Top Description Fields Constructors Methods
jakarta.websocket

public final Class SendResult

extends Object
Class Inheritance

The result of asynchronously sending a web socket message. A SendResult is either ok indicating there was no problem, or is not OK in which case there was a problem and it carries an exception to indicate what the problem was.
Author
dannycoward

Field Summary

Modifier and TypeField and Description
private final Throwable
private final boolean
private final Session

Constructor Summary

AccessConstructor and Description
public
SendResult(Session
the WebSocket session in which the message was sent
session
,
Throwable
the exception causing a send failure.
exception
)

Construct a SendResult carrying an exception.

public
SendResult(Session
the WebSocket session in which the message was sent
session
)

Construct a SendResult signifying a successful send carrying no exception.

public
SendResult(Throwable
the exception causing a send failure.
exception
)
Deprecated Deprecated in WebSocket 2.2 and will be removed in a future version.

Construct a SendResult carrying an exception.

public
SendResult()
Deprecated Deprecated in WebSocket 2.2 and will be removed in a future version.

Construct a SendResult signifying a successful send carrying no exception.

Method Summary

Modifier and TypeMethod and Description
public Throwable

Returns:

the problem or null if the send was successful.
getException
()

The problem sending the message.

public Session

Returns:

the WebSocket session in which the session was sent or null if not known.
getSession
()

The WebSocket session in which the session was sent.

public boolean

Returns:

whether the send was successful or not.
isOK
()

Determines if this result is ok or not.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

exceptionback to summary
private final Throwable exception
isOKback to summary
private final boolean isOK
sessionback to summary
private final Session session

Constructor Detail

SendResultback to summary
public SendResult(Session session, Throwable exception)

Construct a SendResult carrying an exception.

Parameters
session:Session

the WebSocket session in which the message was sent

exception:Throwable

the exception causing a send failure.

SendResultback to summary
public SendResult(Session session)

Construct a SendResult signifying a successful send carrying no exception.

Parameters
session:Session

the WebSocket session in which the message was sent

SendResultback to summary
public SendResult(Throwable exception)

Deprecated

Deprecated in WebSocket 2.2 and will be removed in a future version. Use SendResult(Session, Throwable) as a replacement.

Construct a SendResult carrying an exception.

Parameters
exception:Throwable

the exception causing a send failure.

Annotations
@Deprecated
SendResultback to summary
public SendResult()

Deprecated

Deprecated in WebSocket 2.2 and will be removed in a future version. Use SendResult(Session, Throwable) as a replacement.

Construct a SendResult signifying a successful send carrying no exception.

Annotations
@Deprecated

Method Detail

getExceptionback to summary
public Throwable getException()

The problem sending the message.

Returns:Throwable

the problem or null if the send was successful.

getSessionback to summary
public Session getSession()

The WebSocket session in which the session was sent.

Returns:Session

the WebSocket session in which the session was sent or null if not known.

isOKback to summary
public boolean isOK()

Determines if this result is ok or not.

Returns:boolean

whether the send was successful or not.