com.tivoli.zce.actions
Class DefaultActionHandler

java.lang.Object
  |
  +--com.tivoli.zce.actions.DefaultActionHandler
All Implemented Interfaces:
IAction, com.tivoli.zce.IEventProcessor, com.tivoli.zce.IEventSender
Direct Known Subclasses:
SendTecEvent, TECSummary

public abstract class DefaultActionHandler
extends java.lang.Object
implements IAction

(C) Copyright International Business Machines Corporation, 2000

Helper class that implements IAction. This class is provided to hide unnecessary internal details of an action. It implements methods to forward Event or EventList.


Field Summary
protected  com.tivoli.zce.IEventProcessor aloneEventProcessor
           
protected  java.lang.String aloneEventProcessorId
           
protected  java.util.Hashtable eventProcessors
           
 
Fields inherited from interface com.tivoli.zce.IEventProcessor
IBM_Copyright
 
Fields inherited from interface com.tivoli.zce.IEventSender
IBM_Copyright
 
Constructor Summary
DefaultActionHandler()
           
 
Method Summary
 void addEventProcessor(com.tivoli.zce.IEventProcessor eventProcessor, java.lang.String id)
          Add an eventProcessor.
protected  java.lang.String banner()
           
protected  void forward(Event event)
          Forward the given event to the next action attached to this current action.
protected  void forward(EventList events)
          Forward the given list of events to the next action attached to this current action.
 com.tivoli.zce.IEventProcessor[] getEventProcessor()
          Get the eventProcessor that will receive events that pass this rule
static java.lang.String IBM_Copyright()
           
 com.tivoli.zce.IEventProcessor removeEventProcessor(java.lang.String id)
          Remove an eventProcessor using its id.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.tivoli.zce.actions.IAction
doParse
 
Methods inherited from interface com.tivoli.zce.IEventProcessor
processEvent, processEvents
 

Field Detail

eventProcessors

protected java.util.Hashtable eventProcessors

aloneEventProcessor

protected com.tivoli.zce.IEventProcessor aloneEventProcessor

aloneEventProcessorId

protected java.lang.String aloneEventProcessorId
Constructor Detail

DefaultActionHandler

public DefaultActionHandler()
Method Detail

IBM_Copyright

public static java.lang.String IBM_Copyright()

addEventProcessor

public void addEventProcessor(com.tivoli.zce.IEventProcessor eventProcessor,
                              java.lang.String id)
Add an eventProcessor. An eventProcessor is normally attached to an identifier (id). This id is used to forward events to the next Action; a shared action could be attached to multiple different next actions, the id is used here to find using ruleID the next action to trigger.
Specified by:
addEventProcessor in interface com.tivoli.zce.IEventSender
Parameters:
eventProcessor - the event processor to add to this action, it will be attached to the id
id - the id of this event processor, it is usually the Rule ID of the last rule that trigger this action.

removeEventProcessor

public com.tivoli.zce.IEventProcessor removeEventProcessor(java.lang.String id)
Remove an eventProcessor using its id. After the completion of this operation it will be no more possible to forward event to the id attached to this event processor. This method is mainly called when a rule is removed from the system, or replaced by a new one.
Specified by:
removeEventProcessor in interface com.tivoli.zce.IEventSender
Parameters:
id - the identificateur of the event processor to remove
Returns:
the removed eventProcessor or null if none was not found

getEventProcessor

public com.tivoli.zce.IEventProcessor[] getEventProcessor()
Description copied from interface: com.tivoli.zce.IEventSender
Get the eventProcessor that will receive events that pass this rule
Specified by:
getEventProcessor in interface com.tivoli.zce.IEventSender
Returns:
all event processors attached to this action, or null if no one was attached.

banner

protected java.lang.String banner()

forward

protected void forward(Event event)
                throws java.lang.Exception
Forward the given event to the next action attached to this current action. The next action is found by matching all registered event processor's ID with the current ruleId of the given com.tivoli.zce.engine.Event.
Parameters:
event - the event to forward
Throws:
java.lang.Exception - an exception can be throw by an action.The handling and the raising of exception, is defined by the developer of actions.

forward

protected void forward(EventList events)
                throws java.lang.Exception
Forward the given list of events to the next action attached to this current action. The next action is found by matching all registered event processor's ID with the current ruleId of the first com.tivoli.zce.engine.Event of the given com.tivoli.zce.engine.EventList.
Parameters:
event - the event to forward
Throws:
java.lang.Exception - an exception can be throw by an action.The handling and the raising of exception, is defined by the developer of actions.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
See Also:
Object.toString()