Class SlavesHolder
- java.lang.Object
-
- hudson.slaves.ComputerListener
-
- org.jenkinsci.plugins.jqsmonitoring.slaves.SlavesHolder
-
- All Implemented Interfaces:
ExtensionPoint
@ExportedBean public final class SlavesHolder extends 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
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Api
getApi()
REST API.String
getColor(Slave s)
Return the color assotiated with this slave .static SlavesHolder
getInstance()
Return the instance for this class(Singleton).String
getLastBuild(Slave slave)
Return the last build for a given slave.int
getNumberOfOfflineSlaves()
Return number of offline slaves.int
getNumberOfOnlineSlaves()
Return number of online slaves.int
getNumberOfSlaves()
The number of slaves.ArrayList<Slave>
getSlaves()
List with all slaves.String
getUrl(Slave slave)
Returns the url for a certain slave.void
onConfigurationChange()
-
Methods inherited from class hudson.slaves.ComputerListener
all, onLaunchFailure, onOffline, onOffline, onOnline, onOnline, onTemporarilyOffline, onTemporarilyOnline, preLaunch, preOnline, register, unregister
-
-
-
-
Method Detail
-
getInstance
public static SlavesHolder getInstance()
Return the instance for this class(Singleton).- Returns:
- the instance.
-
getApi
public Api getApi()
REST API.- Returns:
- the api.
-
onConfigurationChange
public void onConfigurationChange()
- Overrides:
onConfigurationChange
in classComputerListener
-
getNumberOfSlaves
@Exported public int getNumberOfSlaves()
The number of slaves.- Returns:
- the number as int.
-
getUrl
public String getUrl(Slave slave)
Returns the url for a certain slave.- Parameters:
slave
- the slave.- Returns:
- the url of the given slave.
-
getLastBuild
public String getLastBuild(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.
-
getNumberOfOfflineSlaves
@Exported public int getNumberOfOfflineSlaves()
Return number of offline slaves.- Returns:
- number of offline slaves as int.
-
-