Class SystemLoad

java.lang.Object
org.opencastproject.serviceregistry.api.SystemLoad

public class SystemLoad extends Object
Mappings between the registered hosts and their load factors.
  • Field Details

  • Constructor Details

    • SystemLoad

      public SystemLoad()
      No-arg constructor needed by JAXB
  • Method Details

    • getNodeLoads

      public Collection<SystemLoad.NodeLoad> getNodeLoads()
      Get the list of nodes and their current loadfactor.
      Returns:
      the nodeLoads
    • setNodeLoads

      public void setNodeLoads(Collection<SystemLoad.NodeLoad> newLoads)
      Sets the list of nodes and their current loadfactor.
      Parameters:
      newLoads - the nodeLoads to set
    • updateNodeLoad

      public void updateNodeLoad(String host, float modifier) throws NotFoundException
      Updates the load factor for a node
      Parameters:
      host - The host to update
      modifier - The modifier to apply to the load
      Throws:
      NotFoundException
    • addNodeLoad

      public void addNodeLoad(SystemLoad.NodeLoad load)
      Adds a node to the map of load values, overwriting an existing entry if the node is already present in the map
      Parameters:
      load - the nodeLoad to add
    • get

      public SystemLoad.NodeLoad get(String host)
      Gets a specific host from the map, if present. If the node is not present, or the host value is null, this method returns null.
      Parameters:
      host - The hostname of the host you are interested in.
      Returns:
      The specific host from the map, if present. If the node is not present, or the host value is null, this method returns null.
    • containsHost

      public boolean containsHost(String host)
      Returns true if the load map contains the host in question.
      Parameters:
      host - The hostname of the host you are interested in.
      Returns:
      True if the host is present, false if the host is not, or the host variable is null.
    • toString

      public String toString()
      Overrides:
      toString in class Object