com.tivoli.zce.actions
Class TecEventUtil

java.lang.Object
  extended bycom.tivoli.zce.actions.TecEventUtil

public class TecEventUtil
extends java.lang.Object

A utility class which helps to convert State Correlation events into information which can be passed back to TEC.

This class provides a utility method for updating the snapshot of a State Correlation event prior to forwarding to TEC. For performance reasons when the State Correlation event is sent back to TEC, a String representation of the snapshot is used. This snapshot must be updated prior to sending the event to TEC so that any changes in the event information can be incorporated in the new snapshot. Failure to update the snapshot will mean lost information.

For good performance characteristics the event snapshot should be updated as infrequently as possible. The two times where updating the snapshot is required are:

A new event does not always have a snapshot and calling DefaultActionHandler.forward() may cause a NullPointerException if the snapshot has not been created.

See Also:
DefaultActionHandler

Constructor Summary
TecEventUtil()
           
 
Method Summary
static void forwardTecEvent(DefaultActionHandler actionHandler, Event event, Event originalEvent)
          Updates the snapshot of the event contents and forwards
static void updateTecEvent(Event event, Event originalEvent)
          Updates the snapshot of the event contents
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TecEventUtil

public TecEventUtil()
Method Detail

forwardTecEvent

public static void forwardTecEvent(DefaultActionHandler actionHandler,
                                   Event event,
                                   Event originalEvent)
                            throws java.lang.Exception
Updates the snapshot of the event contents and forwards

Updates the snapshot with the current event contents so that it will make it back to the TEC server. Once the snapshot is updated the event is forwarded to the next action (if any).

When updating an existing event use the same event for both the event and the originalEvent parameters.

When updating an newly created event pass the new event as the event parameter and use the event passed to the action in the processEvent call as the originalEvent parameter.

Parameters:
actionHandler - the current action handler used to forward the event
event - the event to be updated and forwarded
originalEvent - the event passed into the action
Throws:
java.lang.Exception
See Also:
DefaultActionHandler, Event

updateTecEvent

public static void updateTecEvent(Event event,
                                  Event originalEvent)
                           throws java.lang.Exception
Updates the snapshot of the event contents

Updates the snapshot with the current event contents so that it will make it back to the TEC server. A separate forward() call must be made to pass this event on to the next action. Calling both updateTecEvent() and forwardTecEvent() is not necessary.

When updating an existing event use the same event for both the event and the originalEvent parameters.

When updating an newly created event pass the new event as the event parameter and use the event passed to the action in the processEvent call as the originalEvent parameter.

Parameters:
event - the event to be updated
originalEvent - the event passed into the action
Throws:
java.lang.Exception
See Also:
Event