Class AbstractCondition
java.lang.Object
oracle.iam.policyengine.vo.conditions.AbstractCondition
- All Implemented Interfaces:
EvaluationCondition
AbstractCondition
Top level class for a condition that implements the EvaluationCondition interface
- it can be evaluated as true or false based on a set of facts (the input ValueObject).
Each condition has two arguments and an operator so it looks something like this:
"arg1 OP arg2"
In comments and code various terms are used for the two arguments:
Left side - arg1 - attribute - attrObj (etc)
Right side - arg2 - value - valObj (etc)
The arguments and the operator are contained in a SearchCriteria Condition that
is an attribute of the AbstractCondition.
There are two types of AbstractCondition - Composite and Simple
A CompositeCondition is composed of two AbstractConditions joined by the AND or OR operator
- arg1 and arg2 are either Composite or Simple conditions
A SimpleCondition is composed of two arguments that are not AbstractConditions and an
operator that is not AND or OR.
CompositeConditions: AndCondition, OrCondition
SimpleConditions: BeginsWithCondition, ContainsCondition, EndsWithCondition, EqualCondition, GreaterEqualCondition,
GreaterThanCondition, InCondition, LessEqualCondition, LessThanCondition, NotBeginsWithCondition,
NotContainCondition, NotEndsWithCondition, NotEqualCondition, NotInCondition
An example of a SimpleCondition of type EqualCondition is: role[*].Role Name EQUAL "MyRole2"
NOTE: This class must be kept thread-safe. It is intended to be accessed by multiple threads
during the evaluation of rule conditions.
-
Method Summary
Modifier and TypeMethodDescriptionfinal SearchCriteria.Operator
Return the SearchCriteria operator associated with the conditionfinal String
int
static EvaluationCondition
newCondition
(Condition cond) Static factory method for creating an EvaluationCondition using the specified SearchCriteria Condition.static EvaluationCondition
newCondition
(Condition tmpCond, String tmpRuleName) Static factory method for creating an AbstractCondition using the specified SearchCriteria Condition and rule name Creates and returns an instance of a sub-class of CompositeCondition or SimpleCondition The class returned is based on the operator contained in the Condition.void
prepopulateTokMap
(Map<String, StringTokenizerTS> tmpTokMap, Map<String, String> tmpTokPathMap) Walk the condition tree pre-populating the string tokenizer map with entries that we know will be used repeatedly if the condition is evaluated multiple times.void
void
final void
setRuleName
(String tmpRuleName) Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface oracle.iam.policyengine.vo.conditions.EvaluationCondition
isTrue
-
Method Details
-
newCondition
Static factory method for creating an EvaluationCondition using the specified SearchCriteria Condition. Creates and returns an instance of a sub-class of CompositeCondition or SimpleCondition The class returned is based on the operator contained in the Condition.- Parameters:
cond
-- Returns:
-
newCondition
Static factory method for creating an AbstractCondition using the specified SearchCriteria Condition and rule name Creates and returns an instance of a sub-class of CompositeCondition or SimpleCondition The class returned is based on the operator contained in the Condition.- Parameters:
tmpCond
-tmpRuleName
-- Returns:
-
getOperator
Return the SearchCriteria operator associated with the condition- Returns:
- - SearchCriteria operator
-
getRuleName
- Specified by:
getRuleName
in interfaceEvaluationCondition
-
setRuleName
- Specified by:
setRuleName
in interfaceEvaluationCondition
-
getToksSize
public int getToksSize() -
printTokenizerMapSize
public void printTokenizerMapSize() -
prepopulateTokMap
public void prepopulateTokMap(Map<String, StringTokenizerTS> tmpTokMap, Map<String, String> tmpTokPathMap) Walk the condition tree pre-populating the string tokenizer map with entries that we know will be used repeatedly if the condition is evaluated multiple times.- Parameters:
tmpTokMap
-
-
printAllTokKeys
public void printAllTokKeys() -
convertToString
- Specified by:
convertToString
in interfaceEvaluationCondition
-