|
||||||||||
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. |
|
GerritServer(String name,
boolean pseudoMode)
Constructor. |
Method Summary | |
---|---|
void |
addListener(com.sonymobile.tools.gerrit.gerritevents.ConnectionListener listener)
Adds a Connection Listener to the manager. |
void |
addListener(com.sonymobile.tools.gerrit.gerritevents.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. |
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. |
net.sf.json.JSONObject |
doSleep()
Server to sleep. |
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. |
net.sf.json.JSONObject |
doWakeup()
Wakeup server. |
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()
|
List<GerritVersionChecker.Feature> |
getDisabledFeatures()
Returns the list of disabled features. |
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 |
hasDisabledFeatures()
If server with features disabled due to old Gerrit version. |
boolean |
hasErrors()
This server has errors or not. |
boolean |
hasWarnings()
This server has warnings or not. |
boolean |
isConnected()
A quick check if a connection to Gerrit is open. |
boolean |
isConnectionError()
If connection could not be established. |
boolean |
isGerritSnapshotVersion()
If Gerrit is a snapshot version. |
boolean |
isLastServer()
Check whether this server is the last one. |
boolean |
isPseudoMode()
If pseudo mode or not. |
boolean |
isReplicationEventsSupported()
Return if the current server support replication events. |
boolean |
isTimeoutWakeup()
Gets wakeup is failed by timeout or not. |
void |
removeListener(com.sonymobile.tools.gerrit.gerritevents.ConnectionListener listener)
Removes a connection listener from the manager. |
void |
removeListener(com.sonymobile.tools.gerrit.gerritevents.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 |
setPseudoMode(boolean pseudoMode)
Sets pseudo mode. |
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(com.sonymobile.tools.gerrit.gerritevents.dto.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.public GerritServer(String name, boolean pseudoMode)
name
- the name of the server.pseudoMode
- if pseudo mode or not.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 boolean isPseudoMode()
public void setPseudoMode(boolean pseudoMode)
pseudoMode
- true if pseudoMode connection.public boolean isTimeoutWakeup()
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(com.sonymobile.tools.gerrit.gerritevents.GerritEventListener listener)
listener
- the listener to add.GerritHandler.addListener(com.sonymobile.tools.gerrit.gerritevents.GerritEventListener)
public void removeListener(com.sonymobile.tools.gerrit.gerritevents.GerritEventListener listener)
listener
- the listener to remove.GerritHandler.removeListener(com.sonymobile.tools.gerrit.gerritevents.GerritEventListener)
public void removeListener(com.sonymobile.tools.gerrit.gerritevents.ConnectionListener listener)
listener
- the listener to remove.public GerritConnectionListener getGerritConnectionListener()
public void startConnection()
GerritItemListener
.
public void stopConnection()
public boolean isConnected()
public void restartConnection()
public void addListener(com.sonymobile.tools.gerrit.gerritevents.ConnectionListener listener)
listener
- the listener to be added.public List<String> getGerritProjects()
public void triggerEvent(com.sonymobile.tools.gerrit.gerritevents.dto.GerritEvent event)
event
- the event.GerritHandler.triggerEvent(com.sonymobile.tools.gerrit.gerritevents.dto.GerritEvent)
public String getGerritVersion()
public boolean isReplicationEventsSupported()
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 net.sf.json.JSONObject doWakeup()
public net.sf.json.JSONObject doSleep()
public boolean hasErrors()
public boolean hasWarnings()
@JavaScriptMethod public boolean isConnectionError()
@JavaScriptMethod public boolean isGerritSnapshotVersion()
@JavaScriptMethod public boolean hasDisabledFeatures()
public List<GerritVersionChecker.Feature> getDisabledFeatures()
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 |