Class LogoutActionHandler<A extends Authentication,B extends Identity,C extends AccessController,D extends SecurityContext<B,C>,E extends Exchange<D>>
- Type Parameters:
A
- the authentication typeB
- the identity typeC
- the access controller typeD
- the security context typeE
- the exchange type
- All Implemented Interfaces:
ExchangeHandler<D,
,E> ReactiveExchangeHandler<D,
E>
An exchange handler that logs out a logged in entity and delegates further processing to a success handler.
A logout action handler is used whenever there is a need to explicitly invalidate an authentication (e.g. invalidate a token credentials) or free resources locked by that authentication (e.g.
remove a session). It uses an AuthenticationReleaser
to release the authentication and a LogoutSuccessHandler
to handle successful logouts.
- Since:
- 1.5
- Author:
- Jeremy Kuhn
-
Constructor Summary
ConstructorDescriptionLogoutActionHandler
(AuthenticationReleaser<A> authenticationReleaser) Creates a logout action handler with the specified authentication releaser.LogoutActionHandler
(AuthenticationReleaser<A> authenticationReleaser, LogoutSuccessHandler<A, B, C, D, E> logoutSuccessHandler) Creates a logout action handler with the specified authentication releaser and logout success handler. -
Method Summary
Modifier and TypeMethodDescriptionBy default, returns a Mono that defers the execution ofExchangeHandler.handle(io.inverno.mod.http.server.Exchange)
.Returns the authentication releaser.Returns the logout success handler.void
Processes the specified server exchange.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.inverno.mod.http.server.ReactiveExchangeHandler
intercept
-
Constructor Details
-
LogoutActionHandler
Creates a logout action handler with the specified authentication releaser.
- Parameters:
authenticationReleaser
- an authentication releaser
-
LogoutActionHandler
public LogoutActionHandler(AuthenticationReleaser<A> authenticationReleaser, LogoutSuccessHandler<A, B, C, D, E> logoutSuccessHandler) Creates a logout action handler with the specified authentication releaser and logout success handler.
- Parameters:
authenticationReleaser
- an authentication releaserlogoutSuccessHandler
- a logout success handler
-
-
Method Details
-
getAuthenticationReleaser
Returns the authentication releaser.
- Returns:
- the authentication releaser
-
getLogoutSuccessHandler
Returns the logout success handler.
- Returns:
- the logout success handler
-
defer
Description copied from interface:ExchangeHandler
By default, returns a Mono that defers the execution of
ExchangeHandler.handle(io.inverno.mod.http.server.Exchange)
.- Specified by:
defer
in interfaceExchangeHandler<A extends Authentication,
B extends Identity> - Specified by:
defer
in interfaceReactiveExchangeHandler<A extends Authentication,
B extends Identity> - Parameters:
exchange
- the exchange to process- Returns:
- an empty mono that completes when the exchange has been processed
-
handle
Description copied from interface:ExchangeHandler
Processes the specified server exchange.
This method is more convenient than
ExchangeHandler.defer(io.inverno.mod.http.server.Exchange)
when the handling logic does not need to be reactive.- Specified by:
handle
in interfaceExchangeHandler<A extends Authentication,
B extends Identity> - Parameters:
exchange
- the exchange to process- Throws:
HttpException
- if an error occurs during the processing of the exchange
-