Package com.sun.identity.entitlement
Class StringAttributeCondition
- java.lang.Object
-
- com.sun.identity.entitlement.EntitlementConditionAdaptor
-
- com.sun.identity.entitlement.StringAttributeCondition
-
- All Implemented Interfaces:
EntitlementCondition
public class StringAttributeCondition extends EntitlementConditionAdaptor
Condition for evaluating attribute value of string type.
-
-
Field Summary
Fields Modifier and Type Field Description static StringATTR_NAME_ATTRIBUTE_NAMEstatic StringATTR_NAME_CASE_SENSITIVEstatic StringATTR_NAME_VALUE
-
Constructor Summary
Constructors Constructor Description StringAttributeCondition()
-
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)Returns condition decision.StringgetAttributeName()StringgetState()Returns state of the object encoded as a JSON string.StringgetValue()inthashCode()Returns hash code of the object.voidinit(Map<String,Set<String>> parameters)Initializes the condition object.booleanisCaseSensitive()voidsetAttributeName(String attributeName)voidsetCaseSensitive(boolean flag)voidsetState(String state)Sets state of this object from a JSON string.voidsetValue(String value)voidvalidate()Checks that this condition is configured correctly.-
Methods inherited from class com.sun.identity.entitlement.EntitlementConditionAdaptor
getDisplayType, setDisplayType, setState, toJSONObject
-
-
-
-
Field Detail
-
ATTR_NAME_ATTRIBUTE_NAME
public static final String ATTR_NAME_ATTRIBUTE_NAME
- See Also:
- Constant Field Values
-
ATTR_NAME_CASE_SENSITIVE
public static final String ATTR_NAME_CASE_SENSITIVE
- See Also:
- Constant Field Values
-
ATTR_NAME_VALUE
public static final String ATTR_NAME_VALUE
- See Also:
- Constant Field Values
-
-
Method Detail
-
init
public void init(Map<String,Set<String>> parameters)
Description copied from class:EntitlementConditionAdaptorInitializes the condition object.- Specified by:
initin interfaceEntitlementCondition- Overrides:
initin classEntitlementConditionAdaptor- Parameters:
parameters- Parameters for initializing the condition.
-
setState
public void setState(String state)
Description copied from interface:EntitlementConditionSets state of this object from a JSON string.- Parameters:
state- State of the object encoded as a JSON string
-
getState
public String getState()
Description copied from interface:EntitlementConditionReturns state of the object encoded as a JSON string.- Returns:
- state of the object encoded as a JSON string.
-
evaluate
public ConditionDecision evaluate(String realm, Subject subject, String resourceName, Map<String,Set<String>> environment) throws EntitlementException
Description copied from interface:EntitlementConditionReturns condition decision.- Parameters:
realm- Realm Name.subject- Subject who is under evaluation.resourceName- Resource name.environment- Environment parameters.- Returns:
- resulting condition decision.
- Throws:
EntitlementException- if cannot get condition decision.
-
setAttributeName
public void setAttributeName(String attributeName)
-
setCaseSensitive
public void setCaseSensitive(boolean flag)
-
setValue
public void setValue(String value)
-
getAttributeName
public String getAttributeName()
-
isCaseSensitive
public boolean isCaseSensitive()
-
getValue
public String getValue()
-
equals
public boolean equals(Object obj)
Description copied from class:EntitlementConditionAdaptorReturnstrueif 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()
Description copied from class:EntitlementConditionAdaptorReturns 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.
-
-