public class DefaultWebSessionManager extends java.lang.Object implements WebSessionManager
WebSessionManager
delegating to a
WebSessionIdResolver
for session id resolution and to a
WebSessionStore
Modifier and Type | Field and Description |
---|---|
private WebSessionIdResolver |
sessionIdResolver |
private WebSessionStore |
sessionStore |
Constructor and Description |
---|
DefaultWebSessionManager() |
Modifier and Type | Method and Description |
---|---|
<any> |
getSession(ServerWebExchange exchange)
Return the
WebSession for the given exchange. |
WebSessionIdResolver |
getSessionIdResolver()
Return the configured
WebSessionIdResolver . |
WebSessionStore |
getSessionStore()
Return the configured
WebSessionStore . |
private <any> |
retrieveSession(ServerWebExchange exchange) |
private <any> |
save(ServerWebExchange exchange,
WebSession session) |
void |
setSessionIdResolver(WebSessionIdResolver sessionIdResolver)
Configure the id resolution strategy.
|
void |
setSessionStore(WebSessionStore sessionStore)
Configure the persistence strategy.
|
private WebSessionIdResolver sessionIdResolver
private WebSessionStore sessionStore
public void setSessionIdResolver(WebSessionIdResolver sessionIdResolver)
By default an instance of CookieWebSessionIdResolver
.
sessionIdResolver
- the resolver to usepublic WebSessionIdResolver getSessionIdResolver()
WebSessionIdResolver
.public void setSessionStore(WebSessionStore sessionStore)
By default an instance of InMemoryWebSessionStore
.
sessionStore
- the persistence strategy to usepublic WebSessionStore getSessionStore()
WebSessionStore
.public <any> getSession(ServerWebExchange exchange)
WebSessionManager
WebSession
for the given exchange. Always guaranteed
to return an instance either matching to the session id requested by the
client, or a new session either because the client did not specify one
or because the underlying session expired.getSession
in interface WebSessionManager
exchange
- the current exchangeprivate <any> retrieveSession(ServerWebExchange exchange)
private <any> save(ServerWebExchange exchange, WebSession session)