Class EventEndpoint

java.lang.Object
com.logicaldoc.web.websockets.EventEndpoint
All Implemented Interfaces:
EventListener

public class EventEndpoint extends Object implements EventListener
Websockets end-point to distribute events.
Since:
8.1.1
Author:
Marco Meschieri - LogicalDOC
  • Constructor Details

    • EventEndpoint

      public EventEndpoint()
  • Method Details

    • countQueueSize

      public <T extends History> int countQueueSize(Class<T> historyClass)
      Returns the number of canched events of the given type
      Parameters:
      historyClass - a class of History
      Returns:
      number of cached events
    • onOpen

      public void onOpen(javax.websocket.Session session)
    • onClose

      public void onClose(javax.websocket.Session session)
    • onMessage

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

      public void onBinaryMessage(byte[] data, javax.websocket.Session session)
    • newEvent

      public void newEvent(History event)
      Description copied from interface: EventListener
      Called when a new event arrives
      Specified by:
      newEvent in interface EventListener
      Parameters:
      event - the event to process
    • error

      public void error(javax.websocket.Session session, Throwable t)
    • distributeMessage

      public static void distributeMessage(WebsocketMessage message)
      Distributes a message to all the connected clients
      Parameters:
      message - The message to be sent