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
Constructors -
Method Summary
Modifier and TypeMethodDescription<T extends History>
intcountQueueSize(Class<T> historyClass) Returns the number of canched events of the given typestatic voiddistributeMessage(WebsocketMessage message) Distributes a message to all the connected clientsvoidvoidCalled when a new event arrivesvoidonBinaryMessage(byte[] data, jakarta.websocket.Session session) voidonClose(jakarta.websocket.Session session) voidvoidonOpen(jakarta.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(jakarta.websocket.Session session) -
onClose
public void onClose(jakarta.websocket.Session session) -
onMessage
-
onBinaryMessage
public void onBinaryMessage(byte[] data, jakarta.websocket.Session session) -
newEvent
Description copied from interface:EventListenerCalled when a new event arrives- Specified by:
newEventin interfaceEventListener- Parameters:
event- the event to process
-
error
-
distributeMessage
Distributes a message to all the connected clients- Parameters:
message- The message to be sent
-