public class InstantManager extends Object
| Modifier and Type | Method and Description |
|---|---|
static List<Future<Void>> |
asyncSendBinary(Integer connId,
ByteBuffer data)
Send the message asynchronously, using the Future to signal to the client
when the message has been sent.
|
static void |
asyncSendBinary(Integer connId,
ByteBuffer data,
javax.websocket.SendHandler completion)
Send the message asynchronously, using the SendHandler to signal to the
client when the message has been sent.
|
static void |
asyncSendJson(Integer connId,
Object obj)
Send the message, blocking until the message is sent.
|
static List<Future<Void>> |
asyncSendObject(Integer connId,
Object obj)
Encodes object as a message and sends it asynchronously, using the
Future to signal to the client when the message has been sent.
|
static void |
asyncSendObject(Integer connId,
Object obj,
javax.websocket.SendHandler completion)
Encodes object as a message and sends it asynchronously, using the
SendHandler to signal to the client when the message has been sent.
|
static List<Future<Void>> |
asyncSendText(Integer connId,
String text)
Send the message asynchronously, using the Future to signal to the
client when the message has been sent.
|
void |
asyncSendText(Integer connId,
String text,
javax.websocket.SendHandler completion)
Send the message asynchronously, using the SendHandler to signal to the
client when the message has been sent.
|
static long |
getSessionAsyncSendTimeout(Integer connId)
Obtain the timeout (in milliseconds) for sending a message
asynchronously.
|
static void |
sendBinary(Integer connId,
ByteBuffer data)
Send the message, blocking until the message is sent.
|
void |
sendBinary(Integer connId,
ByteBuffer partialByte,
boolean isLast)
Sends part of a binary message to the remote endpoint.
|
static void |
sendJson(Integer connId,
Object obj)
Send the message, blocking until the message is sent.
|
void |
sendObject(Integer connId,
Object data)
Encodes object as a message and sends it to the remote endpoint.
|
static void |
sendText(Integer connId,
String text)
Send the message, blocking until the message is sent.
|
static void |
sendText(Integer connId,
String fragment,
boolean isLast)
Sends part of a text message to the remote endpoint.
|
static void |
setAsyncSendTimeout(Integer connId,
long timeout)
Set the timeout (in milliseconds) for sending a message
asynchronously.
|
public static void sendText(Integer connId, String text) throws IOException
connId - connect idtext - The text message to send.IllegalArgumentException - if text is null.IOException - if an I/O error occurs during the sending of the
message.public static void sendBinary(Integer connId, ByteBuffer data) throws IOException
connId - connect iddata - The binary message to sendIllegalArgumentException - if data is null.IOException - if an I/O error occurs during the sending of the
message.public static void sendText(Integer connId, String fragment, boolean isLast) throws IOException
connId - connect idfragment - The partial message to sendisLast - true if this is the last part of the
message, otherwise falseIllegalArgumentException - if fragment is null.IOException - if an I/O error occurs during the sending of the
message.public void sendBinary(Integer connId, ByteBuffer partialByte, boolean isLast) throws IOException
connId - connect idpartialByte - The partial message to sendisLast - true if this is the last part of the
message, otherwise falseIllegalArgumentException - if partialByte is
null.IOException - if an I/O error occurs during the sending of the
message.public void sendObject(Integer connId, Object data) throws IOException, javax.websocket.EncodeException
connId - connect iddata - The object to be sent.javax.websocket.EncodeException - if there was a problem encoding the
data object as a websocket message.IllegalArgumentException - if data is null.IOException - if an I/O error occurs during the sending of the
message.public static long getSessionAsyncSendTimeout(Integer connId)
WebSocketContainer.getDefaultAsyncSendTimeout().connId - connect idpublic static void setAsyncSendTimeout(Integer connId, long timeout)
WebSocketContainer.getDefaultAsyncSendTimeout().connId - connect idtimeout - The new timeout for sending messages asynchronously
in milliseconds. A non-positive value means an
infinite timeout.public void asyncSendText(Integer connId, String text, javax.websocket.SendHandler completion)
connId - connect idtext - The text message to sendcompletion - Used to signal to the client when the message has
been sentpublic static List<Future<Void>> asyncSendText(Integer connId, String text)
connId - connect idtext - The text message to sendpublic static List<Future<Void>> asyncSendBinary(Integer connId, ByteBuffer data)
connId - connect iddata - The text message to sendIllegalArgumentException - if data is null.public static void asyncSendBinary(Integer connId, ByteBuffer data, javax.websocket.SendHandler completion)
connId - connect iddata - The text message to sendcompletion - Used to signal to the client when the message has
been sentIllegalArgumentException - if data or completion
is null.public static List<Future<Void>> asyncSendObject(Integer connId, Object obj)
connId - connect idobj - The object to be sent.IllegalArgumentException - if obj is null.public static void asyncSendObject(Integer connId, Object obj, javax.websocket.SendHandler completion)
connId - connect idobj - The object to be sent.completion - Used to signal to the client when the message has
been sentIllegalArgumentException - if obj or
completion is null.public static void sendJson(Integer connId, Object obj) throws IOException
connId - connect idobj - The obj to send.IllegalArgumentException - if text is null.IOException - if an I/O error occurs during the sending of the
message.public static void asyncSendJson(Integer connId, Object obj) throws IOException
connId - connect idobj - The obj to send.IllegalArgumentException - if text is null.IOException - if an I/O error occurs during the sending of the
message.Copyright © 2021. All rights reserved.