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 ofMessageContextthat 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 AuditTrailgetAuditTrail()Gets theAuditTrailinstance for this message exchange.RequestgetRequest()Gets the request object from thisMessageContextInfo.Map<String,Object>getRequestContextMap()Gets the context map for this message exchange.ResponsegetResponse()Gets the response object from thisMessageContextInfo.<T extends AuthenticationState>
TgetState(AsyncServerAuthContext authContext)Gets theAuthenticationStateinstance that maintains any stateful information for the providedAsyncServerAuthContext.voidsetRequest(Request request)Sets the request object for thisMessageContextInfo.voidsetResponse(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:MessageInfoContextGets the request object from thisMessageContextInfo.- Specified by:
getRequestin interfaceMessageInfoContext- Returns:
- The
Requestobject.
-
setRequest
public void setRequest(Request request)
Description copied from interface:MessageInfoContextSets the request object for thisMessageContextInfo.- Specified by:
setRequestin interfaceMessageInfoContext- Parameters:
request- TheRequestobject.
-
getResponse
public Response getResponse()
Description copied from interface:MessageInfoContextGets the response object from thisMessageContextInfo.- Specified by:
getResponsein interfaceMessageInfoContext- Returns:
- The
Responseobject.
-
setResponse
public void setResponse(Response response)
Description copied from interface:MessageInfoContextSets the response object for thisMessageContextInfo.- Specified by:
setResponsein interfaceMessageInfoContext- Parameters:
response- TheResponseobject.
-
getRequestContextMap
public Map<String,Object> getRequestContextMap()
Description copied from interface:MessageInfoContextGets the context map for this message exchange.
This
Mapcan contain shared information betweenAsyncServerAuthContexts andAsyncServerAuthModules which will be maintained for a single request.- Specified by:
getRequestContextMapin interfaceMessageInfoContext- Returns:
- The request context map.
-
getAuditTrail
public AuditTrail getAuditTrail()
Description copied from interface:MessageContextGets theAuditTrailinstance for this message exchange.- Specified by:
getAuditTrailin interfaceMessageContext- Returns:
- The
AuditTrail
-
getState
public <T extends AuthenticationState> T getState(AsyncServerAuthContext authContext)
Description copied from interface:MessageContextGets theAuthenticationStateinstance that maintains any stateful information for the providedAsyncServerAuthContext.- Specified by:
getStatein interfaceMessageContext- Type Parameters:
T- The type of state class.- Parameters:
authContext- TheAsyncServerAuthContextfor which the state applies.- Returns:
- The
AuthenticationStateinstance.
-
-