com.sun.management.oss.impl.job.opstatus
Class DataElement

java.lang.Object
  extended bycom.sun.management.oss.impl.job.opstatus.DataElement

public class DataElement
extends java.lang.Object

DataElement holds a collection of MonitoredObject objects and provides facility for XML reporting.


Constructor Summary
DataElement(OperationalStatusGenericModel model)
          Create an new instance of this class.
 
Method Summary
 long getCollectionTime()
          Returns the time when the last data collection took place.
 java.lang.String getReportByEvent(boolean isInstant)
          Gets the XML by event report associated to this object.
 java.lang.String getReportByFile(boolean isInstant, java.net.URL destination, java.util.Date expirationDate)
          Gets the XML by file report associated to this object.
 boolean setMonitoredObjects(javax.management.ObjectName[] objectNames)
          Set the monitored objects (denoted by their object names) to observe and perform a collection process.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataElement

public DataElement(OperationalStatusGenericModel model)
Create an new instance of this class.

Parameters:
model - the data model where data will be collected.
Method Detail

getCollectionTime

public long getCollectionTime()
Returns the time when the last data collection took place.

Returns:
the time when the last data collection took place.

getReportByEvent

public java.lang.String getReportByEvent(boolean isInstant)
Gets the XML by event report associated to this object.

Parameters:
isInstant - if true include all monitored objects observed in the last collection; otherwise include only monitored objects that had changes from the previous collection campaign.
Returns:
the XML by event report associated to this object.

getReportByFile

public java.lang.String getReportByFile(boolean isInstant,
                                        java.net.URL destination,
                                        java.util.Date expirationDate)
Gets the XML by file report associated to this object.

Parameters:
isInstant - if true include all monitored objects observed in the last collection; otherwise include only monitored objects that had changes from the previous collection campaign.
destination - URL location where measurements must be saved (must be a file).
expirationDate - time from the save measurements are obsolate (null means never delete).
Returns:
the XML by file report associated to this object.

setMonitoredObjects

public boolean setMonitoredObjects(javax.management.ObjectName[] objectNames)
Set the monitored objects (denoted by their object names) to observe and perform a collection process. This class holds a cache of MonitoredObject instances to permit comparisons between collection campaigns. If a known monitored object differs (from an attribute value point of view) from the previous collection, this function returns true; otherwise false is returned. An unknown monitored object can not be compared and will return false.

Note : the timestamp associated to the element in the XML report is the time when the data collection took place.

Parameters:
objectNames - the object names (in String format) of the monitored objects to observe.
Returns:
true, if at least one of the monitored object had attribute changes since last collection; false otherwise.