org.jenkinsci.plugins.jqsmonitoring.slaves
Class SlavesHolder

java.lang.Object
  extended by hudson.slaves.ComputerListener
      extended by org.jenkinsci.plugins.jqsmonitoring.slaves.SlavesHolder
All Implemented Interfaces:
hudson.ExtensionPoint

@ExportedBean
public final class SlavesHolder
extends hudson.slaves.ComputerListener

Holds all information about the slaves in the current jenkins instance.

Author:
yboev

Nested Class Summary
 
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
hudson.ExtensionPoint.LegacyInstancesAreScopedToHudson
 
Method Summary
 hudson.model.Api getApi()
          REST API.
 String getColor(hudson.model.Slave s)
          Return the color assotiated with this slave .
static SlavesHolder getInstance()
          Return the instance for this class(Singleton).
 String getLastBuild(hudson.model.Slave slave)
          Return the last build for a given slave.
 int getNumberOfOnlineSlaves()
          Return number of online slaves.
 int getNumberOfSlaves()
          The number of slaves.
 ArrayList<hudson.model.Slave> getSlaves()
          List with all slaves.
 String getUrl(hudson.model.Slave slave)
          Returns the url for a certain slave.
 void onConfigurationChange()
           
 
Methods inherited from class hudson.slaves.ComputerListener
all, onLaunchFailure, onOffline, onOnline, onOnline, preLaunch, preOnline, register, unregister
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static SlavesHolder getInstance()
Return the instance for this class(Singleton).

Returns:
the instance.

getApi

public hudson.model.Api getApi()
REST API.

Returns:
the api.

onConfigurationChange

public void onConfigurationChange()
Overrides:
onConfigurationChange in class hudson.slaves.ComputerListener

getSlaves

@Exported
public ArrayList<hudson.model.Slave> getSlaves()
List with all slaves.

Returns:
the list.

getNumberOfSlaves

@Exported
public int getNumberOfSlaves()
The number of slaves.

Returns:
the number as int.

getUrl

public String getUrl(hudson.model.Slave slave)
Returns the url for a certain slave.

Parameters:
slave - the slave.
Returns:
the url of the given slave.

getLastBuild

public String getLastBuild(hudson.model.Slave slave)
Return the last build for a given slave.

Parameters:
slave - the slave.
Returns:
the last build of the given slave as String.

getNumberOfOnlineSlaves

@Exported
public int getNumberOfOnlineSlaves()
Return number of online slaves.

Returns:
number of online slaves as int.

getColor

public String getColor(hudson.model.Slave s)
Return the color assotiated with this slave . red - offline orange - all executors busy green - free executor

Parameters:
s - the slave.
Returns:
the color as String.


Copyright © 2004-2013. All Rights Reserved.