Package com.sun.identity.entitlement
Class NotCondition
- java.lang.Object
-
- com.sun.identity.entitlement.EntitlementConditionAdaptor
-
- com.sun.identity.entitlement.LogicalCondition
-
- com.sun.identity.entitlement.NotCondition
-
- All Implemented Interfaces:
EntitlementCondition
public class NotCondition extends LogicalCondition
This class wrapped on an Entitlement Condition object to provide boolean NOT. Membership ofNotCondition
is satisfied in the user is not a member of the nestedEntitlementCondition
. We @JsonIgnore getEConditions and setEConditions (NOTE the 's' on the end) so that we don't indicate via JSON schema exposed that we take multiple condition types. We extend LogicalCondition but ensure that we are only allowing a singleEntitlementCondition
to be referenced by this class.
-
-
Constructor Summary
Constructors Constructor Description NotCondition()
ConstructsNotCondition
NotCondition(EntitlementCondition eCondition)
Constructs NotConditionNotCondition(EntitlementCondition eConditions, String pConditionName)
ConstructsNotCondition
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object obj)
Returnstrue
if the passed in object is equal to this objectConditionDecision
evaluate(String realm, Subject subject, String resourceName, Map<String,Set<String>> environment)
ReturnsConditionDecision
ofEntitlementCondition
evaluationEntitlementCondition
getECondition()
Returns the nestedEntitlementCondition
(s).Set<EntitlementCondition>
getEConditions()
Returns the nestedEntitlementCondition
(s).String
getPConditionName()
Returns OpenAM policy Condition nameString
getState()
Returns state of the object.int
hashCode()
Returns hash code of the objectvoid
setECondition(EntitlementCondition eCondition)
Sets the nestedEntitlementCondition
(s).void
setEConditions(Set<EntitlementCondition> eConditions)
Sets the nestedEntitlementCondition
(s).void
setPConditionName(String pConditionName)
Sets OpenAM policy Condition namevoid
setState(String state)
Sets state of the objectorg.json.JSONObject
toJSONObject()
Returns JSONObject mapping of the objectString
toString()
Returns string representation of the objectvoid
validate()
Checks that this condition is configured correctly.-
Methods inherited from class com.sun.identity.entitlement.EntitlementConditionAdaptor
getDisplayType, init, setDisplayType, setState, toJSONObject
-
-
-
-
Constructor Detail
-
NotCondition
public NotCondition()
ConstructsNotCondition
-
NotCondition
public NotCondition(EntitlementCondition eCondition)
Constructs NotCondition- Parameters:
eCondition
- wrappedEntitlementCondition
(s)
-
NotCondition
public NotCondition(EntitlementCondition eConditions, String pConditionName)
ConstructsNotCondition
.- 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- Specified by:
setState
in interfaceEntitlementCondition
- Overrides:
setState
in classLogicalCondition
- Parameters:
state
- State of the object encoded as string
-
getState
public String getState()
Returns state of the object.- Specified by:
getState
in interfaceEntitlementCondition
- Overrides:
getState
in classLogicalCondition
- Returns:
- state of the object encoded as string.
-
evaluate
public ConditionDecision evaluate(String realm, Subject subject, String resourceName, Map<String,Set<String>> environment) throws EntitlementException
ReturnsConditionDecision
ofEntitlementCondition
evaluation- Specified by:
evaluate
in interfaceEntitlementCondition
- Specified by:
evaluate
in classLogicalCondition
- Parameters:
realm
- Realm name.subject
- EntitlementCondition who is under evaluation.resourceName
- Resource name.environment
- Environment parameters.- Returns:
ConditionDecision
ofEntitlementCondition
evaluation- Throws:
EntitlementException
- if error occurs.
-
setECondition
public void setECondition(EntitlementCondition eCondition)
Sets the nestedEntitlementCondition
(s).- Parameters:
eCondition
- the nestedEntitlementCondition
(s)
-
getECondition
public EntitlementCondition getECondition()
Returns the nestedEntitlementCondition
(s).- Returns:
- the nested
EntitlementCondition
(s).
-
setEConditions
public void setEConditions(Set<EntitlementCondition> eConditions)
Sets the nestedEntitlementCondition
(s).- Overrides:
setEConditions
in classLogicalCondition
- Parameters:
eConditions
- the nestedEntitlementCondition
(s)
-
getEConditions
public Set<EntitlementCondition> getEConditions()
Returns the nestedEntitlementCondition
(s).- Overrides:
getEConditions
in classLogicalCondition
- Returns:
- the nested
EntitlementCondition
(s).
-
setPConditionName
public void setPConditionName(String pConditionName)
Sets OpenAM policy Condition name- Overrides:
setPConditionName
in classLogicalCondition
- 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- Overrides:
getPConditionName
in classLogicalCondition
- 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.JSONException
Returns JSONObject mapping of the object- Overrides:
toJSONObject
in classLogicalCondition
- 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- Overrides:
toString
in classLogicalCondition
- Returns:
- string representation of the object
-
equals
public boolean equals(Object obj)
Returnstrue
if the passed in object is equal to this object- Overrides:
equals
in classLogicalCondition
- Parameters:
obj
- object to check for equality- Returns:
true
if the passed in object is equal to this object
-
hashCode
public int hashCode()
Returns hash code of the object- Overrides:
hashCode
in classLogicalCondition
- Returns:
- hash code of the object
-
validate
public void validate() throws EntitlementException
Description copied from interface:EntitlementCondition
Checks that this condition is configured correctly. ThrowsEntitlementException
if not with an informative message to display to the user creating/updating the policy.- Specified by:
validate
in interfaceEntitlementCondition
- Overrides:
validate
in classLogicalCondition
- Throws:
EntitlementException
- if the configuration state is not valid.
-
-