public final class NullSecurityContextRepository extends Object implements SecurityContextRepository
Constructor and Description |
---|
NullSecurityContextRepository() |
Modifier and Type | Method and Description |
---|---|
boolean |
containsContext(javax.servlet.http.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,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Stores the security context on completion of a request.
|
public boolean containsContext(javax.servlet.http.HttpServletRequest request)
SecurityContextRepository
containsContext
in interface SecurityContextRepository
request
- the current requestpublic SecurityContext loadContext(HttpRequestResponseHolder requestResponseHolder)
SecurityContextRepository
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.
loadContext
in interface SecurityContextRepository
requestResponseHolder
- holder for the current request and response for which
the context should be loaded.public void saveContext(SecurityContext context, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
SecurityContextRepository
saveContext
in interface SecurityContextRepository
context
- the non-null context which was obtained from the holder.