Interface MqttClientBuilderBase<B extends MqttClientBuilderBase<B>>
- Type Parameters:
B- the type of the builder.
- All Known Subinterfaces:
Mqtt3ClientBuilder,Mqtt5ClientBuilder,MqttClientBuilder
MqttClient.- Since:
- 1.0
-
Method Summary
Modifier and TypeMethodDescriptionaddConnectedListener(@NotNull MqttClientConnectedListener connectedListener) Adds a listener which is notified when the client is connected (a successful ConnAck message is received).addDisconnectedListener(@NotNull MqttClientDisconnectedListener disconnectedListener) Adds a listener which is notified when the client is disconnected (with or without a Disconnect message) or the connection fails.@NotNull MqttClientAutoReconnectBuilder.Nested<? extends B> Fluent counterpart ofautomaticReconnect(MqttClientAutoReconnect).automaticReconnect(@Nullable MqttClientAutoReconnect autoReconnect) Sets the optionalautomatic reconnect strategy.Uses automatic reconnect with the default configuration.@NotNull MqttClientExecutorConfigBuilder.Nested<? extends B> Fluent counterpart ofexecutorConfig(MqttClientExecutorConfig).executorConfig(@NotNull MqttClientExecutorConfig executorConfig) Sets theexecutor configuration.identifier(@NotNull MqttClientIdentifier identifier) Sets theClient Identifier.identifier(@NotNull String identifier) Sets theClient Identifier.serverAddress(@NotNull InetSocketAddress address) Sets theserver addressto connect to.serverHost(@NotNull String host) Sets theserver hostto connect to.serverHost(@NotNull InetAddress host) Sets theserver hostto connect to.serverPort(int port) Sets theserver portto connect to.@NotNull MqttClientSslConfigBuilder.Nested<? extends B> Fluent counterpart ofsslConfig(MqttClientSslConfig).sslConfig(@Nullable MqttClientSslConfig sslConfig) Sets the optionalsecure transport configuration.Sets thesecure transport configurationto the default configuration.@NotNull MqttClientTransportConfigBuilder.Nested<? extends B> Fluent counterpart oftransportConfig(MqttClientTransportConfig).transportConfig(@NotNull MqttClientTransportConfig transportConfig) Sets thetransport configuration.default @NotNull MqttClientSslConfigBuilder.Nested<? extends B> useSsl()Deprecated.default BuseSsl(@Nullable MqttClientSslConfig sslConfig) Deprecated.default BDeprecated.default @NotNull MqttWebSocketConfigBuilder.Nested<? extends B> Deprecated.usewebSocketConfig().default BuseWebSocket(@Nullable MqttWebSocketConfig webSocketConfig) Deprecated.default BDeprecated.@NotNull MqttWebSocketConfigBuilder.Nested<? extends B> Fluent counterpart ofwebSocketConfig(MqttWebSocketConfig).webSocketConfig(@Nullable MqttWebSocketConfig webSocketConfig) Sets the optionalWebSocket transport configuration.Sets theWebSocket transport configurationto the default configuration.
-
Method Details
-
identifier
Sets theClient Identifier.- Parameters:
identifier- the string representation of the Client Identifier.- Returns:
- the builder.
-
identifier
Sets theClient Identifier.- Parameters:
identifier- the Client Identifier.- Returns:
- the builder.
-
serverAddress
Sets theserver addressto connect to.- Parameters:
address- the server address.- Returns:
- the builder
- Since:
- 1.1
-
serverHost
Sets theserver hostto connect to.- Parameters:
host- the server host.- Returns:
- the builder.
-
serverHost
Sets theserver hostto connect to.- Parameters:
host- the server host.- Returns:
- the builder.
- Since:
- 1.1
-
serverPort
Sets theserver portto connect to.- Parameters:
port- the server port.- Returns:
- the builder.
-
useSslWithDefaultConfig
Deprecated.- Returns:
- use
sslWithDefaultConfig().
-
sslWithDefaultConfig
Sets thesecure transport configurationto the default configuration.This means that the systems default trust store, ciphers and protocols are used.
- Returns:
- the builder.
- Since:
- 1.1
-
useSsl
Deprecated.- Parameters:
sslConfig- usesslConfig(MqttClientSslConfig).- Returns:
- use
sslConfig(MqttClientSslConfig).
-
sslConfig
Sets the optionalsecure transport configuration.- Parameters:
sslConfig- the secure transport configuration ornullto remove any previously set secure transport configuration.- Returns:
- the builder.
- Since:
- 1.1
-
useSsl
Deprecated.usesslConfig().UsesslConfig().- Returns:
- use
sslConfig().
-
sslConfig
Fluent counterpart ofsslConfig(MqttClientSslConfig).Calling
MqttClientSslConfigBuilder.Nested.applySslConfig()on the returned builder has the effect of extending the current secure transport configuration.- Returns:
- the fluent builder for the secure transport configuration.
- Since:
- 1.1
- See Also:
-
useWebSocketWithDefaultConfig
Deprecated.- Returns:
- use
webSocketWithDefaultConfig().
-
webSocketWithDefaultConfig
Sets theWebSocket transport configurationto the default configuration.- Returns:
- the builder.
- Since:
- 1.1
-
useWebSocket
@Deprecated @NotNull default B useWebSocket(@Nullable @Nullable MqttWebSocketConfig webSocketConfig) Deprecated.- Parameters:
webSocketConfig- usewebSocketConfig(MqttWebSocketConfig).- Returns:
- use
webSocketConfig(MqttWebSocketConfig).
-
webSocketConfig
@CheckReturnValue @NotNull B webSocketConfig(@Nullable @Nullable MqttWebSocketConfig webSocketConfig) Sets the optionalWebSocket transport configuration.- Parameters:
webSocketConfig- the WebSocket transport configuration ornullto remove any previously set WebSocket transport configuration.- Returns:
- the builder.
- Since:
- 1.1
-
useWebSocket
Deprecated.usewebSocketConfig().UsewebSocketConfig().- Returns:
- use
webSocketConfig().
-
webSocketConfig
Fluent counterpart ofwebSocketConfig(MqttWebSocketConfig).Calling
MqttWebSocketConfigBuilder.Nested.applyWebSocketConfig()on the returned builder has the effect of extending the current WebSocket transport configuration.- Returns:
- the fluent builder for the WebSocket configuration.
- Since:
- 1.1
- See Also:
-
transportConfig
@CheckReturnValue @NotNull B transportConfig(@NotNull @NotNull MqttClientTransportConfig transportConfig) Sets thetransport configuration.- Parameters:
transportConfig- the transport configuration.- Returns:
- the builder.
- Since:
- 1.1
-
transportConfig
Fluent counterpart oftransportConfig(MqttClientTransportConfig).Calling
MqttClientTransportConfigBuilder.Nested.applyTransportConfig()on the returned builder has the effect of extending the current transport configuration.- Returns:
- the fluent builder for the transport configuration.
- Since:
- 1.1
- See Also:
-
executorConfig
@CheckReturnValue @NotNull B executorConfig(@NotNull @NotNull MqttClientExecutorConfig executorConfig) Sets theexecutor configuration.- Parameters:
executorConfig- the executor configuration.- Returns:
- the builder.
-
executorConfig
Fluent counterpart ofexecutorConfig(MqttClientExecutorConfig).Calling
MqttClientExecutorConfigBuilder.Nested.applyExecutorConfig()on the returned builder has the effect of extending the current executor configuration.- Returns:
- the fluent builder for the executor configuration.
- See Also:
-
automaticReconnectWithDefaultConfig
Uses automatic reconnect with the default configuration.- Returns:
- the builder.
- Since:
- 1.1
-
automaticReconnect
@CheckReturnValue @NotNull B automaticReconnect(@Nullable @Nullable MqttClientAutoReconnect autoReconnect) Sets the optionalautomatic reconnect strategy.- Parameters:
autoReconnect- the automatic reconnect strategy ornullto remove any previously set automatic reconnect strategy.- Returns:
- the builder.
- Since:
- 1.1
-
automaticReconnect
Fluent counterpart ofautomaticReconnect(MqttClientAutoReconnect).Calling
MqttClientAutoReconnectBuilder.Nested.applyAutomaticReconnect()on the returned builder has the effect of extending the current automatic reconnect strategy.- Returns:
- the fluent builder for the automatic reconnect strategy.
- Since:
- 1.1
- See Also:
-
addConnectedListener
@CheckReturnValue @NotNull B addConnectedListener(@NotNull @NotNull MqttClientConnectedListener connectedListener) Adds a listener which is notified when the client is connected (a successful ConnAck message is received).The listeners are called in the same order in which they are added.
- Parameters:
connectedListener- the listener to add.- Returns:
- the builder.
- Since:
- 1.1
-
addDisconnectedListener
@CheckReturnValue @NotNull B addDisconnectedListener(@NotNull @NotNull MqttClientDisconnectedListener disconnectedListener) Adds a listener which is notified when the client is disconnected (with or without a Disconnect message) or the connection fails.The listeners are called in the same order in which they are added.
- Parameters:
disconnectedListener- the listener to add.- Returns:
- the builder.
- Since:
- 1.1
-
sslConfig().