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 ApigetApi()REST API.StringgetColor(Slave s)Return the color assotiated with this slave .static SlavesHoldergetInstance()Return the instance for this class(Singleton).StringgetLastBuild(Slave slave)Return the last build for a given slave.intgetNumberOfOfflineSlaves()Return number of offline slaves.intgetNumberOfOnlineSlaves()Return number of online slaves.intgetNumberOfSlaves()The number of slaves.ArrayList<Slave>getSlaves()List with all slaves.StringgetUrl(Slave slave)Returns the url for a certain slave.voidonConfigurationChange()-
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:
onConfigurationChangein 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.
-
-