Class JobAgentInfo

java.lang.Object
net.sf.basedb.util.jobagent.JobAgentInfo

public class JobAgentInfo
extends Object
This class can hold information about the status of a job agent.
Version:
2.0
Author:
nicklas
See Also:
JobAgentConnection.getInfo(boolean)
Last modified
$Date: 2012-09-14 09:28:35 +0200 (fr, 14 sep 2012) $
  • Field Details

    • created

      private final long created
    • paused

      private final Boolean paused
    • cpuUsage

      private final Integer cpuUsage
    • usedMemory

      private final Long usedMemory
    • totalMemory

      private final Long totalMemory
    • jobs

      private final Set<JobInfo> jobs
  • Constructor Details

    • JobAgentInfo

      public JobAgentInfo()
      Create a new info object and set all values to null.
    • JobAgentInfo

      public JobAgentInfo​(Boolean paused, Integer cpuUsage, Long usedMemory, Long totalMemory, Set<JobInfo> jobs)
      Create a new info object.
      Parameters:
      paused - If the job agent is paused or running, or null if not know
      cpuUsage - The CPU usage in percent, or null if not known
      usedMemory - The used memory in bytes, or null if not known
      totalMemory - The total memory in bytes, or null if not known
      jobs - Information about jobs that are currently executing or null if not known
    • JobAgentInfo

      public JobAgentInfo​(String answer)
      Create a new info object and parse the answer from a JobAgentConnection to get the values.
      Parameters:
      answer - The answer from info request to the job agent
  • Method Details

    • getAge

      public long getAge()
      Get the age in milliseconds of this object. The age can be used by client applications that caches the information to determine when it is time to issue a new request.
      Returns:
      The age in milliseconds
    • isPaused

      public Boolean isPaused()
      If the job agent is paused or running.
      Returns:
      TRUE if the job agent is pasued, FALSE if it is running, or null if not known
    • getCpuUsage

      public Integer getCpuUsage()
      Get the CPU usage in percent.
      Returns:
      The CPU usage or null if not known
    • getTotalMemory

      public Long getTotalMemory()
      Get the total memory on the job agent's server in bytes.
      Returns:
      The total memory or null if not known
    • getUsedMemory

      public Long getUsedMemory()
      Get the used memory on the job agent's server in bytes.
      Returns:
      The used memory or null if not known
    • getJobInfo

      public Set<JobInfo> getJobInfo()
      Get detailed information about the running jobs.
      Returns:
      A set with job information or null if not known
      Since:
      2.6
    • toString

      public String toString()
      Convert the information to a string that is suitable for sening as an answer to a JobAgentConnection object.
      Overrides:
      toString in class Object
    • getValue

      private String getValue​(Map<String,​List<String>> headers, String header)
    • getValues

      private List<String> getValues​(Map<String,​List<String>> headers, String header)