@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 |
---|---|
default @NotNull io.reactivex.Single<Mqtt5ConnAck> |
connect()
Creates a
Single for connecting this client with the default Connect message. |
@NotNull io.reactivex.Single<Mqtt5ConnAck> |
connect(@NotNull Mqtt5Connect connect)
Creates a
Single for connecting this client with the given Connect message. |
default Mqtt5ConnectBuilder.Nested<io.reactivex.Single<Mqtt5ConnAck>> |
connectWith()
Fluent counterpart of
connect(Mqtt5Connect) . |
default @NotNull io.reactivex.Completable |
disconnect()
Creates a
Completable for disconnecting this client with the default Disconnect message. |
@NotNull io.reactivex.Completable |
disconnect(@NotNull Mqtt5Disconnect disconnect)
Creates a
Completable for disconnecting this client with the given Disconnect message. |
default Mqtt5DisconnectBuilder.Nested<io.reactivex.Completable> |
disconnectWith()
Fluent counterpart of
disconnect(Mqtt5Disconnect) . |
@NotNull io.reactivex.Flowable<Mqtt5PublishResult> |
publish(@NotNull io.reactivex.Flowable<Mqtt5Publish> publishFlowable)
Creates a
Flowable for publishing the Publish messages emitted by the given Flowable . |
@NotNull io.reactivex.Flowable<Mqtt5Publish> |
publishes(@NotNull MqttGlobalPublishFilter filter)
Creates a
Flowable for globally consuming all incoming Publish messages matching the given filter. |
@NotNull io.reactivex.Completable |
reauth()
Creates a
Completable for re-authenticating this client. |
@NotNull io.reactivex.Single<Mqtt5SubAck> |
subscribe(@NotNull Mqtt5Subscribe subscribe)
Creates a
Single for subscribing this client with the given Subscribe message. |
@NotNull FlowableWithSingle<Mqtt5Publish,Mqtt5SubAck> |
subscribeStream(@NotNull Mqtt5Subscribe subscribe)
Creates a
FlowableWithSingle for subscribing this client with the given Subscribe message. |
default Mqtt5SubscribeBuilder.Nested.Start<FlowableWithSingle<Mqtt5Publish,Mqtt5SubAck>> |
subscribeStreamWith()
Fluent counterpart of
subscribeStream(Mqtt5Subscribe) . |
default Mqtt5SubscribeBuilder.Nested.Start<io.reactivex.Single<Mqtt5SubAck>> |
subscribeWith()
Fluent counterpart of
subscribe(Mqtt5Subscribe) . |
default @NotNull Mqtt5RxClient |
toRx()
Turns the API of this client into a reactive API.
|
@NotNull io.reactivex.Single<Mqtt5UnsubAck> |
unsubscribe(@NotNull Mqtt5Unsubscribe unsubscribe)
Creates a
Single for unsubscribing this client with the given Unsubscribe message. |
default Mqtt5UnsubscribeBuilder.Nested.Start<io.reactivex.Single<Mqtt5UnsubAck>> |
unsubscribeWith()
Fluent counterpart of
unsubscribe(Mqtt5Unsubscribe) . |
builder, getConfig, toAsync, toBlocking
@NotNull default @NotNull io.reactivex.Single<Mqtt5ConnAck> connect()
Single
for connecting this client with the default Connect message.connect(Mqtt5Connect)
.connect(Mqtt5Connect)
@NotNull @NotNull io.reactivex.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@NotNull default Mqtt5ConnectBuilder.Nested<io.reactivex.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)
@NotNull @NotNull io.reactivex.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
subscribeStream(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@NotNull default Mqtt5SubscribeBuilder.Nested.Start<io.reactivex.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)
@NotNull @NotNull FlowableWithSingle<Mqtt5Publish,Mqtt5SubAck> subscribeStream(@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 orMqttSessionExpiredException
).@NotNull default Mqtt5SubscribeBuilder.Nested.Start<FlowableWithSingle<Mqtt5Publish,Mqtt5SubAck>> subscribeStreamWith()
subscribeStream(Mqtt5Subscribe)
.
Calling Mqtt5SubscribeBuilder.Nested.Complete#applySubscribe()
on the returned builder has the same
effect as calling subscribeStream(Mqtt5Subscribe)
with the result of Mqtt5SubscribeBuilder.Complete#build()
.
subscribeStream(Mqtt5Subscribe)
@NotNull @NotNull io.reactivex.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.@NotNull @NotNull io.reactivex.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@NotNull default Mqtt5UnsubscribeBuilder.Nested.Start<io.reactivex.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)
@NotNull @NotNull io.reactivex.Flowable<Mqtt5PublishResult> publish(@NotNull @NotNull io.reactivex.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,Flowable
errors orFlowable
are answered by a Mqtt5PublishResult
(e.g. MqttSessionExpiredException
).@NotNull @NotNull io.reactivex.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@NotNull default @NotNull io.reactivex.Completable disconnect()
Completable
for disconnecting this client with the default Disconnect message.disconnect(Mqtt5Disconnect)
.disconnect(Mqtt5Disconnect)
@NotNull @NotNull io.reactivex.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
@NotNull default Mqtt5DisconnectBuilder.Nested<io.reactivex.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)
@NotNull default @NotNull Mqtt5RxClient toRx()
Mqtt5Client
The reactive API can be used simultaneously with the other APIs.
toRx
in interface Mqtt5Client