Class MessageContextImpl
- java.lang.Object
-
- org.forgerock.services.context.AbstractContext
-
- org.forgerock.caf.authentication.framework.MessageContextImpl
-
- All Implemented Interfaces:
MessageContext
,MessageInfoContext
,Context
public final class MessageContextImpl extends AbstractContext implements MessageContext
An implementation ofMessageContext
that holds contextual information and state for a given request and response message exchange.- Since:
- 2.0.0
- See Also:
MessageContext
,MessageInfoContext
-
-
Field Summary
-
Fields inherited from class org.forgerock.services.context.AbstractContext
data
-
-
Constructor Summary
Constructors Constructor Description MessageContextImpl(JsonValue savedContext, ClassLoader classLoader)
Creates a new context from the JSON representation of a previously persisted context.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AuditTrail
getAuditTrail()
Gets theAuditTrail
instance for this message exchange.Request
getRequest()
Gets the request object from thisMessageContextInfo
.Map<String,Object>
getRequestContextMap()
Gets the context map for this message exchange.Response
getResponse()
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 Detail
-
MessageContextImpl
public MessageContextImpl(JsonValue savedContext, ClassLoader classLoader)
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 Detail
-
getRequest
public Request getRequest()
Description copied from interface:MessageInfoContext
Gets the request object from thisMessageContextInfo
.- Specified by:
getRequest
in interfaceMessageInfoContext
- Returns:
- The
Request
object.
-
setRequest
public void setRequest(Request request)
Description copied from interface:MessageInfoContext
Sets the request object for thisMessageContextInfo
.- Specified by:
setRequest
in interfaceMessageInfoContext
- Parameters:
request
- TheRequest
object.
-
getResponse
public Response getResponse()
Description copied from interface:MessageInfoContext
Gets the response object from thisMessageContextInfo
.- Specified by:
getResponse
in interfaceMessageInfoContext
- Returns:
- The
Response
object.
-
setResponse
public void setResponse(Response response)
Description copied from interface:MessageInfoContext
Sets the response object for thisMessageContextInfo
.- Specified by:
setResponse
in interfaceMessageInfoContext
- Parameters:
response
- TheResponse
object.
-
getRequestContextMap
public Map<String,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
public AuditTrail getAuditTrail()
Description copied from interface:MessageContext
Gets theAuditTrail
instance for this message exchange.- Specified by:
getAuditTrail
in interfaceMessageContext
- Returns:
- The
AuditTrail
-
getState
public <T extends AuthenticationState> T getState(AsyncServerAuthContext authContext)
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.
-
-