com.tivoli.twg.alertmgr
Class TWGPublishTextTemplate

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

public class TWGPublishTextTemplate
extends TWGPublish
implements java.lang.Cloneable

TWGPublishTextTemplate is used to publish the event text (as a template) to the event server. Publishing the event text in multiple locale specific representations makes it possible for the event server console to show event information in various languages.


Field Summary
 
Fields inherited from class com.tivoli.twg.alertmgr.TWGPublish
VERSION_ONE
 
Constructor Summary
TWGPublishTextTemplate(IntelByteBuffer buf)
          Constructor for interpreting a provided IntelByteBuffer.
TWGPublishTextTemplate(IntelByteBuffer buf, int off)
          Constructor for interpreting a provided IntelByteBuffer at a given offset.
TWGPublishTextTemplate(java.lang.String family, java.lang.String[] qualifiers, int version, java.util.Locale locale, java.lang.String template)
          Constructor.
TWGPublishTextTemplate(java.lang.String family, java.lang.String[] qualifiers, java.util.Locale locale, java.lang.String template)
          Constructor with default version.
TWGPublishTextTemplate(TWGPublishTextTemplate ptt)
          Copy Constructor.
 
Method Summary
 java.lang.Object clone()
          Copy object.
 java.lang.String getTextTemplate()
          Get text template.
 int getTypeId()
          Get type ID.
 void print()
          Print the contents of the TWGPublishTextTemplate object.
 int readTWGPublishTextTemplate(IntelByteBuffer buf, int off)
          Method for interpreting a provided IntelByteBuffer at a given offset.
 void setTextTemplate(java.lang.String template)
          Set text template.
 int sizeOf()
          Determine the size of the entire TWGPublishTextTemplate object.
static int sizeOfHdr()
          Determine the size of the TWGPublishTextTemplate header.
 int sizeOfTWGPublishTextTemplate()
          Determine the size of the entire TWGPublishTextTemplate object.
 IntelByteBuffer toIntelByteBuffer()
          Convert the TWGPublishTextTemplate into IntelByteBuffer representation.
 int writeIntelByteBuffer(IntelByteBuffer buf)
          Write contents of this object into an IntelByteBuffer.
 int writeIntelByteBuffer(IntelByteBuffer buf, int off)
          Write contents of this object into provided IntelByteBuffer starting at a given offset.
 
Methods inherited from class com.tivoli.twg.alertmgr.TWGPublish
getLocale, getNumTypeQualifiers, getType, getTypeArray, getTypeFamily, getTypeQualifiers, getVersion, readTWGPublish, setLocale, setVersion, sizeOfTWGPublish
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TWGPublishTextTemplate

public TWGPublishTextTemplate(java.lang.String family,
                              java.lang.String[] qualifiers,
                              int version,
                              java.util.Locale locale,
                              java.lang.String template)
Constructor.

Parameters:
family - String representing the highest level qualifier of the event type
qualifiers - Array of strings comprising the remainder of the event type
version - Version of data being published
locale - Locale of data being published
template - Template of the event text

TWGPublishTextTemplate

public TWGPublishTextTemplate(java.lang.String family,
                              java.lang.String[] qualifiers,
                              java.util.Locale locale,
                              java.lang.String template)
Constructor with default version.

Parameters:
family - String representing the highest level qualifier of the event type
qualifiers - Array of strings comprising the remainder of the event type
locale - Locale of data being published
template - Template of the event text

TWGPublishTextTemplate

public TWGPublishTextTemplate(TWGPublishTextTemplate ptt)
Copy Constructor.

Parameters:
ptt - TWGPublishTextTemplate object to be copied

TWGPublishTextTemplate

public TWGPublishTextTemplate(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

TWGPublishTextTemplate

public TWGPublishTextTemplate(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 object.

Overrides:
clone in class TWGPublish
Returns:
copy of the TWGPublishTextTemplate object

setTextTemplate

public void setTextTemplate(java.lang.String template)
Set text template.

Parameters:
template - template of the event text

getTextTemplate

public java.lang.String getTextTemplate()
Get text template.

Returns:
template of the event text

toIntelByteBuffer

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

Overrides:
toIntelByteBuffer in class TWGPublish
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.

Overrides:
writeIntelByteBuffer in class TWGPublish
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 contents of this object 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.

Overrides:
writeIntelByteBuffer in class TWGPublish
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

readTWGPublishTextTemplate

public int readTWGPublishTextTemplate(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 TWGPublishTextTemplate header.

Returns:
number of bytes that comprise the header

sizeOfTWGPublishTextTemplate

public int sizeOfTWGPublishTextTemplate()
Determine the size of the entire TWGPublishTextTemplate object.

Returns:
number of bytes that comprise the object

sizeOf

public int sizeOf()
Determine the size of the entire TWGPublishTextTemplate object.

Overrides:
sizeOf in class TWGPublish
Returns:
number of bytes that comprise the object

print

public void print()
Print the contents of the TWGPublishTextTemplate object.

Overrides:
print in class TWGPublish

getTypeId

public int getTypeId()
Get type ID. Used by engine to match publish and unpublish.

Overrides:
getTypeId in class TWGPublish
Returns:
an ID.