com.vaadin.hilla.push.

Class PushMessageHandler

java.lang.Object
com.vaadin.hilla.push.PushMessageHandler
@Service public class PushMessageHandler extends Object

Handles incoming requests from the client and connects them to fluxes returned from endpoints.

  • Constructor Details

    • PushMessageHandler

      public PushMessageHandler(EndpointInvoker endpointInvoker)

      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) connection

      message - the message from the client

      sender - a method that sends a message back to the client

    • handleBrowserConnect

      public void handleBrowserConnect(String connectionId)

      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

      public void handleBrowserReconnect(String connectionId)

      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

      public void handleBrowserDisconnect(String connectionId)

      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