com.tivoli.twg.alertmgr
Class TWGEventCorrelator

java.lang.Object
  extended bycom.tivoli.twg.alertmgr.TWGEventCorrelator
All Implemented Interfaces:
java.io.Serializable

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

TWGEventCorrelator is a class for defining an instance of a particular type event on a managed object. The presence of the event correlator in conjunction with the TWGBaseEvent.EVENT_FLAGS_ALERT and TWGBaseEvent.EVENT_FLAGS_RESOLUTION flags to distinguish when a managed object is in error-state and when that error-state has been clear. To establish an error-state, the event sender sends a base event (with alert flag) including a newly requested event correlator. It is then the responsibility of the sender to remember the event correlator until problem reported in the event (for this managed object) has been fixed. The event sender can now clear the error-state by sending a second base event (with resolution flag) including the saved event correlator. This signals the Event Server that the problem has been rectified. Now, if same problem is detected again, a new correlator should be requested before sending an alert. In an effort to avoid collisions between event correlators, each event sender is assigned a unique subsystem id using the TWGEventRouter.RequestEventCorrelatorPrefixCommand. Once requested, the event sender uses the subsystem id as a key to request a new event correlator.

See Also:
Serialized Form

Constructor Summary
TWGEventCorrelator(int id)
          Constructor for requesting a new event correlator.
TWGEventCorrelator(IntelByteBuffer buf)
          Constructor for interpreting a provided IntelByteBuffer.
TWGEventCorrelator(IntelByteBuffer buf, int off)
          Constructor for interpreting a provided IntelByteBuffer at a given offset.
TWGEventCorrelator(int id, long inst)
          Constructor for reconstructing an old event correlator from its subcomponents.
TWGEventCorrelator(TWGEventCorrelator ec)
          Copy Constructor.
 
Method Summary
 boolean equals(TWGEventCorrelator ec)
          Determine if this event correlator is equivalent to the one provided
 long getInstanceId()
          Get instance id.
 int getSubsystemId()
          Get subsystem id.
 void print()
          Print the contents of the event correlator
 int readTWGEventCorrelator(IntelByteBuffer buf, int off)
          Method for interpreting a provided IntelByteBuffer at a given offset.
 void setInstanceId(long id)
          Set instance id.
 void setSubsystemId(int id)
          Set subsystem id.
static int sizeOfHdr()
          Determine the size of the TWGEventCorrelator header
 int sizeOfTWGEventCorrelator()
          Determine the size of the entire TWGEventCorrelator object
 IntelByteBuffer toIntelByteBuffer()
          Convert the TWGEventCorrelator 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 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TWGEventCorrelator

public TWGEventCorrelator(int id)
Constructor for requesting a new event correlator.

Parameters:
id - subsystem id of the event sender (assigned by the event router)

TWGEventCorrelator

public TWGEventCorrelator(int id,
                          long inst)
Constructor for reconstructing an old event correlator from its subcomponents.

Parameters:
id - subsystem id of the event sender (assigned by the event router)
inst - instance id of the event

TWGEventCorrelator

public TWGEventCorrelator(TWGEventCorrelator ec)
Copy Constructor.

Parameters:
ec - event correlator to be copied.

TWGEventCorrelator

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

TWGEventCorrelator

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

equals

public boolean equals(TWGEventCorrelator ec)
Determine if this event correlator is equivalent to the one provided

Parameters:
ec - event correlator to be compared.
Returns:
true if equal; otherwise false

getSubsystemId

public int getSubsystemId()
Get subsystem id.

Returns:
subsystem id

setSubsystemId

public void setSubsystemId(int id)
Set subsystem id.


getInstanceId

public long getInstanceId()
Get instance id.

Returns:
instance id of the event correlator.

setInstanceId

public void setInstanceId(long id)
Set instance id.

Parameters:
id - instance id of the event

toIntelByteBuffer

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

sizeOfHdr

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

Returns:
number of bytes that comprise the header

sizeOfTWGEventCorrelator

public int sizeOfTWGEventCorrelator()
Determine the size of the entire TWGEventCorrelator object

Returns:
number of bytes that comprise the TWGEventCorrelator object

readTWGEventCorrelator

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

print

public void print()
Print the contents of the event correlator


toString

public java.lang.String toString()