com.tivoli.twg.monitor
Class TWGMonCurrentData

java.lang.Object
  extended bycom.tivoli.twg.monitor.TWGMonCurrentData
All Implemented Interfaces:
java.lang.Cloneable, java.io.Serializable

public class TWGMonCurrentData
extends java.lang.Object
implements java.lang.Cloneable, java.io.Serializable

This is the TWGMonCurrentData. It is used to contain all relativent data associated with a datapoint that is received from a client. It is normally created by a subsystem in response to a get data or get recording data call. It may also be created to record return code information that indicates why a data was not available to create a data point. The set of return codes that are checked for from this class are:

TWGMonRC.SUCCESS:
indicates that the data contained in the object is valid and useful
TWGMonRC.INVALID_DATA:
indicates that the data point represented by the object does not have valid data. This is usually a transient condition caused by a temporary inability to retreive good data
TWGMonRC.SECURITY_FAILURE:
indicates that the data was not available due to security limits imposed by the managed object
TWGMonRC.LICENSE_FAILURE:
indicates that the data was not available because security limits were exceded in gathering data from the attribute or managed object
TWGMonRC.SOURCE_OFFLINE:
indicates that the item for which the data point was gathered is currently offline and not available to provide data
TWGMonRC.TIMEOUT:
usually indicates temporary communication problem trying to gather data from the managed object.
TWGMonRC.GENERAL_ERROR, TWGMonRC.PERMANENT_ERROR, TWGMonRC.INVALID_HANDLE, TWGMonRC.INVALID_PATH, TWGMonRC.INVALID_MOID:
these all indicate errors of a permanent nature that may only resolve when the managed system is restarted.
all other return codes
indicate a failure occured that is unique to a particular subsystem

See Also:

This class is serialized between the console and the server., Serialized Form


Constructor Summary
TWGMonCurrentData(int rc)
          This is the constructor for the current data class.
TWGMonCurrentData(IntelByteBuffer iBuf)
          This is the constructor for building a monitor data point from data in an Intel Byte Buffer.
TWGMonCurrentData(int rc, int flags, double numberData, java.lang.String stringData, java.lang.String formatStr)
          This is the constructor for the current data class.
TWGMonCurrentData(int rc, int flags, double numberData, java.lang.String stringData, java.lang.String formatStr, long time)
          This is the constructor for the current data class.
TWGMonCurrentData(int rc, int flags, double numberData, java.lang.String stringData, java.lang.String formatStr, long time, java.lang.String unitsStr, java.lang.String enumStr)
          This is the constructor for the current data class.
 
Method Summary
 void clearEnumType()
          function to remove the enumerated data point id
 java.lang.Object clone()
          Returns a clone of this attribute path.
 boolean equals(TWGMonCurrentData that)
          THis method provides an equivalence check for data points
 int getDataType()
          Gets the data type for the data point
 java.lang.String getDisplayString()
          returns the object as a formatted string
 java.lang.String getEnumStr()
          getter function to return enumeration string data from current data object
 java.lang.String getFormatStr()
          getter function to return the format string
 IntelByteBuffer getIntelByteBuffer()
          Writes the class variables out to a new'ed IntelByteBuffer
 int getIntelByteBufferSize()
          Determines the IntelByteBuffer size requirement for this object
 double getNumberData()
          getter function to return numeric data from current data object
 int getRC()
          getter function to return return code from current data object
 java.lang.String getStringData()
          getter function to return string data from current data object
 long getTimeStamp()
          getter function to return the time stamp for the data object
 boolean isEnumType()
          function to determine if this is an enumerated data point
 boolean isNumericData()
          function to determine if this is a numeric data point
 boolean isStringData()
          function to determine if this is a string data point
 void setEnumStr(java.lang.String parm)
          enumeration string setter function
 void setFormatStr(java.lang.String parm)
          format string setter function
 void setRC(int rc)
          setter function to set return code for current data object
 void setUnitsStr(java.lang.String parm)
          units string setter function
 java.lang.String toString()
          returns the data contained within the object as a string
 IntelByteBuffer writeIntelByteBuffer(IntelByteBuffer iBuf)
          Writes the state of the objects variables out to the passed in IntelByteBuffer
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TWGMonCurrentData

public TWGMonCurrentData(int rc)
This is the constructor for the current data class. It encapsulates information being returned to the screen from the monitor server

The description of this class of objects indicates what return code values are expected to be set in the object.

Parameters:
rc - return code to reflect with the current data point

TWGMonCurrentData

public TWGMonCurrentData(int rc,
                         int flags,
                         double numberData,
                         java.lang.String stringData,
                         java.lang.String formatStr)
This is the constructor for the current data class. It encapsulates information being returned to the screen from the monitor server

The description of this class of objects indicates what return code values are expected to be set in the object.

Parameters:
rc - return code to reflect with the current data point
flags - flag word with information on the data present in the object
numberData - double value to set as the current value of the data point
stringData - string value to set as the current value of the data point
formatStr - string value to use to format the data (uses a simple form of the format strings used by the printf function found in the C library, as implemented by the com.tivoli.libs.Format class).
See Also:
com.tivoli.twg.libs.Format

TWGMonCurrentData

public TWGMonCurrentData(int rc,
                         int flags,
                         double numberData,
                         java.lang.String stringData,
                         java.lang.String formatStr,
                         long time)
This is the constructor for the current data class. It encapsulates information being returned to the server from clients or to GUI from server

Parameters:
rc - return code to reflect with the current data point
flags - flag word with information on the data present in the object
numberData - double value to set as the current value of the data point
stringData - string value to set as the current value of the data point
formatStr - string value to use to format the data (uses a simple form of the format strings used by the printf function found in the C library, as implemented by the com.tivoli.libs.Format class).
time - timestamp of when this data was collected
See Also:
com.tivoli.twg.libs.Format

TWGMonCurrentData

public TWGMonCurrentData(int rc,
                         int flags,
                         double numberData,
                         java.lang.String stringData,
                         java.lang.String formatStr,
                         long time,
                         java.lang.String unitsStr,
                         java.lang.String enumStr)
This is the constructor for the current data class. It encapsulates information being returned to the server from clients or to GUI from server

The description of this class of objects indicates what return code values are expected to be set in the object.

Parameters:
rc - return code to reflect with the current data point
flags - flag word with information on the data present in the object
numberData - double value to set as the current value of the data point
stringData - string value to set as the current value of the data point
formatStr - string value to use to format the data (uses a simple form of the format strings used by the printf function found in the C library, as implemented by the com.tivoli.libs.Format class).
time - timestamp of when this data was collected
unitsStr - Java-style format and/or label string to use to format the data point
enumStr - locale requested enumeration value to use for this data point
See Also:
com.tivoli.twg.libs.Format

TWGMonCurrentData

public TWGMonCurrentData(IntelByteBuffer iBuf)
This is the constructor for building a monitor data point from data in an Intel Byte Buffer.

Parameters:
iBuf - Intel byte buffer with information to construct object from
Method Detail

getIntelByteBufferSize

public int getIntelByteBufferSize()
Determines the IntelByteBuffer size requirement for this object

Returns:
int containing the size of buffer needed

writeIntelByteBuffer

public IntelByteBuffer writeIntelByteBuffer(IntelByteBuffer iBuf)
Writes the state of the objects variables out to the passed in IntelByteBuffer

Parameters:
iBuf - byte buffer to save the state of the object into
Returns:
IntelByteBuffer containing the passed in IntelByteBuffer with values set

getIntelByteBuffer

public IntelByteBuffer getIntelByteBuffer()
Writes the class variables out to a new'ed IntelByteBuffer

Returns:
IntelByteBuffer reference containing a new IntelByteBuffer with values set

clone

public java.lang.Object clone()
Returns a clone of this attribute path.

Returns:
Object a clone of this attribute path.

isStringData

public boolean isStringData()
function to determine if this is a string data point

Returns:
boolean is this a string data point

getStringData

public java.lang.String getStringData()
getter function to return string data from current data object

Returns:
String with current data point's string representation

getFormatStr

public java.lang.String getFormatStr()
getter function to return the format string

Returns:
String printf-style format string to use

getEnumStr

public java.lang.String getEnumStr()
getter function to return enumeration string data from current data object

Returns:
String with current enumeration data point

isNumericData

public boolean isNumericData()
function to determine if this is a numeric data point

Returns:
boolean is this a numeric data point

getNumberData

public double getNumberData()
getter function to return numeric data from current data object

Returns:
double with current data point's string representation

isEnumType

public boolean isEnumType()
function to determine if this is an enumerated data point

Returns:
boolean is this an enumerated data point

clearEnumType

public void clearEnumType()
function to remove the enumerated data point id


getRC

public int getRC()
getter function to return return code from current data object

The description of this class of objects indicates what return code values are expected to be set in the object.

Returns:
int with current data point's return code

getTimeStamp

public long getTimeStamp()
getter function to return the time stamp for the data object

Returns:
long current data point's client time stamp

getDataType

public int getDataType()
Gets the data type for the data point

Returns:
int data type for this data

setRC

public void setRC(int rc)
setter function to set return code for current data object

The description of this class of objects indicates what return code values are expected to be set in the object.

Parameters:
rc - return code to set into the object

equals

public boolean equals(TWGMonCurrentData that)
THis method provides an equivalence check for data points

This method verifies that this data point and the datapoint tested against represent * equivalent information. The timeStamp, flags, data and return code are checked.

Parameters:
that - the other data point to check for equality to
Returns:
boolean containing flag indicating whether the two objects are logically equal

getDisplayString

public java.lang.String getDisplayString()
returns the object as a formatted string

Returns:
String with the data ready to display

setFormatStr

public void setFormatStr(java.lang.String parm)
format string setter function

Parameters:
parm - printf style format string. note: only one substitution allowed in string

setEnumStr

public void setEnumStr(java.lang.String parm)
enumeration string setter function

Parameters:
parm - locale requested enumeration string for this data value

setUnitsStr

public void setUnitsStr(java.lang.String parm)
units string setter function

Parameters:
parm - locale requested units string for this data value

toString

public java.lang.String toString()
returns the data contained within the object as a string

Returns:
String with the data ready to display