Interface SessionStore<A,B extends Session<A>>
- Type Parameters:
A
- the session data typeB
- the session type
- All Known Subinterfaces:
BasicSessionStore<A>
,JWTSessionStore<A,
B>
- All Known Implementing Classes:
AbstractSessionStore
,InMemoryBasicSessionStore
,InMemoryJWTSessionStore
,RedisBasicSessionStore
,RedisJWTSessionStore
A session store is used to create, get, save, move and remove session and its data uniquely identified by a session id in a data store.
- Since:
- 1.13
- Author:
- Jeremy Kuhn
-
Method Summary
Modifier and TypeMethodDescriptioncreate()
Creates a new session in the session store.Returns the session identified by the specified session id.Returns the data of the session identified by the specified session id.Moves the session identified by the specified identifier to a new identifier.Removes the session identified by the specified identifier.Saves the specified session.
-
Method Details
-
create
Creates a new session in the session store.
This shall physically create a new session in the data store.
- Returns:
- a mono for creating a session
-
get
Returns the session identified by the specified session id.
- Parameters:
sessionId
- a session id- Returns:
- a mono emitting the session or an empty mono if no session exists with the specified identifier
-
getData
Returns the data of the session identified by the specified session id.
- Parameters:
sessionId
- a session id- Returns:
- a mono emitting the session data or an empty mono if no session exists with specified identifier or if a session exists which does not define any data
-
move
Moves the session identified by the specified identifier to a new identifier.
- Parameters:
sessionId
- a session idnewSessionId
- a new session id- Returns:
- a mono for moving a session
- Throws:
IllegalStateException
- if there is no session with the specified identifier or if a session already exists at the specified new identifier
-
remove
Removes the session identified by the specified identifier.
- Parameters:
sessionId
- a session id- Returns:
- a mono for removing a session
-
save
Saves the specified session.
Whether resolved session data are saved along with the session is implementation specific. Implementors must however at least guarantee that data that is explicitly set on a session using
Session.setData(Object)
are saved.- Parameters:
session
- a session- Returns:
- a mono for saving a session
- Throws:
IllegalArgumentException
- if the specified session does not originate from this session storeIllegalStateException
- if the specified session does not exist in the store or if it was invalidated
-