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

java.lang.Object
  extended by hudson.model.ManagementLink
      extended by com.sonyericsson.hudson.plugins.gerrit.trigger.GerritManagement
All Implemented Interfaces:
hudson.ExtensionPoint, hudson.model.Action, hudson.model.Describable<GerritManagement>, hudson.model.ModelObject, hudson.model.Saveable, org.kohsuke.stapler.StaplerProxy

@Extension
public class GerritManagement
extends hudson.model.ManagementLink
implements org.kohsuke.stapler.StaplerProxy, hudson.model.Describable<GerritManagement>, hudson.model.Saveable

Management link for configuring the global configuration of this trigger.

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

Nested Class Summary
static class GerritManagement.DescriptorImpl
          Descriptor is only used for UI form bindings.
 
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
hudson.ExtensionPoint.LegacyInstancesAreScopedToHudson
 
Field Summary
 
Fields inherited from class hudson.model.ManagementLink
LIST
 
Fields inherited from interface hudson.model.Saveable
NOOP
 
Constructor Summary
GerritManagement()
           
 
Method Summary
 void doConfigSubmit(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp)
          Saves the form to the configuration and disk.
 hudson.util.FormValidation doEmptyOrIntegerCheck(java.lang.String value)
          Checks that the provided parameter is an empty string or an integer.
 hudson.util.FormValidation doIntegerCheck(java.lang.String value)
          Checks that the provided parameter is an integer.
 hudson.util.FormValidation doPositiveIntegerCheck(java.lang.String value)
          Checks that the provided parameter is an integer and not negative.
 hudson.util.FormValidation doUrlCheck(java.lang.String value)
          Checks if the value is a valid URL.
 hudson.util.FormValidation doValidKeyFileCheck(java.lang.String value)
          Checks to see if the provided value is a file path to a valid private key file.
static GerritManagement get()
          Returns this singleton.
 GerritAdministrativeMonitor getAdministrativeMonitor()
          The AdministrativeMonitor related to Gerrit.
static IGerritHudsonTriggerConfig getConfig()
          Gets the global config.
 java.lang.String getDescription()
           
 GerritManagement.DescriptorImpl getDescriptor()
           
 java.lang.String getDisplayName()
           
 java.lang.String getIconFileName()
           
 java.lang.Object getTarget()
           
 java.lang.String getUrlName()
           
 void save()
           
 
Methods inherited from class hudson.model.ManagementLink
all
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GerritManagement

public GerritManagement()
Method Detail

getIconFileName

public java.lang.String getIconFileName()
Specified by:
getIconFileName in interface hudson.model.Action
Specified by:
getIconFileName in class hudson.model.ManagementLink

getUrlName

public java.lang.String getUrlName()
Specified by:
getUrlName in interface hudson.model.Action
Specified by:
getUrlName in class hudson.model.ManagementLink

getDisplayName

public java.lang.String getDisplayName()
Specified by:
getDisplayName in interface hudson.model.Action
Specified by:
getDisplayName in interface hudson.model.ModelObject

getDescription

public java.lang.String getDescription()
Overrides:
getDescription in class hudson.model.ManagementLink

getDescriptor

public GerritManagement.DescriptorImpl getDescriptor()
Specified by:
getDescriptor in interface hudson.model.Describable<GerritManagement>

doConfigSubmit

public void doConfigSubmit(org.kohsuke.stapler.StaplerRequest req,
                           org.kohsuke.stapler.StaplerResponse rsp)
                    throws javax.servlet.ServletException,
                           java.io.IOException,
                           java.lang.InterruptedException
Saves the form to the configuration and disk.

Parameters:
req - StaplerRequest
rsp - StaplerResponse
Throws:
javax.servlet.ServletException - if something unfortunate happens.
java.io.IOException - if something unfortunate happens.
java.lang.InterruptedException - if something unfortunate happens.

doPositiveIntegerCheck

public hudson.util.FormValidation doPositiveIntegerCheck(@QueryParameter(value="value")
                                                         java.lang.String value)
Checks that the provided parameter is an integer and not negative.

Parameters:
value - the value.
Returns:
FormValidation.validatePositiveInteger(String)

doIntegerCheck

public hudson.util.FormValidation doIntegerCheck(@QueryParameter(value="value")
                                                 java.lang.String value)
Checks that the provided parameter is an integer.

Parameters:
value - the value.
Returns:
FormValidation.validatePositiveInteger(String)

doEmptyOrIntegerCheck

public hudson.util.FormValidation doEmptyOrIntegerCheck(@QueryParameter(value="value")
                                                        java.lang.String value)
Checks that the provided parameter is an empty string or an integer.

Parameters:
value - the value.
Returns:
FormValidation.validatePositiveInteger(String)

doUrlCheck

public hudson.util.FormValidation doUrlCheck(@QueryParameter(value="value")
                                             java.lang.String value)
Checks if the value is a valid URL. It does not check if the URL is reachable.

Parameters:
value - the value
Returns:
FormValidation.ok() if it is so.

doValidKeyFileCheck

public hudson.util.FormValidation doValidKeyFileCheck(@QueryParameter(value="value")
                                                      java.lang.String value)
Checks to see if the provided value is a file path to a valid private key file.

Parameters:
value - the value.
Returns:
FormValidation.ok() if it is so.

getTarget

public java.lang.Object getTarget()
Specified by:
getTarget in interface org.kohsuke.stapler.StaplerProxy

save

public void save()
          throws java.io.IOException
Specified by:
save in interface hudson.model.Saveable
Throws:
java.io.IOException

get

public static GerritManagement get()
Returns this singleton.

Returns:
the single loaded instance if this class.

getConfig

public static IGerritHudsonTriggerConfig getConfig()
Gets the global config.

Returns:
the config.
See Also:
PluginImpl.getConfig()

getAdministrativeMonitor

public GerritAdministrativeMonitor getAdministrativeMonitor()
The AdministrativeMonitor related to Gerrit. convenience method for the jelly page.

Returns:
the monitor if it could be found.


Copyright © 2004-2012. All Rights Reserved.