Class PushSessionTracker

java.lang.Object
com.vaadin.kubernetes.starter.sessiontracker.push.PushSessionTracker
All Implemented Interfaces:
PushSendListener

public class PushSessionTracker extends Object implements PushSendListener
A PushSendListener that serialize HTTP session when messages are pushed to the client. It has the same scope of SessionTrackerFilter but for PUSH communication.
  • Constructor Details

  • Method Details

    • setActiveSessionChecker

      public void setActiveSessionChecker(Predicate<String> activeSessionChecker)
      Sets the active HTTP session checker.
      Parameters:
      activeSessionChecker - active HTTP session checker.
    • canPush

      public boolean canPush()
      Description copied from interface: PushSendListener
      Determines if a push operation should be performed or not.

      This method is invoked before the actual push operation is performed. Implementors can decide to block the operation and thus postpone the application of pending changes to the UI. Preventing PUSH is useful, for example, when a server is shutting down, to prevent disalignments between the server and the client while the session is transferred to another server.

      The default implementation always returns true.

      Specified by:
      canPush in interface PushSendListener
      Returns:
      true if the current push operation should be performed, false otherwise.
    • onConnect

      public void onConnect(org.atmosphere.cpr.AtmosphereResource resource)
      Description copied from interface: PushSendListener
      Invoked when a new PUSH connection is established.
      Specified by:
      onConnect in interface PushSendListener
      Parameters:
      resource - the AtmosphereResource behind the PUSH connection.
    • onMessageSent

      public void onMessageSent(org.atmosphere.cpr.AtmosphereResource resource)
      Description copied from interface: PushSendListener
      Invoked whenever a UIDL message has been sent to the client.
      Specified by:
      onMessageSent in interface PushSendListener
      Parameters:
      resource - the AtmosphereResource used to process the message