Class PushSessionTracker
java.lang.Object
com.vaadin.kubernetes.starter.sessiontracker.push.PushSessionTracker
- All Implemented Interfaces:
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 Summary
ConstructorsConstructorDescriptionPushSessionTracker(SessionSerializer sessionSerializer) Deprecated, for removal: This API element is subject to removal in a future version.PushSessionTracker(SessionSerializer sessionSerializer, String clusterCookieName) -
Method Summary
Modifier and TypeMethodDescriptionbooleancanPush()Determines if a push operation should be performed or not.voidonConnect(org.atmosphere.cpr.AtmosphereResource resource) Invoked when a new PUSH connection is established.voidonMessageSent(org.atmosphere.cpr.AtmosphereResource resource) Invoked whenever a UIDL message has been sent to the client.voidsetActiveSessionChecker(Predicate<String> activeSessionChecker) Sets the active HTTP session checker.
-
Constructor Details
-
PushSessionTracker
Deprecated, for removal: This API element is subject to removal in a future version.usePushSessionTracker(SessionSerializer, String)instead -
PushSessionTracker
-
-
Method Details
-
setActiveSessionChecker
Sets the active HTTP session checker.- Parameters:
activeSessionChecker- active HTTP session checker.
-
canPush
public boolean canPush()Description copied from interface:PushSendListenerDetermines 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:
canPushin interfacePushSendListener- 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:PushSendListenerInvoked when a new PUSH connection is established.- Specified by:
onConnectin interfacePushSendListener- Parameters:
resource- theAtmosphereResourcebehind the PUSH connection.
-
onMessageSent
public void onMessageSent(org.atmosphere.cpr.AtmosphereResource resource) Description copied from interface:PushSendListenerInvoked whenever a UIDL message has been sent to the client.- Specified by:
onMessageSentin interfacePushSendListener- Parameters:
resource- theAtmosphereResourceused to process the message
-
PushSessionTracker(SessionSerializer, String)instead