Package org.forgerock.openam.entitlement
Class PrivilegeEvaluatorContext
- java.lang.Object
-
- org.forgerock.openam.entitlement.PrivilegeEvaluatorContext
-
- All Implemented Interfaces:
Serializable
public class PrivilegeEvaluatorContext extends Object implements Serializable
Holds the context of the policy evaluation making it available to policy conditions.- Author:
- Steve Ferris steve.ferris@forgerock.com
- 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 StringgetApplicationName()Return the application nameObjectgetAttribute(String key)Fetch an attribute from the mapcom.google.common.cache.Cache<String,ConditionDecision>getConditionDecisionCache()Return the condition decision cache.static PrivilegeEvaluatorContextgetCurrent()Returns the current context of the running threadStringgetRealm()Return the realmStringgetResourceName()Return the resource namevoidsetAttribute(String key, Object value)Set an attribute on the contextstatic voidsetCurrent(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 com.google.common.cache.Cache<String,ConditionDecision> getConditionDecisionCache()
Return the condition decision cache.- Returns:
- the condition decision cache.
-
-