Module io.inverno.mod.session.http
Interface JWTSessionContext<A,B>
- Type Parameters:
A
- the session data typeB
- the stateless session data type
- All Superinterfaces:
ExchangeContext
,SessionContext<A,
JWTSession<A, B>>
- All Known Subinterfaces:
JWTSessionContext.Intercepted<A,
,B> JWTSessionSecurityContext<A,
,B, C, D> JWTSessionSecurityContext.Intercepted<A,
B, C, D>
A session context for exposing basic sessions.
It basically fixes the session type to JWTSession
in order to simplify configuration in an application that relies on JWT sessions to be able to use stateless session data.
- Since:
- 1.13
- Author:
- Jeremy Kuhn
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interface
An intercepted JWT session context used by the session interceptor to populate the session context with a JWT session. -
Method Summary
Modifier and TypeMethodDescriptionReturns the stateless session data.getStatelessSessionData
(Supplier<B> supplier) Returns the stateless session data or creates them using the specified supplier if none exist in the session.Methods inherited from interface io.inverno.mod.http.base.ExchangeContext
init
Methods inherited from interface io.inverno.mod.session.http.context.SessionContext
getSession, getSessionData, getSessionData, isSessionPresent
-
Method Details
-
getStatelessSessionData
Returns the stateless session data.
This is a shortcut for
context.getSession().flatMap(JWTSession::getStatelessData)
and as a result a new session is created when if none is present.- Returns:
- a mono emitting stateless session data or an empty mono if none exist in the session or if a new session was created
-
getStatelessSessionData
Returns the stateless session data or creates them using the specified supplier if none exist in the session.
- Parameters:
supplier
- a stateless session data supplier- Returns:
- a mono emitting stateless session data
-