@DoNotImplement public interface Mqtt5RxClient extends Mqtt5Client
Mqtt5Client
.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 Single<Mqtt5ConnAck> |
connect()
Creates a
Single for connecting this client with the default Connect message. |
@NotNull Single<Mqtt5ConnAck> |
connect(@NotNull Mqtt5Connect connect)
Creates a
Single for connecting this client with the given Connect message. |
Mqtt5ConnectBuilder.Nested<Single<Mqtt5ConnAck>> |
connectWith()
Fluent counterpart of
connect(Mqtt5Connect) . |
@NotNull Completable |
disconnect()
Creates a
Completable for disconnecting this client with the default Disconnect message. |
@NotNull Completable |
disconnect(@NotNull Mqtt5Disconnect disconnect)
Creates a
Completable for disconnecting this client with the given Disconnect message. |
Mqtt5DisconnectBuilder.Nested<Completable> |
disconnectWith()
Fluent counterpart of
disconnect(Mqtt5Disconnect) . |
@NotNull Flowable<Mqtt5PublishResult> |
publish(@NotNull Flowable<Mqtt5Publish> publishFlowable)
|
@NotNull Flowable<Mqtt5Publish> |
publishes(@NotNull MqttGlobalPublishFilter filter)
Creates a
Flowable for globally consuming all incoming Publish messages matching the given filter. |
@NotNull Flowable<Mqtt5Publish> |
publishes(@NotNull MqttGlobalPublishFilter filter,
boolean manualAcknowledgement)
Creates a
Flowable for globally consuming all incoming Publish messages matching the given filter. |
@NotNull Completable |
reauth()
Creates a
Completable for re-authenticating this client. |
@NotNull Single<Mqtt5SubAck> |
subscribe(@NotNull Mqtt5Subscribe subscribe)
Creates a
Single for subscribing this client with the given Subscribe message. |
@NotNull FlowableWithSingle<Mqtt5Publish,Mqtt5SubAck> |
subscribePublishes(@NotNull Mqtt5Subscribe subscribe)
Creates a
FlowableWithSingle for subscribing this client with the given Subscribe message. |
@NotNull FlowableWithSingle<Mqtt5Publish,Mqtt5SubAck> |
subscribePublishes(@NotNull Mqtt5Subscribe subscribe,
boolean manualAcknowledgement)
Creates a
FlowableWithSingle for subscribing this client with the given Subscribe message. |
Mqtt5SubscribeBuilder.Publishes.Start<FlowableWithSingle<Mqtt5Publish,Mqtt5SubAck>> |
subscribePublishesWith()
Fluent counterpart of
subscribePublishes(Mqtt5Subscribe, boolean) . |
@NotNull FlowableWithSingle<Mqtt5Publish,Mqtt5SubAck> |
subscribeStream(@NotNull Mqtt5Subscribe subscribe)
Deprecated.
|
Mqtt5SubscribeBuilder.Nested.Start<FlowableWithSingle<Mqtt5Publish,Mqtt5SubAck>> |
subscribeStreamWith()
Deprecated.
|
Mqtt5SubscribeBuilder.Nested.Start<Single<Mqtt5SubAck>> |
subscribeWith()
Fluent counterpart of
subscribe(Mqtt5Subscribe) . |
default @NotNull Mqtt5RxClient |
toRx()
Turns the API of this client into a reactive API.
|
@NotNull Single<Mqtt5UnsubAck> |
unsubscribe(@NotNull Mqtt5Unsubscribe unsubscribe)
Creates a
Single for unsubscribing this client with the given Unsubscribe message. |
Mqtt5UnsubscribeBuilder.Nested.Start<Single<Mqtt5UnsubAck>> |
unsubscribeWith()
Fluent counterpart of
unsubscribe(Mqtt5Unsubscribe) . |
builder, getConfig, toAsync, toBlocking
getState
@CheckReturnValue @NotNull @NotNull Single<Mqtt5ConnAck> connect()
Single
for connecting this client with the default Connect message.connect(Mqtt5Connect)
.connect(Mqtt5Connect)
@CheckReturnValue @NotNull @NotNull Single<Mqtt5ConnAck> connect(@NotNull @NotNull Mqtt5Connect connect)
Single
for connecting this client with the given Connect message.
The returned Single
represents the source of the ConnAck message corresponding to the given Connect
message. Calling this method does not connect yet. Connecting is performed lazy and asynchronous when subscribing
(in terms of Reactive Streams) to the returned Single
.
connect
- the Connect message sent to the broker during connect.Single
which
Mqtt5ConnAckException
wrapping the ConnAck message if it contains an Error Code or
@CheckReturnValue Mqtt5ConnectBuilder.Nested<Single<Mqtt5ConnAck>> connectWith()
connect(Mqtt5Connect)
.
Calling Mqtt5ConnectBuilder.Nested#applyConnect()
on the returned builder has the same effect as calling
connect(Mqtt5Connect)
with the result of Mqtt5ConnectBuilder.build()
.
connect(Mqtt5Connect)
@CheckReturnValue @NotNull @NotNull Single<Mqtt5SubAck> subscribe(@NotNull @NotNull Mqtt5Subscribe subscribe)
Single
for subscribing this client with the given Subscribe message.
The returned Single
represents the source of the SubAck message corresponding to the given Subscribe
message. Calling this method does not subscribe yet. Subscribing is performed lazy and asynchronous when
subscribing (in terms of Reactive Streams) to the returned Single
.
See publishes(MqttGlobalPublishFilter)
to consume the incoming Publish messages. Alternatively, call
subscribePublishes(Mqtt5Subscribe)
to consume the incoming Publish messages matching the subscriptions
of the Subscribe message directly.
subscribe
- the Subscribe message sent to the broker during subscribe.Single
which
Mqtt5SubAckException
wrapping the SubAck message if it only contains Error Codes or
@CheckReturnValue Mqtt5SubscribeBuilder.Nested.Start<Single<Mqtt5SubAck>> subscribeWith()
subscribe(Mqtt5Subscribe)
.
Calling Mqtt5SubscribeBuilder.Nested.Complete#applySubscribe()
on the returned builder has the same
effect as calling subscribe(Mqtt5Subscribe)
with the result of Mqtt5SubscribeBuilder.Complete#build()
.
subscribe(Mqtt5Subscribe)
@Deprecated @NotNull @NotNull FlowableWithSingle<Mqtt5Publish,Mqtt5SubAck> subscribeStream(@NotNull @NotNull Mqtt5Subscribe subscribe)
subscribePublishes(Mqtt5Subscribe)
.subscribe
- use subscribePublishes(Mqtt5Subscribe)
.subscribePublishes(Mqtt5Subscribe)
.@Deprecated Mqtt5SubscribeBuilder.Nested.Start<FlowableWithSingle<Mqtt5Publish,Mqtt5SubAck>> subscribeStreamWith()
subscribePublishesWith()
.subscribePublishesWith()
.@CheckReturnValue @NotNull @NotNull FlowableWithSingle<Mqtt5Publish,Mqtt5SubAck> subscribePublishes(@NotNull @NotNull Mqtt5Subscribe subscribe)
FlowableWithSingle
for subscribing this client with the given Subscribe message.
The returned FlowableWithSingle
represents the source of the SubAck message corresponding to the given
Subscribe message and the source of the incoming Publish messages matching the subscriptions of the Subscribe
message. Calling this method does not subscribe yet. Subscribing is performed lazy and asynchronous when
subscribing (in terms of Reactive Streams) to the returned FlowableWithSingle
.
subscribe
- the Subscribe message sent to the broker during subscribe.FlowableWithSingle
which
Mqtt5SubAckException
wrapping the SubAck message if it only contains Error Codes or
MqttSessionExpiredException
).
subscribePublishes(Mqtt5Subscribe, boolean)
@CheckReturnValue @NotNull @NotNull FlowableWithSingle<Mqtt5Publish,Mqtt5SubAck> subscribePublishes(@NotNull @NotNull Mqtt5Subscribe subscribe, boolean manualAcknowledgement)
FlowableWithSingle
for subscribing this client with the given Subscribe message.
The returned FlowableWithSingle
represents the source of the SubAck message corresponding to the given
Subscribe message and the source of the incoming Publish messages matching the subscriptions of the Subscribe
message. Calling this method does not subscribe yet. Subscribing is performed lazy and asynchronous when
subscribing (in terms of Reactive Streams) to the returned FlowableWithSingle
.
subscribe
- the Subscribe message sent to the broker during subscribe.manualAcknowledgement
- whether the Publish messages are acknowledged manually.FlowableWithSingle
which
Mqtt5SubAckException
wrapping the SubAck message if it only contains Error Codes or
MqttSessionExpiredException
).
subscribePublishes(Mqtt5Subscribe)
@CheckReturnValue Mqtt5SubscribeBuilder.Publishes.Start<FlowableWithSingle<Mqtt5Publish,Mqtt5SubAck>> subscribePublishesWith()
subscribePublishes(Mqtt5Subscribe, boolean)
.
Calling Mqtt5SubscribeBuilder.Nested.Complete#applySubscribe()
on the returned builder has the same
effect as calling subscribePublishes(Mqtt5Subscribe)
with the result of Mqtt5SubscribeBuilder.Complete#build()
.
subscribePublishes(Mqtt5Subscribe, boolean)
@CheckReturnValue @NotNull @NotNull Flowable<Mqtt5Publish> publishes(@NotNull @NotNull MqttGlobalPublishFilter filter)
Flowable
for globally consuming all incoming Publish messages matching the given filter.
The returned Flowable
represents the source of the incoming Publish messages matching the given type.
Calling this method does not start consuming yet. This is done lazy and asynchronous when subscribing (in terms
of Reactive Streams) to the returned Flowable
.
filter
- the filter with which all incoming Publish messages are filtered.Flowable
which
MqttSessionExpiredException
when the MQTT session expires.
publishes(MqttGlobalPublishFilter, boolean)
@CheckReturnValue @NotNull @NotNull Flowable<Mqtt5Publish> publishes(@NotNull @NotNull MqttGlobalPublishFilter filter, boolean manualAcknowledgement)
Flowable
for globally consuming all incoming Publish messages matching the given filter.
The returned Flowable
represents the source of the incoming Publish messages matching the given type.
Calling this method does not start consuming yet. This is done lazy and asynchronous when subscribing (in terms
of Reactive Streams) to the returned Flowable
.
filter
- the filter with which all incoming Publish messages are filtered.manualAcknowledgement
- whether the Publish messages are acknowledged manually.Flowable
which
MqttSessionExpiredException
when the MQTT session expires.
publishes(MqttGlobalPublishFilter)
@CheckReturnValue @NotNull @NotNull Single<Mqtt5UnsubAck> unsubscribe(@NotNull @NotNull Mqtt5Unsubscribe unsubscribe)
Single
for unsubscribing this client with the given Unsubscribe message.
The returned Single
represents the source of the UnsubAck message corresponding to the given Unsubscribe
message. Calling this method does not unsubscribe yet. Unsubscribing is performed lazy and asynchronous when
subscribing (in terms of Reactive Streams) to the returned Single
.
unsubscribe
- the Unsubscribe message sent to the broker during unsubscribe.Single
which
Mqtt5UnsubAckException
wrapping the UnsubAck message if it only contains Error Codes or
@CheckReturnValue Mqtt5UnsubscribeBuilder.Nested.Start<Single<Mqtt5UnsubAck>> unsubscribeWith()
unsubscribe(Mqtt5Unsubscribe)
.
Calling Mqtt5UnsubscribeBuilder.Nested.Complete#applyUnsubscribe()
on the returned builder has the same
effect as calling unsubscribe(Mqtt5Unsubscribe)
with the result of Mqtt5UnsubscribeBuilder.Complete#build()
.
unsubscribe(Mqtt5Unsubscribe)
@CheckReturnValue @NotNull @NotNull Flowable<Mqtt5PublishResult> publish(@NotNull @NotNull Flowable<Mqtt5Publish> publishFlowable)
Flowable
for publishing the Publish messages emitted by the given Flowable
.
The returned Flowable
represents the source of Mqtt5PublishResult
s each corresponding to a
Publish message emitted by the given Flowable
. Calling this method does not start publishing yet.
Publishing is performed lazy and asynchronous. When subscribing (in terms of Reactive Streams) to the returned
Flowable
the client subscribes (in terms of Reactive Streams) to the given Flowable
.
publishFlowable
- the source of the Publish messages to publish.Flowable
which
Mqtt5PublishResult
s each corresponding to a Publish message,
Flowable
completes, but not before all Mqtt5PublishResult
s
were emitted, or
Flowable
errors, but not before all
Mqtt5PublishResult
s were emitted.
@CheckReturnValue @NotNull @NotNull Completable reauth()
Completable
for re-authenticating this client.
Calling this method does not re-authenticate yet. Re-authenticating is performed lazy and asynchronous when
subscribing (in terms of Reactive Streams) to the returned Completable
.
Completable
which
Mqtt5AuthException
wrapping the Auth message with the Error Code if not re-authenticated successfully or
@CheckReturnValue @NotNull @NotNull Completable disconnect()
Completable
for disconnecting this client with the default Disconnect message.disconnect(Mqtt5Disconnect)
.disconnect(Mqtt5Disconnect)
@CheckReturnValue @NotNull @NotNull Completable disconnect(@NotNull @NotNull Mqtt5Disconnect disconnect)
Completable
for disconnecting this client with the given Disconnect message.
Calling this method does not disconnect yet. Disconnecting is performed lazy and asynchronous when subscribing
(in terms of Reactive Streams) to the returned Completable
.
disconnect
- the Disconnect message sent to the broker during disconnect.Completable
which
@CheckReturnValue Mqtt5DisconnectBuilder.Nested<Completable> disconnectWith()
disconnect(Mqtt5Disconnect)
.
Calling Mqtt5DisconnectBuilder.Nested#applyDisconnect()
on the returned builder has the same effect as
calling disconnect(Mqtt5Disconnect)
with the result of Mqtt5DisconnectBuilder.build()
.
disconnect(Mqtt5Disconnect)
@CheckReturnValue @NotNull default @NotNull Mqtt5RxClient toRx()
Mqtt5Client
The reactive API can be used simultaneously with the other APIs.
toRx
in interface Mqtt5Client