com.isti.trinetwatch.ruleset
Class RuleSet

java.lang.Object
  extended by com.isti.trinetwatch.ruleset.RuleSet

public class RuleSet
extends java.lang.Object

Class RuleSet manages a table of CriteriaTable objects which map to dynamic parameters. Each station will have one RuleSet object.


Constructor Summary
RuleSet(java.lang.String name)
          Creates a rule set object.
 
Method Summary
 boolean add(java.lang.String paramName, CriteriaTable cTable)
          Adds a dynamic-parameter-name / CriteriaTable pair to the rule-set table.
 boolean add(java.lang.String paramName, UsageLevelTag usageLevel, Criteria criteriaObj)
          Adds a usage-level / criteria pair to the CriteriaTable for the given dynamic-parameter-name.
 boolean containsParam(java.lang.String paramName)
          Determines if an entry for the given dynamic parameter name exists in the rule set.
 void enterArchiveParameterFalseSet(java.util.Collection paramList)
          Enters the given list of dynamic-parameter-name strings into the archive-parameter false set.
 void enterArchiveParameterTrueSet(java.util.Collection paramList)
          Enters the given list of dynamic-parameter-name strings into the archive-parameter true set.
 CriteriaTable get(java.lang.String paramName)
          Returns the CriteriaTable object associated with the given dynamic parameter name.
 ArchiveParameterFlag getArchiveParameterFlag(java.lang.String paramName)
          Get the archive-parameter flag for the given dynamic-parameter-name.
 java.lang.String getName()
          Returns the name associated with this rule set.
 java.util.List getParamNamesList()
          Returns a list containing the dynamic parameter names in this rule set.
 int indexOfParam(java.lang.String paramName)
          Returns an index value corresponding to the position of the given dynamic parameter name in the rule set.
 void setUseCriteriaRegExFlag(boolean b)
          Set the use regular expressions for criteria flag.
 StatusLevelTag toStatus(java.lang.String paramName, UsageLevelTag usageLevel, java.lang.Object value)
          Translates the given dynamic parameter name, usage-level and value to a status level.
 java.lang.String toString()
          Returns a string representation of this object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RuleSet

public RuleSet(java.lang.String name)
Creates a rule set object.

Parameters:
name - the name to be associated with this rule set.
Method Detail

add

public boolean add(java.lang.String paramName,
                   CriteriaTable cTable)
Adds a dynamic-parameter-name / CriteriaTable pair to the rule-set table.

Parameters:
paramName - the name of a dynamic parameter.
cTable - the CriteriaTable object to be associated with the dynamic parameter.
Returns:
true if successful, false if an entry with the same name already exists in this table.

add

public boolean add(java.lang.String paramName,
                   UsageLevelTag usageLevel,
                   Criteria criteriaObj)
Adds a usage-level / criteria pair to the CriteriaTable for the given dynamic-parameter-name. If a CriteriaTable for the given dynamic-parameter-name does not yet exist then one is created.

Parameters:
paramName - name of dynamic parameter.
usageLevel - usage-level to be entered.
criteriaObj - Criteria object to be entered.
Returns:
true if successful, false if an object with the same usage-level already exists in the CriteriaTable.

get

public CriteriaTable get(java.lang.String paramName)
Returns the CriteriaTable object associated with the given dynamic parameter name.

Parameters:
paramName - parameter name to use.
Returns:
The handle of the CriteriaTable object or null if no matching object was found.

containsParam

public boolean containsParam(java.lang.String paramName)
Determines if an entry for the given dynamic parameter name exists in the rule set.

Parameters:
paramName - parameter name to use.
Returns:
true if an entry for the given dynamic parameter name exists in the rule set; false if not.

indexOfParam

public int indexOfParam(java.lang.String paramName)
Returns an index value corresponding to the position of the given dynamic parameter name in the rule set.

Parameters:
paramName - parameter name to use.
Returns:
An index value corresponding to the position of the given dynamic parameter name in the rule set, or -1 if the given name does not exist in the table.

toStatus

public StatusLevelTag toStatus(java.lang.String paramName,
                               UsageLevelTag usageLevel,
                               java.lang.Object value)
Translates the given dynamic parameter name, usage-level and value to a status level.

Parameters:
paramName - the name of a dynamic parameter.
usageLevel - the handle of UsageLevelTag object.
value - an object containing the value to be translated (such as an 'Integer', 'Double', etc.)
Returns:
A 'StatusLevelTag' object.
Throws:
java.lang.ClassCastException - if the given object's type prevents it from being compared to the objects in the list.

enterArchiveParameterTrueSet

public void enterArchiveParameterTrueSet(java.util.Collection paramList)
Enters the given list of dynamic-parameter-name strings into the archive-parameter true set.

Parameters:
paramList - collection of dynamic-parameter-name strings to be entered.

enterArchiveParameterFalseSet

public void enterArchiveParameterFalseSet(java.util.Collection paramList)
Enters the given list of dynamic-parameter-name strings into the archive-parameter false set.

Parameters:
paramList - collection of dynamic-parameter-name strings to be entered.

getArchiveParameterFlag

public ArchiveParameterFlag getArchiveParameterFlag(java.lang.String paramName)
Get the archive-parameter flag for the given dynamic-parameter-name.

Parameters:
paramName - name of dynamic parameter.
Returns:
the archive-parameter flag.

getParamNamesList

public java.util.List getParamNamesList()
Returns a list containing the dynamic parameter names in this rule set.

Returns:
A new list containing the dynamic parameter name strings in this rule set.

getName

public java.lang.String getName()
Returns the name associated with this rule set.

Returns:
The name associated with this rule set.

setUseCriteriaRegExFlag

public void setUseCriteriaRegExFlag(boolean b)
Set the use regular expressions for criteria flag.

Parameters:
b - true if specified regular expressions should be used for criteria.

toString

public java.lang.String toString()
Returns a string representation of this object. The string representation of each 'CriteriaTable' object is put in a separate section delimited by a blank line.

Overrides:
toString in class java.lang.Object
Returns:
A string representation of this object.