Package hudson.model
Class ComputerSet
- java.lang.Object
-
- hudson.model.AbstractModelObject
-
- hudson.model.ComputerSet
-
- All Implemented Interfaces:
Describable<ComputerSet>,ModelObject,SearchableModelObject,SearchItem,ModelObjectWithChildren,HasWidgets
@ExportedBean public final class ComputerSet extends AbstractModelObject implements Describable<ComputerSet>, ModelObjectWithChildren, HasWidgets
Serves as the top ofComputers in the URL hierarchy.Getter methods are prefixed with '_' to avoid collision with computer names.
- Author:
- Kohsuke Kawaguchi
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classComputerSet.DescriptorImpl
-
Constructor Summary
Constructors Constructor Description ComputerSet()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description StringcheckName(String name)Makes sure that the given name is good as an agent name.voiddo_launchAll(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp)FormValidationdoCheckName(String value)Makes sure that the given name is good as an agent name.ModelObjectWithContextMenu.ContextMenudoChildrenContextMenu(org.kohsuke.stapler.StaplerRequest request, org.kohsuke.stapler.StaplerResponse response)Generates the context menu to list up all the children.org.kohsuke.stapler.HttpResponsedoConfigSubmit(org.kohsuke.stapler.StaplerRequest req)Accepts submission from the configuration page.voiddoCreateItem(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp, String name, String mode, String from)First check point in creating a new agent.voiddoDoCreateItem(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp, String name, String type)Really creates a new agent.voiddoUpdateNow(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp)Triggers the schedule update now.Computer[]get_all()static List<NodeMonitor>get_monitors()Deprecated.as of 1.301 UsegetMonitors().List<String>get_slaveNames()Gets all the agent names.ApigetApi()intgetBusyExecutors()Number of busyExecutors that are carrying out some work right now.static List<String>getComputerNames()Descriptor<ComputerSet>getDescriptor()Gets the descriptor for this instance.StringgetDisplayName()ComputergetDynamic(String token, org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp)intgetIdleExecutors()getTotalExecutors()-getBusyExecutors(), plus executors that are being brought online.static DescribableList<NodeMonitor,Descriptor<NodeMonitor>>getMonitors()DescriptorExtensionList<NodeMonitor,Descriptor<NodeMonitor>>getNodeMonitorDescriptors()ExposingNodeMonitor.all()for Jelly binding.static Map<Descriptor<NodeMonitor>,NodeMonitor>getNonIgnoredMonitors()Returns a subset pfgetMonitors()that are not ignored.StringgetSearchUrl()Returns the URL of this item relative to the parentSearchItem.intgetTotalExecutors()Number of totalExecutors that belong to this label that are functioning.static voidinit()static voidinitialize()Just to force the execution of the static initializer.-
Methods inherited from class hudson.model.AbstractModelObject
getSearch, getSearchIndex, getSearchName, makeSearchIndex, requirePOST, sendError, sendError, sendError, sendError, sendError
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface jenkins.widgets.HasWidgets
getWidget, getWidgets
-
-
-
-
Method Detail
-
getDisplayName
@Exported public String getDisplayName()
- Specified by:
getDisplayNamein interfaceModelObject
-
get_monitors
@Deprecated public static List<NodeMonitor> get_monitors()
Deprecated.as of 1.301 UsegetMonitors().
-
get_all
@Exported(name="computer", inline=true) public Computer[] get_all()
-
doChildrenContextMenu
public ModelObjectWithContextMenu.ContextMenu doChildrenContextMenu(org.kohsuke.stapler.StaplerRequest request, org.kohsuke.stapler.StaplerResponse response) throws Exception
Description copied from interface:ModelObjectWithChildrenGenerates the context menu to list up all the children.- Specified by:
doChildrenContextMenuin interfaceModelObjectWithChildren- Throws:
Exception
-
getNodeMonitorDescriptors
public DescriptorExtensionList<NodeMonitor,Descriptor<NodeMonitor>> getNodeMonitorDescriptors()
ExposingNodeMonitor.all()for Jelly binding.
-
getMonitors
public static DescribableList<NodeMonitor,Descriptor<NodeMonitor>> getMonitors()
-
getNonIgnoredMonitors
public static Map<Descriptor<NodeMonitor>,NodeMonitor> getNonIgnoredMonitors()
Returns a subset pfgetMonitors()that are not ignored.
-
getTotalExecutors
@Exported public int getTotalExecutors()
Number of totalExecutors that belong to this label that are functioning.This excludes executors that belong to offline nodes.
-
getBusyExecutors
@Exported public int getBusyExecutors()
Number of busyExecutors that are carrying out some work right now.
-
getIdleExecutors
public int getIdleExecutors()
getTotalExecutors()-getBusyExecutors(), plus executors that are being brought online.
-
getSearchUrl
public String getSearchUrl()
Description copied from interface:SearchItemReturns the URL of this item relative to the parentSearchItem.- Specified by:
getSearchUrlin interfaceSearchItem- Returns:
- URL like "foo" or "foo/bar". The path can end with '/'. The path that starts with '/' will be interpreted as the absolute path (within the context path of Jenkins.)
-
getDynamic
public Computer getDynamic(String token, org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp)
-
do_launchAll
public void do_launchAll(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp) throws IOException- Throws:
IOException
-
doUpdateNow
public void doUpdateNow(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp) throws IOException, javax.servlet.ServletExceptionTriggers the schedule update now. TODO: ajax on the client side to wait until the update completion might be nice.- Throws:
IOExceptionjavax.servlet.ServletException
-
doCreateItem
public void doCreateItem(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp, @QueryParameter String name, @QueryParameter String mode, @QueryParameter String from) throws IOException, javax.servlet.ServletExceptionFirst check point in creating a new agent.- Throws:
IOExceptionjavax.servlet.ServletException
-
doDoCreateItem
@POST public void doDoCreateItem(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp, @QueryParameter String name, @QueryParameter String type) throws IOException, javax.servlet.ServletException, Descriptor.FormExceptionReally creates a new agent.- Throws:
IOExceptionjavax.servlet.ServletExceptionDescriptor.FormException
-
checkName
public String checkName(String name) throws Failure
Makes sure that the given name is good as an agent name.- Returns:
- trimmed name if valid; throws ParseException if not
- Throws:
Failure
-
doCheckName
public FormValidation doCheckName(@QueryParameter String value) throws IOException, javax.servlet.ServletException
Makes sure that the given name is good as an agent name.- Throws:
IOExceptionjavax.servlet.ServletException
-
doConfigSubmit
@POST public org.kohsuke.stapler.HttpResponse doConfigSubmit(org.kohsuke.stapler.StaplerRequest req) throws IOException, javax.servlet.ServletException, Descriptor.FormExceptionAccepts submission from the configuration page.- Throws:
IOExceptionjavax.servlet.ServletExceptionDescriptor.FormException
-
getApi
public Api getApi()
-
getDescriptor
public Descriptor<ComputerSet> getDescriptor()
Description copied from interface:DescribableGets the descriptor for this instance.Descriptoris a singleton for every concreteDescribableimplementation, so ifa.getClass() == b.getClass()then by defaulta.getDescriptor() == b.getDescriptor()as well. (In rare cases a single implementation class may be used for instances with distinct descriptors.)- Specified by:
getDescriptorin interfaceDescribable<ComputerSet>
-
initialize
public static void initialize()
Just to force the execution of the static initializer.
-
init
@Initializer(after=JOB_CONFIG_ADAPTED) public static void init()
-
-