Interface WebSocketClient

All Known Implementing Classes:
AbstractWebSocketClient, SockJsClient, StandardWebSocketClient

public interface WebSocketClient
Contract for initiating a WebSocket request. As an alternative considering using the declarative style WebSocketConnectionManager that starts a WebSocket connection to a pre-configured URI when the application starts.
Since:
4.0
Author:
Rossen Stoyanchev
See Also:
  • Method Details

    • doHandshake

      @Deprecated(since="6.0") default org.springframework.util.concurrent.ListenableFuture<WebSocketSession> doHandshake(WebSocketHandler webSocketHandler, String uriTemplate, Object... uriVariables)
      Deprecated.
      Execute a handshake request to the given url and handle the resulting WebSocket session with the given handler.
      Parameters:
      webSocketHandler - the session handler
      uriTemplate - the url template
      uriVariables - the variables to expand the template
      Returns:
      a future that completes when the session is available
    • execute

      CompletableFuture<WebSocketSession> execute(WebSocketHandler webSocketHandler, String uriTemplate, Object... uriVariables)
      Execute a handshake request to the given url and handle the resulting WebSocket session with the given handler.
      Parameters:
      webSocketHandler - the session handler
      uriTemplate - the url template
      uriVariables - the variables to expand the template
      Returns:
      a future that completes when the session is available
      Since:
      6.0
    • doHandshake

      @Deprecated(since="6.0") default org.springframework.util.concurrent.ListenableFuture<WebSocketSession> doHandshake(WebSocketHandler webSocketHandler, @Nullable WebSocketHttpHeaders headers, URI uri)
      Deprecated.
      Execute a handshake request to the given url and handle the resulting WebSocket session with the given handler.
      Parameters:
      webSocketHandler - the session handler
      uri - the url
      Returns:
      a future that completes when the session is available
    • execute

      CompletableFuture<WebSocketSession> execute(WebSocketHandler webSocketHandler, @Nullable WebSocketHttpHeaders headers, URI uri)
      Execute a handshake request to the given url and handle the resulting WebSocket session with the given handler.
      Parameters:
      webSocketHandler - the session handler
      uri - the url
      Returns:
      a future that completes when the session is available
      Since:
      6.0