Package com.logicaldoc.web.websockets
Class EventEndpoint
java.lang.Object
com.logicaldoc.web.websockets.EventEndpoint
- All Implemented Interfaces:
EventListener
Websockets end-point to distribute events.
- Since:
- 8.1.1
- Author:
- Marco Meschieri - LogicalDOC
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription<T extends History>
intcountQueueSize
(Class<T> historyClass) Returns the number of canched events of the given typestatic void
distributeMessage
(WebsocketMessage message) Distributes a message to all the connected clientsvoid
void
Called when a new event arrivesvoid
onBinaryMessage
(byte[] data, javax.websocket.Session session) void
onClose
(javax.websocket.Session session) void
void
onOpen
(javax.websocket.Session session)
-
Constructor Details
-
EventEndpoint
public EventEndpoint()
-
-
Method Details
-
countQueueSize
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
-
onBinaryMessage
public void onBinaryMessage(byte[] data, javax.websocket.Session session) -
newEvent
Description copied from interface:EventListener
Called when a new event arrives- Specified by:
newEvent
in interfaceEventListener
- Parameters:
event
- the event to process
-
error
-
distributeMessage
Distributes a message to all the connected clients- Parameters:
message
- The message to be sent
-