com.sonyericsson.hudson.plugins.gerrit.trigger
Class PluginImpl

java.lang.Object
  extended by hudson.Plugin
      extended by com.sonyericsson.hudson.plugins.gerrit.trigger.PluginImpl
All Implemented Interfaces:
hudson.model.Saveable

public class PluginImpl
extends hudson.Plugin

Main Plugin entrance.

Author:
Robert Sandell <robert.sandell@sonyericsson.com>

Nested Class Summary
 
Nested classes/interfaces inherited from class hudson.Plugin
hudson.Plugin.DummyImpl
 
Field Summary
static String DEFAULT_SERVER_NAME
          the default server name.
static String DISPLAY_NAME
          What to call this plug-in to humans.
static hudson.security.Permission MANUAL_TRIGGER
          The permission that allows users to perform the ManualTriggerAction.
static hudson.security.PermissionGroup PERMISSION_GROUP
          Any special permissions needed by this plugin are grouped into this.
static hudson.security.Permission RETRIGGER
          The permission that allows users to perform the RetriggerAction.
 
Fields inherited from interface hudson.model.Saveable
NOOP
 
Constructor Summary
PluginImpl()
          Constructor.
 
Method Summary
 LinkedList<GerritServer> addServer(GerritServer s)
          Add a server to the list.
 boolean containsServer(String serverName)
          Check whether the list of servers contains a GerritServer object of a specific name.
protected static void doXStreamRegistrations()
          Registers XStream alias and converters to handle backwards compatibility with old data.
 List<hudson.model.AbstractProject> getConfiguredJobs(String serverName)
          Return the list of jobs configured with a server.
 GerritServer getFirstServer()
          Gets the first server in the server list.
 GerritHandler getHandler()
          Returns the GerritHandler object.
static PluginImpl getInstance()
          Returns this singleton instance.
 PluginConfig getPluginConfig()
          Gets the global config.
 GerritServer getServer(String name)
          Get a GerritServer object by its name.
 List<String> getServerNames()
          Get the list of Gerrit server names.
 List<GerritServer> getServers()
          Get the list of Gerrit servers.
 void load()
           
 LinkedList<GerritServer> removeServer(GerritServer s)
          Remove a server from the list.
 void setServers(LinkedList<GerritServer> servers)
          Set the list of Gerrit servers.
 void start()
           
 void stop()
           
 
Methods inherited from class hudson.Plugin
configure, configure, doDynamic, getConfigXml, getWrapper, postInitialize, save, setServletContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DISPLAY_NAME

public static final String DISPLAY_NAME
What to call this plug-in to humans.

See Also:
Constant Field Values

PERMISSION_GROUP

public static final hudson.security.PermissionGroup PERMISSION_GROUP
Any special permissions needed by this plugin are grouped into this.


MANUAL_TRIGGER

public static final hudson.security.Permission MANUAL_TRIGGER
The permission that allows users to perform the ManualTriggerAction.


RETRIGGER

public static final hudson.security.Permission RETRIGGER
The permission that allows users to perform the RetriggerAction.


DEFAULT_SERVER_NAME

public static final String DEFAULT_SERVER_NAME
the default server name.

See Also:
Constant Field Values
Constructor Detail

PluginImpl

public PluginImpl()
Constructor.

Method Detail

getInstance

public static PluginImpl getInstance()
Returns this singleton instance.

Returns:
the singleton.

getServers

public List<GerritServer> getServers()
Get the list of Gerrit servers.

Returns:
the list as a LinkedList of GerritServers

getServerNames

public List<String> getServerNames()
Get the list of Gerrit server names.

Returns:
the list of server names as a list.

getServer

public GerritServer getServer(String name)
Get a GerritServer object by its name.

Parameters:
name - the name of the server to get.
Returns:
the GerritServer object to get, or null if no server has this name.

getFirstServer

public GerritServer getFirstServer()
Gets the first server in the server list. Or null if there are no servers.

Returns:
the server.

setServers

public void setServers(LinkedList<GerritServer> servers)
Set the list of Gerrit servers.

Parameters:
servers - the list to be set.

addServer

public LinkedList<GerritServer> addServer(GerritServer s)
Add a server to the list.

Parameters:
s - the server to be added.
Returns:
the list after adding the server.

removeServer

public LinkedList<GerritServer> removeServer(GerritServer s)
Remove a server from the list.

Parameters:
s - the server to be removed.
Returns:
the list after removing the server.

containsServer

public boolean containsServer(String serverName)
Check whether the list of servers contains a GerritServer object of a specific name.

Parameters:
serverName - to check.
Returns:
whether the list contains a server with the given name.

getPluginConfig

public PluginConfig getPluginConfig()
Gets the global config.

Returns:
the config.

getHandler

public GerritHandler getHandler()
Returns the GerritHandler object.

Returns:
gerritEventManager

getConfiguredJobs

public List<hudson.model.AbstractProject> getConfiguredJobs(String serverName)
Return the list of jobs configured with a server.

Parameters:
serverName - the name of the Gerrit server.
Returns:
the list of jobs configured with this server.

start

public void start()
           throws Exception
Overrides:
start in class hudson.Plugin
Throws:
Exception

load

public void load()
          throws IOException
Overrides:
load in class hudson.Plugin
Throws:
IOException

doXStreamRegistrations

protected static void doXStreamRegistrations()
Registers XStream alias and converters to handle backwards compatibility with old data.


stop

public void stop()
          throws Exception
Overrides:
stop in class hudson.Plugin
Throws:
Exception


Copyright © 2004-2013. All Rights Reserved.