public class StandardWebSocketClient extends WebSocketClientSupport implements WebSocketClient
WebSocketClient
implementation for use with the Java WebSocket API.logger
Constructor and Description |
---|
StandardWebSocketClient()
Default constructor that calls
ContainerProvider.getWebSocketContainer() to obtain a (new)
WebSocketContainer instance. |
StandardWebSocketClient(javax.websocket.WebSocketContainer webSocketContainer)
Constructor accepting an existing
WebSocketContainer instance. |
Modifier and Type | Method and Description |
---|---|
protected DataBufferFactory |
bufferFactory() |
protected StandardWebSocketSession |
createWebSocketSession(javax.websocket.Session session,
HandshakeInfo info,
reactor.core.publisher.MonoProcessor<java.lang.Void> completion) |
reactor.core.publisher.Mono<java.lang.Void> |
execute(java.net.URI url,
HttpHeaders headers,
WebSocketHandler handler)
A variant of
WebSocketClient.execute(URI, WebSocketHandler) with custom headers. |
reactor.core.publisher.Mono<java.lang.Void> |
execute(java.net.URI url,
WebSocketHandler handler)
Execute a handshake request to the given url and handle the resulting
WebSocket session with the given handler.
|
javax.websocket.WebSocketContainer |
getWebSocketContainer()
Return the configured
WebSocketContainer to use. |
afterHandshake, beforeHandshake
public StandardWebSocketClient()
ContainerProvider.getWebSocketContainer()
to obtain a (new)
WebSocketContainer
instance.public StandardWebSocketClient(javax.websocket.WebSocketContainer webSocketContainer)
WebSocketContainer
instance.webSocketContainer
- a web socket containerpublic javax.websocket.WebSocketContainer getWebSocketContainer()
WebSocketContainer
to use.public reactor.core.publisher.Mono<java.lang.Void> execute(java.net.URI url, WebSocketHandler handler)
WebSocketClient
execute
in interface WebSocketClient
url
- the handshake urlhandler
- the handler of the WebSocket sessionMono<Void>
to indicate the outcome of the
WebSocket session handling.public reactor.core.publisher.Mono<java.lang.Void> execute(java.net.URI url, HttpHeaders headers, WebSocketHandler handler)
WebSocketClient
WebSocketClient.execute(URI, WebSocketHandler)
with custom headers.execute
in interface WebSocketClient
url
- the handshake urlheaders
- custom headers for the handshake requesthandler
- the handler of the WebSocket sessionMono<Void>
to indicate the outcome of the
WebSocket session handling.protected StandardWebSocketSession createWebSocketSession(javax.websocket.Session session, HandshakeInfo info, reactor.core.publisher.MonoProcessor<java.lang.Void> completion)
protected DataBufferFactory bufferFactory()