Module io.inverno.mod.session.http
Package io.inverno.mod.session.http
Interface SessionInjector<A,B extends Session<A>,C extends ExchangeContext,D extends Exchange<C>>
- Type Parameters:
A
- the session data typeB
- the session typeC
- the exchange context typeD
- the exchange type
- All Known Implementing Classes:
CookieSessionInjector
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface
public interface SessionInjector<A,B extends Session<A>,C extends ExchangeContext,D extends Exchange<C>>
A session injector injects or removes the session identifier from an exchange.
It is used by the SessionInterceptor
to inject the session identifier in the exchange when a new session is created or if the session identifier has been refreshed and to remove the session
identifier from the exchange when the session has been invalidated.
- Since:
- 1.13
- Author:
- Jeremy Kuhn
-
Method Summary
Modifier and TypeMethodDescriptiondefault SessionInjector
<A, B, C, D> Invokes this session injector and then invokes the specified session injector.default SessionInjector
<A, B, C, D> Invokes the specified session injector and then invokes this session injector.Injects the specified session into the exchange.static <A,
B extends Session<A>, C extends ExchangeContext, D extends Exchange<C>>
SessionInjector<A, B, C, D> of
(SessionInjector<? super A, ? super B, ? super C, ? super D>... injectors) Returns a composed session injector that invokes the specified injectors in sequence.Removes the session from the exchange.
-
Method Details
-
inject
Injects the specified session into the exchange.
- Parameters:
exchange
- the exchangesession
- the session- Returns:
- a mono which completes when the session has been injected
-
remove
Removes the session from the exchange.
- Parameters:
exchange
- the exchange- Returns:
- a mono which completes when the session has been removed
-
andThen
default SessionInjector<A,B, andThenC, D> (SessionInjector<? super A, ? super B, ? super C, ? super D> after) Invokes this session injector and then invokes the specified session injector.
- Parameters:
after
- the injector to invoke after this injector- Returns:
- a composed session injector that invokes in sequence this injector followed by the specified injector
-
compose
default SessionInjector<A,B, composeC, D> (SessionInjector<? super A, ? super B, ? super C, ? super D> before) Invokes the specified session injector and then invokes this session injector.
- Parameters:
before
- the injector to invoke before this injector- Returns:
- a composed session injector that invokes in sequence the specified injector followed by this injector
-
of
@SafeVarargs static <A,B extends Session<A>, SessionInjector<A,C extends ExchangeContext, D extends Exchange<C>> B, ofC, D> (SessionInjector<? super A, ? super B, ? super C, ? super D>... injectors) Returns a composed session injector that invokes the specified injectors in sequence.
- Type Parameters:
A
- the session data typeB
- the session typeC
- the exchange context typeD
- the exchange type- Parameters:
injectors
- the list of injectors to invoke in sequence- Returns:
- a composed session injector that invokes the specified injectors in sequence
-