Top Fields Constructors Methods
org.eclipse.jetty.ee10.websocket.jakarta.common

public Class JakartaWebSocketBasicRemote

extends JakartaWebSocketRemoteEndpoint
implements Basic
Class Inheritance
All Implemented Interfaces
jakarta.websocket.RemoteEndpoint.Basic, jakarta.websocket.RemoteEndpoint
Imports
java.io.IOException, .OutputStream, .Writer, java.nio.ByteBuffer, jakarta.websocket.EncodeException, .RemoteEndpoint, org.eclipse.jetty.util.BufferUtil, .FutureCallback, org.eclipse.jetty.websocket.core.CoreSession, .Frame, .OpCode, org.eclipse.jetty.websocket.core.util.TextUtils, org.slf4j.Logger, .LoggerFactory

Field Summary

Modifier and TypeField and Description
private static final Logger
Inherited from org.eclipse.jetty.ee10.websocket.jakarta.common.JakartaWebSocketRemoteEndpoint:
batchmessageTypesession

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
public OutputStream
getSendStream()

Implements jakarta.websocket.RemoteEndpoint.Basic.getSendStream.

Opens an output stream on which a binary message may be sent.

public Writer
getSendWriter()

Implements jakarta.websocket.RemoteEndpoint.Basic.getSendWriter.

Opens a character stream on which a text message may be sent.

public void
sendBinary(ByteBuffer
the message to be sent.
data
)

Implements jakarta.websocket.RemoteEndpoint.Basic.sendBinary.

Send a binary message, returning when all of the message has been transmitted.

public void
sendBinary(ByteBuffer
the part of the message being sent.
partialByte
,
boolean
Whether the partial message being sent is the last part of the message.
isLast
)

Implements jakarta.websocket.RemoteEndpoint.Basic.sendBinary.

Send a binary message in parts, blocking until all of the message has been transmitted.

public void
sendObject(Object
the object to be sent.
data
)

Implements jakarta.websocket.RemoteEndpoint.Basic.sendObject.

Sends a custom developer object, blocking until it has been transmitted.

public void
sendText(String
the message to be sent.
text
)

Implements jakarta.websocket.RemoteEndpoint.Basic.sendText.

Send a text message, blocking until all of the message has been transmitted.

public void
sendText(String
the parts of the message being sent.
partialMessage
,
boolean
Whether the partial message being sent is the last part of the message.
isLast
)

Implements jakarta.websocket.RemoteEndpoint.Basic.sendText.

Send a text message in parts, blocking until all of the message has been transmitted.

Inherited from org.eclipse.jetty.ee10.websocket.jakarta.common.JakartaWebSocketRemoteEndpoint:
assertMessageNotNullassertSendHandlerNotNullflushBatchgetBatchingAllowedgetIdleTimeoutgetWriteTimeoutnewMessageOutputStreamnewMessageWritersendFramesendObjectsendPingsendPongsetBatchingAllowedsetIdleTimeoutsetWriteTimeout

Field Detail

LOGback to summary
private static final Logger LOG

Hides org.eclipse.jetty.ee10.websocket.jakarta.common.JakartaWebSocketRemoteEndpoint.LOG.

Constructor Detail

JakartaWebSocketBasicRemoteback to summary
protected JakartaWebSocketBasicRemote(JakartaWebSocketSession session, CoreSession coreSession)

Method Detail

getSendStreamback to summary
public OutputStream getSendStream() throws IOException

Implements jakarta.websocket.RemoteEndpoint.Basic.getSendStream.

Doc from jakarta.websocket.RemoteEndpoint.Basic.getSendStream.

Opens an output stream on which a binary message may be sent. The developer must close the output stream in order to indicate that the complete message has been placed into the output stream. If no calls are made to one of the write() methods before the output stream is closed then no WebSocket binary messages will be sent. If at least one call is made to one of the write() methods before the output stream is closed then at least one WebSocket binary message will be sent even if that message is of zero length.

Returns:OutputStream

the output stream to which the message will be written.

Annotations
@Override
Exceptions
IOException:
if there is a problem obtaining the OutputStream to write the binary message.
getSendWriterback to summary
public Writer getSendWriter() throws IOException

Implements jakarta.websocket.RemoteEndpoint.Basic.getSendWriter.

Doc from jakarta.websocket.RemoteEndpoint.Basic.getSendWriter.

Opens a character stream on which a text message may be sent. The developer must close the writer in order to indicate that the complete message has been placed into the character stream. If no calls are made to one of the write() or append() methods before the writer is closed then no WebSocket text messages will be sent. If at least one call is made to one of the write() or append() methods before the writer is closed then at least one WebSocket text message will be sent even if that message is of zero length.

Returns:Writer

the writer to which the message will be written.

Annotations
@Override
Exceptions
IOException:
if there is a problem obtaining the Writer to write the text message.
sendBinaryback to summary
public void sendBinary(ByteBuffer data) throws IOException

Implements jakarta.websocket.RemoteEndpoint.Basic.sendBinary.

Doc from jakarta.websocket.RemoteEndpoint.Basic.sendBinary.

Send a binary message, returning when all of the message has been transmitted.

It is not safe for other threads to use the ByteBuffer until the sending of this message is complete. If the sending of the message completes successfully, the buffer's limit will be unchanged and the buffer's position will be equal to the limit. If the sending of the message does not complete successfully, the state of the buffer is undefined.

Parameters
data:ByteBuffer

the message to be sent.

Annotations
@Override
Exceptions
IOException:
if there is a problem delivering the message.
sendBinaryback to summary
public void sendBinary(ByteBuffer partialByte, boolean isLast) throws IOException

Implements jakarta.websocket.RemoteEndpoint.Basic.sendBinary.

Doc from jakarta.websocket.RemoteEndpoint.Basic.sendBinary.

Send a binary message in parts, blocking until all of the message has been transmitted. The runtime reads the message in order. Non-final parts are sent with isLast set to false. The final piece must be sent with isLast set to true.

It is not safe for other threads to use the ByteBuffer until the sending of this partial message is complete. If the sending of the partial message completes successfully, the buffer's limit will be unchanged and the buffer's position will be equal to the limit. If the sending of the partial message does not complete successfully, the state of the buffer is undefined.

Parameters
partialByte:ByteBuffer

the part of the message being sent.

isLast:boolean

Whether the partial message being sent is the last part of the message.

Annotations
@Override
Exceptions
IOException:
if there is a problem delivering the partial message.
sendObjectback to summary
public void sendObject(Object data) throws IOException, EncodeException

Implements jakarta.websocket.RemoteEndpoint.Basic.sendObject.

Doc from jakarta.websocket.RemoteEndpoint.Basic.sendObject.

Sends a custom developer object, blocking until it has been transmitted. Containers will by default be able to encode java primitive types and their object equivalents, otherwise the developer must have provided an encoder for the object type in the endpoint configuration. A developer-provided encoder for a Java primitive type and its object equivalent overrides the container default encoder.

Parameters
data:Object

the object to be sent.

Annotations
@Override
Exceptions
IOException:
if there is a communication error sending the message object.
EncodeException:
if there was a problem encoding the message object into the form of a native websocket message.
sendTextback to summary
public void sendText(String text) throws IOException

Implements jakarta.websocket.RemoteEndpoint.Basic.sendText.

Doc from jakarta.websocket.RemoteEndpoint.Basic.sendText.

Send a text message, blocking until all of the message has been transmitted.

Parameters
text:String

the message to be sent.

Annotations
@Override
Exceptions
IOException:
if there is a problem delivering the message.
sendTextback to summary
public void sendText(String partialMessage, boolean isLast) throws IOException

Implements jakarta.websocket.RemoteEndpoint.Basic.sendText.

Doc from jakarta.websocket.RemoteEndpoint.Basic.sendText.

Send a text message in parts, blocking until all of the message has been transmitted. The runtime reads the message in order. Non-final parts of the message are sent with isLast set to false. The final part must be sent with isLast set to true.

Parameters
partialMessage:String

the parts of the message being sent.

isLast:boolean

Whether the partial message being sent is the last part of the message.

Annotations
@Override
Exceptions
IOException:
if there is a problem delivering the message fragment.