public class Mqtt3RxClientView extends java.lang.Object implements Mqtt3RxClient
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 io.reactivex.Single<Mqtt3ConnAck> |
connect(@Nullable Mqtt3Connect connect)
Creates a
Single for connecting this client with the given Connect message. |
@NotNull io.reactivex.Completable |
disconnect()
Creates a
Completable for disconnecting this client. |
@NotNull Mqtt3ClientConfigView |
getConfig() |
@NotNull io.reactivex.Flowable<Mqtt3PublishResult> |
publish(@Nullable io.reactivex.Flowable<Mqtt3Publish> publishFlowable)
Creates a
Flowable for publishing the Publish messages emitted by the given Flowable . |
@NotNull io.reactivex.Flowable<Mqtt3Publish> |
publishes(@Nullable MqttGlobalPublishFilter filter)
Creates a
Flowable for globally consuming all incoming Publish messages matching the given filter. |
@NotNull io.reactivex.Single<Mqtt3SubAck> |
subscribe(@Nullable Mqtt3Subscribe subscribe)
Creates a
Single for subscribing this client with the given Subscribe message. |
@NotNull FlowableWithSingle<Mqtt3Publish,Mqtt3SubAck> |
subscribeStream(@Nullable Mqtt3Subscribe subscribe)
Creates a
FlowableWithSingle for subscribing this client with the given Subscribe message. |
@NotNull Mqtt3AsyncClientView |
toAsync()
Turns the API of this client into a asynchronous API based on futures and callbacks.
|
@NotNull Mqtt3BlockingClientView |
toBlocking()
Turns the API of this client into a blocking API.
|
@NotNull io.reactivex.Completable |
unsubscribe(@Nullable Mqtt3Unsubscribe unsubscribe)
Creates a
Single for unsubscribing this client with the given Unsubscribe message. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
connect, connectWith, subscribeStreamWith, subscribeWith, toRx, unsubscribeWith
builder
@NotNull public @NotNull io.reactivex.Single<Mqtt3ConnAck> connect(@Nullable @Nullable Mqtt3Connect connect)
Mqtt3RxClient
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
in interface Mqtt3RxClient
connect
- the Connect message sent to the broker during connect.Single
which
Mqtt3ConnAckException
wrapping the ConnAck message if it contains an Error Code or@NotNull public @NotNull io.reactivex.Single<Mqtt3SubAck> subscribe(@Nullable @Nullable Mqtt3Subscribe subscribe)
Mqtt3RxClient
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 Mqtt3RxClient.publishes(MqttGlobalPublishFilter)
to consume the incoming Publish messages. Alternatively, call
Mqtt3RxClient.subscribeStream(Mqtt3Subscribe)
to consume the incoming Publish messages matching the subscriptions of
the Subscribe message directly.
subscribe
in interface Mqtt3RxClient
subscribe
- the Subscribe message sent to the broker during subscribe.Single
which
Mqtt3SubAckException
wrapping the SubAck message if it only contains Error Codes or@NotNull public @NotNull FlowableWithSingle<Mqtt3Publish,Mqtt3SubAck> subscribeStream(@Nullable @Nullable Mqtt3Subscribe subscribe)
Mqtt3RxClient
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
.
subscribeStream
in interface Mqtt3RxClient
subscribe
- the Subscribe message sent to the broker during subscribe.FlowableWithSingle
which
Mqtt3SubAckException
wrapping the SubAck message if it only contains Error Codes orMqttSessionExpiredException
).@NotNull public @NotNull io.reactivex.Flowable<Mqtt3Publish> publishes(@Nullable @Nullable MqttGlobalPublishFilter filter)
Mqtt3RxClient
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
.
publishes
in interface Mqtt3RxClient
filter
- the filter with which all incoming Publish messages are filtered.Flowable
which
MqttSessionExpiredException
when the MQTT session expires.@NotNull public @NotNull io.reactivex.Completable unsubscribe(@Nullable @Nullable Mqtt3Unsubscribe unsubscribe)
Mqtt3RxClient
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
in interface Mqtt3RxClient
unsubscribe
- the Unsubscribe message sent to the broker during unsubscribe.Single
which
@NotNull public @NotNull io.reactivex.Flowable<Mqtt3PublishResult> publish(@Nullable @Nullable io.reactivex.Flowable<Mqtt3Publish> publishFlowable)
Mqtt3RxClient
Flowable
for publishing the Publish messages emitted by the given Flowable
.
The returned Flowable
represents the source of Mqtt3PublishResult
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
.
publish
in interface Mqtt3RxClient
publishFlowable
- the source of the Publish messages to publish.Flowable
which
Mqtt3PublishResult
s each corresponding to a Publish message,Flowable
completes,Flowable
errors orFlowable
are answered by a Mqtt3PublishResult
(e.g. MqttSessionExpiredException
).@NotNull public @NotNull io.reactivex.Completable disconnect()
Mqtt3RxClient
Completable
for disconnecting this client.
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
in interface Mqtt3RxClient
Completable
which
@NotNull public @NotNull Mqtt3ClientConfigView getConfig()
getConfig
in interface Mqtt3Client
getConfig
in interface MqttClient
@NotNull public @NotNull Mqtt3AsyncClientView toAsync()
Mqtt3Client
The asynchronous API can be used simultaneously with the other APIs.
toAsync
in interface Mqtt3Client
@NotNull public @NotNull Mqtt3BlockingClientView toBlocking()
Mqtt3Client
The blocking API can be used simultaneously with the other APIs.
toBlocking
in interface Mqtt3Client