public class Mqtt3AsyncClientView extends java.lang.Object implements Mqtt3AsyncClient
Modifier and Type | Class and Description |
---|---|
static class |
Mqtt3AsyncClientView.Mqtt3SubscribeViewAndCallbackBuilder |
Mqtt3AsyncClient.Mqtt3SubscribeAndCallbackBuilder
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 java.util.concurrent.CompletableFuture<Mqtt3ConnAck> |
connect(@Nullable Mqtt3Connect connect)
Connects this client with the given Connect message.
|
@NotNull java.util.concurrent.CompletableFuture<java.lang.Void> |
disconnect()
Disconnects this client.
|
@NotNull Mqtt3ClientConfig |
getConfig() |
@NotNull java.util.concurrent.CompletableFuture<Mqtt3Publish> |
publish(@Nullable Mqtt3Publish publish)
Publishes the given Publish message.
|
void |
publishes(@Nullable MqttGlobalPublishFilter filter,
@Nullable java.util.function.Consumer<Mqtt3Publish> callback)
Globally consumes all incoming Publish messages matching the given filter.
|
void |
publishes(@Nullable MqttGlobalPublishFilter filter,
@Nullable java.util.function.Consumer<Mqtt3Publish> callback,
@Nullable java.util.concurrent.Executor executor)
Globally consumes all incoming Publish messages matching the given filter.
|
@NotNull java.util.concurrent.CompletableFuture<Mqtt3SubAck> |
subscribe(@Nullable Mqtt3Subscribe subscribe)
Subscribes this client with the given Subscribe message.
|
@NotNull java.util.concurrent.CompletableFuture<Mqtt3SubAck> |
subscribe(@Nullable Mqtt3Subscribe subscribe,
@Nullable java.util.function.Consumer<Mqtt3Publish> callback)
Subscribes this client with the given Subscribe message and consumes the the incoming Publish messages matching
the subscriptions of the Subscribe message with a callback.
|
@NotNull java.util.concurrent.CompletableFuture<Mqtt3SubAck> |
subscribe(@Nullable Mqtt3Subscribe subscribe,
@Nullable java.util.function.Consumer<Mqtt3Publish> callback,
@Nullable java.util.concurrent.Executor executor)
Subscribes this client with the given Subscribe message and consumes the the incoming Publish messages matching
the subscriptions of the Subscribe message with a callback.
|
@NotNull Mqtt3BlockingClient |
toBlocking()
Turns the API of this client into a blocking API.
|
@NotNull Mqtt3RxClient |
toRx()
Turns the API of this client into a reactive API.
|
@NotNull java.util.concurrent.CompletableFuture<java.lang.Void> |
unsubscribe(@Nullable Mqtt3Unsubscribe unsubscribe)
Unsubscribes this client with the given Unsubscribe message.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
connect, connectWith, publishWith, subscribeWith, toAsync, unsubscribeWith
builder
@NotNull public @NotNull java.util.concurrent.CompletableFuture<Mqtt3ConnAck> connect(@Nullable @Nullable Mqtt3Connect connect)
Mqtt3AsyncClient
connect
in interface Mqtt3AsyncClient
connect
- the Connect message sent to the broker.CompletableFuture
which
Mqtt3ConnAckException
wrapping the ConnAck message if it contains an Error Code or@NotNull public @NotNull java.util.concurrent.CompletableFuture<Mqtt3SubAck> subscribe(@Nullable @Nullable Mqtt3Subscribe subscribe)
Mqtt3AsyncClient
See Mqtt3AsyncClient.publishes(MqttGlobalPublishFilter, Consumer)
or Mqtt3AsyncClient.publishes(MqttGlobalPublishFilter, Consumer,
Executor)
to consume the incoming Publish messages. Alternatively, call Mqtt3AsyncClient.subscribe(Mqtt3Subscribe,
Consumer)
or Mqtt3AsyncClient.subscribe(Mqtt3Subscribe, Consumer, Executor)
to consume the incoming Publish messages
matching the subscriptions of the Subscribe message directly.
subscribe
in interface Mqtt3AsyncClient
subscribe
- the Subscribe messages sent to the broker.CompletableFuture
which
Mqtt3SubAckException
wrapping the SubAck message if it contains at least one Error Code or@NotNull public @NotNull java.util.concurrent.CompletableFuture<Mqtt3SubAck> subscribe(@Nullable @Nullable Mqtt3Subscribe subscribe, @Nullable @Nullable java.util.function.Consumer<Mqtt3Publish> callback)
Mqtt3AsyncClient
subscribe
in interface Mqtt3AsyncClient
subscribe
- the Subscribe messages sent to the broker.callback
- the callback for consuming the incoming Publish messages matching the subscriptions of the
Subscribe message.Mqtt3AsyncClient.subscribe(Mqtt3Subscribe)
.Mqtt3AsyncClient.subscribe(Mqtt3Subscribe, Consumer, Executor)
@NotNull public @NotNull java.util.concurrent.CompletableFuture<Mqtt3SubAck> subscribe(@Nullable @Nullable Mqtt3Subscribe subscribe, @Nullable @Nullable java.util.function.Consumer<Mqtt3Publish> callback, @Nullable @Nullable java.util.concurrent.Executor executor)
Mqtt3AsyncClient
The future is completed and the callback is executed on the given executor.
subscribe
in interface Mqtt3AsyncClient
subscribe
- the Subscribe messages sent to the broker.callback
- the callback for consuming the incoming Publish messages matching the subscriptions of the
Subscribe message.executor
- the executor where the future is completed and the callback is executed on.Mqtt3AsyncClient.subscribe(Mqtt3Subscribe)
.Mqtt3AsyncClient.subscribe(Mqtt3Subscribe, Consumer)
public void publishes(@Nullable @Nullable MqttGlobalPublishFilter filter, @Nullable @Nullable java.util.function.Consumer<Mqtt3Publish> callback)
Mqtt3AsyncClient
publishes
in interface Mqtt3AsyncClient
filter
- the filter with which all incoming Publish messages are filtered.callback
- the callback for all incoming Publish messages matching the given filter.Mqtt3AsyncClient.publishes(MqttGlobalPublishFilter, Consumer, Executor)
public void publishes(@Nullable @Nullable MqttGlobalPublishFilter filter, @Nullable @Nullable java.util.function.Consumer<Mqtt3Publish> callback, @Nullable @Nullable java.util.concurrent.Executor executor)
Mqtt3AsyncClient
publishes
in interface Mqtt3AsyncClient
filter
- the filter with which all incoming Publish messages are filtered.callback
- the callback for all incoming Publish messages matching the given filter.executor
- the executor where the callback is executed on.Mqtt3AsyncClient.publishes(MqttGlobalPublishFilter, Consumer)
@NotNull public @NotNull java.util.concurrent.CompletableFuture<java.lang.Void> unsubscribe(@Nullable @Nullable Mqtt3Unsubscribe unsubscribe)
Mqtt3AsyncClient
unsubscribe
in interface Mqtt3AsyncClient
unsubscribe
- the Unsubscribe message sent to the broker.CompletableFuture
which
@NotNull public @NotNull java.util.concurrent.CompletableFuture<Mqtt3Publish> publish(@Nullable @Nullable Mqtt3Publish publish)
Mqtt3AsyncClient
publish
in interface Mqtt3AsyncClient
publish
- the Publish message sent to the broker.CompletableFuture
which
@NotNull public @NotNull java.util.concurrent.CompletableFuture<java.lang.Void> disconnect()
Mqtt3AsyncClient
disconnect
in interface Mqtt3AsyncClient
CompletableFuture
which
@NotNull public @NotNull Mqtt3ClientConfig getConfig()
getConfig
in interface Mqtt3Client
getConfig
in interface MqttClient
@NotNull public @NotNull Mqtt3RxClient toRx()
Mqtt3Client
The reactive API can be used simultaneously with the other APIs.
toRx
in interface Mqtt3Client
@NotNull public @NotNull Mqtt3BlockingClient toBlocking()
Mqtt3Client
The blocking API can be used simultaneously with the other APIs.
toBlocking
in interface Mqtt3Client