Class PresenceBarEndpoint


  • public class PresenceBarEndpoint
    extends Object
    WebSocket endpoint for the presence bar. It authenticates new connections and subscribes them to the requested FORM_RECORD's presence bar updates.
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  PresenceBarEndpoint.Configurator
      Configurator for the PresenceBarEndpoint that extracts the HTTP session and form request ID from the handshake request and stores data in the endpoint's user properties.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void onClose​(javax.websocket.Session wsSession, javax.websocket.CloseReason reason)
      Removes the session from the presence registry once the connection closes.
      void onError​(javax.websocket.Session wsSession, Throwable error)
      Logs a WebSocket transport error, removes the subscription and closes the connection if it is still open.
      void onOpen​(javax.websocket.Session wsSession, javax.websocket.EndpointConfig config)
      Authenticates a new WebSocket connection and, once valid, subscribes it to the requested form record presence bar updates.
      void onPong​(javax.websocket.Session wsSession, javax.websocket.PongMessage pong)
      Acknowledges the connection's outstanding ping without inspecting the pong payload.
    • Constructor Detail

      • PresenceBarEndpoint

        public PresenceBarEndpoint()
    • Method Detail

      • onOpen

        public void onOpen​(javax.websocket.Session wsSession,
                           javax.websocket.EndpointConfig config)
        Authenticates a new WebSocket connection and, once valid, subscribes it to the requested form record presence bar updates.
        Parameters:
        wsSession - The newly opened WebSocket session.
        config - The endpoint configuration, carrying the HTTP session set by PresenceBarEndpoint.Configurator.
      • onPong

        public void onPong​(javax.websocket.Session wsSession,
                           javax.websocket.PongMessage pong)
        Acknowledges the connection's outstanding ping without inspecting the pong payload.
        Parameters:
        wsSession - the WebSocket session that received the pong
        pong - the received pong control frame
        Since:
        8.6.0
      • onClose

        public void onClose​(javax.websocket.Session wsSession,
                            javax.websocket.CloseReason reason)
        Removes the session from the presence registry once the connection closes.
        Parameters:
        wsSession - The WebSocket session that closed.
        reason - Why the session closed.
      • onError

        public void onError​(javax.websocket.Session wsSession,
                            Throwable error)
        Logs a WebSocket transport error, removes the subscription and closes the connection if it is still open.
        Parameters:
        wsSession - The WebSocket session the error occurred on, or null.
        error - The error that occurred, or null.