Class BackChannelLogoutSubscription

java.lang.Object
com.vaadin.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.
  • Constructor Details

    • BackChannelLogoutSubscription

      public BackChannelLogoutSubscription()
  • Method Details

    • onApplicationEvent

      public void onApplicationEvent(UserLogoutEvent event)
      When an UserLogoutEvent is received, broadcast the event to all subscribed clients.
      Specified by:
      onApplicationEvent in interface org.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

      public boolean broadcast(Object principal)
      Broadcast a back-channel logout event
      Parameters:
      principal - the user that accepts the logout event.
      Returns:
      true if broadcast succeeds, false otherwise.