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
  • Method Details

    • 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 class ComputerListener
    • getSlaves

      @Exported public ArrayList<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(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.
    • getColor

      public String getColor(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.