| Modifier and Type | Field and Description |
|---|---|
| private final CoreSession | |
| private final JettyWebSocketFrameHandler | |
| private byte | |
| private final UpgradeRequest | |
| private final UpgradeResponse |
| Access | Constructor and Description |
|---|---|
| public | WebSocketSession(WebSocketContainer container, CoreSession coreSession, JettyWebSocketFrameHandler frameHandler)
|
| Modifier and Type | Method and Description |
|---|---|
| public void | close(int
the status code statusCode, String the (optional) reason reason, Callback callback to notify when the send operation is complete callback)Implements org. Sends a websocket CLOSE frame, with status code and reason, notifying the given callback when the frame send is completed, either successfully or with a failure. |
| public void | demand()
Implements org. Explicitly demands for WebSocket events. |
| public void | disconnect()
Implements org. Abruptly closes the WebSocket connection without sending a CLOSE frame. |
| public void | dump(Appendable
The appendable to dump to out, String The indent to apply after any new lines. indent)Implements org. Dump this object (and children) into an Appendable using the provided indent after any new lines. |
| public String | dumpSelf()
Overrides default org. The description of this/self found in the dump. |
| public CoreSession | |
| public Duration | getIdleTimeout()
Implements org. The duration that a websocket may be idle before being closed by the implementation |
| public int | getInputBufferSize()
Implements org. The input (read from network layer) buffer size. |
| public SocketAddress | |
| public long | getMaxBinaryMessageSize()
Implements org. Get the maximum size of a binary message during parsing. |
| public long | getMaxFrameSize()
Implements org. The maximum payload size of any WebSocket Frame which can be received. |
| public int | getMaxOutgoingFrames()
Implements org. Get the maximum number of data frames allowed to be waiting to be sent at any one time. |
| public long | getMaxTextMessageSize()
Implements org. Get the maximum size of a text message during parsing. |
| public int | getOutputBufferSize()
Implements org. The output (write to network layer) buffer size. |
| public String | getProtocolVersion()
Implements org. Returns the version of the WebSocket protocol currently being used. |
| public SocketAddress | |
| public UpgradeRequest | |
| public UpgradeResponse | |
| public boolean | isAutoFragment()
Implements org. If true, frames are automatically fragmented to respect the maximum frame size. |
| public boolean | |
| public boolean | |
| public void | sendBinary(ByteBuffer
the message bytes to send buffer, Callback callback to notify when the send operation is complete callback)Implements org. Initiates the asynchronous send of a BINARY message, notifying the given callback when the message send is completed, either successfully or with a failure. |
| public void | sendPartialBinary(ByteBuffer
the frame bytes to send buffer, boolean whether this is the last frame of the message last, Callback callback to notify when the send operation is complete callback)Implements org. Initiates the asynchronous send of a BINARY frame, possibly part of a larger binary message, notifying the given callback when the frame send is completed, either successfully or with a failure. |
| public void | sendPartialText(String
the frame text to send text, boolean whether this is the last frame of the message last, Callback callback to notify when the send operation is complete callback)Implements org. Initiates the asynchronous send of a TEXT frame, possibly part of a larger binary message, notifying the given callback when the frame send is completed, either successfully or with a failure. |
| public void | sendPing(ByteBuffer
the data to be carried in the PING frame applicationData, Callback callback to notify when the send operation is complete callback)Implements org. Initiates the asynchronous send of a PING frame, notifying the given callback when the frame send is completed, either successfully or with a failure. |
| public void | sendPong(ByteBuffer
the data to be carried in the PONG frame applicationData, Callback callback to notify when the send operation is complete callback)Implements org. Initiates the asynchronous send of a PONG frame, notifying the given callback when the frame send is completed, either successfully or with a failure. |
| public void | sendText(String
the message text to send text, Callback callback to notify when the send operation is complete callback)Implements org. Initiates the asynchronous send of a TEXT message, notifying the given callback when the message send is completed, either successfully or with a failure. |
| public void | setAutoFragment(boolean
whether to automatically fragment incoming WebSocket Frames. autoFragment)Implements org. If set to true, frames are automatically fragmented to respect the maximum frame size. |
| public void | setIdleTimeout(Duration
the timeout duration (may not be null or negative) duration)Implements org. The duration that a websocket may be idle before being closed by the implementation |
| public void | setInputBufferSize(int
the size in bytes size)Implements org. The input (read from network layer) buffer size. |
| public void | setMaxBinaryMessageSize(long
the maximum allowed size of a binary message. size)Implements org. The maximum size of a binary message during parsing/generating. |
| public void | setMaxFrameSize(long
the maximum allowed size of a WebSocket Frame. maxFrameSize)Implements org. The maximum payload size of any WebSocket Frame which can be received. |
| public void | setMaxOutgoingFrames(int
the max number of frames. maxOutgoingFrames)Implements org. Set the maximum number of data frames allowed to be waiting to be sent at any one time. |
| public void | setMaxTextMessageSize(long
the maximum allowed size of a text message. size)Implements org. The maximum size of a text message during parsing/generating. |
| public void | setOutputBufferSize(int
the size in bytes size)Implements org. The output (write to network layer) buffer size. |
| public String |
| coreSession | back to summary |
|---|---|
| private final CoreSession coreSession | |
| frameHandler | back to summary |
|---|---|
| private final JettyWebSocketFrameHandler frameHandler | |
| messageType | back to summary |
|---|---|
| private byte messageType | |
| upgradeRequest | back to summary |
|---|---|
| private final UpgradeRequest upgradeRequest | |
| upgradeResponse | back to summary |
|---|---|
| private final UpgradeResponse upgradeResponse | |
| WebSocketSession | back to summary |
|---|---|
| public WebSocketSession(WebSocketContainer container, CoreSession coreSession, JettyWebSocketFrameHandler frameHandler) | |
| close | back to summary |
|---|---|
| public void close(int statusCode, String reason, Callback callback) Implements org. Doc from org. Sends a websocket CLOSE frame, with status code and reason, notifying the given callback when the frame send is completed, either successfully or with a failure. | |
| demand | back to summary |
|---|---|
| public void demand() Implements org. Doc from org. Explicitly demands for WebSocket events. This method should be called only when the WebSocket endpoint is not
demanding automatically, as defined by In general, invoking this method results in a listener method or an annotated method to be called when the corresponding event is ready to be delivered. For WebSocket endpoints that wants to receive frame events
(for example by overriding For WebSocket endpoints that want to receive whole message
events (for example by overriding Note that even when the WebSocket endpoint is interested in whole messages, calling this method is necessary not only to possibly receive the next whole message, but also to receive control frames (such as PING or CLOSE frames). Failing to call this method after receiving a whole message results in the CLOSE frame event to not be processed, and therefore for the endpoint to not notice when the other peer closed the WebSocket communication.
| |
| disconnect | back to summary |
|---|---|
| public void disconnect() Implements org. Doc from org. Abruptly closes the WebSocket connection without sending a CLOSE frame.
| |
| dump | back to summary |
|---|---|
| public void dump(Appendable out, String indent) throws IOException Implements org. Doc from org. Dump this object (and children) into an Appendable using the provided indent after any new lines. The indent should not be applied to the first object dumped.
| |
| dumpSelf | back to summary |
|---|---|
| public String dumpSelf() Overrides default org. Doc from org. The description of this/self found in the dump. Allows for alternative representation of Object other then .toString() where the long form output of toString() is represented in a cleaner way within the dump infrastructure. | |
| getCoreSession | back to summary |
|---|---|
| public CoreSession getCoreSession() | |
| getIdleTimeout | back to summary |
|---|---|
| public Duration getIdleTimeout() Implements org. Doc from org. The duration that a websocket may be idle before being closed by the implementation | |
| getInputBufferSize | back to summary |
|---|---|
| public int getInputBufferSize() Implements org. Doc from org. The input (read from network layer) buffer size. This is the raw read operation buffer size, before the parsing of the websocket frames.
| |
| getLocalSocketAddress | back to summary |
|---|---|
| public SocketAddress getLocalSocketAddress() Implements org.
| |
| getMaxBinaryMessageSize | back to summary |
|---|---|
| public long getMaxBinaryMessageSize() Implements org. Doc from org. Get the maximum size of a binary message during parsing. This is a memory conservation option, memory over this limit will not be allocated by Jetty for handling binary messages. This applies to individual frames, whole message handling, and partial message handling.
Binary messages over this maximum will result in a close code 1009
| |
| getMaxFrameSize | back to summary |
|---|---|
| public long getMaxFrameSize() Implements org. Doc from org. The maximum payload size of any WebSocket Frame which can be received.
| |
| getMaxOutgoingFrames | back to summary |
|---|---|
| public int getMaxOutgoingFrames() Implements org. Doc from org. Get the maximum number of data frames allowed to be waiting to be sent at any one time.
The default value is -1, this indicates there is no limit on how many frames can be
queued to be sent by the implementation. If the limit is exceeded, subsequent frames
sent are failed with a
| |
| getMaxTextMessageSize | back to summary |
|---|---|
| public long getMaxTextMessageSize() Implements org. Doc from org. Get the maximum size of a text message during parsing. This is a memory conservation option, memory over this limit will not be allocated by Jetty for handling text messages. This applies to individual frames, whole message handling, and partial message handling.
Text messages over this maximum will result in a close code 1009
| |
| getOutputBufferSize | back to summary |
|---|---|
| public int getOutputBufferSize() Implements org. Doc from org. The output (write to network layer) buffer size. This is the raw write operation buffer size and has no relationship to the websocket frame.
| |
| getProtocolVersion | back to summary |
|---|---|
| public String getProtocolVersion() Implements org. Doc from org. Returns the version of the WebSocket protocol currently being used. This is taken as the value of the | |
| getRemoteSocketAddress | back to summary |
|---|---|
| public SocketAddress getRemoteSocketAddress() Implements org.
| |
| getUpgradeRequest | back to summary |
|---|---|
| public UpgradeRequest getUpgradeRequest() Implements org.
| |
| getUpgradeResponse | back to summary |
|---|---|
| public UpgradeResponse getUpgradeResponse() Implements org.
| |
| isAutoFragment | back to summary |
|---|---|
| public boolean isAutoFragment() Implements org. Doc from org. If true, frames are automatically fragmented to respect the maximum frame size.
| |
| isOpen | back to summary |
|---|---|
| public boolean isOpen() Implements org.
| |
| isSecure | back to summary |
|---|---|
| public boolean isSecure() Implements org.
| |
| sendBinary | back to summary |
|---|---|
| public void sendBinary(ByteBuffer buffer, Callback callback) Implements org. Doc from org. Initiates the asynchronous send of a BINARY message, notifying the given callback when the message send is completed, either successfully or with a failure.
| |
| sendPartialBinary | back to summary |
|---|---|
| public void sendPartialBinary(ByteBuffer buffer, boolean last, Callback callback) Implements org. Doc from org. Initiates the asynchronous send of a BINARY frame, possibly part of a larger binary message, notifying the given callback when the frame send is completed, either successfully or with a failure. Non-final frames must be sent with the parameter
| |
| sendPartialText | back to summary |
|---|---|
| public void sendPartialText(String text, boolean last, Callback callback) Implements org. Doc from org. Initiates the asynchronous send of a TEXT frame, possibly part of a larger binary message, notifying the given callback when the frame send is completed, either successfully or with a failure. Non-final frames must be sent with the parameter | |
| sendPing | back to summary |
|---|---|
| public void sendPing(ByteBuffer applicationData, Callback callback) Implements org. Doc from org. Initiates the asynchronous send of a PING frame, notifying the given callback when the frame send is completed, either successfully or with a failure.
| |
| sendPong | back to summary |
|---|---|
| public void sendPong(ByteBuffer applicationData, Callback callback) Implements org. Doc from org. Initiates the asynchronous send of a PONG frame, notifying the given callback when the frame send is completed, either successfully or with a failure.
| |
| sendText | back to summary |
|---|---|
| public void sendText(String text, Callback callback) Implements org. Doc from org. Initiates the asynchronous send of a TEXT message, notifying the given callback when the message send is completed, either successfully or with a failure. | |
| setAutoFragment | back to summary |
|---|---|
| public void setAutoFragment(boolean autoFragment) Implements org. Doc from org. If set to true, frames are automatically fragmented to respect the maximum frame size.
| |
| setIdleTimeout | back to summary |
|---|---|
| public void setIdleTimeout(Duration duration) Implements org. Doc from org. The duration that a websocket may be idle before being closed by the implementation | |
| setInputBufferSize | back to summary |
|---|---|
| public void setInputBufferSize(int size) Implements org. Doc from org. The input (read from network layer) buffer size.
| |
| setMaxBinaryMessageSize | back to summary |
|---|---|
| public void setMaxBinaryMessageSize(long size) Implements org. Doc from org. The maximum size of a binary message during parsing/generating.
Binary messages over this maximum will result in a close code 1009
| |
| setMaxFrameSize | back to summary |
|---|---|
| public void setMaxFrameSize(long maxFrameSize) Implements org. Doc from org. The maximum payload size of any WebSocket Frame which can be received.
WebSocket Frames over this maximum will result in a close code 1009
| |
| setMaxOutgoingFrames | back to summary |
|---|---|
| public void setMaxOutgoingFrames(int maxOutgoingFrames) Implements org. Doc from org. Set the maximum number of data frames allowed to be waiting to be sent at any one time.
The default value is -1, this indicates there is no limit on how many frames can be
queued to be sent by the implementation. If the limit is exceeded, subsequent frames
sent are failed with a
| |
| setMaxTextMessageSize | back to summary |
|---|---|
| public void setMaxTextMessageSize(long size) Implements org. Doc from org. The maximum size of a text message during parsing/generating.
Text messages over this maximum will result in a close code 1009
| |
| setOutputBufferSize | back to summary |
|---|---|
| public void setOutputBufferSize(int size) Implements org. Doc from org. The output (write to network layer) buffer size.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non- | |