@ExportedBean(defaultVisibility=2) public class GerritServer extends Object implements hudson.model.Describable<GerritServer>, hudson.model.Action
Modifier and Type | Class and Description |
---|---|
static class |
GerritServer.DescriptorImpl
Descriptor is only used for UI form bindings.
|
Modifier and Type | Field and Description |
---|---|
static String |
ANY_SERVER
Key that is used to select to trigger a build on events from any server.
|
Constructor and Description |
---|
GerritServer(String name)
Constructor.
|
GerritServer(String name,
boolean noConnectionOnStartup)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
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.Job> |
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() |
String |
getFrontEndUrl()
Get frontend url of the server.
|
GerritConnectionListener |
getGerritConnectionListener()
Get the GerritConnectionListener for GerritAdministrativeMonitor.
|
List<String> |
getGerritProjects()
Returns a list of Gerrit projects.
|
String |
getGerritVersion()
Returns the current Gerrit version.
|
String |
getHostName()
Get hostname of the server.
|
String |
getHttpUserName()
Get HTTP username of the server.
|
String |
getIconFileName() |
GerritMissedEventsPlaybackManager |
getMissedEventsPlaybackManager()
Returns the Missed Events playback manager.
|
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.
|
int |
getSshPort()
Get ssh port of the server.
|
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() |
String |
getUserName()
Get username of the server.
|
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 |
isGerritMissedEventsSupported()
If Gerrit Missed Events Playback is supported.
|
boolean |
isGerritSnapshotVersion()
If Gerrit is a snapshot version.
|
boolean |
isLastServer()
Check whether this server is the last one.
|
boolean |
isNoConnectionOnStartup()
If no connection on startup or not.
|
boolean |
isProjectCreatedEventsSupported()
Checks whether the current server support project-created events or not.
|
boolean |
isPseudoMode()
Deprecated.
|
boolean |
isReplicationEventsSupported()
Return if the current server support replication events.
|
boolean |
isTimeoutWakeup()
Gets wakeup is failed by timeout or not.
|
static Map<com.sonymobile.tools.gerrit.gerritevents.dto.rest.Notify,String> |
notificationLevelTextsById()
Returns localized texts for each known notification value.
|
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 |
setNoConnectionOnStartup(boolean noConnectionOnStartup)
Sets connect on startup.
|
void |
setPseudoMode(boolean pseudoMode)
Deprecated.
|
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.
|
public static final String ANY_SERVER
public GerritServer(String name)
name
- the name of the server.public GerritServer(String name, boolean noConnectionOnStartup)
name
- the name of the server.noConnectionOnStartup
- if noConnectionOnStartup or not.public GerritServer.DescriptorImpl getDescriptor()
getDescriptor
in interface hudson.model.Describable<GerritServer>
public GerritMissedEventsPlaybackManager getMissedEventsPlaybackManager()
public String getParentUrl()
public String getUrl()
public IGerritHudsonTriggerConfig getConfig()
public void setConfig(IGerritHudsonTriggerConfig config)
config
- the config.@Exported public String getName()
@Exported public String getHostName()
@Exported public int getSshPort()
@Exported public String getUserName()
@Exported public String getHttpUserName()
@Exported public String getFrontEndUrl()
@Deprecated public boolean isPseudoMode()
@Deprecated public void setPseudoMode(boolean pseudoMode)
pseudoMode
- true if pseudoMode connection.@Exported public boolean isNoConnectionOnStartup()
public void setNoConnectionOnStartup(boolean noConnectionOnStartup)
noConnectionOnStartup
- true if connect on startup.@Exported 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()
@Exported 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 boolean isProjectCreatedEventsSupported()
public static Map<com.sonymobile.tools.gerrit.gerritevents.dto.rest.Notify,String> notificationLevelTextsById()
public void doConfigSubmit(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp) throws javax.servlet.ServletException, IOException, InterruptedException
req
- StaplerRequestrsp
- StaplerResponsejavax.servlet.ServletException
- if something unfortunate happens.IOException
- if something unfortunate happens.InterruptedException
- if something unfortunate happens.public List<hudson.model.Job> 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 isGerritMissedEventsSupported()
@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
- StaplerResponsejavax.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 valueFormValidation.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()
Copyright © 2004-2016. All Rights Reserved.