campus.sysnort
Class Trigger

java.lang.Object
  |
  +--campus.sysnort.Trigger
Direct Known Subclasses:
FlickerTrigger, HotspotTrigger, MissingCardTrigger

public abstract class Trigger
extends java.lang.Object

Abstract class for Sysnort trigger. A trigger has a condition and an action. Sysnort checks an arriving event against the condition and calls the action if the condition is satisfied.

Version:
$Id: Trigger.java,v 1.4 2003/08/22 01:06:46 glchen Exp $
Author:
Guanling Chen

Field Summary
protected  java.lang.Object _actionObject
           
protected  java.lang.String _name
           
 
Constructor Summary
Trigger()
           
 
Method Summary
abstract  boolean checkCondition(Event evt)
          Check whether the new event satisfy this trigger's condition.
 java.lang.Object getActionObject()
          Get the object containing all necessary info to take an action.
 java.lang.String getName()
          Get the name of this trigger.
 java.lang.String getPackPolicy()
          Return the PACK policy for this trigger, default as empty.
 void init(serp.util.Options opts)
          Init the trigger with customized arguments in configuration.
 void setName(java.lang.String name)
          Set the name of this trigger.
abstract  void takeAction(java.lang.Object actionObject)
          When the checkCondition returns true, Sysnort retrieves the action object and may call takeAction immediately or defer to a later time.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_actionObject

protected java.lang.Object _actionObject

_name

protected java.lang.String _name
Constructor Detail

Trigger

public Trigger()
Method Detail

init

public void init(serp.util.Options opts)
          throws java.lang.Exception
Init the trigger with customized arguments in configuration.

java.lang.Exception

setName

public void setName(java.lang.String name)
Set the name of this trigger.


getName

public java.lang.String getName()
Get the name of this trigger.


getPackPolicy

public java.lang.String getPackPolicy()
Return the PACK policy for this trigger, default as empty.


checkCondition

public abstract boolean checkCondition(Event evt)
                                throws java.lang.Exception
Check whether the new event satisfy this trigger's condition. If yes, then this function returns true. The subclass must also encapsulate all the information to take action in the object _actionObject, which will be used by Sysnort to call takeAction.

java.lang.Exception

getActionObject

public final java.lang.Object getActionObject()
Get the object containing all necessary info to take an action. Once the object is returned, the original variable _actionObject is set to null for next cycle.


takeAction

public abstract void takeAction(java.lang.Object actionObject)
                         throws java.lang.Exception
When the checkCondition returns true, Sysnort retrieves the action object and may call takeAction immediately or defer to a later time.

java.lang.Exception