|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface SecurityContextRepository
Strategy used for persisting a SecurityContext
between requests.
Used by SecurityContextPersistenceFilter
to obtain the context which should be used for the current thread
of execution and to store the context once it has been removed from thread-local storage and the request has
completed.
The persistence mechanism used will depend on the implementation, but most commonly the HttpSession will be used to store the context.
SecurityContextPersistenceFilter
,
HttpSessionSecurityContextRepository
,
SaveContextOnUpdateOrErrorResponseWrapper
Method Summary | |
---|---|
boolean |
containsContext(HttpServletRequest request)
Allows the repository to be queried as to whether it contains a security context for the current request. |
SecurityContext |
loadContext(HttpRequestResponseHolder requestResponseHolder)
Obtains the security context for the supplied request. |
void |
saveContext(SecurityContext context,
HttpServletRequest request,
HttpServletResponse response)
Stores the security context on completion of a request. |
Method Detail |
---|
SecurityContext loadContext(HttpRequestResponseHolder requestResponseHolder)
The use of the HttpRequestResponseHolder parameter allows implementations to return wrapped versions of
the request or response (or both), allowing them to access implementation-specific state for the request.
The values obtained from the holder will be passed on to the filter chain and also to the saveContext
method when it is finally called. Implementations may wish to return a subclass of
SaveContextOnUpdateOrErrorResponseWrapper
as the response object, which guarantees that the context is
persisted when an error or redirect occurs.
requestResponseHolder
- holder for the current request and response for which the context should be loaded.
void saveContext(SecurityContext context, HttpServletRequest request, HttpServletResponse response)
context
- the non-null context which was obtained from the holder.request
- response
- boolean containsContext(HttpServletRequest request)
request
- the current request
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |