Class GerritManagement
java.lang.Object
hudson.model.ManagementLink
com.sonyericsson.hudson.plugins.gerrit.trigger.GerritManagement
- All Implemented Interfaces:
ExtensionPoint,Action,Describable<GerritManagement>,ModelObject,Saveable,ModelObjectWithContextMenu,org.kohsuke.stapler.StaplerProxy
@Extension
public class GerritManagement
extends ManagementLink
implements org.kohsuke.stapler.StaplerProxy, Describable<GerritManagement>, Saveable, ModelObjectWithContextMenu
Management link for configuring the global configuration of this trigger.
- Author:
- Robert Sandell <robert.sandell@sonyericsson.com>
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classDescriptor is only used for UI form bindings.Nested classes/interfaces inherited from class hudson.model.ManagementLink
ManagementLink.CategoryNested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudsonNested classes/interfaces inherited from interface jenkins.model.ModelObjectWithContextMenu
ModelObjectWithContextMenu.ContextMenu, ModelObjectWithContextMenu.ContextMenuVisibility, ModelObjectWithContextMenu.MenuItem, ModelObjectWithContextMenu.MenuItemType -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe relative url name for this management link.Fields inherited from class hudson.model.ManagementLink
LIST -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoAddNewServer(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp) Add a new server.voiddoConfigSubmit(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp) Saves the form to the configuration and disk.doContextMenu(org.kohsuke.stapler.StaplerRequest request, org.kohsuke.stapler.StaplerResponse response) doNameFreeCheck(String value) Checks whether server name already exists.static GerritManagementget()Returns this singleton.The AdministrativeMonitor related to Gerrit.static IGerritHudsonTriggerConfigGet the config of a server.A sub page displaying some diagnostic views.static PluginConfigGet the plugin config.Jenkins.ADMINISTERpermission.Used when redirected to a server.Convenience method for jelly.Gets the list of GerritServer.net.sf.json.JSONObjectUsed when getting server status from JavaScript.voidsave()Methods inherited from class hudson.model.ManagementLink
all, getBadge, getCategory, getCategoryName, getRequiresConfirmation, getRequiresPOST
-
Field Details
-
URL_NAME
The relative url name for this management link. As returned bygetUrlName().- See Also:
-
-
Constructor Details
-
GerritManagement
public GerritManagement()
-
-
Method Details
-
getIconFileName
- Specified by:
getIconFileNamein interfaceAction- Specified by:
getIconFileNamein classManagementLink
-
getUrlName
- Specified by:
getUrlNamein interfaceAction- Specified by:
getUrlNamein classManagementLink
-
getDisplayName
- Specified by:
getDisplayNamein interfaceAction- Specified by:
getDisplayNamein interfaceModelObject
-
getDescription
- Overrides:
getDescriptionin classManagementLink
-
getDescriptor
- Specified by:
getDescriptorin interfaceDescribable<GerritManagement>
-
doContextMenu
public ModelObjectWithContextMenu.ContextMenu doContextMenu(org.kohsuke.stapler.StaplerRequest request, org.kohsuke.stapler.StaplerResponse response) throws Exception - Specified by:
doContextMenuin interfaceModelObjectWithContextMenu- Throws:
Exception
-
getDiagnostics
A sub page displaying some diagnostic views.- Returns:
- the diagnostics page.
-
getServers
Gets the list of GerritServer.- Returns:
- the list of GerritServer.
-
getServer
Used when redirected to a server.- Parameters:
encodedServerName- the server name encoded by URLEncoder.encode(name,"UTF-8").- Returns:
- the GerritServer object.
-
getServerStatuses
@JavaScriptMethod public net.sf.json.JSONObject getServerStatuses()Used when getting server status from JavaScript.- Returns:
- the json array of server status.
-
doAddNewServer
public GerritServer doAddNewServer(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp) throws IOException Add a new server.- Parameters:
req- the StaplerRequestrsp- the StaplerResponse- Returns:
- the new GerritServer
- Throws:
IOException- when error sending redirect back to the list of servers
-
getTarget
- Specified by:
getTargetin interfaceorg.kohsuke.stapler.StaplerProxy
-
save
- Specified by:
savein interfaceSaveable- Throws:
IOException
-
get
Returns this singleton.- Returns:
- the single loaded instance if this class.
-
getPluginConfig
Get the plugin config.- Returns:
- the plugin config.
-
getConfig
Get the config of a server.- Parameters:
serverName- the name of the server for which we want to get the config.- Returns:
- the config.
- See Also:
-
getAdministrativeMonitor
The AdministrativeMonitor related to Gerrit. convenience method for the jelly page.- Returns:
- the monitor if it could be found, or null otherwise.
-
getServerNames
Convenience method for jelly. Get the list of Gerrit server names.- Returns:
- the list of server names as a list.
-
doNameFreeCheck
Checks whether server name already exists.- Parameters:
value- the value of the name field.- Returns:
- ok or error.
-
doConfigSubmit
public void doConfigSubmit(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp) throws javax.servlet.ServletException, IOException, InterruptedException Saves the form to the configuration and disk.- Parameters:
req- StaplerRequestrsp- StaplerResponse- Throws:
javax.servlet.ServletException- if something unfortunate happens.IOException- if something unfortunate happens.InterruptedException- if something unfortunate happens.
-
getRequiredPermission
Jenkins.ADMINISTERpermission. Also used by Jelly- Overrides:
getRequiredPermissionin classManagementLink- Returns:
- the permission
-