接口 WebSessionStore
- 所有已知实现类:
InMemoryWebSessionStore
public interface WebSessionStore
Strategy forWebSessionpersistence.- 从以下版本开始:
- 5.0
- 作者:
- Rossen Stoyanchev, Rob Winch
方法概要
所有方法 实例方法 抽象方法 修饰符和类型 方法 说明 reactor.core.publisher.Mono<WebSession>createWebSession()Create a new WebSession.reactor.core.publisher.Mono<Void>removeSession(String sessionId)Remove the WebSession for the specified id.reactor.core.publisher.Mono<WebSession>retrieveSession(String sessionId)Return the WebSession for the given id.reactor.core.publisher.Mono<WebSession>updateLastAccessTime(WebSession webSession)Update the last accessed timestamp to "now".
方法详细资料
createWebSession
reactor.core.publisher.Mono<WebSession> createWebSession()
Create a new WebSession.Note that this does nothing more than create a new instance. The session can later be started explicitly via
WebSession.start()or implicitly by adding attributes -- and then persisted viaWebSession.save().- 返回:
- the created session instance
retrieveSession
reactor.core.publisher.Mono<WebSession> retrieveSession(String sessionId)
Return the WebSession for the given id.Note: This method should perform an expiration check, and if it has expired remove the session and return empty. This method should also update the lastAccessTime of retrieved sessions.
- 参数:
sessionId- the session to load- 返回:
- the session, or an empty
Mono.
removeSession
reactor.core.publisher.Mono<Void> removeSession(String sessionId)
Remove the WebSession for the specified id.- 参数:
sessionId- the id of the session to remove- 返回:
- a completion notification (success or error)
updateLastAccessTime
reactor.core.publisher.Mono<WebSession> updateLastAccessTime(WebSession webSession)
Update the last accessed timestamp to "now".- 参数:
webSession- the session to update- 返回:
- the session with the updated last access time