There is exactly one instance per cluster node and all communication is realized using this instance.
| Modifier and Type | Field and Description |
|---|---|
| public static final String | CLUSTER_CONTEXT
ClusterContext registration property. |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public abstract void | broadcastBinary(String
endpoint path identifying sessions alignment to the endpoint. endpointPath, byte[] data to be broadcasted. data)Broadcast binary message. |
| public abstract void | broadcastText(String
endpoint path identifying sessions alignment to the endpoint. endpointPath, String message to be broadcasted. text)Broadcast text message. |
| public abstract Future | Returns: future representing the event.java. returns when there is an
acknowledge from the other node that the command was successfully executed. If there is any exception, it will
be
wrapped into java. and thrown.remote session id. sessionId)Close remote session. |
| public abstract Future | Returns: future representing the event.java. returns when there is an
acknowledge from the other node that the command was successfully executed. If there is any exception, it will
be
wrapped into java. and thrown.remote session id. sessionId, CloseReason custom close reason. closeReason)Close remote session with custom |
| public abstract String | Returns: connection id.Create connection id. It has to be unique among all cluster nodes. |
| public abstract String | Returns: session id.Create session id. It has to be unique among all cluster nodes. |
| public abstract void | destroyDistributedUserProperties(String
connection id. Connection id may be shared among subsequent TCP connection - represents
logical connection. connectionId)Destroy map which holds distributed user properties. |
| public abstract Map | Returns: distributed map containing session properties.remote session id. sessionId)Get the map containing session properties to be shared among nodes. |
| public abstract Map | Returns: distributed map containing session properties.connection id. Connection id may be shared among subsequent TCP connection - represents
logical connection. connectionId)Get the map containing session user properties to be shared among nodes. |
| public abstract Set | Returns: set of sessions ids.endpoint path identifying endpoint within the cluster. endpointPath)Get set containing session ids of all remote sessions registered to given endpoint path. |
| public abstract boolean | Returns: true when session is opened, false otherwise.remote session id. sessionId, String endpoint path identifying sessions alignment to the endpoint. endpointPath)Get information about session state. |
| public abstract void | registerBroadcastListener(String
endpoint path identifying sessions alignment to the endpoint. endpointPath, BroadcastListener listener instance. listener)Register broadcast listener. |
| public abstract void | registerSession(String
session id to be registered. sessionId, String endpoint path identifying sessions alignment to the endpoint. endpointPath, SessionEventListener session event listener. When remote node sends a message to this session, it will be
invoked. listener)Register local session. |
| public abstract void | registerSessionListener(String
endpoint path identifying sessions alignment to the endpoint. endpointPath, SessionListener listener instance. listener)Register session listener. |
| public abstract void | removeSession(String
session id. sessionId, String endpoint path identifying sessions alignment to the endpoint. endpointPath)Remove session from this Cluster context. |
| public abstract Future | Returns: future representing the send event.java. returns when there is an
acknowledge from the other node that the message has been successfully sent. If there is any exception, it will
be wrapped into java. and thrown.remote session id. sessionId, byte[] data to be sent. data)Send binary message. |
| public abstract Future | Returns: future representing the send event.java. returns when there is an
acknowledge from the other node that the message has been successfully sent. If there is any exception, it will
be wrapped into java. and thrown.remote session id. sessionId, byte[] data to be sent. data, boolean true when the partial message being sent is the last part of the message.Send partial binary message. |
| public abstract void | sendBinary(String
remote session id. sessionId, byte[] data to be sent. data, SendHandler sendhandler instance on which
sendHandler)jakarta. will be invoked.Send binary message with |
| public abstract Future | Returns: future representing the send event.java. returns when there is an
acknowledge from the other node that the message has been successfully sent. If there is any exception, it will
be wrapped into java. and thrown.remote session id. sessionId, byte[] data to be sent as ping message payload. data)Send ping message. |
| public abstract Future | Returns: future representing the send event.java. returns when there is an
acknowledge from the other node that the message has been successfully sent. If there is any exception, it will
be wrapped into java. and thrown.remote session id. sessionId, byte[] data to be sent as pong message payload. data)Send pong message. |
| public abstract Future | Returns: future representing the send event.java. returns when there is an
acknowledge from the other node that the message has been successfully sent. If there is any exception, it will
be wrapped into java. and thrown.remote session id. sessionId, String text to be sent. text)Send text message. |
| public abstract Future | Returns: future representing the send event.java. returns when there is an
acknowledge from the other node that the message has been successfully sent. If there is any exception, it will
be wrapped into java. and thrown.remote session id. sessionId, String text to be sent. text, boolean true when the partial message being sent is the last part of the message.Send partial text message. |
| public abstract void | sendText(String
remote session id. sessionId, String text to be sent. text, SendHandler sendhandler instance on which
sendHandler)jakarta. will be invoked.Send text message with |
| public abstract void |
| CLUSTER_CONTEXT | back to summary |
|---|---|
| public static final String CLUSTER_CONTEXT ClusterContext registration property.
ClusterContext is registered to the Server container via properties passed to
| |
| ClusterContext | back to summary |
|---|---|
| public ClusterContext() | |
| broadcastBinary | back to summary |
|---|---|
| public abstract void broadcastBinary(String endpointPath, byte[] data) Broadcast binary message.
| |
| broadcastText | back to summary |
|---|---|
| public abstract void broadcastText(String endpointPath, String text) Broadcast text message. | |
| close | back to summary |
|---|---|
| public abstract Future Close remote session.
| |
| close | back to summary |
|---|---|
| public abstract Future Close remote session with custom
| |
| createConnectionId | back to summary |
|---|---|
| public abstract String createConnectionId() Create connection id. It has to be unique among all cluster nodes.
| |
| createSessionId | back to summary |
|---|---|
| public abstract String createSessionId() Create session id. It has to be unique among all cluster nodes.
| |
| destroyDistributedUserProperties | back to summary |
|---|---|
| public abstract void destroyDistributedUserProperties(String connectionId) Destroy map which holds distributed user properties. This method should be invoked only when session is properly closed.
| |
| getDistributedSessionProperties | back to summary |
|---|---|
| public abstract Map Get the map containing session properties to be shared among nodes. Changes must be propagated to remote instances.
| |
| getDistributedUserProperties | back to summary |
|---|---|
| public abstract Map Get the map containing session user properties to be shared among nodes. Changes must be propagated to remote instances. | |
| getRemoteSessionIds | back to summary |
|---|---|
| public abstract Set Get set containing session ids of all remote sessions registered to given endpoint path. | |
| isSessionOpen | back to summary |
|---|---|
| public abstract boolean isSessionOpen(String sessionId, String endpointPath) Get information about session state.
| |
| registerBroadcastListener | back to summary |
|---|---|
| public abstract void registerBroadcastListener(String endpointPath, BroadcastListener listener) Register broadcast listener.
Gets notification about broadcasted messages. Used as an optimized variant of standard websocket broadcast
pattern. In this case, only one message is sent to all cluster nodes (instead
| |
| registerSession | back to summary |
|---|---|
| public abstract void registerSession(String sessionId, String endpointPath, SessionEventListener listener) Register local session.
Session id will be broadcasted to other nodes which will call
| |
| registerSessionListener | back to summary |
|---|---|
| public abstract void registerSessionListener(String endpointPath, SessionListener listener) Register session listener.
Gets notification about session creation
| |
| removeSession | back to summary |
|---|---|
| public abstract void removeSession(String sessionId, String endpointPath) Remove session from this Cluster context. | |
| sendBinary | back to summary |
|---|---|
| public abstract Future Send binary message.
| |
| sendBinary | back to summary |
|---|---|
| public abstract Future Send partial binary message.
| |
| sendBinary | back to summary |
|---|---|
| public abstract void sendBinary(String sessionId, byte[] data, SendHandler sendHandler) Send binary message with
| |
| sendPing | back to summary |
|---|---|
| public abstract Future Send ping message.
| |
| sendPong | back to summary |
|---|---|
| public abstract Future Send pong message.
| |
| sendText | back to summary |
|---|---|
| public abstract Future Send text message.
| |
| sendText | back to summary |
|---|---|
| public abstract Future Send partial text message.
| |
| sendText | back to summary |
|---|---|
| public abstract void sendText(String sessionId, String text, SendHandler sendHandler) Send text message with
| |
| shutdown | back to summary |
|---|---|
| public abstract void shutdown() Shutdown this ClusterContext. This will stop whole clustered node, any operation related to this cluster context will fail after this method is invoked. | |