Package org.basex.http.ws
Class WsPool
- java.lang.Object
-
- org.basex.http.ws.WsPool
-
public final class WsPool extends Object
This class defines a pool for WebSockets. It manages all connected WebSockets.- Author:
- BaseX Team 2005-23, BSD License, Johannes Finckh
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidbroadcast(Value message, String client)Sends a message to all connected clients except to the one with the given id.static voidemit(Value message)Sends a message to all connected clients.static WebSocketget(String id)Returns the client with the specified id.static TokenListids()Returns the ids of all connected clients.static voidsend(Value message, String... ids)Sends a message to a specific clients.
-
-
-
Method Detail
-
ids
public static TokenList ids()
Returns the ids of all connected clients.- Returns:
- client ids
-
emit
public static void emit(Value message) throws QueryException
Sends a message to all connected clients.- Parameters:
message- message- Throws:
QueryException- query exception
-
broadcast
public static void broadcast(Value message, String client) throws QueryException
Sends a message to all connected clients except to the one with the given id.- Parameters:
message- messageclient- client id- Throws:
QueryException- query exception
-
send
public static void send(Value message, String... ids) throws QueryException
Sends a message to a specific clients.- Parameters:
message- messageids- client ids- Throws:
QueryException- query exception
-
-