public interface WebSocketClient
extends java.lang.AutoCloseable
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
SCHEME_WS
Constant for HTTP scheme.
|
static java.lang.String |
SCHEME_WSS
Constant for HTTPS scheme.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
<T extends java.lang.AutoCloseable> |
connect(java.lang.Class<T> clientEndpointType,
java.util.Map<java.lang.String,java.lang.Object> parameters)
Connect the given client endpoint type.
|
<T extends java.lang.AutoCloseable> |
connect(java.lang.Class<T> clientEndpointType,
MutableHttpRequest<?> request)
Connect the given client endpoint type to the URI over WebSocket.
|
default <T extends java.lang.AutoCloseable> |
connect(java.lang.Class<T> clientEndpointType,
java.lang.String uri)
Connect the given client endpoint type to the URI over WebSocket.
|
default <T extends java.lang.AutoCloseable> |
connect(java.lang.Class<T> clientEndpointType,
java.net.URI uri)
Connect the given client endpoint type to the URI over WebSocket.
|
static WebSocketClient |
create(java.net.URI uri)
Create a new
WebSocketClient. |
static WebSocketClient |
create(java.net.URI uri,
HttpClientConfiguration configuration)
Create a new
WebSocketClient with the specified configuration. |
static WebSocketClient |
create(java.net.URL url)
Deprecated.
Use
create(URI) instead |
static WebSocketClient |
create(java.net.URL url,
HttpClientConfiguration configuration)
Deprecated.
Use
create(URI, HttpClientConfiguration) instead |
static final java.lang.String SCHEME_WS
static final java.lang.String SCHEME_WSS
<T extends java.lang.AutoCloseable> org.reactivestreams.Publisher<T> connect(java.lang.Class<T> clientEndpointType,
MutableHttpRequest<?> request)
T - The generic typeclientEndpointType - The endpoint type. Should be a class annotated with ClientWebSocketrequest - The original request to establish the connectionPublisher that emits the ClientWebSocket instance<T extends java.lang.AutoCloseable> org.reactivestreams.Publisher<T> connect(java.lang.Class<T> clientEndpointType,
java.util.Map<java.lang.String,java.lang.Object> parameters)
connect(Class, URI) this method will the value declared within the ClientWebSocket as the URI
and expand the URI with the given parameters.T - The generic typeclientEndpointType - The endpoint type. Should be a class annotated with ClientWebSocketparameters - The URI parameters for the endpointPublisher that emits the ClientWebSocket instancevoid close()
close in interface java.lang.AutoCloseabledefault <T extends java.lang.AutoCloseable> org.reactivestreams.Publisher<T> connect(java.lang.Class<T> clientEndpointType,
java.lang.String uri)
T - The generic typeclientEndpointType - The endpoint type. Should be a class annotated with ClientWebSocketuri - The URI to connect overPublisher that emits the ClientWebSocket instancedefault <T extends java.lang.AutoCloseable> org.reactivestreams.Publisher<T> connect(java.lang.Class<T> clientEndpointType,
java.net.URI uri)
T - The generic typeclientEndpointType - The endpoint type. Should be a class annotated with ClientWebSocketuri - The URI to connect overPublisher that emits the ClientWebSocket instance@Deprecated @NonNull static WebSocketClient create(@Nullable java.net.URL url)
create(URI) insteadWebSocketClient.
Note that this method should only be used outside of the context of a Micronaut application.
The returned WebSocketClient is not subject to dependency injection.
The creator is responsible for closing the client to avoid leaking connections.
Within a Micronaut application use Inject to inject a client instead.url - The base URL@Deprecated @NonNull static WebSocketClient create(@Nullable java.net.URL url, HttpClientConfiguration configuration)
create(URI, HttpClientConfiguration) insteadWebSocketClient with the specified configuration. Note that this method should only be used
outside of the context of an application. Within Micronaut use Inject to inject a client insteadurl - The base URLconfiguration - the client configuration@NonNull static WebSocketClient create(@Nullable java.net.URI uri)
WebSocketClient.
Note that this method should only be used outside of the context of a Micronaut application.
The returned WebSocketClient is not subject to dependency injection.
The creator is responsible for closing the client to avoid leaking connections.
Within a Micronaut application use Inject to inject a client instead.uri - The base URI@NonNull static WebSocketClient create(@Nullable java.net.URI uri, HttpClientConfiguration configuration)
WebSocketClient with the specified configuration. Note that this method should only be used
outside of the context of an application. Within Micronaut use Inject to inject a client insteaduri - The base URIconfiguration - the client configuration