|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object hudson.model.ManagementLink com.sonyericsson.hudson.plugins.multislaveconfigplugin.NodeManageLink
@Extension public class NodeManageLink
Registers the plugin to be recognized by Jenkins as a management link and controls the main attributes of the plugin.
Nested Class Summary | |
---|---|
static class |
NodeManageLink.DescriptorImpl
Descriptor is only used for auto completion. |
static class |
NodeManageLink.RemovePropertyDescriptor
Descriptor to show in the removal list for node properties. |
static class |
NodeManageLink.UserMode
Different user modes, depending on which wizard the user is running. |
Nested classes/interfaces inherited from interface hudson.ExtensionPoint |
---|
hudson.ExtensionPoint.LegacyInstancesAreScopedToHudson |
Field Summary | |
---|---|
protected static String |
ICON
Icon used by this plugin. |
protected static String |
URL
URL to the plugin. |
protected HashMap<String,NodeManageLink.UserMode> |
userMode
Hashmap with user and what userMode that currently is active. |
Fields inherited from class hudson.model.ManagementLink |
---|
LIST |
Constructor Summary | |
---|---|
NodeManageLink()
|
Method Summary | |
---|---|
boolean |
connectSlaves(org.kohsuke.stapler.StaplerRequest req,
org.kohsuke.stapler.StaplerResponse rsp)
Connects (not forced) to selected slaves. |
boolean |
disconnectSlaves(String reason,
org.kohsuke.stapler.StaplerRequest req,
org.kohsuke.stapler.StaplerResponse rsp)
Disconnects from selected slaves. |
void |
doAddRedirect(org.kohsuke.stapler.StaplerRequest req,
org.kohsuke.stapler.StaplerResponse rsp)
Redirects to the add slaves-wizard, also setting usermode to add. |
void |
doApply(org.kohsuke.stapler.StaplerRequest req,
org.kohsuke.stapler.StaplerResponse rsp)
Applies the settings on the current slaves. |
void |
doConfigureRedirect(org.kohsuke.stapler.StaplerRequest req,
org.kohsuke.stapler.StaplerResponse rsp)
Redirects to the configure-wizard, also setting usermode to configure. |
void |
doCreateSlaves(org.kohsuke.stapler.StaplerRequest req,
org.kohsuke.stapler.StaplerResponse rsp,
String slaveNames,
String slaveName,
String mode,
String first,
String last,
String copyFrom,
boolean extendedEnvInterpretation)
Adds the slaves to create to the current NodeList. |
void |
doDeleteRedirect(org.kohsuke.stapler.StaplerRequest req,
org.kohsuke.stapler.StaplerResponse rsp)
Redirects to the delete-wizard, also setting usermode to delete. |
void |
doDeleteSlaves(org.kohsuke.stapler.StaplerRequest req,
org.kohsuke.stapler.StaplerResponse rsp)
Deletes the slaves in this list. |
void |
doHomeRedirect(org.kohsuke.stapler.StaplerRequest req,
org.kohsuke.stapler.StaplerResponse rsp)
Redirects to home. |
void |
doManageRedirect(org.kohsuke.stapler.StaplerRequest req,
org.kohsuke.stapler.StaplerResponse rsp)
Redirects to Slaves management, also setting usermode to MANAGE. |
net.sf.json.JSONArray |
doSearch(String sessionId,
net.sf.json.JSONObject searchParameters)
Searches for slaves. |
void |
doSelectSlaves(org.kohsuke.stapler.StaplerRequest req,
org.kohsuke.stapler.StaplerResponse rsp)
Adds all slaves that are checked on the slavefilter page to a NodeList. |
String |
generateStars(int length)
Generates a string of given length filled with stars characters. |
List<hudson.model.Node> |
getAllNodes()
Gets all Jenkins registered nodes. |
String |
getDescription()
Gets the description of this plugin. |
hudson.model.Descriptor<NodeManageLink> |
getDescriptor()
Gets the descriptor. |
String |
getDisplayName()
Gets the name of this plugin. |
String |
getIconFileName()
Gets the icon for this plugin. |
static NodeManageLink |
getInstance()
Returns the instance of NodeManageLink. |
HashMap |
getLastChangedSettings(String sessionId)
Used for letting the jelly scripts find out what changes have been applied. |
NodeList |
getNodeList(String sessionId)
Gets the active nodelist of a specific sessionid. |
List<hudson.slaves.NodePropertyDescriptor> |
getNodePropertyDescriptors()
This is needed by settingsselector.jelly to list the Node properties the user can add or change. |
List<NodeManageLink.RemovePropertyDescriptor> |
getRemovePropertyDescriptor()
This is needed by settingsselector.jelly to list the Node properties the user can remove. |
hudson.security.Permission |
getRequiredPermission()
Returns required permission to use this plugin. |
static HashSet<String> |
getSlaveNames(String slaveNames,
String nodeName,
String first,
String last)
Calculates all new node names and returns them as a set. |
String |
getUrlName()
The URL of this plugin. |
boolean |
hadLabels(String sessionId)
Checks if the used nodelist (by searching for session id) contained the labels to remove before removing them. |
boolean |
isAddMode()
Checks if current used mode was UserMode Add. |
boolean |
isCommandLauncher(hudson.slaves.ComputerLauncher candidate)
Checks if argument is instance of CommandLauncher. |
boolean |
isConfigureMode()
Checks if current used mode was UserMode Configure. |
boolean |
isDeleteMode()
Checks if current used mode was UserMode Delete. |
boolean |
isJNLPLauncher(hudson.slaves.ComputerLauncher candidate)
Checks if argument is instance of JNLPLauncher. |
static boolean |
isLenientShutdownPluginInstalled()
Checks if Lenient Shutdown Plugin is installed. |
boolean |
isManagedWindowsServiceLauncher(hudson.slaves.ComputerLauncher candidate)
Checks if argument is instance of ManagedWindowsServiceLauncher. |
boolean |
isManageMode()
Checks if current used mode was UserMode Manage. |
boolean |
isRetentionStrategyAlways(hudson.slaves.RetentionStrategy candidate)
Checks if argument is instance of RetentionStrategy.Always. |
boolean |
isRetentionStrategyDemand(hudson.slaves.RetentionStrategy candidate)
Checks if argument is instance of RetentionStrategy.Demand. |
boolean |
isSimpleScheduledRetentionStrategy(hudson.slaves.RetentionStrategy candidate)
Checks if argument is instance of SimpleScheduledRetentionStrategy. |
String |
mapClassToDescriptorName(String className)
Maps a class name to a real descriptor name. |
boolean |
takeOffline(String reason,
org.kohsuke.stapler.StaplerRequest req,
org.kohsuke.stapler.StaplerResponse rsp)
Requests the selected slaves to go offline. |
boolean |
takeOfflineLeniently(org.kohsuke.stapler.StaplerRequest req,
org.kohsuke.stapler.StaplerResponse rsp)
Requests the selected slaves to go offline leniently. |
boolean |
takeOnline(org.kohsuke.stapler.StaplerRequest req,
org.kohsuke.stapler.StaplerResponse rsp)
Requests the selected slaves to go online. |
Methods inherited from class hudson.model.ManagementLink |
---|
all, getRequiresConfirmation |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final String URL
protected static final String ICON
protected HashMap<String,NodeManageLink.UserMode> userMode
Constructor Detail |
---|
public NodeManageLink()
Method Detail |
---|
public hudson.model.Descriptor<NodeManageLink> getDescriptor()
getDescriptor
in interface hudson.model.Describable<NodeManageLink>
public String getIconFileName()
getIconFileName
in interface hudson.model.Action
getIconFileName
in class hudson.model.ManagementLink
public String getUrlName()
getUrlName
in interface hudson.model.Action
getUrlName
in class hudson.model.ManagementLink
public String getDisplayName()
getDisplayName
in interface hudson.model.Action
getDisplayName
in interface hudson.model.ModelObject
public String getDescription()
getDescription
in class hudson.model.ManagementLink
public hudson.security.Permission getRequiredPermission()
getRequiredPermission
in class hudson.model.ManagementLink
public static NodeManageLink getInstance()
public NodeList getNodeList(String sessionId)
sessionId
- the session id to get the list from
public HashMap getLastChangedSettings(String sessionId)
sessionId
- which session id to get the settings from
public boolean isManagedWindowsServiceLauncher(hudson.slaves.ComputerLauncher candidate)
candidate
- RetentionStrategy to check
public boolean isCommandLauncher(hudson.slaves.ComputerLauncher candidate)
candidate
- RetentionStrategy to check
public boolean isJNLPLauncher(hudson.slaves.ComputerLauncher candidate)
candidate
- RetentionStrategy to check
public boolean isRetentionStrategyAlways(hudson.slaves.RetentionStrategy candidate)
candidate
- RetentionStrategy to check
public boolean isRetentionStrategyDemand(hudson.slaves.RetentionStrategy candidate)
candidate
- RetentionStrategy to check
public boolean isSimpleScheduledRetentionStrategy(hudson.slaves.RetentionStrategy candidate)
candidate
- RetentionStrategy to check
public boolean isConfigureMode()
public boolean isDeleteMode()
public boolean isAddMode()
public boolean isManageMode()
public List<hudson.model.Node> getAllNodes()
public String generateStars(int length)
length
- how many stars it should contain
public void doConfigureRedirect(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp) throws IOException
req
- StaplerRequestrsp
- StaplerResponse to redirect with
IOException
- if redirection goes wrongpublic void doAddRedirect(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp) throws IOException
req
- StaplerRequestrsp
- StaplerResponse to redirect with
IOException
- if redirection goes wrongpublic void doManageRedirect(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp) throws IOException
req
- StaplerRequestrsp
- StaplerResponse to redirect with
IOException
- if redirection goes wrongpublic void doDeleteRedirect(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp) throws IOException
req
- StaplerRequestrsp
- StaplerResponse to redirect with
IOException
- if redirection goes wrongpublic void doHomeRedirect(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp) throws IOException
req
- StaplerRequestrsp
- StaplerResponse to redirect with
IOException
- if redirection goes wrong@JavaScriptMethod public net.sf.json.JSONArray doSearch(String sessionId, net.sf.json.JSONObject searchParameters)
sessionId
- the current session ID to to place the nodeList with.searchParameters
- JSONObject with information on what to search for.
public void doSelectSlaves(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp) throws IOException
rsp
- StaplerRequestreq
- StaplerRequest
IOException
- if redirection goes wrong
hudson.model.Failure
public void doApply(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp) throws IOException, javax.servlet.ServletException
rsp
- StaplerRequest.req
- StaplerRequest.
IOException
- if redirection goes wrong.
javax.servlet.ServletException
- if something is wrong with the submitted form.public boolean hadLabels(String sessionId)
sessionId
- the session id to get the state from
public void doDeleteSlaves(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp) throws IOException
req
- StaplerRequestrsp
- StaplerResponse
IOException
- if redirection goes wrongpublic void doCreateSlaves(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp, @QueryParameter String slaveNames, @QueryParameter String slaveName, @QueryParameter String mode, @QueryParameter String first, @QueryParameter String last, @QueryParameter String copyFrom, @QueryParameter boolean extendedEnvInterpretation) throws IOException, hudson.model.Descriptor.FormException
rsp
- StaplerResponse.req
- StaplerRequest.slaveNames
- string with several names separated by space.slaveName
- string with a single name, used when automatically creating a span of slaves.mode
- different kinds of create nodes.first
- the first number of the span.last
- the last number of the span.copyFrom
- a string containing the name of the node to copy.extendedEnvInterpretation
- if extended environment variable interpretation should be used.
IOException
- if slave creation goes wrong.
Descriptor.FormException
- if slave creation goes wrong.
hudson.model.Failure
public static HashSet<String> getSlaveNames(String slaveNames, String nodeName, String first, String last)
slaveNames
- specific node names that is separated with space.nodeName
- contains a node name in a specific interval.first
- the first node in a intervallast
- the last node in a interval
hudson.model.Failure
@JavaScriptMethod public boolean takeOnline(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp)
rsp
- StaplerResponse.req
- StaplerRequest.
@JavaScriptMethod public boolean takeOffline(String reason, org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp)
reason
- String.rsp
- StaplerResponse.req
- StaplerRequest.
@JavaScriptMethod public boolean takeOfflineLeniently(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp)
rsp
- StaplerResponse.req
- StaplerRequest.
@JavaScriptMethod public boolean connectSlaves(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp)
rsp
- StaplerResponse.req
- StaplerRequest.
public static boolean isLenientShutdownPluginInstalled()
@JavaScriptMethod public boolean disconnectSlaves(String reason, org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp)
reason
- the reason for disconnectingrsp
- StaplerResponse.req
- StaplerRequest.
public List<hudson.slaves.NodePropertyDescriptor> getNodePropertyDescriptors()
NodePropertyDescriptor
for DumbSlave
public List<NodeManageLink.RemovePropertyDescriptor> getRemovePropertyDescriptor()
NodePropertyDescriptor
for DumbSlave
public String mapClassToDescriptorName(String className)
className
- the class name to match with a descriptor name.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |