Files
SCM-Manager/scm-web-api/src/main/java/sonia/scm/web/plugin/SCMPlugin.java

146 lines
2.8 KiB
Java
Raw Normal View History

2010-10-12 09:16:40 +02:00
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
2010-10-31 13:07:43 +01:00
package sonia.scm.web.plugin;
2010-10-12 09:16:40 +02:00
//~--- non-JDK imports --------------------------------------------------------
import sonia.scm.repository.RepositoryHandler;
//~--- JDK imports ------------------------------------------------------------
import java.util.Collection;
import java.util.HashSet;
import java.util.Set;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementWrapper;
import javax.xml.bind.annotation.XmlRootElement;
/**
*
* @author Sebastian Sdorra
*/
@XmlRootElement(name = "plugin-config")
@XmlAccessorType(XmlAccessType.FIELD)
public class SCMPlugin
{
/**
* Constructs ...
*
*/
public SCMPlugin()
{
handlers = new HashSet<Class<? extends RepositoryHandler>>();
}
//~--- methods --------------------------------------------------------------
/**
* Method description
*
*
* @param handlerClass
*
* @return
*/
public boolean addHandler(Class<? extends RepositoryHandler> handlerClass)
{
return handlers.add(handlerClass);
}
/**
* Method description
*
*
* @param handlerClass
*
* @return
*/
public boolean removeHandler(Class<? extends RepositoryHandler> handlerClass)
{
return handlers.remove(handlerClass);
}
//~--- get methods ----------------------------------------------------------
/**
* Method description
*
*
* @return
*/
public Collection<Class<? extends RepositoryHandler>> getHandlers()
{
return handlers;
}
2010-10-31 13:07:43 +01:00
/**
* Method description
*
*
* @return
*/
public SecurityConfig getSecurityConfig()
{
return securityConfig;
}
/**
* Method description
*
*
* @return
*/
public Class<? extends ScmWebPlugin> getWebPlugin()
{
return webPlugin;
}
//~--- set methods ----------------------------------------------------------
/**
* Method description
*
*
* @param securityConfig
*/
public void setSecurityConfig(SecurityConfig securityConfig)
{
this.securityConfig = securityConfig;
}
/**
* Method description
*
*
* @param webPlugin
*/
public void setWebPlugin(Class<? extends ScmWebPlugin> webPlugin)
{
this.webPlugin = webPlugin;
}
2010-10-12 09:16:40 +02:00
//~--- fields ---------------------------------------------------------------
/** Field description */
@XmlElementWrapper(name = "repository-handlers")
2010-10-31 13:07:43 +01:00
@XmlElement(name = "repository-handler")
2010-10-12 09:16:40 +02:00
private Set<Class<? extends RepositoryHandler>> handlers;
2010-10-31 13:07:43 +01:00
/** Field description */
@XmlElement(name = "security")
private SecurityConfig securityConfig;
/** Field description */
@XmlElement(name = "web-plugin")
private Class<? extends ScmWebPlugin> webPlugin;
2010-10-12 09:16:40 +02:00
}