com.tivoli.twg.alertmgr
Class TWGPartialEvent

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

public class TWGPartialEvent
extends java.lang.Object
implements java.io.Serializable

TWGPartialEvent is the subcomponent TWGBaseEvent used to contain the most common characteristics of a Director event. The scope of the data available here is equivalent to the data displayed in the Event Log table (non-detail view).

See Also:
Serialized Form

Field Summary
static java.lang.String ACTION
           
static java.lang.String BOSSMAN
           
static int CATEGORY_COUNT
           
static int EVENT_CATEGORY_ALERT
           
static int EVENT_CATEGORY_RESOLUTION
           
static int EVENT_FLAGS_ALERT
           
static int EVENT_FLAGS_CHILD
           
static int EVENT_FLAGS_FAILOVER_COPY
           
static int EVENT_FLAGS_FORWARDED
           
static int EVENT_FLAGS_OUT_OF_BAND
           
static int EVENT_FLAGS_QUEUED
           
static int EVENT_FLAGS_RESENT
           
static int EVENT_FLAGS_RESOLUTION
           
static short EVENT_SEVERITY_CRITICAL
           
static short EVENT_SEVERITY_FATAL
           
static short EVENT_SEVERITY_HARMLESS
           
static short EVENT_SEVERITY_MINOR
           
static short EVENT_SEVERITY_UNKNOWN
           
static short EVENT_SEVERITY_WARNING
           
static java.lang.String EVENT_TYPE_DELIMITER
           
static short SEVERITY_COUNT
           
static java.lang.String SNMP
           
static java.lang.String TEC
           
static java.lang.String TEST
           
 
Constructor Summary
TWGPartialEvent(IntelByteBuffer buf)
          Constructor for interpreting a provided IntelByteBuffer.
TWGPartialEvent(IntelByteBuffer buf, int off)
          Constructor for interpreting a provided IntelByteBuffer at a given offset.
TWGPartialEvent(java.lang.String family, java.lang.String[] qualifiers, short severity, long groupId, long managedObjectId, java.lang.String textTemplate, java.util.Locale textLocale, java.lang.Object[] subVars, int flags)
          Constructor - general constructor for use by other constructors
TWGPartialEvent(TWGPartialEvent partialEvent)
          Copy Constructor
 
Method Summary
static long bytesToLong(byte[] buf)
          Convert byte array into a long
static long bytesToLong(byte[] buf, int begin, int len)
          Convert byte array into a long
static long generateEventId()
          Generate an event id using the current serverId, processId, and InstanceId
 int getCategory()
           
static int getCategoryCount()
          Get the number of architected event categories
 long[] getChildEventIds()
          Get child event ids
 java.util.Date getDate()
          Get the time/date of the event
 long getDateAsLong()
          Get the time/date of the event
static int getDaysIndex(long eventId)
          Extract the day index from the given event id
 long getEventId()
          Get event id
 int getFlags()
          Get the flags of the event
 long getGroupId()
          Get the persistent object id associated with the group of which this managed object is a member
 java.lang.String getGroupName()
          Get the name associated with the group object id included in the event
 long getKey()
          Get the datastore key associated with this event record
 long getManagedObjectId()
          Get the persistent object id associated with this target of the event
 java.lang.String getManagedObjectName()
          Get the name associated with the managed object id targeted in the event
 int getNumChildEventIds()
          Get the number of child event ids
 int getNumSubVars()
          Get the number of text substitution strings
 int getNumTypeQualifiers()
          Get the number of qualifiers in the event type (not including family)
 java.lang.String getSenderName()
          Get the name associated with the system that originated the event
 short getSeverity()
          Get the severity of the event
static int getSeverityCount()
          Get the number of architected event severities
 java.util.Locale getSourceLocale()
          Get the locale of the text provided in the event (this method retired)
 java.lang.Object getSubVar(int index)
          Get the text parm referenced by given index
 java.lang.Object[] getSubVars()
          Get the array of text parms
 java.lang.String getText()
          Get the formatted text of the event
 java.lang.String getTextBundleName()
          Get the name of the resource bundle associated with the text template
 java.lang.String getTextKeyword()
          Get the keyword associated with the text template
 java.util.Locale getTextLocale()
          Get the locale of the text provided in the event
 java.lang.String getTextTemplate()
          Get the raw text template in the event
 java.lang.String getType()
          Get the fully qualified (programmatic) event type string
 java.lang.String[] getTypeArray()
          Get the fully qualified (programmatic) event type as an array
 java.lang.String getTypeFamily()
          Get the highest level qualifier of the event type
protected  java.lang.String getTypeQualifier(int index)
          Get the type qualifier referenced by given index
 java.lang.String[] getTypeQualifiers()
          Get the array of event type qualifiers
 java.lang.String getUglyType()
          Get the fully qualified (programmatic) event type string
 boolean isaChildEvent()
          Get child event indicator
 boolean isaFailoverCopy()
          Get failover copy indicator
 boolean isaForwardedEvent()
          Get forwarded event indicator
 boolean isanOutOfBandEvent()
          Get out-of-band event indicator Used only by Director Comprehensive Event/Director Lan Event generators Only events from these sources will have this value as boolean true
 boolean isaQueuedEvent()
          Get queued event indicator
 boolean isaSummaryEvent()
          Check if this is a summary event
 boolean isResent()
          Get resent event indicator
 void print()
          Print the contents of the TWGPartialEvent object
 int readTWGPartialEvent(IntelByteBuffer buf, int off)
          Method for interpreting a provided IntelByteBuffer at a given offset.
 void setChildEvent(boolean b)
          Set child event indicator On or Off
 void setChildEventIds(long[] ids)
          Set child event ids
 void setDate(long date)
          Set the time/date of the event
 void setEventId(long id)
          Set event id
 void setFailoverCopy(boolean b)
          Set failover copy indicator On or Off
 void setForwardedEvent()
          Set forwarded event indicator On
 void setForwardedEvent(boolean b)
          Set forwarded event indicator On or Off
 void setGroupId(long grpId)
          Set the persistent object id associated with the group of which this managed object is a member
 void setGroupName(java.lang.String name)
          Set the name associated with the group object id included in the event
 void setKey(long key)
          Set the datastore key associated with this event record
 void setLocalizedTypeFamily(java.lang.String f)
          Set the localized version of the event type family.
 void setManagedObjectId(long mo)
          Set the persistent object id associated with this target of the event
 void setManagedObjectName(java.lang.String name)
          Set the name associated with the managed object id targeted in the event
 void setOutOfBandEvent()
          Set out-of-band event indicator On This method is to be used only by Director Comprehensive Event/Director Lan Event generators that send out of band events with 'anything' in sender name.
 void setOutOfBandEvent(boolean b)
          Set out-of-band event indicator On or Off This method is to be used only by Director Comprehensive Event/Director Lan Event generators that send out of band events with 'anything' in sender name.
 void setQueuedEvent()
          Set queued event indicator On
 void setQueuedEvent(boolean b)
          Set queued event indicator On or Off
 void setReplacementQualifiers(java.lang.String[] qualifiers)
          Set the localized version of the event type qualifiers.
 void setResent()
          Set resent indicator on
 void setSenderName(java.lang.String name)
          Set the name associated with the system that originated the event
static void setServerId(java.lang.String id)
          Set the Server id of this system (This is assumed to be a system unique identifier)
 void setSeverity(short severity)
          Set the severity of the event
 void setSourceLocale(java.util.Locale locale)
          Set the locale of the text provided in the event (this method retired)
 void setSubVars(java.lang.Object[] parms)
          Set the array of substitution parms that should be merged with the text template to form the text of the event.
protected  void setTextBundleName(java.lang.String bundleName)
          Set the name of the resource bundle associated with the text template
protected  void setTextKeyword(java.lang.String keyword)
          Set the keyword associated with the text template
 void setTextKeywordAndBundleName(java.lang.String keyword, java.lang.String bundleName)
          Set the keyword and bundle name associated with the text template
 void setTextLocale(java.util.Locale locale)
          Set the locale of the text provided in the event
 void setTextTemplate(java.lang.String textTemplate)
          Set the raw text template in the event
 void setTypeQualifiers(java.lang.String[] qualifiers)
          Set the 2-n level qualifiers of the event type
 int sizeOf()
          Determine the size of the entire TWGPartialEvent object
static int sizeOfHdr()
          Determine the size of the TWGPartialEvent header
 int sizeOfTWGPartialEvent()
          Determine the size of the entire TWGPartialEvent object
 IntelByteBuffer toIntelByteBuffer()
          Convert the TWGPartialEvent into IntelByteBuffer representation.
 java.lang.String toString()
           
 java.lang.String toStringCategory()
          Get the string equivalent of the event category (assuming the default locale)
static java.lang.String toStringCategory(int cat)
          Get the string equivalent of a given event category (assuming the default locale)
static java.lang.String toStringCategory(int index, java.util.Locale locale)
          Get the string equivalent of a given event category and locale
 java.lang.String toStringFlags()
          Convert the current flag settings to their string equivalents
 java.lang.String toStringSeverity()
          Get the string equivalent of the event severity (assuming the default locale)
static java.lang.String toStringSeverity(int sev)
          Get the string equivalent of a given event severity (assuming the default locale)
static java.lang.String toStringSeverity(int index, java.util.Locale locale)
          Get the string equivalent of a given event severity and locale
 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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

BOSSMAN

public static final java.lang.String BOSSMAN
See Also:
Constant Field Values

SNMP

public static final java.lang.String SNMP
See Also:
Constant Field Values

TEC

public static final java.lang.String TEC
See Also:
Constant Field Values

TEST

public static final java.lang.String TEST
See Also:
Constant Field Values

ACTION

public static final java.lang.String ACTION
See Also:
Constant Field Values

EVENT_TYPE_DELIMITER

public static final java.lang.String EVENT_TYPE_DELIMITER
See Also:
Constant Field Values

SEVERITY_COUNT

public static final short SEVERITY_COUNT
See Also:
Constant Field Values

EVENT_SEVERITY_FATAL

public static final short EVENT_SEVERITY_FATAL
See Also:
Constant Field Values

EVENT_SEVERITY_CRITICAL

public static final short EVENT_SEVERITY_CRITICAL
See Also:
Constant Field Values

EVENT_SEVERITY_MINOR

public static final short EVENT_SEVERITY_MINOR
See Also:
Constant Field Values

EVENT_SEVERITY_WARNING

public static final short EVENT_SEVERITY_WARNING
See Also:
Constant Field Values

EVENT_SEVERITY_HARMLESS

public static final short EVENT_SEVERITY_HARMLESS
See Also:
Constant Field Values

EVENT_SEVERITY_UNKNOWN

public static final short EVENT_SEVERITY_UNKNOWN
See Also:
Constant Field Values

CATEGORY_COUNT

public static final int CATEGORY_COUNT
See Also:
Constant Field Values

EVENT_CATEGORY_ALERT

public static final int EVENT_CATEGORY_ALERT
See Also:
Constant Field Values

EVENT_CATEGORY_RESOLUTION

public static final int EVENT_CATEGORY_RESOLUTION
See Also:
Constant Field Values

EVENT_FLAGS_ALERT

public static final int EVENT_FLAGS_ALERT
See Also:
Constant Field Values

EVENT_FLAGS_RESOLUTION

public static final int EVENT_FLAGS_RESOLUTION
See Also:
Constant Field Values

EVENT_FLAGS_QUEUED

public static final int EVENT_FLAGS_QUEUED
See Also:
Constant Field Values

EVENT_FLAGS_FAILOVER_COPY

public static final int EVENT_FLAGS_FAILOVER_COPY
See Also:
Constant Field Values

EVENT_FLAGS_FORWARDED

public static final int EVENT_FLAGS_FORWARDED
See Also:
Constant Field Values

EVENT_FLAGS_CHILD

public static final int EVENT_FLAGS_CHILD
See Also:
Constant Field Values

EVENT_FLAGS_OUT_OF_BAND

public static final int EVENT_FLAGS_OUT_OF_BAND
See Also:
Constant Field Values

EVENT_FLAGS_RESENT

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

TWGPartialEvent

public TWGPartialEvent(java.lang.String family,
                       java.lang.String[] qualifiers,
                       short severity,
                       long groupId,
                       long managedObjectId,
                       java.lang.String textTemplate,
                       java.util.Locale textLocale,
                       java.lang.Object[] subVars,
                       int flags)
Constructor - general constructor for use by other constructors

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)
groupId - Persistent object id of group object that contains this managed object
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.
flags - Bit fields for various things.
Throws:
java.lang.NullPointerException - if family or qualifiers are null
java.lang.IllegalArgumentException - if no qualifiers specified

TWGPartialEvent

public TWGPartialEvent(TWGPartialEvent partialEvent)
Copy Constructor

Parameters:
partialEvent - partial event to be copied

TWGPartialEvent

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

TWGPartialEvent

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

getKey

public long getKey()
Get the datastore key associated with this event record

Returns:
long key of the record

setKey

public void setKey(long key)
Set the datastore key associated with this event record

Parameters:
key - long key of the record

getManagedObjectId

public long getManagedObjectId()
Get the persistent object id associated with this target of the event

Returns:
persistent object id assocaiated with the taret of the event

setManagedObjectId

public void setManagedObjectId(long mo)
Set the persistent object id associated with this target of the event

Parameters:
mo - persistent object id assocaiated with the taret of the event

getGroupId

public long getGroupId()
Get the persistent object id associated with the group of which this managed object is a member

Returns:
persistent object id associated with the group of which this managed object is a member

setGroupId

public void setGroupId(long grpId)
Set the persistent object id associated with the group of which this managed object is a member

Parameters:
grpId - persistent object id associated with the group of which this managed object is a member

getManagedObjectName

public java.lang.String getManagedObjectName()
Get the name associated with the managed object id targeted in the event

Returns:
name associated with the managed object id targeted in the event

setManagedObjectName

public void setManagedObjectName(java.lang.String name)
Set the name associated with the managed object id targeted in the event

Parameters:
name - associated with the managed object id targeted in the event

getGroupName

public java.lang.String getGroupName()
Get the name associated with the group object id included in the event

Returns:
name associated with the group object id included in the event

setGroupName

public void setGroupName(java.lang.String name)
Set the name associated with the group object id included in the event

Returns:
name associated with the group object id included in the event

setTypeQualifiers

public void setTypeQualifiers(java.lang.String[] qualifiers)
Set the 2-n level qualifiers of the event type


setLocalizedTypeFamily

public void setLocalizedTypeFamily(java.lang.String f)
Set the localized version of the event type family. Called by the Event Server to replace the programmatic event type.


setReplacementQualifiers

public void setReplacementQualifiers(java.lang.String[] qualifiers)
Set the localized version of the event type qualifiers. Called by the Event Server to replace the programmatic event type.


setSubVars

public void setSubVars(java.lang.Object[] parms)
Set the array of substitution parms that should be merged with the text template to form the text of the event.


getSeverity

public short getSeverity()
Get the severity of the event

Returns:
severity of the event as a short

setSeverity

public void setSeverity(short severity)
Set the severity of the event

Parameters:
severity - severity of the event as a short

getFlags

public int getFlags()
Get the flags of the event

Returns:
integer representing the flags of the event

isaQueuedEvent

public boolean isaQueuedEvent()
Get queued event indicator

Returns:
true if queued on client prior to delivery; false if not queued

setQueuedEvent

public void setQueuedEvent()
Set queued event indicator On


setQueuedEvent

public void setQueuedEvent(boolean b)
Set queued event indicator On or Off


isaFailoverCopy

public boolean isaFailoverCopy()
Get failover copy indicator

Returns:
true if this is a failover copy; false if not

setFailoverCopy

public void setFailoverCopy(boolean b)
Set failover copy indicator On or Off


isaForwardedEvent

public boolean isaForwardedEvent()
Get forwarded event indicator

Returns:
true if forwarded from another server; false if not forwarded

setForwardedEvent

public void setForwardedEvent()
Set forwarded event indicator On


setForwardedEvent

public void setForwardedEvent(boolean b)
Set forwarded event indicator On or Off


isaChildEvent

public boolean isaChildEvent()
Get child event indicator

Returns:
true if this is a child event; false if not

setChildEvent

public void setChildEvent(boolean b)
Set child event indicator On or Off


isanOutOfBandEvent

public boolean isanOutOfBandEvent()
Get out-of-band event indicator Used only by Director Comprehensive Event/Director Lan Event generators Only events from these sources will have this value as boolean true

Returns:
true if event received out-of-band; false if not out-of-band

isResent

public boolean isResent()
Get resent event indicator

Returns:
true if event was resent; false if not resent

setOutOfBandEvent

public void setOutOfBandEvent()
Set out-of-band event indicator On This method is to be used only by Director Comprehensive Event/Director Lan Event generators that send out of band events with 'anything' in sender name. Other event sources should not use flag set to true.


setResent

public void setResent()
Set resent indicator on


setOutOfBandEvent

public void setOutOfBandEvent(boolean b)
Set out-of-band event indicator On or Off This method is to be used only by Director Comprehensive Event/Director Lan Event generators that send out of band events with 'anything' in sender name. Other event sources should not use flag set to true.


getTypeFamily

public java.lang.String getTypeFamily()
Get the highest level qualifier of the event type

Returns:
string representing the source of the event

getNumTypeQualifiers

public int getNumTypeQualifiers()
Get the number of qualifiers in the event type (not including family)

Returns:
number of type qualifiers in the event type (not including family)

getNumSubVars

public int getNumSubVars()
Get the number of text substitution strings

Returns:
number of text substitution strings

getTypeQualifiers

public java.lang.String[] getTypeQualifiers()
Get the array of event type qualifiers

Returns:
array of type qualifiers

getSubVars

public java.lang.Object[] getSubVars()
Get the array of text parms

Returns:
array of text parms

getTypeQualifier

protected java.lang.String getTypeQualifier(int index)
Get the type qualifier referenced by given index

Parameters:
index - index of qualifier
Returns:
type qualifier reference by index

getSubVar

public java.lang.Object getSubVar(int index)
Get the text parm referenced by given index

Parameters:
index - index of parm
Returns:
parm referenced by index

getText

public java.lang.String getText()
Get the formatted text of the event

Returns:
text of the event

getTextTemplate

public java.lang.String getTextTemplate()
Get the raw text template in the event

Returns:
text template in the event

setTextTemplate

public void setTextTemplate(java.lang.String textTemplate)
Set the raw text template in the event


getTextBundleName

public java.lang.String getTextBundleName()
Get the name of the resource bundle associated with the text template

Returns:
name of the resource bundle contining the text template

setTextBundleName

protected void setTextBundleName(java.lang.String bundleName)
Set the name of the resource bundle associated with the text template

Parameters:
bundleName - name of the resource bundle contining the text template

getTextKeyword

public java.lang.String getTextKeyword()
Get the keyword associated with the text template

Returns:
keyword associated with the text template

setTextKeyword

protected void setTextKeyword(java.lang.String keyword)
Set the keyword associated with the text template

Parameters:
keyword - keyword associated with the text template

setTextKeywordAndBundleName

public void setTextKeywordAndBundleName(java.lang.String keyword,
                                        java.lang.String bundleName)
Set the keyword and bundle name associated with the text template

Parameters:
keyword - keyword associated with the text template
bundleName - name of the resource bundle containing the text template

getSourceLocale

public java.util.Locale getSourceLocale()
Get the locale of the text provided in the event (this method retired)

Returns:
locale of the text provided in the event

setSourceLocale

public void setSourceLocale(java.util.Locale locale)
Set the locale of the text provided in the event (this method retired)

Returns:
locale of the text provided in the event

getTextLocale

public java.util.Locale getTextLocale()
Get the locale of the text provided in the event

Returns:
locale of the text provided in the event

setTextLocale

public void setTextLocale(java.util.Locale locale)
Set the locale of the text provided in the event

Returns:
locale of the text provided in the event

getType

public java.lang.String getType()
Get the fully qualified (programmatic) event type string

Returns:
event type string

getTypeArray

public java.lang.String[] getTypeArray()
Get the fully qualified (programmatic) event type as an array

Returns:
event type string array

getUglyType

public java.lang.String getUglyType()
Get the fully qualified (programmatic) event type string

Returns:
event type string

getDateAsLong

public long getDateAsLong()
Get the time/date of the event

Returns:
long value representing the time/date of the event

getDate

public java.util.Date getDate()
Get the time/date of the event

Returns:
time/date of the event

setDate

public void setDate(long date)
Set the time/date of the event


getSenderName

public java.lang.String getSenderName()
Get the name associated with the system that originated the event

Returns:
name of the system that originated the event

setSenderName

public void setSenderName(java.lang.String name)
Set the name associated with the system that originated the event

Parameters:
name - of the system that originated the event

getEventId

public long getEventId()
Get event id

Returns:
id of the event

setEventId

public void setEventId(long id)
Set event id

Parameters:
id - id of the event

getNumChildEventIds

public int getNumChildEventIds()
Get the number of child event ids

Returns:
number of child event ids

getChildEventIds

public long[] getChildEventIds()
Get child event ids

Returns:
ids of child events if this is a summary event; null if not

setChildEventIds

public void setChildEventIds(long[] ids)
Set child event ids

Parameters:
ids - ids of child events

isaSummaryEvent

public boolean isaSummaryEvent()
Check if this is a summary event

Returns:
true if this is a summary event; false if not

getSeverityCount

public static int getSeverityCount()
Get the number of architected event severities

Returns:
number of architected severities

toStringSeverity

public java.lang.String toStringSeverity()
Get the string equivalent of the event severity (assuming the default locale)

Returns:
event severity as a string

toStringSeverity

public static java.lang.String toStringSeverity(int sev)
Get the string equivalent of a given event severity (assuming the default locale)

Parameters:
sev - numerical equivalent of severity
Returns:
event severity as a string

toStringSeverity

public static java.lang.String toStringSeverity(int index,
                                                java.util.Locale locale)
Get the string equivalent of a given event severity and locale

Parameters:
index - numerical equivalent of severity
locale - desired locale of severity
Returns:
event severity as a string

toStringFlags

public java.lang.String toStringFlags()
Convert the current flag settings to their string equivalents

Returns:
string representing the flags

toIntelByteBuffer

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

readTWGPartialEvent

public int readTWGPartialEvent(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 TWGPartialEvent object

Returns:
number of bytes that comprise the object

sizeOfHdr

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

Returns:
number of bytes that comprise the header

sizeOfTWGPartialEvent

public int sizeOfTWGPartialEvent()
Determine the size of the entire TWGPartialEvent object

Returns:
number of bytes that comprise the object

getCategory

public int getCategory()

getCategoryCount

public static int getCategoryCount()
Get the number of architected event categories

Returns:
number of architected categories

toStringCategory

public java.lang.String toStringCategory()
Get the string equivalent of the event category (assuming the default locale)

Returns:
event category as a string

toStringCategory

public static java.lang.String toStringCategory(int cat)
Get the string equivalent of a given event category (assuming the default locale)

Parameters:
cat - numerical equivalent of category
Returns:
event severity as a string

toStringCategory

public static java.lang.String toStringCategory(int index,
                                                java.util.Locale locale)
Get the string equivalent of a given event category and locale

Parameters:
index - numerical equivalent of category
locale - desired locale of category
Returns:
event category as a string

print

public void print()
Print the contents of the TWGPartialEvent object


toString

public java.lang.String toString()

generateEventId

public static long generateEventId()
Generate an event id using the current serverId, processId, and InstanceId

Returns:
event id

setServerId

public static void setServerId(java.lang.String id)
Set the Server id of this system (This is assumed to be a system unique identifier)

Parameters:
id - - unique identifier for this system

getDaysIndex

public static int getDaysIndex(long eventId)
Extract the day index from the given event id

Returns:
last eight bits of the event id as an int

bytesToLong

public static long bytesToLong(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

bytesToLong

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

Parameters:
buf - - buffer to be converted