Class MessageIdSyncErrorEvent
java.lang.Object
java.util.EventObject
com.vaadin.flow.server.communication.MessageIdSyncErrorEvent
- All Implemented Interfaces:
Serializable
Event fired through the
service event bus
when the client sent a message with an id the server did not expect, on the
request thread while the session is locked.
The message is not processed and the client is shown the session synchronization error. This typically happens when the server that handled the UI stopped before the UI state was stored, and the client continues on another server with an older state.
- See Also:
-
Field Summary
Fields inherited from class java.util.EventObject
source -
Constructor Summary
ConstructorsConstructorDescriptionMessageIdSyncErrorEvent(UI ui, int expectedId, int receivedId) Creates a new event. -
Method Summary
Modifier and TypeMethodDescriptionintGets the message id the server expected.intGets the message id the client sent.getUI()Gets the UI the message was sent to.Methods inherited from class java.util.EventObject
getSource, toString
-
Constructor Details
-
MessageIdSyncErrorEvent
Creates a new event.- Parameters:
ui- the UI the message was sent to, notnullexpectedId- the message id the server expectedreceivedId- the message id the client sent
-
-
Method Details
-
getUI
Gets the UI the message was sent to.- Returns:
- the UI, not
null
-
getExpectedId
public int getExpectedId()Gets the message id the server expected.- Returns:
- the expected message id
-
getReceivedId
public int getReceivedId()Gets the message id the client sent.- Returns:
- the received message id
-