Class SilverpeasServerEventWebSocket

  • Direct Known Subclasses:
    CommonServerEventWebSocket

    public abstract class SilverpeasServerEventWebSocket
    extends Object
    This abstraction defines the behavior the Servlets in charge of responding to EventSource JavaScript API must have.
    Finally, adding a new URI to handle EventSource needs to extends this class and to parametrize the mapping! (see CommonServerSentEventServlet as an example)
    Author:
    Yohann Chastagnier
    • Constructor Detail

      • SilverpeasServerEventWebSocket

        public SilverpeasServerEventWebSocket()
    • Method Detail

      • getSessionInfo

        protected abstract SessionInfo getSessionInfo​(javax.websocket.Session session)
        This method is called one time only, when onOpen(Session) is executed.
        Parameters:
        session - a WebSocket session instance.
        Returns:
        a SessionInfo instance.
      • onClose

        public void onClose​(javax.websocket.Session session)
      • onError

        public void onError​(javax.websocket.Session session,
                            Throwable throwable)
      • onMessage

        public void onMessage​(javax.websocket.Session session,
                              String message)
      • prepareEventsOnOpening

        public default void prepareEventsOnOpening​(org.silverpeas.core.webapi.notification.sse.SilverpeasServerEventWebAccess.WebAccessContext wac,
                                                   Long initialLastServerEventId)