public abstract class AbstractWebSocketClient extends Object implements WebSocketClient
WebSocketClient
implementations.Constructor and Description |
---|
AbstractWebSocketClient() |
Modifier and Type | Method and Description |
---|---|
protected void |
assertUri(URI uri) |
ListenableFuture<WebSocketSession> |
doHandshake(WebSocketHandler webSocketHandler,
String uriTemplate,
Object... uriVars) |
ListenableFuture<WebSocketSession> |
doHandshake(WebSocketHandler webSocketHandler,
WebSocketHttpHeaders headers,
URI uri) |
protected abstract ListenableFuture<WebSocketSession> |
doHandshakeInternal(WebSocketHandler webSocketHandler,
HttpHeaders headers,
URI uri,
List<String> subProtocols,
List<WebSocketExtension> extensions,
Map<String,Object> attributes)
Perform the actual handshake to establish a connection to the server.
|
protected final Log logger
public ListenableFuture<WebSocketSession> doHandshake(WebSocketHandler webSocketHandler, String uriTemplate, Object... uriVars)
doHandshake
in interface WebSocketClient
public final ListenableFuture<WebSocketSession> doHandshake(WebSocketHandler webSocketHandler, WebSocketHttpHeaders headers, URI uri)
doHandshake
in interface WebSocketClient
protected void assertUri(URI uri)
protected abstract ListenableFuture<WebSocketSession> doHandshakeInternal(WebSocketHandler webSocketHandler, HttpHeaders headers, URI uri, List<String> subProtocols, List<WebSocketExtension> extensions, Map<String,Object> attributes)
webSocketHandler
- the client-side handler for WebSocket messagesheaders
- HTTP headers to use for the handshake, with unwanted (forbidden)
headers filtered out, never null
uri
- the target URI for the handshake, never null
subProtocols
- requested sub-protocols, or an empty listextensions
- requested WebSocket extensions, or an empty listattributes
- attributes to associate with the WebSocketSession, i.e. via
WebSocketSession.getAttributes()
; currently always an empty map.