Class StandardWebSocketClient
java.lang.Object
org.springframework.web.reactive.socket.client.StandardWebSocketClient
- All Implemented Interfaces:
- WebSocketClient
- Direct Known Subclasses:
- TomcatWebSocketClient
WebSocketClient implementation for use with the Java WebSocket API.- Since:
- 5.0
- Author:
- Violeta Georgieva, Rossen Stoyanchev
- See Also:
- 
Constructor SummaryConstructorsConstructorDescriptionDefault constructor that callsContainerProvider.getWebSocketContainer()to obtain a (new)WebSocketContainerinstance.StandardWebSocketClient(WebSocketContainer webSocketContainer) Constructor accepting an existingWebSocketContainerinstance.
- 
Method SummaryModifier and TypeMethodDescriptionprotected DataBufferFactoryprotected StandardWebSocketSessioncreateWebSocketSession(Session session, HandshakeInfo info, reactor.core.publisher.Sinks.Empty<Void> completionSink) reactor.core.publisher.Mono<Void>execute(URI url, HttpHeaders headers, WebSocketHandler handler) A variant ofWebSocketClient.execute(URI, WebSocketHandler)with custom headers.reactor.core.publisher.Mono<Void>execute(URI url, WebSocketHandler handler) Execute a handshake request to the given url and handle the resulting WebSocket session with the given handler.Return the configuredWebSocketContainerto use.
- 
Constructor Details- 
StandardWebSocketClientpublic StandardWebSocketClient()Default constructor that callsContainerProvider.getWebSocketContainer()to obtain a (new)WebSocketContainerinstance.
- 
StandardWebSocketClientConstructor accepting an existingWebSocketContainerinstance.- Parameters:
- webSocketContainer- a web socket container
 
 
- 
- 
Method Details- 
getWebSocketContainerReturn the configuredWebSocketContainerto use.
- 
executeDescription copied from interface:WebSocketClientExecute a handshake request to the given url and handle the resulting WebSocket session with the given handler.- Specified by:
- executein interface- WebSocketClient
- Parameters:
- url- the handshake url
- handler- the handler of the WebSocket session
- Returns:
- completion Mono<Void>to indicate the outcome of the WebSocket session handling.
 
- 
executepublic reactor.core.publisher.Mono<Void> execute(URI url, HttpHeaders headers, WebSocketHandler handler) Description copied from interface:WebSocketClientA variant ofWebSocketClient.execute(URI, WebSocketHandler)with custom headers.- Specified by:
- executein interface- WebSocketClient
- Parameters:
- url- the handshake url
- headers- custom headers for the handshake request
- handler- the handler of the WebSocket session
- Returns:
- completion Mono<Void>to indicate the outcome of the WebSocket session handling.
 
- 
createWebSocketSessionprotected StandardWebSocketSession createWebSocketSession(Session session, HandshakeInfo info, reactor.core.publisher.Sinks.Empty<Void> completionSink) 
- 
bufferFactory
 
-