Package dev.hilla.sso.starter
Class BackChannelLogoutSubscription
java.lang.Object
dev.hilla.sso.starter.BackChannelLogoutSubscription
- All Implemented Interfaces:
EventListener,org.springframework.context.ApplicationListener<UserLogoutEvent>
public class BackChannelLogoutSubscription
extends Object
implements org.springframework.context.ApplicationListener<UserLogoutEvent>
A subscription for broadcasting back-channel logout events to the subscribed
clients.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classThe message returned by the flux. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanBroadcast a back-channel logout eventreactor.core.publisher.Flux<BackChannelLogoutSubscription.Message>getFluxForUser(Object principal) Create a filtered Flux for the given user.voidWhen anUserLogoutEventis received, broadcast the event to all subscribed clients.
-
Constructor Details
-
BackChannelLogoutSubscription
public BackChannelLogoutSubscription()
-
-
Method Details
-
onApplicationEvent
When anUserLogoutEventis received, broadcast the event to all subscribed clients.- Specified by:
onApplicationEventin interfaceorg.springframework.context.ApplicationListener<UserLogoutEvent>- Parameters:
event- the event to broadcast.
-
getFluxForUser
public reactor.core.publisher.Flux<BackChannelLogoutSubscription.Message> getFluxForUser(Object principal) Create a filtered Flux for the given user.- Parameters:
principal- the user to filter the Flux for.- Returns:
- a Flux that only concerns the given user.
-
broadcast
Broadcast a back-channel logout event- Parameters:
principal- the user that accepts the logout event.- Returns:
- true if broadcast succeeds, false otherwise.
-