| Modifier and Type | Field and Description |
|---|---|
| private long | |
| private final Configuration. | |
| private final WebSocketCoreClient | |
| private final JettyWebSocketFrameHandlerFactory | |
| private final int | |
| private static final Logger | |
| private final List | |
| private final SessionTracker | |
| private boolean |
| Access | Constructor and Description |
|---|---|
| public | |
| public | WebSocketClient(HttpClient
the HttpClient to use httpClient)Instantiates a WebSocketClient with the given |
| Modifier and Type | Method and Description |
|---|---|
| public void | addSessionListener(WebSocketSessionListener
the listener listener)Implements org. Register a WebSocketSessionListener with the container |
| public CompletableFuture | |
| public CompletableFuture | Returns: the future for the session, available on success of connectthe websocket object websocket, URI the websocket uri to connect to toUri, ClientUpgradeRequest the upgrade request information request)Connect to remote websocket endpoint |
| public CompletableFuture | Returns: the future for the session, available on success of connectthe websocket object websocket, URI the websocket uri to connect to toUri, ClientUpgradeRequest the upgrade request information request, JettyUpgradeListener the upgrade listener upgradeListener)Connect to remote websocket endpoint |
| protected void | doStop()
Overrides org. Stops the managed lifecycle beans in the reverse order they were added. |
| public void | dump(Appendable
The appendable to dump to out, String The indent to apply after any new lines. indent)Overrides org. Implements org. Dump this object (and children) into an Appendable using the provided indent after any new lines. |
| public SocketAddress | |
| public long | |
| public Executor | getExecutor()
Implements org. The Container provided Executor. |
| public HttpClient | |
| 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 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 DecoratedObjectFactory | |
| public Collection | getOpenSessions()
Implements org. Get the collection of open Sessions being tracked by this container |
| public int | getOutputBufferSize()
Implements org. The output (write to network layer) buffer size. |
| public SslContextFactory | Returns: theSslContextFactory that manages TLS encryptionGet the |
| public long | |
| public boolean | isAutoFragment()
Implements org. If true, frames are automatically fragmented to respect the maximum frame size. |
| public boolean | |
| public void | notifySessionListeners(Consumer<WebSocketSessionListener>
the consumer to call for each tracked listener consumer)Implements org. Notify the Session Listeners of an event. |
| public boolean | removeSessionListener(WebSocketSessionListener
the listener listener)Implements org. Remove a WebSocketSessionListener from the container |
| 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 | |
| public void | setConnectTimeout(long
the timeout in milliseconds ms)Set the timeout for connecting to the remote server. |
| 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 void | setStopAtShutdown(boolean
If true, this client instance will be explicitly stopped when the
JVM is shutdown. Otherwise the application is responsible for maintaining the WebSocketClient lifecycle. stop)Set JVM shutdown behavior. |
| public void | setStopTimeout(long
the time in ms to wait for the graceful close, use a value less than or equal to 0 to not gracefully close. stopTimeout)The timeout to allow all remaining open Sessions to be closed gracefully using the close code |
| public String | toString()
Overrides org. Returns a string representation of the object. |
| _stopTimeout | back to summary |
|---|---|
| private long _stopTimeout | |
| configurationCustomizer | back to summary |
|---|---|
| private final Configuration. | |
| coreClient | back to summary |
|---|---|
| private final WebSocketCoreClient coreClient | |
| frameHandlerFactory | back to summary |
|---|---|
| private final JettyWebSocketFrameHandlerFactory frameHandlerFactory | |
| id | back to summary |
|---|---|
| private final int id | |
| LOG | back to summary |
|---|---|
| private static final Logger LOG Hides org. | |
| sessionListeners | back to summary |
|---|---|
| private final List<WebSocketSessionListener> sessionListeners | |
| sessionTracker | back to summary |
|---|---|
| private final SessionTracker sessionTracker | |
| stopAtShutdown | back to summary |
|---|---|
| private boolean stopAtShutdown | |
| WebSocketClient | back to summary |
|---|---|
| public WebSocketClient() Instantiates a WebSocketClient with a default | |
| WebSocketClient | back to summary |
|---|---|
| public WebSocketClient(HttpClient httpClient) Instantiates a WebSocketClient with the given
| |
| addSessionListener | back to summary |
|---|---|
| public void addSessionListener(WebSocketSessionListener listener) Implements org. Doc from org. Register a WebSocketSessionListener with the container
| |
| connect | back to summary |
|---|---|
| public CompletableFuture | |
| connect | back to summary |
|---|---|
| public CompletableFuture Connect to remote websocket endpoint
| |
| connect | back to summary |
|---|---|
| public CompletableFuture Connect to remote websocket endpoint
| |
| doStop | back to summary |
|---|---|
| protected void doStop() throws Exception Overrides org. Doc from org. Stops the managed lifecycle beans in the reverse order they were added.
| |
| dump | back to summary |
|---|---|
| public void dump(Appendable out, String indent) throws IOException Overrides org. 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.
| |
| getBindAddress | back to summary |
|---|---|
| public SocketAddress getBindAddress() | |
| getConnectTimeout | back to summary |
|---|---|
| public long getConnectTimeout() | |
| getExecutor | back to summary |
|---|---|
| public Executor getExecutor() Implements org. Doc from org. The Container provided Executor.
| |
| getHttpClient | back to summary |
|---|---|
| public HttpClient getHttpClient() | |
| 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.
| |
| 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
| |
| getObjectFactory | back to summary |
|---|---|
| public DecoratedObjectFactory getObjectFactory() | |
| getOpenSessions | back to summary |
|---|---|
| public Collection Implements org. Doc from org. Get the collection of open Sessions being tracked by this container
| |
| 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.
| |
| getSslContextFactory | back to summary |
|---|---|
| public SslContextFactory getSslContextFactory() Get the
| |
| getStopTimeout | back to summary |
|---|---|
| public long getStopTimeout() | |
| isAutoFragment | back to summary |
|---|---|
| public boolean isAutoFragment() Implements org. Doc from org. If true, frames are automatically fragmented to respect the maximum frame size.
| |
| isStopAtShutdown | back to summary |
|---|---|
| public boolean isStopAtShutdown() | |
| notifySessionListeners | back to summary |
|---|---|
| public void notifySessionListeners(Consumer<WebSocketSessionListener> consumer) Implements org. Doc from org. Notify the Session Listeners of an event.
| |
| removeSessionListener | back to summary |
|---|---|
| public boolean removeSessionListener(WebSocketSessionListener listener) Implements org. Doc from org. Remove a WebSocketSessionListener from the container
| |
| 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.
| |
| setBindAddress | back to summary |
|---|---|
| public void setBindAddress(SocketAddress bindAddress) | |
| setConnectTimeout | back to summary |
|---|---|
| public void setConnectTimeout(long ms) Set the timeout for connecting to the remote server.
| |
| 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.
| |
| setStopAtShutdown | back to summary |
|---|---|
| public void setStopAtShutdown(boolean stop) Set JVM shutdown behavior.
| |
| setStopTimeout | back to summary |
|---|---|
| public void setStopTimeout(long stopTimeout) The timeout to allow all remaining open Sessions to be closed gracefully using the close code
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides org. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non- | |