S - the Session typepublic class SpringSessionWebSessionStore<S extends Session>
extends java.lang.Object
implements org.springframework.web.server.session.WebSessionStore
WebSessionStore implementation that provides the WebSession
implementation backed by a Session returned by the
ReactiveSessionRepository.| Constructor and Description |
|---|
SpringSessionWebSessionStore(ReactiveSessionRepository<S> reactiveSessionRepository) |
| Modifier and Type | Method and Description |
|---|---|
reactor.core.publisher.Mono<org.springframework.web.server.WebSession> |
createWebSession() |
reactor.core.publisher.Mono<java.lang.Void> |
removeSession(java.lang.String sessionId) |
reactor.core.publisher.Mono<org.springframework.web.server.WebSession> |
retrieveSession(java.lang.String sessionId) |
void |
setClock(java.time.Clock clock)
Configure the
Clock to use to set lastAccessTime on every created session
and to calculate if it is expired. |
reactor.core.publisher.Mono<org.springframework.web.server.WebSession> |
updateLastAccessTime(org.springframework.web.server.WebSession session) |
public SpringSessionWebSessionStore(ReactiveSessionRepository<S> reactiveSessionRepository)
public void setClock(java.time.Clock clock)
Clock to use to set lastAccessTime on every created session
and to calculate if it is expired.
This may be useful to align to different timezone or to set the clock back in a
test, e.g. Clock.offset(clock, Duration.ofMinutes(-31)) in order to
simulate session expiration.
By default this is Clock.system(ZoneId.of("GMT")).
clock - the clock to usepublic reactor.core.publisher.Mono<org.springframework.web.server.WebSession> createWebSession()
createWebSession in interface org.springframework.web.server.session.WebSessionStorepublic reactor.core.publisher.Mono<org.springframework.web.server.WebSession> updateLastAccessTime(org.springframework.web.server.WebSession session)
updateLastAccessTime in interface org.springframework.web.server.session.WebSessionStorepublic reactor.core.publisher.Mono<org.springframework.web.server.WebSession> retrieveSession(java.lang.String sessionId)
retrieveSession in interface org.springframework.web.server.session.WebSessionStorepublic reactor.core.publisher.Mono<java.lang.Void> removeSession(java.lang.String sessionId)
removeSession in interface org.springframework.web.server.session.WebSessionStore