Class JdkWebsocketConnector

java.lang.Object
io.fluxzero.sdk.common.websocket.JdkWebsocketConnector
All Implemented Interfaces:
WebsocketConnector

public class JdkWebsocketConnector extends Object implements WebsocketConnector
Low-level Fluxzero websocket connector backed by the JDK HttpClient websocket implementation.

The JDK WebSocket API does not expose successful 101 Switching Protocols response headers directly. This connector captures them through a shared CookieHandler wrapper while preserving any cookie handler configured on the supplied HttpClient.

  • Constructor Details

    • JdkWebsocketConnector

      public JdkWebsocketConnector()
      Creates a connector backed by a default HTTP/1.1 HttpClient.
    • JdkWebsocketConnector

      public JdkWebsocketConnector(HttpClient httpClient)
      Creates a connector backed by the supplied HTTP client.

      A single internal client is derived from this client so the connector can install its handshake-header capturing cookie handler without mutating the original client.

      Parameters:
      httpClient - base client whose proxy, SSL, authenticator, executor, cookie, and timeout settings are reused
    • JdkWebsocketConnector

      public JdkWebsocketConnector(HttpClient httpClient, Executor executor)
      Creates a connector backed by the supplied HTTP client and executor.

      The executor is used for the internal HTTP client derived from the supplied client and for dispatching native JDK websocket listener callbacks.

      Parameters:
      httpClient - base client whose proxy, SSL, authenticator, cookie, and timeout settings are reused
      executor - executor for JDK websocket and listener callback work
  • Method Details