com.sun.grid.jgdi.monitoring
Class QueueInstanceSummaryImpl

java.lang.Object
  extended by com.sun.grid.jgdi.monitoring.QueueInstanceSummaryImpl
All Implemented Interfaces:
QueueInstanceSummary, java.io.Serializable

public class QueueInstanceSummaryImpl
extends java.lang.Object
implements QueueInstanceSummary, java.io.Serializable

See Also:
Serialized Form

Constructor Summary
QueueInstanceSummaryImpl()
          Creates a new instance of QueueInstanceSummary
 
Method Summary
 void addExplainMessage(java.lang.String message)
          Add an explain message
 void addJob(JobSummary jobSummary)
          Add a job.
 void addJobs(java.util.List<JobSummary> jobList)
          Add all jobs from a list
 void addResource(java.lang.String dom, java.lang.String name, java.lang.String value)
          Add a resource value to the queue instance
 java.lang.String getArch()
          Get the architecture of the queue instance
 java.util.List getExplainMessageList()
          Get the list of explain messages
 int getFreeSlots()
          Deprecated. 
 java.util.List<JobSummary> getJobList()
          Get the list of jobs which are assigned to the queue instance
 java.lang.String getLoadAlarmReason()
          Get the load alarm reason for the queue instance
 double getLoadAvg()
          Get the load average of the queue instance.
 java.lang.String getLoadAvgStr()
          Get the string representation of the load average
 java.lang.String getName()
          Get the name of the queue instance
 java.lang.String getQueueType()
          Get the type of the queue
 int getReservedSlots()
          Get the number of reserved slots.
 java.util.Set<java.lang.String> getResourceDominanceSet()
          Get avaialable dominances for the resource values
 java.util.Set<java.lang.String> getResourceNames(java.lang.String dom)
          Get all resources names which have the dominane dom
 java.lang.String getResourceValue(java.lang.String dom, java.lang.String name)
          Get a resource value
 java.lang.String getState()
          Get the state of the queue instance
 java.lang.String getSuspendAlarmReason()
          Get the suspend alarm reason for the queue instance
 int getTotalSlots()
          Get the number of total slots
 int getUsedSlots()
          Get the number of used slots.
 boolean hasLoadValue()
          Determine if the queue instance has a load value
 boolean isHasLoadValueFromObject()
          Determine if the load value is derived from an object
 void setArch(java.lang.String arch)
          Set the architecture of the queue instance
 void setHasLoadValue(boolean hasLoadValue)
          Set the has load value flag
 void setHasLoadValueFromObject(boolean hasLoadValueFromObject)
          Set the has load value from object flag
 void setLoadAlarmReason(java.lang.String loadAlarmReason)
          Set the load alarm reason for the queue instance
 void setLoadAvg(double loadAvg)
          Set the load average of the queue instance
 void setLoadAvgStr(java.lang.String loadAvgStr)
          Set the string representation of the load average
 void setName(java.lang.String name)
          Set the name of the queue instance
 void setQueueType(java.lang.String queueType)
          Set the type of the queue
 void setReservedSlots(int reservedSlots)
          Set the number of reserved slots
 void setState(java.lang.String state)
          Set the state of a queue instance
 void setSuspendAlarmReason(java.lang.String suspendAlarmReason)
          Set the suspend alarm reason for the queue instance
 void setTotalSlots(int totalSlots)
          Set the number of total slots
 void setUsedSlots(int usedSlots)
          Set the number of used slots
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QueueInstanceSummaryImpl

public QueueInstanceSummaryImpl()
Creates a new instance of QueueInstanceSummary

Method Detail

getName

public java.lang.String getName()
Get the name of the queue instance

Specified by:
getName in interface QueueInstanceSummary
Returns:
name of the queue instance

setName

public void setName(java.lang.String name)
Set the name of the queue instance

Parameters:
name - name of the queue instance

getQueueType

public java.lang.String getQueueType()
Get the type of the queue

Specified by:
getQueueType in interface QueueInstanceSummary
Returns:
type of the queue

setQueueType

public void setQueueType(java.lang.String queueType)
Set the type of the queue

Parameters:
queueType - type of the queue

getReservedSlots

public int getReservedSlots()
Get the number of reserved slots.

Specified by:
getReservedSlots in interface QueueInstanceSummary
Returns:
number of reserved slots

setReservedSlots

public void setReservedSlots(int reservedSlots)
Set the number of reserved slots

Parameters:
reservedSlots - number of reserved slots

getUsedSlots

public int getUsedSlots()
Get the number of used slots.

Specified by:
getUsedSlots in interface QueueInstanceSummary
Returns:
number of used slots

setUsedSlots

public void setUsedSlots(int usedSlots)
Set the number of used slots

Parameters:
usedSlots - number of used slots

getFreeSlots

@Deprecated
public int getFreeSlots()
Deprecated. 

Get the number of free slots (returns total instead of free slots)

Specified by:
getFreeSlots in interface QueueInstanceSummary
Returns:
number of free slots

getTotalSlots

public int getTotalSlots()
Get the number of total slots

Specified by:
getTotalSlots in interface QueueInstanceSummary
Returns:
number of total slots

setTotalSlots

public void setTotalSlots(int totalSlots)
Set the number of total slots

Parameters:
totalSlots - number of total slots

getArch

public java.lang.String getArch()
Get the architecture of the queue instance

Specified by:
getArch in interface QueueInstanceSummary
Returns:
architecture of the queue instance

setArch

public void setArch(java.lang.String arch)
Set the architecture of the queue instance

Parameters:
arch - architecture of the queue instance

getState

public java.lang.String getState()
Get the state of the queue instance

Specified by:
getState in interface QueueInstanceSummary
Returns:
state of the queue instance

setState

public void setState(java.lang.String state)
Set the state of a queue instance

Parameters:
state - state of a queue instance

getLoadAvgStr

public java.lang.String getLoadAvgStr()
Get the string representation of the load average

Specified by:
getLoadAvgStr in interface QueueInstanceSummary
Returns:
the string representation of the load average

setLoadAvgStr

public void setLoadAvgStr(java.lang.String loadAvgStr)
Set the string representation of the load average

Parameters:
loadAvgStr - the string representation of the load average

hasLoadValue

public boolean hasLoadValue()
Determine if the queue instance has a load value

Specified by:
hasLoadValue in interface QueueInstanceSummary
Returns:
true if the queue instance has a load value

setHasLoadValue

public void setHasLoadValue(boolean hasLoadValue)
Set the has load value flag

Parameters:
hasLoadValue - the has load value flag

isHasLoadValueFromObject

public boolean isHasLoadValueFromObject()
Determine if the load value is derived from an object

Specified by:
isHasLoadValueFromObject in interface QueueInstanceSummary
Returns:
true if the load value is derived from an object

setHasLoadValueFromObject

public void setHasLoadValueFromObject(boolean hasLoadValueFromObject)
Set the has load value from object flag

Parameters:
hasLoadValueFromObject - the load value from object flag

getLoadAvg

public double getLoadAvg()
Get the load average of the queue instance. Return only a meanful value if hasLoadValue returns true.

Specified by:
getLoadAvg in interface QueueInstanceSummary
Returns:
The load average of the queue instance
See Also:
hasLoadValue

setLoadAvg

public void setLoadAvg(double loadAvg)
Set the load average of the queue instance

Parameters:
loadAvg - the load average

addJobs

public void addJobs(java.util.List<JobSummary> jobList)
Add all jobs from a list

Parameters:
jobList - list of JobSummary instances

addJob

public void addJob(JobSummary jobSummary)
Add a job.

Parameters:
jobSummary - the job

getJobList

public java.util.List<JobSummary> getJobList()
Get the list of jobs which are assigned to the queue instance

Specified by:
getJobList in interface QueueInstanceSummary
Returns:
list of jobs (instances of JobSummary)

getLoadAlarmReason

public java.lang.String getLoadAlarmReason()
Get the load alarm reason for the queue instance

Specified by:
getLoadAlarmReason in interface QueueInstanceSummary
Returns:
the load alarm reason

setLoadAlarmReason

public void setLoadAlarmReason(java.lang.String loadAlarmReason)
Set the load alarm reason for the queue instance

Parameters:
loadAlarmReason - the load alarm reason

getSuspendAlarmReason

public java.lang.String getSuspendAlarmReason()
Get the suspend alarm reason for the queue instance

Specified by:
getSuspendAlarmReason in interface QueueInstanceSummary
Returns:
the suspend alarm reason

setSuspendAlarmReason

public void setSuspendAlarmReason(java.lang.String suspendAlarmReason)
Set the suspend alarm reason for the queue instance


addExplainMessage

public void addExplainMessage(java.lang.String message)
Add an explain message

Parameters:
message - the explain message

getExplainMessageList

public java.util.List getExplainMessageList()
Get the list of explain messages

Specified by:
getExplainMessageList in interface QueueInstanceSummary
Returns:
list of explain messages

addResource

public void addResource(java.lang.String dom,
                        java.lang.String name,
                        java.lang.String value)
Add a resource value to the queue instance

Parameters:
dom - dominance of the resource value
name - name of the resource
value - value of the resource

getResourceDominanceSet

public java.util.Set<java.lang.String> getResourceDominanceSet()
Get avaialable dominances for the resource values

Specified by:
getResourceDominanceSet in interface QueueInstanceSummary
Returns:
set of avaialable dominances

getResourceNames

public java.util.Set<java.lang.String> getResourceNames(java.lang.String dom)
Get all resources names which have the dominane dom

Specified by:
getResourceNames in interface QueueInstanceSummary
Returns:
set of resource names

getResourceValue

public java.lang.String getResourceValue(java.lang.String dom,
                                         java.lang.String name)
Get a resource value

Specified by:
getResourceValue in interface QueueInstanceSummary
Parameters:
dom - dominance of the resource value
name - name of the resource
Returns:
the resource value


Copyright © 2007 Sun Microsystems, Inc. All rights reserved.