edu.sdsc.inca.depot.persistent
Class InstanceInfo

java.lang.Object
  extended by edu.sdsc.inca.depot.persistent.PersistentObject
      extended by edu.sdsc.inca.depot.persistent.InstanceInfo

public class InstanceInfo
extends PersistentObject

Represents information specific to a particular instance of a reporter run.


Field Summary
 
Fields inherited from class edu.sdsc.inca.depot.persistent.PersistentObject
DB_EMPTY_STRING, MAX_DB_LONG_STRING_LENGTH, MAX_DB_STRING_LENGTH
 
Constructor Summary
InstanceInfo()
          Default constructor.
InstanceInfo(java.util.Date collected, java.util.Date commited, java.lang.Float memoryUsageMB, java.lang.Float cpuUsageSec, java.lang.Float wallClockTimeSec)
          Full constructor.
InstanceInfo(java.util.Date collected, java.lang.String sysusage)
          A constructor that parses the Inca protocol SYSUSAGE message.
 
Method Summary
 boolean equals(java.lang.Object o)
          Compares another object to this InstanceInfo for logical equality.
 PersistentObject fromBean(org.apache.xmlbeans.XmlObject o)
          Copies information from an Inca schema XmlBean object so that this object contains equivalent information.
 java.util.Date getCollected()
          Retrieve the time this instance was collected.
 java.util.Date getCommited()
          Retrieve the time this instance was committed.
 java.lang.Float getCpuUsageSec()
          get the cpu usage.
 java.lang.Long getId()
          Retrieve the id -- null if not yet connected to database.
 java.lang.String getLog()
          Retrieve the log of this InstanceInfo as an XML string.
 java.lang.Float getMemoryUsageMB()
          Retrieve the memory usage.
 java.lang.Long getReportId()
          Return the DB id of the report to which this instance is attached.
 java.lang.Float getWallClockTimeSec()
          Get the length of time this reporter took to run.
 int hashCode()
          Calculate a hash code using the same fields that where used in equals.
 void setCollected(java.util.Date collected)
          Set the time this data was collected.
 void setCommited(java.util.Date commited)
          set the thime this data was commited to db.
 void setCpuUsageSec(java.lang.Float cpuUsageSec)
          Set the cup usage.
 void setId(java.lang.Long id)
          Set the id.
 void setLog(java.lang.String log)
          Set the log of this InstanceInfo.
 void setMemoryUsageMB(java.lang.Float memoryUsageMB)
          Set the memory usage.
 void setReportId(java.lang.Long id)
          Set the DB id of the report to which this instance is attached.
 void setWallClockTimeSec(java.lang.Float wallClockTimeSec)
          Set the amount of time this reporter took to run.
 org.apache.xmlbeans.XmlObject toBean()
          Returns a Inca schema XmlBean Limits object that contains information equivalent to this object.
 java.lang.String toXml()
          Returns XML that represents the information in this object.
 
Methods inherited from class edu.sdsc.inca.depot.persistent.PersistentObject
truncate
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InstanceInfo

public InstanceInfo()
Default constructor.


InstanceInfo

public InstanceInfo(java.util.Date collected,
                    java.util.Date commited,
                    java.lang.Float memoryUsageMB,
                    java.lang.Float cpuUsageSec,
                    java.lang.Float wallClockTimeSec)
Full constructor.

Parameters:
collected - The time that the data was collected
commited - The time that the data was saved to the database.
memoryUsageMB - The amount of memory used by the reporter.
cpuUsageSec - The cpu used by this run of the reporter
wallClockTimeSec - The time the reporter took to run.

InstanceInfo

public InstanceInfo(java.util.Date collected,
                    java.lang.String sysusage)
A constructor that parses the Inca protocol SYSUSAGE message.

Parameters:
collected - The time that the date was collected.
sysusage - The Inca protocol SYSUSAGE message.
Method Detail

fromBean

public PersistentObject fromBean(org.apache.xmlbeans.XmlObject o)
Copies information from an Inca schema XmlBean object so that this object contains equivalent information.

Specified by:
fromBean in class PersistentObject
Parameters:
o - the XmlBean object to copy
Returns:
this, for convenience

getId

public java.lang.Long getId()
Retrieve the id -- null if not yet connected to database.

Returns:
The Long representation of the DB ID

setId

public void setId(java.lang.Long id)
Set the id. Hibernate use only.

Parameters:
id - The DB ID.

getCollected

public java.util.Date getCollected()
Retrieve the time this instance was collected.

Returns:
date collected

setCollected

public void setCollected(java.util.Date collected)
Set the time this data was collected.

Parameters:
collected - date collected

getCommited

public java.util.Date getCommited()
Retrieve the time this instance was committed.

Returns:
date committed

setCommited

public void setCommited(java.util.Date commited)
set the thime this data was commited to db.

Parameters:
commited - commit time

getMemoryUsageMB

public java.lang.Float getMemoryUsageMB()
Retrieve the memory usage.

Returns:
memory usage

setMemoryUsageMB

public void setMemoryUsageMB(java.lang.Float memoryUsageMB)
Set the memory usage.

Parameters:
memoryUsageMB - Memory usage in MB

getCpuUsageSec

public java.lang.Float getCpuUsageSec()
get the cpu usage.

Returns:
cpu usage in Sec

setCpuUsageSec

public void setCpuUsageSec(java.lang.Float cpuUsageSec)
Set the cup usage.

Parameters:
cpuUsageSec - cpu usage in sec

getWallClockTimeSec

public java.lang.Float getWallClockTimeSec()
Get the length of time this reporter took to run.

Returns:
runtime in sec

setWallClockTimeSec

public void setWallClockTimeSec(java.lang.Float wallClockTimeSec)
Set the amount of time this reporter took to run.

Parameters:
wallClockTimeSec - time in sec

getLog

public java.lang.String getLog()
Retrieve the log of this InstanceInfo as an XML string.

Returns:
XML string

setLog

public void setLog(java.lang.String log)
Set the log of this InstanceInfo.

Parameters:
log - xml log of InstanceInfo

getReportId

public java.lang.Long getReportId()
Return the DB id of the report to which this instance is attached.

Returns:
the DB id of this instance's report

setReportId

public void setReportId(java.lang.Long id)
Set the DB id of the report to which this instance is attached.

Parameters:
id - the DB id of this instance's report

toBean

public org.apache.xmlbeans.XmlObject toBean()
Returns a Inca schema XmlBean Limits object that contains information equivalent to this object.

Specified by:
toBean in class PersistentObject
Returns:
an XmlBean Limits object that contains equivalent information

equals

public boolean equals(java.lang.Object o)
Compares another object to this InstanceInfo for logical equality.

Overrides:
equals in class java.lang.Object
Parameters:
o - the object to compare
Returns:
true iff the comparison object represents the same InstanceInfo

toXml

public java.lang.String toXml()
Returns XML that represents the information in this object.

Overrides:
toXml in class PersistentObject

hashCode

public int hashCode()
Calculate a hash code using the same fields that where used in equals.

Overrides:
hashCode in class java.lang.Object
Returns:
a hash code for this object