public class MqttBlockingClient extends java.lang.Object implements Mqtt5BlockingClient
Mqtt5BlockingClient.Mqtt5Publishes
DEFAULT_SERVER_HOST, DEFAULT_SERVER_PORT, DEFAULT_SERVER_PORT_SSL, DEFAULT_SERVER_PORT_WEBSOCKET, DEFAULT_SERVER_PORT_WEBSOCKET_SSL
Modifier and Type | Method and Description |
---|---|
@NotNull Mqtt5ConnAck |
connect(@Nullable Mqtt5Connect connect)
Connects this client with the given Connect message.
|
void |
disconnect(@NotNull Mqtt5Disconnect disconnect)
Disconnects this client with the given Disconnect message.
|
@NotNull MqttClientConfig |
getConfig() |
@NotNull Mqtt5PublishResult |
publish(@Nullable Mqtt5Publish publish)
Publishes the given Publish message.
|
@NotNull Mqtt5BlockingClient.Mqtt5Publishes |
publishes(@Nullable MqttGlobalPublishFilter filter)
Globally consumes all incoming Publish messages matching the given filter.
|
void |
reauth()
Re-authenticates this client.
|
@NotNull Mqtt5SubAck |
subscribe(@Nullable Mqtt5Subscribe subscribe)
Subscribes this client with the given Subscribe message.
|
@NotNull MqttAsyncClient |
toAsync()
Turns the API of this client into a asynchronous API based on futures and callbacks.
|
@NotNull MqttRxClient |
toRx()
Turns the API of this client into a reactive API.
|
@NotNull Mqtt5UnsubAck |
unsubscribe(@Nullable Mqtt5Unsubscribe unsubscribe)
Unsubscribes this client with the given Unsubscribe message.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
connect, connectWith, disconnect, disconnectWith, publishWith, subscribeWith, toBlocking, unsubscribeWith
builder
@NotNull public @NotNull Mqtt5ConnAck connect(@Nullable @Nullable Mqtt5Connect connect)
Mqtt5BlockingClient
connect
in interface Mqtt5BlockingClient
connect
- the Connect message sent to the broker.@NotNull public @NotNull Mqtt5SubAck subscribe(@Nullable @Nullable Mqtt5Subscribe subscribe)
Mqtt5BlockingClient
See Mqtt5BlockingClient.publishes(MqttGlobalPublishFilter)
to consume the incoming Publish messages.
subscribe
in interface Mqtt5BlockingClient
subscribe
- the Subscribe messages sent to the broker.@NotNull public @NotNull Mqtt5BlockingClient.Mqtt5Publishes publishes(@Nullable @Nullable MqttGlobalPublishFilter filter)
Mqtt5BlockingClient
publishes
in interface Mqtt5BlockingClient
filter
- the filter with which all incoming Publish messages are filtered.Mqtt5BlockingClient.Mqtt5Publishes
instance that can be used to receive the Publish messages on the calling
thread.@NotNull public @NotNull Mqtt5UnsubAck unsubscribe(@Nullable @Nullable Mqtt5Unsubscribe unsubscribe)
Mqtt5BlockingClient
unsubscribe
in interface Mqtt5BlockingClient
unsubscribe
- the Unsubscribe message sent to the broker.@NotNull public @NotNull Mqtt5PublishResult publish(@Nullable @Nullable Mqtt5Publish publish)
Mqtt5BlockingClient
publish
in interface Mqtt5BlockingClient
publish
- the Publish message sent to the broker.Mqtt5PublishResult
if the Publish message was successfully published (no acknowledgement
message contains an Error Code, Mqtt5PublishResult.getError()
will always be absent).public void reauth()
Mqtt5BlockingClient
reauth
in interface Mqtt5BlockingClient
public void disconnect(@NotNull @NotNull Mqtt5Disconnect disconnect)
Mqtt5BlockingClient
disconnect
in interface Mqtt5BlockingClient
disconnect
- the Disconnect message sent to the broker.@NotNull public @NotNull MqttClientConfig getConfig()
getConfig
in interface Mqtt5Client
getConfig
in interface MqttClient
@NotNull public @NotNull MqttRxClient toRx()
Mqtt5Client
The reactive API can be used simultaneously with the other APIs.
toRx
in interface Mqtt5Client
@NotNull public @NotNull MqttAsyncClient toAsync()
Mqtt5Client
The asynchronous API can be used simultaneously with the other APIs.
toAsync
in interface Mqtt5Client