Package org.forgerock.services.context
Class AttributesContext
- java.lang.Object
-
- org.forgerock.services.context.AbstractContext
-
- org.forgerock.services.context.AttributesContext
-
- All Implemented Interfaces:
Context
public final class AttributesContext extends AbstractContext
AnAttributesContext
is a mechanism for transferring transient state between components when processing a single request. For example, a filter may store information about the end-user in theAttributeContext
which can then be accessed in subsequent filters and handlers in order to perform access control decisions, routing decisions, etc.The
AttributesContext
has the same life-cycle as the request with which it is associated. Specifically, any attributes stored when processing one request will not be accessible when processing a subsequent request, even if it is from the same logical client.Use a
SessionContext
for maintaining state between successive requests from the same logical client.
-
-
Field Summary
-
Fields inherited from class org.forgerock.services.context.AbstractContext
data
-
-
Constructor Summary
Constructors Constructor Description AttributesContext(JsonValue savedContext, ClassLoader classLoader)
Restore from JSON representation.AttributesContext(Context parent)
Constructs a newAttributesContext
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Map<String,Object>
getAttributes()
Returns the attributes associated with the current request.-
Methods inherited from class org.forgerock.services.context.AbstractContext
as, asContext, containsContext, containsContext, get, getContext, getContextName, getId, getParent, getRootId, isRootContext, toJsonValue, toString
-
-
-
-
Constructor Detail
-
AttributesContext
public AttributesContext(Context parent)
Constructs a newAttributesContext
.- Parameters:
parent
- The parentContext
.
-
AttributesContext
public AttributesContext(JsonValue savedContext, ClassLoader classLoader)
Restore from JSON representation.- Parameters:
savedContext
- The JSON representation from which this context's attributes should be parsed.classLoader
- The ClassLoader which can properly resolve the persisted class-name.
-
-