com.tivoli.zce
Interface IRule

All Superinterfaces:
com.tivoli.zce.IEventProcessor, com.tivoli.zce.IEventSender

public interface IRule
extends com.tivoli.zce.IEventSender, com.tivoli.zce.IEventProcessor

(C) Copyright International Business Machines Corporation, 2000

Generic Interface to represent a Rule. This interface is mainly the glue between a Parser and an Engine: a Parser plug-ins give an com.tivoli.zce.IRule object to the com.tivoli.zce.engine.IEngine plug-ins.


Field Summary
static java.lang.String IBM_Copyright
           
 
Method Summary
 void addAction(java.lang.String function, java.lang.String parameters, boolean multipleInstance)
          add an action to the current Rule
 void addPredicate(com.tivoli.zce.predicates.IPredicate predicate)
          add a predicate in the list of predicates
 boolean getDirectAccess()
           
 com.tivoli.zce.engine.IEngine getEngine()
           
 java.util.ArrayList getEventTypes()
          Return the event types to which this rule applies to.
 com.tivoli.zce.predicates.IPredicate[] getPredicates()
           
 java.lang.String getRuleID()
          Return the identifier for this rule; an identifier could be hierarchical using "." as separator between each level.
 java.lang.String getStringForm()
          Return the String representation of the rule, as set by
 com.tivoli.zce.Variable getVar(java.lang.String var)
           
 boolean isElseType()
           
 void remove()
          Remove this rule and update all associated Objects (actions)
 void setDirectAccess(boolean directAccess)
          set the direct access properties, i.e., a rule with this property set to false is not registered into any RuleProcessor, it could be only triggered internally via actions.
 void setElseType(boolean elseRule)
          An else rule is processes an event only if this event was not matched by any normal rules.
 void setEngine(com.tivoli.zce.engine.IEngine engine)
          set the engine attached to this rule
 void setEventTypes(java.util.ArrayList type)
          Set the types of events applicable to this rule
 void setRuleID(java.lang.String id)
          Change the identifier for this rule, this method uses the same syntax as
 void setStringForm(java.lang.String rule)
          set the display representation of a rule
 
Methods inherited from interface com.tivoli.zce.IEventSender
addEventProcessor, getEventProcessor, removeEventProcessor
 
Methods inherited from interface com.tivoli.zce.IEventProcessor
processEvent, processEvents
 

Field Detail

IBM_Copyright

public static final java.lang.String IBM_Copyright
Method Detail

getEventTypes

public java.util.ArrayList getEventTypes()
Return the event types to which this rule applies to.
Returns:
the Event types this rule applies to

getRuleID

public java.lang.String getRuleID()
Return the identifier for this rule; an identifier could be hierarchical using "." as separator between each level.
Returns:
Identifier for this rule

setRuleID

public void setRuleID(java.lang.String id)
Change the identifier for this rule, this method uses the same syntax as
Parameters:
id - the new identifier for this rule
See Also:
getRuleID()

remove

public void remove()
Remove this rule and update all associated Objects (actions)

getEngine

public com.tivoli.zce.engine.IEngine getEngine()
Returns:
the engine that contains this rule

setEngine

public void setEngine(com.tivoli.zce.engine.IEngine engine)
set the engine attached to this rule
Parameters:
engine -  

setDirectAccess

public void setDirectAccess(boolean directAccess)
set the direct access properties, i.e., a rule with this property set to false is not registered into any RuleProcessor, it could be only triggered internally via actions.
Parameters:
directAccess -  

getDirectAccess

public boolean getDirectAccess()
Returns:
the direct access properties.
See Also:
setDirectAccess(boolean directAccess)

setElseType

public void setElseType(boolean elseRule)
An else rule is processes an event only if this event was not matched by any normal rules. This method sets this property according to the given parameter.
Parameters:
elseRule - true to set this rule as a else rule

isElseType

public boolean isElseType()
Returns:
true if this rule is a else rule.
See Also:
setElseType(boolean elseRule)

setStringForm

public void setStringForm(java.lang.String rule)
set the display representation of a rule

getStringForm

public java.lang.String getStringForm()
Return the String representation of the rule, as set by
Returns:
String representation of the rule
See Also:
setStringForm(String rule)

setEventTypes

public void setEventTypes(java.util.ArrayList type)
Set the types of events applicable to this rule
Parameters:
types - Event types this rule should receive

getPredicates

public com.tivoli.zce.predicates.IPredicate[] getPredicates()
Returns:
array of predicates defined for the current rule

addPredicate

public void addPredicate(com.tivoli.zce.predicates.IPredicate predicate)
add a predicate in the list of predicates

addAction

public void addAction(java.lang.String function,
                      java.lang.String parameters,
                      boolean multipleInstance)
               throws java.lang.Exception
add an action to the current Rule
Parameters:
function - the action name
parameters - the parameters for this action
multipleInstance - this parameter specifies if the action should be replicated at each usage, or if only one instance of it will be used for every Rule attach to it.

In a single instance mode, parameters will be process only at the first creation of the action.

getVar

public com.tivoli.zce.Variable getVar(java.lang.String var)
                               throws java.lang.Exception
Parameters:
var - the name of the variable to search for, the variable could contains "." characters for hierarchical specification as Rule name, but cannot refer directly to a Rule, but only to folder.
Returns:
the variable or null if none was found
Throws:
java.lang.Exception - an exception could be raised if the variable name refere to an unknown Rule path.