Package com.sun.identity.entitlement
Class LogicalCondition
- java.lang.Object
-
- com.sun.identity.entitlement.EntitlementConditionAdaptor
-
- com.sun.identity.entitlement.LogicalCondition
-
- All Implemented Interfaces:
EntitlementCondition
- Direct Known Subclasses:
AndCondition,NotCondition,OrCondition
public abstract class LogicalCondition extends EntitlementConditionAdaptor
-
-
Constructor Summary
Constructors Constructor Description LogicalCondition()Constructor.LogicalCondition(Set<EntitlementCondition> eConditions)Constructor.LogicalCondition(Set<EntitlementCondition> eConditions, String pConditionName)Constructor.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)Returnstrueif the passed in object is equal to this objectabstract ConditionDecisionevaluate(String realm, Subject subject, String resourceName, Map<String,Set<String>> environment)ReturnsConditionDecisionofEntitlementConditionevaluationSet<EntitlementCondition>getEConditions()Returns the nestedEntitlementCondition(s).StringgetPConditionName()Returns OpenAM policy Condition nameStringgetState()Returns state of the object.inthashCode()Returns hash code of the objectvoidsetEConditions(Set<EntitlementCondition> eConditions)Sets the nestedEntitlementCondition(s).voidsetPConditionName(String pConditionName)Sets OpenAM policy Condition namevoidsetState(String state)Sets state of the objectorg.json.JSONObjecttoJSONObject()Returns JSONObject mapping of the objectStringtoString()Returns string representation of the objectvoidvalidate()Checks that this condition is configured correctly.-
Methods inherited from class com.sun.identity.entitlement.EntitlementConditionAdaptor
getDisplayType, init, setDisplayType, setState, toJSONObject
-
-
-
-
Constructor Detail
-
LogicalCondition
public LogicalCondition()
Constructor.
-
LogicalCondition
public LogicalCondition(Set<EntitlementCondition> eConditions)
Constructor.- Parameters:
eConditions- wrappedEntitlementCondition(s)
-
LogicalCondition
public LogicalCondition(Set<EntitlementCondition> eConditions, String pConditionName)
Constructor.- Parameters:
eConditions- wrappedEntitlementCondition(s)pConditionName- subject name as used in OpenAM policy, this is relevant only when UserECondition was created from OpenAM policy Condition
-
-
Method Detail
-
setState
public void setState(String state)
Sets state of the object- Parameters:
state- State of the object encoded as string
-
getState
public String getState()
Returns state of the object.- Returns:
- state of the object encoded as string.
-
evaluate
public abstract ConditionDecision evaluate(String realm, Subject subject, String resourceName, Map<String,Set<String>> environment) throws EntitlementException
ReturnsConditionDecisionofEntitlementConditionevaluation- Parameters:
realm- Realm name.subject- EntitlementCondition who is under evaluation.resourceName- Resource name.environment- Environment parameters.- Returns:
ConditionDecisionofEntitlementConditionevaluation- Throws:
EntitlementException- if error occurs.
-
setEConditions
public void setEConditions(Set<EntitlementCondition> eConditions)
Sets the nestedEntitlementCondition(s).- Parameters:
eConditions- the nestedEntitlementCondition(s)
-
getEConditions
public Set<EntitlementCondition> getEConditions()
Returns the nestedEntitlementCondition(s).- Returns:
- the nested
EntitlementCondition(s).
-
setPConditionName
public void setPConditionName(String pConditionName)
Sets OpenAM policy Condition name- Parameters:
pConditionName- subject name as used in OpenAM policy, this is relevant only when UserECondition was created from OpenAM policy Condition
-
getPConditionName
public String getPConditionName()
Returns OpenAM policy Condition name- Returns:
- subject name as used in OpenAM policy, this is relevant only when UserECondition was created from OpenAM policy Condition
-
toJSONObject
public org.json.JSONObject toJSONObject() throws org.json.JSONExceptionReturns JSONObject mapping of the object- Returns:
- JSONObject mapping of the object
- Throws:
org.json.JSONException- if can not map to JSONObject
-
toString
public String toString()
Returns string representation of the object
-
equals
public boolean equals(Object obj)
Returnstrueif the passed in object is equal to this object- Overrides:
equalsin classEntitlementConditionAdaptor- Parameters:
obj- object to check for equality- Returns:
trueif the passed in object is equal to this object
-
hashCode
public int hashCode()
Returns hash code of the object- Overrides:
hashCodein classEntitlementConditionAdaptor- Returns:
- hash code of the object
-
validate
public void validate() throws EntitlementExceptionDescription copied from interface:EntitlementConditionChecks that this condition is configured correctly. ThrowsEntitlementExceptionif not with an informative message to display to the user creating/updating the policy.- Throws:
EntitlementException- if the configuration state is not valid.
-
-