| Constructor and Description |
|---|
WebsocketSessionManager() |
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
add(jakarta.websocket.Session session)
On open, add given web socket session to the mapping associated with its channel identifier and returns
true if it's accepted (i.e. |
protected void |
deregister(Iterable<String> channelIds)
Deregister given channel identifiers and explicitly close all open web socket sessions associated with it.
|
protected void |
register(Iterable<String> channelIds)
Register given channel identifiers.
|
protected void |
register(String channelId)
Register given channel identifier.
|
protected void |
remove(jakarta.websocket.Session session,
jakarta.websocket.CloseReason reason)
On close, remove given web socket session from the mapping.
|
protected Set<Future<Void>> |
send(String channelId,
Object message)
Encode the given message object as JSON and send it to all open web socket sessions associated with given web socket
channel identifier.
|
protected void register(String channelId)
channelId - The channel identifier to register.protected void register(Iterable<String> channelIds)
channelIds - The channel identifiers to register.protected boolean add(jakarta.websocket.Session session)
true if it's accepted (i.e. the channel identifier is known) and the same session hasn't been added
before, otherwise false.session - The opened web socket session.true if given web socket session is accepted and is new, otherwise false.protected Set<Future<Void>> send(String channelId, Object message)
channelId - The web socket channel identifier.message - The push message object.null on Future.get() if the message
was successfully delivered and otherwise throw ExecutionException.protected void remove(jakarta.websocket.Session session,
jakarta.websocket.CloseReason reason)
session - The closed web socket session.reason - The close reason.Copyright © 1997–2020 Eclipse Foundation. All rights reserved.