com.tivoli.twg.alertmgr
Class TWGDetail

java.lang.Object
  extended bycom.tivoli.twg.alertmgr.TWGDetail
All Implemented Interfaces:
java.lang.Cloneable

public class TWGDetail
extends java.lang.Object
implements java.lang.Cloneable

TWGDetail is sub-component of a TWGPublishDetailCommand used to house the event detail's presentation (label and reference) and data type. An Event detail's presentational strings may be published to the Director in an effort to remove the need for sending it each time data is sent. In addition it offers the added fexibility to publish multiple language-dependent versions of these strings.


Field Summary
static int TYPE_BOOLEAN
           
static int TYPE_BYTE
           
static int TYPE_CHAR
           
static int TYPE_DATETIME
           
static int TYPE_DOUBLE
           
static int TYPE_FLOAT
           
static int TYPE_INT
           
static int TYPE_LONG
           
static int TYPE_OCTET
           
static int TYPE_SHORT
           
static int TYPE_STRING
           
static int TYPE_UNICHAR
           
static int TYPE_UNKNOWN
           
 
Constructor Summary
TWGDetail(IntelByteBuffer buf)
          Constructor for interpreting a provided IntelByteBuffer.
TWGDetail(IntelByteBuffer buf, int off)
          Constructor for interpreting a provided IntelByteBuffer at a given offset.
TWGDetail(java.lang.String id, java.lang.String label, java.lang.String reference)
          Constructor for detail data (used for migration purposes only).
TWGDetail(java.lang.String id, java.lang.String label, java.lang.String reference, int dataType)
          Constructor for detail data.
TWGDetail(TWGDetail d)
          Copy Constructor
 
Method Summary
 java.lang.Object clone()
          Copy the object
 boolean equals(java.lang.Object obj)
          Equals.
 int getDataType()
          Get the data type to be published
 java.lang.String getId()
          Get the id of the data being published
 java.lang.String getLabel()
          Get the label to be published
 java.lang.String getReference()
          Get the reference to be published
 void print()
          Print the detail.
 int readTWGDetail(IntelByteBuffer buf, int off)
          Method for interpreting a provided IntelByteBuffer at a given offset.
 void setLabel(java.lang.String label)
          Set the label to be published
static int sizeOfHdr()
          Determine the size of the TWGDetail header
 int sizeOfTWGDetail()
          Determine the size of the entire TWGDetail object
 IntelByteBuffer toIntelByteBuffer()
          Convert the TWGDetail into IntelByteBuffer representation.
 int writeIntelByteBuffer(IntelByteBuffer buf)
          Write contents of this object into an IntelByteBuffer.
 int writeIntelByteBuffer(IntelByteBuffer buf, int off)
          Write action parm into provided IntelByteBuffer starting at a given offset.
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TYPE_BYTE

public static final int TYPE_BYTE
See Also:
Constant Field Values

TYPE_CHAR

public static final int TYPE_CHAR
See Also:
Constant Field Values

TYPE_UNICHAR

public static final int TYPE_UNICHAR
See Also:
Constant Field Values

TYPE_SHORT

public static final int TYPE_SHORT
See Also:
Constant Field Values

TYPE_INT

public static final int TYPE_INT
See Also:
Constant Field Values

TYPE_LONG

public static final int TYPE_LONG
See Also:
Constant Field Values

TYPE_BOOLEAN

public static final int TYPE_BOOLEAN
See Also:
Constant Field Values

TYPE_FLOAT

public static final int TYPE_FLOAT
See Also:
Constant Field Values

TYPE_DOUBLE

public static final int TYPE_DOUBLE
See Also:
Constant Field Values

TYPE_OCTET

public static final int TYPE_OCTET
See Also:
Constant Field Values

TYPE_STRING

public static final int TYPE_STRING
See Also:
Constant Field Values

TYPE_DATETIME

public static final int TYPE_DATETIME
See Also:
Constant Field Values

TYPE_UNKNOWN

public static final int TYPE_UNKNOWN
See Also:
Constant Field Values
Constructor Detail

TWGDetail

public TWGDetail(java.lang.String id,
                 java.lang.String label,
                 java.lang.String reference,
                 int dataType)
Constructor for detail data.

Parameters:
id - Unique string to be referenced by TWGEventDetail objects
label - Presentation label for the data referenced by id
reference - Architectual reference (source) of data provided
dataType - Event detail data type

TWGDetail

public TWGDetail(java.lang.String id,
                 java.lang.String label,
                 java.lang.String reference)
Constructor for detail data (used for migration purposes only).

Parameters:
id - Unique string to be referenced by TWGEventDetail objects
label - Presentation label for the data referenced by id
reference - Architectual reference (source) of data provided

TWGDetail

public TWGDetail(TWGDetail d)
Copy Constructor

Parameters:
d - TWGDetail object to be copied.

TWGDetail

public TWGDetail(IntelByteBuffer buf)
Constructor for interpreting a provided IntelByteBuffer. Use the current offset and start ptrs within the provided IntelByteBuffer; upon return the buffer's offset ptr is advanced to reflect the number of bytes read.

Parameters:
buf - IntelByteBuffer from which data should be read

TWGDetail

public TWGDetail(IntelByteBuffer buf,
                 int off)
Constructor for interpreting a provided IntelByteBuffer at a given offset.

Parameters:
buf - IntelByteBuffer from which data should be read
off - offset from the current relative start of the provided IntelByteBuffer
Method Detail

clone

public java.lang.Object clone()
Copy the object


getId

public java.lang.String getId()
Get the id of the data being published

Returns:
id of label/refernce being published

setLabel

public void setLabel(java.lang.String label)
Set the label to be published

Parameters:
label - string being published

getLabel

public java.lang.String getLabel()
Get the label to be published

Returns:
label string being published

getReference

public java.lang.String getReference()
Get the reference to be published

Returns:
reference string being published

getDataType

public int getDataType()
Get the data type to be published

Returns:
data type

equals

public boolean equals(java.lang.Object obj)
Equals. To be equal, all id, label, reference, and data type have to be equal.

Parameters:
obj - object to be compared with
Returns:
true if equal; false if not

toIntelByteBuffer

public IntelByteBuffer toIntelByteBuffer()
Convert the TWGDetail into IntelByteBuffer representation.

Returns:
IntelByteBuffer representing the encoded object

writeIntelByteBuffer

public int writeIntelByteBuffer(IntelByteBuffer buf)
Write contents of this object into an IntelByteBuffer. Use the current offset and start ptrs within the provided IntelByteBuffer; upon return the buffer's offset ptr is advanced to reflect the number of bytes written.

Parameters:
buf - IntelByteBuffer into which data should be written
Returns:
original offset plus number of bytes written

writeIntelByteBuffer

public int writeIntelByteBuffer(IntelByteBuffer buf,
                                int off)
Write action parm into provided IntelByteBuffer starting at a given offset. Use the current offset and start ptrs within the provided IntelByteBuffer to determine a relative start ptr and begin writing off bytes from that location. Return the buffer's offset ptr advanced to reflect the number of bytes written.

Parameters:
buf - IntelByteBuffer into which data should be written
off - offset from the current relative start of the provided IntelByteBuffer
Returns:
number of bytes written

readTWGDetail

public int readTWGDetail(IntelByteBuffer buf,
                         int off)
Method for interpreting a provided IntelByteBuffer at a given offset.

Parameters:
buf - IntelByteBuffer from which data should be read
off - offset from the current relative start of the provided IntelByteBuffer
Returns:
number of bytes read while interpreting the buffer

sizeOfHdr

public static int sizeOfHdr()
Determine the size of the TWGDetail header

Returns:
number of bytes that comprise the header

sizeOfTWGDetail

public int sizeOfTWGDetail()
Determine the size of the entire TWGDetail object

Returns:
number of bytes that comprise the object

print

public void print()
Print the detail.