Class MessageContextImpl
java.lang.Object
org.forgerock.services.context.AbstractContext
org.forgerock.caf.authentication.framework.MessageContextImpl
- All Implemented Interfaces:
MessageContext
,MessageInfoContext
,Context
An implementation of
MessageContext
that holds contextual information and state for a
given request and response message exchange.- Since:
- 2.0.0
- See Also:
-
Field Summary
Fields inherited from class org.forgerock.services.context.AbstractContext
data
-
Constructor Summary
ConstructorDescriptionMessageContextImpl
(JsonValue savedContext, ClassLoader classLoader) Creates a new context from the JSON representation of a previously persisted context. -
Method Summary
Modifier and TypeMethodDescriptionGets theAuditTrail
instance for this message exchange.Gets the request object from thisMessageContextInfo
.Gets the context map for this message exchange.Gets the response object from thisMessageContextInfo
.<T extends AuthenticationState>
TgetState
(AsyncServerAuthContext authContext) Gets theAuthenticationState
instance that maintains any stateful information for the providedAsyncServerAuthContext
.void
setRequest
(Request request) Sets the request object for thisMessageContextInfo
.void
setResponse
(Response response) Sets the response object for thisMessageContextInfo
.Methods inherited from class org.forgerock.services.context.AbstractContext
as, asContext, containsContext, containsContext, get, getContext, getContextName, getId, getParent, getRootId, isRootContext, toJsonValue, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.forgerock.services.context.Context
as, asContext, containsContext, containsContext, get, getContext, getContextName, getId, getParent, getRootId, isRootContext, toJsonValue
-
Constructor Details
-
MessageContextImpl
Creates a new context from the JSON representation of a previously persisted context.- 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.
-
-
Method Details
-
getRequest
Description copied from interface:MessageInfoContext
Gets the request object from thisMessageContextInfo
.- Specified by:
getRequest
in interfaceMessageInfoContext
- Returns:
- The
Request
object.
-
setRequest
Description copied from interface:MessageInfoContext
Sets the request object for thisMessageContextInfo
.- Specified by:
setRequest
in interfaceMessageInfoContext
- Parameters:
request
- TheRequest
object.
-
getResponse
Description copied from interface:MessageInfoContext
Gets the response object from thisMessageContextInfo
.- Specified by:
getResponse
in interfaceMessageInfoContext
- Returns:
- The
Response
object.
-
setResponse
Description copied from interface:MessageInfoContext
Sets the response object for thisMessageContextInfo
.- Specified by:
setResponse
in interfaceMessageInfoContext
- Parameters:
response
- TheResponse
object.
-
getRequestContextMap
Description copied from interface:MessageInfoContext
Gets the context map for this message exchange.
This
Map
can contain shared information betweenAsyncServerAuthContext
s andAsyncServerAuthModule
s which will be maintained for a single request.- Specified by:
getRequestContextMap
in interfaceMessageInfoContext
- Returns:
- The request context map.
-
getAuditTrail
Description copied from interface:MessageContext
Gets theAuditTrail
instance for this message exchange.- Specified by:
getAuditTrail
in interfaceMessageContext
- Returns:
- The
AuditTrail
-
getState
Description copied from interface:MessageContext
Gets theAuthenticationState
instance that maintains any stateful information for the providedAsyncServerAuthContext
.- Specified by:
getState
in interfaceMessageContext
- Type Parameters:
T
- The type of state class.- Parameters:
authContext
- TheAsyncServerAuthContext
for which the state applies.- Returns:
- The
AuthenticationState
instance.
-