Class SendResult
java.lang.Object
jakarta.websocket.SendResult
Represents the result of an asynchronous WebSocket message send operation.
-
Constructor Summary
ConstructorsConstructorDescriptionDeprecated.Deprecated in WebSocket 2.2 and will be removed in a future version.SendResult(Session session) Create an instance for a successful message.SendResult(Session session, Throwable exception) Create an instance for an unsuccessful message.SendResult(Throwable exception) Deprecated.Deprecated in WebSocket 2.2 and will be removed in a future version. -
Method Summary
Modifier and TypeMethodDescriptionReturns the exception that occurred during the send operation, ornullif the operation was successful.The WebSocket session in which the session was sent.booleanisOK()Returns whether the send operation was successful.
-
Constructor Details
-
SendResult
-
SendResult
Create an instance for a successful message.- Parameters:
session- the WebSocket session in which the message was sent
-
SendResult
Deprecated.Deprecated in WebSocket 2.2 and will be removed in a future version. UseSendResult(Session, Throwable)as a replacement.Create an instance for an unsuccessful message.- Parameters:
exception- The exception describing the failure when trying to send the message.
-
SendResult
Deprecated.Deprecated in WebSocket 2.2 and will be removed in a future version. UseSendResult(Session, Throwable)as a replacement.Create an instance for a successful message.
-
-
Method Details
-
getException
Returns the exception that occurred during the send operation, ornullif the operation was successful.- Returns:
- The exception, or
nullif successful
-
isOK
public boolean isOK()Returns whether the send operation was successful.- Returns:
trueif the send was successful,falseotherwise
-
getSession
The WebSocket session in which the session was sent.- Returns:
- the WebSocket session in which the session was sent or
nullif not known.
-