com.tivoli.twg.alertmgr
Class TWGBaseEvent

java.lang.Object
  extended bycom.tivoli.twg.alertmgr.TWGPartialEvent
      extended bycom.tivoli.twg.alertmgr.TWGBaseEvent
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
TWGEvent

public class TWGBaseEvent
extends TWGPartialEvent
implements java.io.Serializable

TWGBaseEvent is a class for creating events in Director.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.tivoli.twg.alertmgr.TWGPartialEvent
ACTION, BOSSMAN, CATEGORY_COUNT, EVENT_CATEGORY_ALERT, EVENT_CATEGORY_RESOLUTION, EVENT_FLAGS_ALERT, EVENT_FLAGS_CHILD, EVENT_FLAGS_FAILOVER_COPY, EVENT_FLAGS_FORWARDED, EVENT_FLAGS_OUT_OF_BAND, EVENT_FLAGS_QUEUED, EVENT_FLAGS_RESENT, EVENT_FLAGS_RESOLUTION, EVENT_SEVERITY_CRITICAL, EVENT_SEVERITY_FATAL, EVENT_SEVERITY_HARMLESS, EVENT_SEVERITY_MINOR, EVENT_SEVERITY_UNKNOWN, EVENT_SEVERITY_WARNING, EVENT_TYPE_DELIMITER, SEVERITY_COUNT, SNMP, TEC, TEST
 
Constructor Summary
TWGBaseEvent(IntelByteBuffer buf)
          Constructor for interpreting a provided IntelByteBuffer.
TWGBaseEvent(IntelByteBuffer buf, int off)
          Constructor for interpreting a provided IntelByteBuffer at a given offset.
TWGBaseEvent(java.lang.String family, java.lang.String[] qualifiers, short severity, byte[] managedObjectUniqueId, byte[] senderUniqueId, java.lang.String textTemplate, java.util.Locale textLocale, java.lang.Object[] subVars, TWGEventCorrelator correlator, int flags)
          Constructor for events generated within the Director Server about individual workstations and the specific managed object id is not known.
TWGBaseEvent(java.lang.String family, java.lang.String[] qualifiers, short severity, byte[] managedObjectUniqueId, byte[] senderUniqueId, java.lang.String textTemplate, java.util.Locale textLocale, java.lang.String[] subVars, TWGEventCorrelator correlator, int flags)
          Constructor for events generated within the Director Server about individual workstations and the specific managed object id is not known.
TWGBaseEvent(java.lang.String family, java.lang.String[] qualifiers, short severity, long managedObjectId, byte[] senderUniqueId, java.lang.String textTemplate, java.util.Locale textLocale, java.lang.Object[] subVars, TWGEventCorrelator correlator, int flags)
          Constructor for events generated within the Director Server about individual workstations and the specific managed object id is known.
TWGBaseEvent(java.lang.String family, java.lang.String[] qualifiers, short severity, long managedObjectId, byte[] senderUniqueId, java.lang.String textTemplate, java.util.Locale textLocale, java.lang.String[] subVars, TWGEventCorrelator correlator, int flags)
          Constructor for events generated within the Director Server about individual workstations and the specific managed object id is known.
TWGBaseEvent(java.lang.String family, java.lang.String[] qualifiers, short severity, long groupId, long managedObjectId, byte[] senderUniqueId, java.lang.String textTemplate, java.util.Locale textLocale, java.lang.Object[] subVars, TWGEventCorrelator correlator, int flags)
          Constructor for events generated within the Director Server about individual workstations being monitored under a group threshold and the specific managed object id and group id is known.
TWGBaseEvent(java.lang.String family, java.lang.String[] qualifiers, short severity, long groupId, long managedObjectId, byte[] senderUniqueId, java.lang.String textTemplate, java.util.Locale textLocale, java.lang.String[] subVars, TWGEventCorrelator correlator, int flags)
          Constructor for events generated within the Director Server about individual workstations being monitored under a group threshold and the specific managed object id and group id is known.
TWGBaseEvent(TWGBaseEvent baseEvent)
          Copy constructor
 
Method Summary
 void addEventDetail(TWGEventDetail detail)
          Add an event detail object
static long byteToLong(byte[] buf)
          Convert byte array into a long
static long byteToLong(byte[] buf, int begin, int len)
          Convert byte array into a long
 TWGEventCorrelator getCorrelator()
          Get the event correlator
 java.util.Vector getDetails()
          Get a reference to the Vector of event detail objects
 TWGEventCorrelator getEventCorrelator()
          Get the event correlator
 TWGEventDetail getEventDetail(int index)
          Get the TWGEventDetail object referenced by index (Method for migration only)
 TWGEventDetail getEventDetail(java.lang.String id)
          Get the TWGEventDetail object referenced by id
 java.util.Vector getEventDetails()
          Get a reference to the Vector of event detail objects
 com.tivoli.twg.engine.TWGManagedObjectFingerprint getManagedObjectFingerprint()
          Get the TWGManagedObjectFingerprint relative to managed object for which this event was generated
 byte[] getManagedObjectUniqueId()
          Get the native managed object's unique identifer
 int getNumDetails()
          Get the number of event detail object attached to this event
 byte[] getRawData()
          Get the raw data attached to this event
 com.tivoli.twg.engine.TWGManagedObjectFingerprint getSenderFingerprint()
          Get the TWGManagedObjectFingerprint relative to sender object that generated this event
 java.lang.String getSenderPath()
          Get the sender path -- This method is retired and therefore unsupported
 byte[] getSenderUniqueId()
          Get the native sender's unique identifer
 void print()
          Print the contents of this TWGBaseEvent object.
 int readTWGBaseEvent(IntelByteBuffer buf, int off)
          Method for interpreting a provided IntelByteBuffer at a given offset.
 boolean removeEventDetail(java.lang.String id)
          Remove an event detail object
 void setCorrelator(TWGEventCorrelator correlator)
          Set the event correlator for this event
 void setEventCorrelator(TWGEventCorrelator correlator)
          Set the event correlator for this event
 void setManagedObjectFingerprint(com.tivoli.twg.engine.TWGManagedObjectFingerprint fingerprint)
          Set the TWGManagedObjectFingerprint relative to managed object for which this event was generated
 void setManagedObjectUniqueId(byte[] id)
          Set the native managed object's unique id
 void setRawData(byte[] data)
          Set the raw data attached to this event
 void setSenderFingerprint(com.tivoli.twg.engine.TWGManagedObjectFingerprint fingerprint)
          Set the TWGManagedObjectFingerprint relative to sender object that generated this event
 void setSenderPath(java.lang.String s)
          Set the sender path -- This method is retired and therefore unsupported
 void setSenderUniqueId(byte[] id)
          Set the native sender's unique id
 int sizeOf()
          Determine the size of the entire TWGBaseEvent object
static int sizeOfHdr()
          Determine the size of the TWGBaseEvent header
 int sizeOfRawData()
          Determine the size of any raw data appended to the base event
 int sizeOfTWGBaseEvent()
          Determine the size of the entire TWGBaseEvent object
 IntelByteBuffer toIntelByteBuffer()
          Convert the TWGBaseEvent into IntelByteBuffer representation.
 java.lang.String toString()
           
 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 com.tivoli.twg.alertmgr.TWGPartialEvent
bytesToLong, bytesToLong, generateEventId, getCategory, getCategoryCount, getChildEventIds, getDate, getDateAsLong, getDaysIndex, getEventId, getFlags, getGroupId, getGroupName, getKey, getManagedObjectId, getManagedObjectName, getNumChildEventIds, getNumSubVars, getNumTypeQualifiers, getSenderName, getSeverity, getSeverityCount, getSourceLocale, getSubVar, getSubVars, getText, getTextBundleName, getTextKeyword, getTextLocale, getTextTemplate, getType, getTypeArray, getTypeFamily, getTypeQualifier, getTypeQualifiers, getUglyType, isaChildEvent, isaFailoverCopy, isaForwardedEvent, isanOutOfBandEvent, isaQueuedEvent, isaSummaryEvent, isResent, readTWGPartialEvent, setChildEvent, setChildEventIds, setDate, setEventId, setFailoverCopy, setForwardedEvent, setForwardedEvent, setGroupId, setGroupName, setKey, setLocalizedTypeFamily, setManagedObjectId, setManagedObjectName, setOutOfBandEvent, setOutOfBandEvent, setQueuedEvent, setQueuedEvent, setReplacementQualifiers, setResent, setSenderName, setServerId, setSeverity, setSourceLocale, setSubVars, setTextBundleName, setTextKeyword, setTextKeywordAndBundleName, setTextLocale, setTextTemplate, setTypeQualifiers, sizeOfTWGPartialEvent, toStringCategory, toStringCategory, toStringCategory, toStringFlags, toStringSeverity, toStringSeverity, toStringSeverity
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TWGBaseEvent

public TWGBaseEvent(java.lang.String family,
                    java.lang.String[] qualifiers,
                    short severity,
                    long managedObjectId,
                    byte[] senderUniqueId,
                    java.lang.String textTemplate,
                    java.util.Locale textLocale,
                    java.lang.String[] subVars,
                    TWGEventCorrelator correlator,
                    int flags)
Constructor for events generated within the Director Server about individual workstations and the specific managed object id is known.

Parameters:
family - String representing the highest level qualifier of the event type
qualifiers - Array of strings comprising the remainder of the event type
severity - Severity of the event (inplies urgency)
managedObjectId - Persistent object id of managed object (who the event is about)
textTemplate - template for the text of the event
textLocale - locale of the text template
subVars - Array of objects that replace the variables of the text template to form the text.
correlator - Instance of the event.
flags - Bit fields for various things.

TWGBaseEvent

public TWGBaseEvent(java.lang.String family,
                    java.lang.String[] qualifiers,
                    short severity,
                    long managedObjectId,
                    byte[] senderUniqueId,
                    java.lang.String textTemplate,
                    java.util.Locale textLocale,
                    java.lang.Object[] subVars,
                    TWGEventCorrelator correlator,
                    int flags)
Constructor for events generated within the Director Server about individual workstations and the specific managed object id is known.

Parameters:
family - String representing the highest level qualifier of the event type
qualifiers - Array of strings comprising the remainder of the event type
severity - Severity of the event (inplies urgency)
managedObjectId - Persistent object id of managed object (who the event is about)
textTemplate - template for the text of the event
textLocale - locale of the text template
subVars - Array of objects that replace the variables of the text template to form the text.
correlator - Instance of the event.
flags - Bit fields for various things.

TWGBaseEvent

public TWGBaseEvent(java.lang.String family,
                    java.lang.String[] qualifiers,
                    short severity,
                    long groupId,
                    long managedObjectId,
                    byte[] senderUniqueId,
                    java.lang.String textTemplate,
                    java.util.Locale textLocale,
                    java.lang.String[] subVars,
                    TWGEventCorrelator correlator,
                    int flags)
Constructor for events generated within the Director Server about individual workstations being monitored under a group threshold and the specific managed object id and group id is known.

Parameters:
family - String representing the highest level qualifier of the event type
qualifiers - Array of strings comprising the remainder of the event type
severity - Severity of the event (implies urgency)
managedObjectId - Persistent object id of managed object (who the event is about)
groupId - Persistent object id of group object that contains this managed object
textTemplate - template for the text of the event
textLocale - locale of the text template
subVars - Array of objects that replace the variables of the text template to form the text.
correlator - Instance of the event.
flags - Bit fields for various things.

TWGBaseEvent

public TWGBaseEvent(java.lang.String family,
                    java.lang.String[] qualifiers,
                    short severity,
                    long groupId,
                    long managedObjectId,
                    byte[] senderUniqueId,
                    java.lang.String textTemplate,
                    java.util.Locale textLocale,
                    java.lang.Object[] subVars,
                    TWGEventCorrelator correlator,
                    int flags)
Constructor for events generated within the Director Server about individual workstations being monitored under a group threshold and the specific managed object id and group id is known.

Parameters:
family - String representing the highest level qualifier of the event type
qualifiers - Array of strings comprising the remainder of the event type
severity - Severity of the event (implies urgency)
managedObjectId - Persistent object id of managed object (who the event is about)
groupId - Persistent object id of group object that contains this managed object
textTemplate - template for the text of the event
textLocale - locale of the text template
subVars - Array of objects that replace the variables of the text template to form the text.
correlator - Instance of the event.
flags - Bit fields for various things.

TWGBaseEvent

public TWGBaseEvent(java.lang.String family,
                    java.lang.String[] qualifiers,
                    short severity,
                    byte[] managedObjectUniqueId,
                    byte[] senderUniqueId,
                    java.lang.String textTemplate,
                    java.util.Locale textLocale,
                    java.lang.String[] subVars,
                    TWGEventCorrelator correlator,
                    int flags)
Constructor for events generated within the Director Server about individual workstations and the specific managed object id is not known. The native client id is used to resolve managed object id.

Parameters:
family - String representing the highest level qualifier of the event type
qualifiers - Array of strings comprising the remainder of the event type
severity - Severity of the event (implies urgency)
textTemplate - template for the text of the event
textLocale - locale of the text template
subVars - Array of strings that replace the variables of the text template to form the text.
correlator - Instance of the event.
flags - Bit fields for various things.

TWGBaseEvent

public TWGBaseEvent(java.lang.String family,
                    java.lang.String[] qualifiers,
                    short severity,
                    byte[] managedObjectUniqueId,
                    byte[] senderUniqueId,
                    java.lang.String textTemplate,
                    java.util.Locale textLocale,
                    java.lang.Object[] subVars,
                    TWGEventCorrelator correlator,
                    int flags)
Constructor for events generated within the Director Server about individual workstations and the specific managed object id is not known. The native client id is used to resolve managed object id.

Parameters:
family - String representing the highest level qualifier of the event type
qualifiers - Array of strings comprising the remainder of the event type
severity - Severity of the event (implies urgency)
textTemplate - template for the text of the event
textLocale - locale of the text template
subVars - Array of objects that replace the variables of the text template to form the text.
correlator - Instance of the event.
flags - Bit fields for various things.

TWGBaseEvent

public TWGBaseEvent(TWGBaseEvent baseEvent)
Copy constructor


TWGBaseEvent

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

TWGBaseEvent

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

setManagedObjectUniqueId

public void setManagedObjectUniqueId(byte[] id)
Set the native managed object's unique id

Parameters:
id - 64-bit native client id

setSenderUniqueId

public void setSenderUniqueId(byte[] id)
Set the native sender's unique id

Parameters:
id - 64-bit native client id

addEventDetail

public void addEventDetail(TWGEventDetail detail)
Add an event detail object

Parameters:
detail - Event detail object to be added

removeEventDetail

public boolean removeEventDetail(java.lang.String id)
Remove an event detail object

Parameters:
id - id of detail to be removed
Returns:
true if successful; false if not

getEventDetail

public TWGEventDetail getEventDetail(int index)
Get the TWGEventDetail object referenced by index (Method for migration only)

Parameters:
index - of EventDetail in Vector
Returns:
TWGEventDetail object referenced by given index

getEventDetail

public TWGEventDetail getEventDetail(java.lang.String id)
Get the TWGEventDetail object referenced by id

Parameters:
id - id of detail to be returned
Returns:
TWGEventDetail object referenced by given id

getNumDetails

public int getNumDetails()
Get the number of event detail object attached to this event

Returns:
number of event details

getDetails

public java.util.Vector getDetails()
Get a reference to the Vector of event detail objects

Returns:
vector of event details objects

getEventDetails

public java.util.Vector getEventDetails()
Get a reference to the Vector of event detail objects

Returns:
vector of event details objects

getSenderPath

public java.lang.String getSenderPath()
Get the sender path -- This method is retired and therefore unsupported

Returns:
Protocol and address pairs back to the event source

setSenderPath

public void setSenderPath(java.lang.String s)
Set the sender path -- This method is retired and therefore unsupported


sizeOfRawData

public int sizeOfRawData()
Determine the size of any raw data appended to the base event

Returns:
Number of bytes associated with the raw data

getRawData

public byte[] getRawData()
Get the raw data attached to this event

Returns:
Reference to the array of raw data bytes

setRawData

public void setRawData(byte[] data)
Set the raw data attached to this event

Parameters:
data - Reference to an array of raw data bytes

getManagedObjectUniqueId

public byte[] getManagedObjectUniqueId()
Get the native managed object's unique identifer

Returns:
64-bit native client id

getManagedObjectFingerprint

public com.tivoli.twg.engine.TWGManagedObjectFingerprint getManagedObjectFingerprint()
Get the TWGManagedObjectFingerprint relative to managed object for which this event was generated

Returns:
managed object's TWGManagedObjectFingerprint

setManagedObjectFingerprint

public void setManagedObjectFingerprint(com.tivoli.twg.engine.TWGManagedObjectFingerprint fingerprint)
Set the TWGManagedObjectFingerprint relative to managed object for which this event was generated


getSenderUniqueId

public byte[] getSenderUniqueId()
Get the native sender's unique identifer

Returns:
64-bit native client id

getSenderFingerprint

public com.tivoli.twg.engine.TWGManagedObjectFingerprint getSenderFingerprint()
Get the TWGManagedObjectFingerprint relative to sender object that generated this event

Returns:
sender object's TWGManagedObjectFingerprint

setSenderFingerprint

public void setSenderFingerprint(com.tivoli.twg.engine.TWGManagedObjectFingerprint fingerprint)
Set the TWGManagedObjectFingerprint relative to sender object that generated this event


getCorrelator

public TWGEventCorrelator getCorrelator()
Get the event correlator

Returns:
event correlator for this event

getEventCorrelator

public TWGEventCorrelator getEventCorrelator()
Get the event correlator

Returns:
event correlator for this event

setCorrelator

public void setCorrelator(TWGEventCorrelator correlator)
Set the event correlator for this event

Parameters:
correlator - Event correlator

setEventCorrelator

public void setEventCorrelator(TWGEventCorrelator correlator)
Set the event correlator for this event

Parameters:
correlator - Event correlator

toIntelByteBuffer

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

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

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

readTWGBaseEvent

public int readTWGBaseEvent(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

sizeOf

public int sizeOf()
Determine the size of the entire TWGBaseEvent object

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

sizeOfHdr

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

Returns:
number of bytes that comprise the header

sizeOfTWGBaseEvent

public int sizeOfTWGBaseEvent()
Determine the size of the entire TWGBaseEvent object

Returns:
number of bytes that comprise the object

print

public void print()
Print the contents of this TWGBaseEvent object.

Overrides:
print in class TWGPartialEvent

toString

public java.lang.String toString()
Overrides:
toString in class TWGPartialEvent

byteToLong

public static long byteToLong(byte[] buf,
                              int begin,
                              int len)
Convert byte array into a long

Parameters:
buf - - buffer to be converted
begin - - index to start
len - - length to convert

byteToLong

public static long byteToLong(byte[] buf)
Convert byte array into a long

Parameters:
buf - - buffer to be converted