hudson.model
Class ComputerSet

java.lang.Object
  extended by hudson.model.AbstractModelObject
      extended by hudson.model.ComputerSet
All Implemented Interfaces:
Describable<ComputerSet>, ModelObject, SearchableModelObject, SearchItem

@ExportedBean
public final class ComputerSet
extends AbstractModelObject
implements Describable<ComputerSet>

Serves as the top of Computers in the URL hierarchy.

Getter methods are prefixed with '_' to avoid collision with computer names.

Author:
Kohsuke Kawaguchi

Nested Class Summary
static class ComputerSet.DescriptorImpl
           
 
Constructor Summary
ComputerSet()
           
 
Method Summary
 String checkName(String name)
          Makes sure that the given name is good as a slave name.
 void do_launchAll(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp)
           
 FormValidation doCheckName(String value)
          Makes sure that the given name is good as a slave name.
 org.kohsuke.stapler.HttpResponse doConfigSubmit(org.kohsuke.stapler.StaplerRequest req)
          Accepts submission from the configuration page.
 void doCreateItem(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp, String name, String mode, String from)
          First check point in creating a new slave.
 void doDoCreateItem(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp, String name, String type)
          Really creates a new slave.
 void doUpdateNow(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 Use getMonitors().
 List<String> get_slaveNames()
          Gets all the slave names.
 Api getApi()
           
 int getBusyExecutors()
          Number of busy Executors that are carrying out some work right now.
 Descriptor<ComputerSet> getDescriptor()
          Gets the descriptor for this instance.
 String getDisplayName()
           
 Computer getDynamic(String token, org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp)
           
 int getIdleExecutors()
          getTotalExecutors()-getBusyExecutors(), plus executors that are being brought online.
static DescribableList<NodeMonitor,Descriptor<NodeMonitor>> getMonitors()
           
 DescriptorExtensionList<NodeMonitor,Descriptor<NodeMonitor>> getNodeMonitorDescriptors()
          Exposing NodeMonitor.all() for Jelly binding.
static Map<Descriptor<NodeMonitor>,NodeMonitor> getNonIgnoredMonitors()
          Returns a subset pf getMonitors() that are not ignored.
 String getSearchUrl()
          Returns the URL of this item relative to the parent SearchItem.
 int getTotalExecutors()
          Number of total Executors that belong to this label that are functioning.
static void initialize()
          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
 

Constructor Detail

ComputerSet

public ComputerSet()
Method Detail

getDisplayName

@Exported
public String getDisplayName()
Specified by:
getDisplayName in interface ModelObject

get_monitors

public static List<NodeMonitor> get_monitors()
Deprecated. as of 1.301 Use getMonitors().


get_all

@Exported(name="computer",
          inline=true)
public Computer[] get_all()

getNodeMonitorDescriptors

public DescriptorExtensionList<NodeMonitor,Descriptor<NodeMonitor>> getNodeMonitorDescriptors()
Exposing NodeMonitor.all() for Jelly binding.


getMonitors

public static DescribableList<NodeMonitor,Descriptor<NodeMonitor>> getMonitors()

getNonIgnoredMonitors

public static Map<Descriptor<NodeMonitor>,NodeMonitor> getNonIgnoredMonitors()
Returns a subset pf getMonitors() that are not ignored.


get_slaveNames

public List<String> get_slaveNames()
Gets all the slave names.


getTotalExecutors

@Exported
public int getTotalExecutors()
Number of total Executors that belong to this label that are functioning.

This excludes executors that belong to offline nodes.


getBusyExecutors

@Exported
public int getBusyExecutors()
Number of busy Executors 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: SearchItem
Returns the URL of this item relative to the parent SearchItem.

Specified by:
getSearchUrl in interface SearchItem
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 Hudson.)

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.ServletException
Triggers the schedule update now. TODO: ajax on the client side to wait until the update completion might be nice.

Throws:
IOException
javax.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.ServletException
First check point in creating a new slave.

Throws:
IOException
javax.servlet.ServletException

doDoCreateItem

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.FormException
Really creates a new slave.

Throws:
IOException
javax.servlet.ServletException
Descriptor.FormException

checkName

public String checkName(String name)
                 throws Failure
Makes sure that the given name is good as a slave 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 a slave name.

Throws:
IOException
javax.servlet.ServletException

doConfigSubmit

public org.kohsuke.stapler.HttpResponse doConfigSubmit(org.kohsuke.stapler.StaplerRequest req)
                                                throws IOException,
                                                       javax.servlet.ServletException,
                                                       Descriptor.FormException
Accepts submission from the configuration page.

Throws:
IOException
javax.servlet.ServletException
Descriptor.FormException

getApi

public Api getApi()

getDescriptor

public Descriptor<ComputerSet> getDescriptor()
Description copied from interface: Describable
Gets the descriptor for this instance.

Descriptor is a singleton for every concrete Describable implementation, so if a.getClass()==b.getClass() then a.getDescriptor()==b.getDescriptor() must hold.

Specified by:
getDescriptor in interface Describable<ComputerSet>

initialize

public static void initialize()
Just to force the execution of the static initializer.



Copyright © 2004-2013. All Rights Reserved.