Class VaadinSessionNotificationEventPublisher

java.lang.Object
io.jmix.notificationsflowui.event.VaadinSessionNotificationEventPublisher
All Implemented Interfaces:
UserSessionNotifier, org.springframework.beans.factory.Aware, org.springframework.context.ApplicationContextAware

@Component("ntf_VaadinSessionNotificationEventPublisher") public class VaadinSessionNotificationEventPublisher extends Object implements UserSessionNotifier, org.springframework.context.ApplicationContextAware
Allows to notify active Vaadin sessions.
  • Field Details

    • applicationContext

      protected org.springframework.context.ApplicationContext applicationContext
    • systemAuthenticator

      protected final SystemAuthenticator systemAuthenticator
  • Constructor Details

    • VaadinSessionNotificationEventPublisher

      public VaadinSessionNotificationEventPublisher(SystemAuthenticator systemAuthenticator)
  • Method Details

    • setApplicationContext

      public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) throws org.springframework.beans.BeansException
      Specified by:
      setApplicationContext in interface org.springframework.context.ApplicationContextAware
      Throws:
      org.springframework.beans.BeansException
    • onSessionInitialized

      @EventListener public void onSessionInitialized(io.jmix.notificationsflowui.event.NotificationsServiceInitListener.SessionInitializedEvent event)
      Handles NotificationsServiceInitListener.SessionInitializedEvent to collect new active Vaadin sessions.
      Parameters:
      event - session initialized event
    • notifyUserSession

      public void notifyUserSession(String username)
      Description copied from interface: UserSessionNotifier
      Notifies session (if active) of specific user
      Specified by:
      notifyUserSession in interface UserSessionNotifier
      Parameters:
      username - username
    • notifyAllUserSessions

      public void notifyAllUserSessions()
      Description copied from interface: UserSessionNotifier
      Notifies all active sessions
      Specified by:
      notifyAllUserSessions in interface UserSessionNotifier
    • publishEvent

      protected void publishEvent(VaadinSessionNotificationEvent event)
    • onSessionAccess

      protected void onSessionAccess(com.vaadin.flow.server.VaadinSession session, VaadinSessionNotificationEvent event)
    • getUsernameFromVaadinSession

      @Nullable protected String getUsernameFromVaadinSession(com.vaadin.flow.server.VaadinSession session)