Class DittoConnect.Builder
java.lang.Object
com.ditto.java.transports.DittoConnect.Builder
-
Method Summary
Modifier and TypeMethodDescription@NonNull DittoConnect.BuilderaddTcpServers(@NonNull String... tcpServers) Adds TCP servers to the existing set of servers.@NonNull DittoConnect.BuilderaddTcpServers(@NonNull Collection<String> tcpServers) Adds TCP servers to the existing set of servers.@NonNull DittoConnect.BuilderaddWebsocketUrls(@NonNull String... websocketUrls) Adds WebSocket URLs to the existing set of URLs.@NonNull DittoConnect.BuilderaddWebsocketUrls(@NonNull Collection<String> websocketUrls) Adds WebSocket URLs to the existing set of URLs.longReturns the current retry interval in milliseconds.@NonNull DittoConnect.BuilderretryIntervalMs(long retryIntervalMs) Sets the retry interval for connection attempts.@NonNull DittoConnect.BuildersetTcpServers(@NonNull String... tcpServers) Sets the TCP servers to connect to, replacing any existing servers.@NonNull DittoConnect.BuildersetTcpServers(@NonNull Collection<String> tcpServers) Sets the TCP servers to connect to, replacing any existing servers.@NonNull DittoConnect.BuildersetWebsocketUrls(@NonNull String... websocketUrls) Sets the WebSocket URLs to connect to, replacing any existing URLs.@NonNull DittoConnect.BuildersetWebsocketUrls(@NonNull Collection<String> websocketUrls) Sets the WebSocket URLs to connect to, replacing any existing URLs.Returns the current set of configured TCP servers.Returns the current set of configured WebSocket URLs.
-
Method Details
-
tcpServers
-
setTcpServers
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
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
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
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
-
setWebsocketUrls
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
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
Adds WebSocket URLs to the existing set of URLs.- Parameters:
websocketUrls- WebSocket URLs to add.- Returns:
- this Builder for method chaining.
-
addWebsocketUrls
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
Sets the retry interval for connection attempts.- Parameters:
retryIntervalMs- the retry interval in milliseconds.- Returns:
- this Builder for method chaining.
-