Package com.vaadin.hilla.push
Class PushMessageHandler
java.lang.Object
com.vaadin.hilla.push.PushMessageHandler
Handles incoming requests from the client and connects them to fluxes
returned from endpoints.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
handleBrowserConnect
(String connectionId) Called when the browser establishes a new connection.void
handleBrowserDisconnect
(String connectionId) Called when the browser connection has been lost.void
handleBrowserReconnect
(String connectionId) Called when the browser establishes a new connection.void
handleMessage
(String connectionId, AbstractServerMessage message, Consumer<AbstractClientMessage> sender) Handles the message.
-
Constructor Details
-
PushMessageHandler
Creates the instance.- Parameters:
endpointInvoker
- the endpoint invoker
-
-
Method Details
-
handleMessage
public void handleMessage(String connectionId, AbstractServerMessage message, Consumer<AbstractClientMessage> sender) Handles the message.- Parameters:
connectionId
- an id uniquely identifying the underlying (shared) connectionmessage
- the message from the clientsender
- a method that sends a message back to the client
-
handleBrowserConnect
Called when the browser establishes a new connection. Only ever called once for the same connectionId parameter.- Parameters:
connectionId
- the id of the connection
-
handleBrowserReconnect
Called when the browser establishes a new connection. Only ever called once for the same connectionId parameter.- Parameters:
connectionId
- the id of the connection
-
handleBrowserDisconnect
Called when the browser connection has been lost. Only ever called once for the same connectionId parameter. The same connectionId parameter will never be used after this call.- Parameters:
connectionId
- the id of the connection
-