Package org.forgerock.openam.entitlement
Class PrivilegeEvaluatorContext
- java.lang.Object
-
- org.forgerock.openam.entitlement.PrivilegeEvaluatorContext
-
- All Implemented Interfaces:
Serializable
@SupportedAll public class PrivilegeEvaluatorContext extends Object implements Serializable
Holds the context of the policy evaluation making it available to policy conditions.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description PrivilegeEvaluatorContext(String realm, String resourceName, String applicationName)
Creates a new Privilege Evaluator Context
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getApplicationName()
Return the application nameObject
getAttribute(String key)
Fetch an attribute from the mapMap<String,ConditionDecision>
getConditionDecisionCache()
Return the condition decision cache.static PrivilegeEvaluatorContext
getCurrent()
Returns the current context of the running threadString
getRealm()
Return the realmString
getResourceName()
Return the resource namevoid
setAttribute(String key, Object value)
Set an attribute on the contextstatic void
setCurrent(PrivilegeEvaluatorContext ctx)
Set the current context of the running thread
-
-
-
Constructor Detail
-
PrivilegeEvaluatorContext
public PrivilegeEvaluatorContext(String realm, String resourceName, String applicationName)
Creates a new Privilege Evaluator Context- Parameters:
realm
- The realm of the policy evaluationresourceName
- The resource being evaluatedapplicationName
- The application being evaluated
-
-
Method Detail
-
getCurrent
public static PrivilegeEvaluatorContext getCurrent()
Returns the current context of the running thread- Returns:
- object containing the current context
-
setCurrent
public static void setCurrent(PrivilegeEvaluatorContext ctx)
Set the current context of the running thread
-
getRealm
public String getRealm()
Return the realm- Returns:
- The realm
-
getResourceName
public String getResourceName()
Return the resource name- Returns:
- The resource name
-
getApplicationName
public String getApplicationName()
Return the application name- Returns:
- The application name
-
setAttribute
public void setAttribute(String key, Object value)
Set an attribute on the context- Parameters:
key
- The key of the attributevalue
- The value
-
getAttribute
public Object getAttribute(String key)
Fetch an attribute from the map- Parameters:
key
- The key of the attribute- Returns:
- The value
-
getConditionDecisionCache
public Map<String,ConditionDecision> getConditionDecisionCache()
Return the condition decision cache.- Returns:
- the condition decision cache.
-
-