Class DittoConnect.Builder

java.lang.Object
com.ditto.java.transports.DittoConnect.Builder
Enclosing class:
DittoConnect

public static final class DittoConnect.Builder extends Object
Builder for constructing a DittoConnect configuration.
  • Method Details

    • tcpServers

      public @NonNull Set<String> tcpServers()
      Returns the current set of configured TCP servers.
      Returns:
      a mutable Set of TCP server addresses.
    • setTcpServers

      public @NonNull DittoConnect.Builder setTcpServers(@NonNull String... tcpServers)
      Sets the TCP servers to connect to, replacing any existing servers.
      Parameters:
      tcpServers - TCP server addresses in "host:port" format.
      Returns:
      this Builder for method chaining.
    • setTcpServers

      public @NonNull DittoConnect.Builder setTcpServers(@NonNull Collection<String> tcpServers)
      Sets the TCP servers to connect to, replacing any existing servers.
      Parameters:
      tcpServers - a collection of TCP server addresses in "host:port" format.
      Returns:
      this Builder for method chaining.
    • addTcpServers

      public @NonNull DittoConnect.Builder addTcpServers(@NonNull String... tcpServers)
      Adds TCP servers to the existing set of servers.
      Parameters:
      tcpServers - TCP server addresses in "host:port" format to add.
      Returns:
      this Builder for method chaining.
    • addTcpServers

      public @NonNull DittoConnect.Builder addTcpServers(@NonNull Collection<String> tcpServers)
      Adds TCP servers to the existing set of servers.
      Parameters:
      tcpServers - a collection of TCP server addresses to add.
      Returns:
      this Builder for method chaining.
    • websocketUrls

      public @NonNull Set<String> websocketUrls()
      Returns the current set of configured WebSocket URLs.
      Returns:
      a mutable Set of WebSocket URLs.
    • setWebsocketUrls

      public @NonNull DittoConnect.Builder setWebsocketUrls(@NonNull String... websocketUrls)
      Sets the WebSocket URLs to connect to, replacing any existing URLs.
      Parameters:
      websocketUrls - WebSocket URLs (e.g., "wss://example.ditto.live").
      Returns:
      this Builder for method chaining.
    • setWebsocketUrls

      public @NonNull DittoConnect.Builder setWebsocketUrls(@NonNull Collection<String> websocketUrls)
      Sets the WebSocket URLs to connect to, replacing any existing URLs.
      Parameters:
      websocketUrls - a collection of WebSocket URLs.
      Returns:
      this Builder for method chaining.
    • addWebsocketUrls

      public @NonNull DittoConnect.Builder addWebsocketUrls(@NonNull String... websocketUrls)
      Adds WebSocket URLs to the existing set of URLs.
      Parameters:
      websocketUrls - WebSocket URLs to add.
      Returns:
      this Builder for method chaining.
    • addWebsocketUrls

      public @NonNull DittoConnect.Builder addWebsocketUrls(@NonNull Collection<String> websocketUrls)
      Adds WebSocket URLs to the existing set of URLs.
      Parameters:
      websocketUrls - a collection of WebSocket URLs to add.
      Returns:
      this Builder for method chaining.
    • retryIntervalMs

      public long retryIntervalMs()
      Returns the current retry interval in milliseconds.
      Returns:
      the retry interval in milliseconds.
    • retryIntervalMs

      public @NonNull DittoConnect.Builder retryIntervalMs(long retryIntervalMs)
      Sets the retry interval for connection attempts.
      Parameters:
      retryIntervalMs - the retry interval in milliseconds.
      Returns:
      this Builder for method chaining.