Package com.sun.identity.entitlement
Class AttributeLookupCondition
- java.lang.Object
-
- com.sun.identity.entitlement.EntitlementConditionAdaptor
-
- com.sun.identity.entitlement.AttributeLookupCondition
-
- All Implemented Interfaces:
EntitlementCondition
public class AttributeLookupCondition extends EntitlementConditionAdaptor
This condition evaluates if a given attribute from subject matches with the one in resource.
-
-
Field Summary
Fields Modifier and Type Field Description static StringMACRO_RESOURCEResource Macrostatic StringMACRO_USERUser Macro
-
Constructor Summary
Constructors Constructor Description AttributeLookupCondition()Constructor.AttributeLookupCondition(String key, String value)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)Returnstrueif the passed in object is equal to this objectConditionDecisionevaluate(String realm, Subject subject, String resourceName, Map<String,Set<String>> environment)ReturnsConditionDecisionofEntitlementConditionevaluation.StringgetKey()Returns matching key.StringgetPConditionName()Returns OpenAM policy Condition name.StringgetState()Returns state of the object.StringgetValue()Returns matching value.inthashCode()Returns hash code of the object.voidsetKey(String key)Sets matching key.voidsetPConditionName(String pConditionName)Sets OpenAM policy Condition namevoidsetState(String state)Sets state of the objectvoidsetValue(String value)Set matching value.org.json.JSONObjecttoJSONObject()Returns JSONObject mapping of the object.StringtoString()Returns string representation of the object.voidvalidate()Checks that this condition is configured correctly.-
Methods inherited from class com.sun.identity.entitlement.EntitlementConditionAdaptor
getDisplayType, init, setDisplayType, setState, toJSONObject
-
-
-
-
Field Detail
-
MACRO_USER
public static final String MACRO_USER
User Macro- See Also:
- Constant Field Values
-
MACRO_RESOURCE
public static final String MACRO_RESOURCE
Resource Macro- See Also:
- Constant Field Values
-
-
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 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.
-
getKey
public String getKey()
Returns matching key.- Returns:
- matching key.
-
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.
-
getValue
public String getValue()
Returns matching value.- Returns:
- matching value.
-
setKey
public void setKey(String key)
Sets matching key.- Parameters:
key- Matching key.
-
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.
-
setValue
public void setValue(String value)
Set matching value.- Parameters:
value- Matching value.
-
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
-
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.
-
toString
public String toString()
Returns string representation 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.
-
-