|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sonyericsson.hudson.plugins.gerrit.trigger.GerritServer
public class GerritServer
Every instance of this class represents a Gerrit server having its own unique name, connection, project list updater, configuration, and lists of listeners. All interactions with a Gerrit server should go through this class. The list of GerritServer is kept in @PluginImpl.
Nested Class Summary | |
---|---|
static class |
GerritServer.DescriptorImpl
Descriptor is only used for UI form bindings. |
Field Summary | |
---|---|
static String |
ANY_SERVER
Key that is used to select to trigger a build on events from any server. |
Constructor Summary | |
---|---|
GerritServer(String name)
Constructor. |
Method Summary | |
---|---|
void |
addListener(ConnectionListener listener)
Adds a Connection Listener to the manager. |
void |
addListener(GerritEventListener listener)
Adds a listener to the EventManager. |
void |
doConfigSubmit(org.kohsuke.stapler.StaplerRequest req,
org.kohsuke.stapler.StaplerResponse rsp)
Saves the form to the configuration and disk. |
void |
doConnectionSubmit(org.kohsuke.stapler.StaplerRequest req,
org.kohsuke.stapler.StaplerResponse rsp)
|
hudson.util.FormValidation |
doDynamicConfigRefreshCheck(String value)
Checks that the provided parameter is an integer, not negative, that is larger than the minimum value. |
hudson.util.FormValidation |
doEmptyOrIntegerCheck(String value)
Checks that the provided parameter is an empty string or an integer. |
hudson.util.FormValidation |
doIntegerCheck(String value)
Checks that the provided parameter is an integer. |
hudson.util.FormValidation |
doNameFreeCheck(String value)
Checks whether server name already exists. |
hudson.util.FormValidation |
doNonNegativeIntegerCheck(String value)
Checks that the provided parameter is an integer and not negative, zero is accepted. |
hudson.util.FormValidation |
doPositiveIntegerCheck(String value)
Checks that the provided parameter is an integer and not negative. |
void |
doRemoveConfirm(org.kohsuke.stapler.StaplerRequest req,
org.kohsuke.stapler.StaplerResponse rsp)
Saves the form to the configuration and disk. |
hudson.util.FormValidation |
doUrlCheck(String value)
Checks if the value is a valid URL. |
hudson.util.FormValidation |
doValidKeyFileCheck(String value)
Checks to see if the provided value is a file path to a valid private key file. |
hudson.util.FormValidation |
doValidTimeCheck(String fromValue,
String toValue)
Checks to see if the provided value represents a time on the hh:mm format. |
List<ExceptionDataHelper> |
generateHelper()
Generates a list of helper objects for the jelly view. |
IGerritHudsonTriggerConfig |
getConfig()
Gets the global config of this server. |
List<hudson.model.AbstractProject> |
getConfiguredJobs()
Convenience method for remove.jelly. |
String |
getConnectionResponse()
Get the response after a start/stop/restartConnection; Used by jelly. |
GerritServer.DescriptorImpl |
getDescriptor()
|
String |
getDisplayName()
|
GerritConnectionListener |
getGerritConnectionListener()
Get the GerritConnectionListener for GerritAdministrativeMonitor. |
List<String> |
getGerritProjects()
Returns a list of Gerrit projects. |
String |
getGerritVersion()
Returns the current Gerrit version. |
String |
getIconFileName()
|
String |
getName()
Get the name of the server. |
String |
getParentUrl()
Convenience method for jelly to get url of the server list's page relative to root. |
String |
getUrl()
Convenience method for jelly to get url of this server's config page relative to root. |
String |
getUrlEncodedName()
Get the url encoded name of the server. |
String |
getUrlName()
|
boolean |
isConnected()
A quick check if a connection to Gerrit is open. |
boolean |
isLastServer()
Check whether this server is the last one. |
void |
removeListener(ConnectionListener listener)
Removes a connection listener from the manager. |
void |
removeListener(GerritEventListener listener)
Removes a listener from the manager. |
void |
restartConnection()
Restarts the connection to Gerrit stream of events. |
void |
setConfig(IGerritHudsonTriggerConfig config)
Sets the global config of this server. |
void |
start()
Starts the server's project list updater, send command queue and event manager. |
void |
startConnection()
Starts the connection to Gerrit stream of events. |
void |
stop()
Stops the server's project list updater, send command queue and event manager. |
void |
stopConnection()
Stops the connection to Gerrit stream of events. |
void |
triggerEvent(GerritEvent event)
Adds the given event to the stream of events. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String ANY_SERVER
Constructor Detail |
---|
public GerritServer(String name)
name
- the name of the server.Method Detail |
---|
public GerritServer.DescriptorImpl getDescriptor()
getDescriptor
in interface hudson.model.Describable<GerritServer>
public String getParentUrl()
public String getUrl()
public IGerritHudsonTriggerConfig getConfig()
public void setConfig(IGerritHudsonTriggerConfig config)
config
- the config.public String getName()
public String getIconFileName()
getIconFileName
in interface hudson.model.Action
public String getDisplayName()
getDisplayName
in interface hudson.model.Action
getDisplayName
in interface hudson.model.ModelObject
public String getUrlName()
getUrlName
in interface hudson.model.Action
public String getUrlEncodedName()
public boolean isLastServer()
public void start()
public void stop()
public void addListener(GerritEventListener listener)
listener
- the listener to add.GerritHandler.addListener(com.sonyericsson.hudson.plugins.gerrit.gerritevents.GerritEventListener)
public void removeListener(GerritEventListener listener)
listener
- the listener to remove.GerritHandler.removeListener(com.sonyericsson.hudson.plugins.gerrit.gerritevents.GerritEventListener)
public void removeListener(ConnectionListener listener)
listener
- the listener to remove.public GerritConnectionListener getGerritConnectionListener()
public void startConnection()
GerritItemListener
.
doConnectionSubmit(StaplerRequest, StaplerResponse)
public void stopConnection()
doConnectionSubmit(StaplerRequest, StaplerResponse)
public boolean isConnected()
public void restartConnection()
doConnectionSubmit(StaplerRequest, StaplerResponse)
public void addListener(ConnectionListener listener)
listener
- the listener to be added.public List<String> getGerritProjects()
public void triggerEvent(GerritEvent event)
event
- the event.GerritHandler.triggerEvent(com.sonyericsson.hudson.plugins.gerrit.gerritevents.dto.GerritEvent)
public String getGerritVersion()
public void doConfigSubmit(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp) throws javax.servlet.ServletException, IOException, InterruptedException
req
- StaplerRequestrsp
- StaplerResponse
javax.servlet.ServletException
- if something unfortunate happens.
IOException
- if something unfortunate happens.
InterruptedException
- if something unfortunate happens.public List<hudson.model.AbstractProject> getConfiguredJobs()
public void doConnectionSubmit(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp) throws IOException
req
- the StaplerRequestrsp
- the StaplerResponse
IOException
- if unable to send redirect.public String getConnectionResponse()
public void doRemoveConfirm(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp) throws javax.servlet.ServletException, IOException, InterruptedException
req
- StaplerRequestrsp
- StaplerResponse
javax.servlet.ServletException
- if something unfortunate happens.
IOException
- if something unfortunate happens.
InterruptedException
- if something unfortunate happens.public hudson.util.FormValidation doPositiveIntegerCheck(@QueryParameter(value="value") String value)
value
- the value.
FormValidation.validatePositiveInteger(String)
public hudson.util.FormValidation doNonNegativeIntegerCheck(@QueryParameter(value="value") String value)
value
- the value.
FormValidation.validateNonNegativeInteger(String)
public hudson.util.FormValidation doDynamicConfigRefreshCheck(@QueryParameter(value="value") String value)
value
- the value.
FormValidation.validatePositiveInteger(String)
public hudson.util.FormValidation doIntegerCheck(@QueryParameter(value="value") String value)
value
- the value.
FormValidation.validatePositiveInteger(String)
public hudson.util.FormValidation doEmptyOrIntegerCheck(@QueryParameter(value="value") String value)
value
- the value.
FormValidation.validatePositiveInteger(String)
public hudson.util.FormValidation doUrlCheck(@QueryParameter(value="value") String value)
value
- the value
FormValidation.ok()
if it is so.public hudson.util.FormValidation doValidKeyFileCheck(@QueryParameter(value="value") String value)
value
- the value.
FormValidation.ok()
if it is so.public hudson.util.FormValidation doValidTimeCheck(@QueryParameter String fromValue, @QueryParameter String toValue)
fromValue
- the from value.toValue
- the to value.
FormValidation.ok()
if it is so.public hudson.util.FormValidation doNameFreeCheck(@QueryParameter(value="value") String value)
value
- the value of the name field.
public List<ExceptionDataHelper> generateHelper()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |