com.tivoli.twg.alertmgr
Class TWGPublishDetail

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

public class TWGPublishDetail
extends TWGPublish
implements java.lang.Cloneable

PublishDetail objects are meant to be used as a publishing mechanism for the Event detail labels and references that would otherwise be retransmitted each time the on event was sent. The event generator assigns an id to be used henceforth when generating the actual events. Multiple detail objects may be included in one publishEventDetail. The family and qualifiers are used to convey the scope of the detail being published. This way, one detail id could be used to publish label and reference information for all Director events (assuing family = Director, qualifiers = null). In general, this will be the desireable approach. However, should there be conflict, a more detailed publishing (ie. more qualifiers) could be used. Version is available so that data stored at the server may be replaced over time by new translatable text.


Field Summary
 
Fields inherited from class com.tivoli.twg.alertmgr.TWGPublish
VERSION_ONE
 
Constructor Summary
TWGPublishDetail(IntelByteBuffer buf)
          Constructor for interpreting a provided IntelByteBuffer.
TWGPublishDetail(IntelByteBuffer buf, int off)
          Constructor for interpreting a provided IntelByteBuffer at a given offset.
TWGPublishDetail(java.lang.String family, java.lang.String[] qualifiers, int version, java.util.Locale locale)
          Constructor.
TWGPublishDetail(java.lang.String family, java.lang.String[] qualifiers, java.util.Locale locale)
          Constructor with default version.
TWGPublishDetail(TWGPublishDetail pd)
          Copy Constructor.
 
Method Summary
 void addDetail(TWGDetail detail)
          Add a TWGDetail object to the publication.
 java.lang.Object clone()
          Copy object.
 TWGDetail getDetail(int index)
          Get a TWGDetail object refernced by index.
 java.util.Vector getDetails()
          Get a reference to the list TWGDetail objects within the publication.
 int getNumDetails()
          Get a the number TWGDetail objects within the publication.
 int getTypeId()
          Get type ID.
 int readTWGPublishDetail(IntelByteBuffer buf, int off)
          Method for interpreting a provided IntelByteBuffer at a given offset.
 int sizeOf()
          Determine the size of the entire TWGPublishDetail object.
static int sizeOfHdr()
          Determine the size of the TWGPublishDetail header.
 int sizeOfTWGPublishDetail()
          Determine the size of the entire TWGPublishDetail object.
 IntelByteBuffer toIntelByteBuffer()
          Convert the TWGPublishDetail 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, print, readTWGPublish, setLocale, setVersion, sizeOfTWGPublish
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TWGPublishDetail

public TWGPublishDetail(java.lang.String family,
                        java.lang.String[] qualifiers,
                        int version,
                        java.util.Locale locale)
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

TWGPublishDetail

public TWGPublishDetail(java.lang.String family,
                        java.lang.String[] qualifiers,
                        java.util.Locale locale)
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

TWGPublishDetail

public TWGPublishDetail(TWGPublishDetail pd)
Copy Constructor.

Parameters:
pd - TWGPublishDetail object to be copied

TWGPublishDetail

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

TWGPublishDetail

public TWGPublishDetail(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 TWGPublishDetail object

addDetail

public void addDetail(TWGDetail detail)
Add a TWGDetail object to the publication.

Parameters:
detail - detail object to be added

getDetails

public java.util.Vector getDetails()
Get a reference to the list TWGDetail objects within the publication.

Returns:
vector of TWGDetail object

getNumDetails

public int getNumDetails()
Get a the number TWGDetail objects within the publication.

Returns:
number of TWGDetail objects within the publication

getDetail

public TWGDetail getDetail(int index)
                    throws com.tivoli.twg.alertmgr.TWGOutOfBoundsException
Get a TWGDetail object refernced by index.

Parameters:
index - index of requested object
Returns:
TWGDetail object referenced by index
Throws:
com.tivoli.twg.alertmgr.TWGOutOfBoundsException

toIntelByteBuffer

public IntelByteBuffer toIntelByteBuffer()
Convert the TWGPublishDetail 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

readTWGPublishDetail

public int readTWGPublishDetail(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 TWGPublishDetail header.

Returns:
number of bytes that comprise the header

sizeOfTWGPublishDetail

public int sizeOfTWGPublishDetail()
Determine the size of the entire TWGPublishDetail object.

Returns:
number of bytes that comprise the object

sizeOf

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

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

getTypeId

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

Overrides:
getTypeId in class TWGPublish
Returns:
an ID.