Interface Mqtt3BlockingClient
- All Superinterfaces:
Mqtt3Client,MqttClient
Mqtt3Client.- Since:
- 1.0
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceResource which queues incoming Publish messages until they are received. -
Field Summary
Fields inherited from interface com.hivemq.client.mqtt.MqttClient
DEFAULT_SERVER_HOST, DEFAULT_SERVER_PORT, DEFAULT_SERVER_PORT_SSL, DEFAULT_SERVER_PORT_WEBSOCKET, DEFAULT_SERVER_PORT_WEBSOCKET_SSL -
Method Summary
Modifier and TypeMethodDescriptionconnect()Connects this client with the default Connect message.connect(@NotNull Mqtt3Connect connect) Connects this client with the given Connect message.Fluent counterpart ofconnect(Mqtt3Connect).voidDisconnects this client with the given Disconnect message.voidpublish(@NotNull Mqtt3Publish publish) Publishes the given Publish message.publishes(@NotNull MqttGlobalPublishFilter filter) Globally consumes all incoming Publish messages matching the given filter.publishes(@NotNull MqttGlobalPublishFilter filter, boolean manualAcknowledgement) Globally consumes all incoming Publish messages matching the given filter.Fluent counterpart ofpublish(Mqtt3Publish).subscribe(@NotNull Mqtt3Subscribe subscribe) Subscribes this client with the given Subscribe message.Fluent counterpart ofsubscribe(Mqtt3Subscribe).default @NotNull Mqtt3BlockingClientTurns the API of this client into a blocking API.voidunsubscribe(@NotNull Mqtt3Unsubscribe unsubscribe) Unsubscribes this client with the given Unsubscribe message.Fluent counterpart ofunsubscribe(Mqtt3Unsubscribe).Methods inherited from interface com.hivemq.client.mqtt.mqtt3.Mqtt3Client
getConfig, toAsync, toRxMethods inherited from interface com.hivemq.client.mqtt.MqttClient
getState
-
Method Details
-
connect
Connects this client with the default Connect message.- Returns:
- see
connect(Mqtt3Connect). - See Also:
-
connect
Connects this client with the given Connect message.- Parameters:
connect- the Connect message sent to the broker.- Returns:
- the ConnAck message if it does not contain an Error Code (connected successfully).
- Throws:
Mqtt3ConnAckException- wrapping the ConnAck message if it contains an Error Code.
-
connectWith
Fluent counterpart ofconnect(Mqtt3Connect).Calling
Mqtt3ConnectBuilder.Send.send()on the returned builder has the same effect as callingconnect(Mqtt3Connect)with the result ofMqtt3ConnectBuilder.build().- Returns:
- the fluent builder for the Connect message.
- See Also:
-
subscribe
Subscribes this client with the given Subscribe message.See
publishes(MqttGlobalPublishFilter)to consume the incoming Publish messages.- Parameters:
subscribe- the Subscribe messages sent to the broker.- Returns:
- the SubAck message if all subscriptions of the Subscribe message were successful (the SubAck message contains no Error Codes).
- Throws:
Mqtt3SubAckException- wrapping the SubAck message if it contains at least one Error Code.
-
subscribeWith
Fluent counterpart ofsubscribe(Mqtt3Subscribe).Calling
Mqtt3SubscribeBuilder.Send.Complete.send()on the returned builder has the same effect as callingsubscribe(Mqtt3Subscribe)with the result ofMqtt3SubscribeBuilder.Complete.build().- Returns:
- the fluent builder for the Subscribe message.
- See Also:
-
publishes
@NotNull @NotNull Mqtt3BlockingClient.Mqtt3Publishes publishes(@NotNull @NotNull MqttGlobalPublishFilter filter) Globally consumes all incoming Publish messages matching the given filter.- Parameters:
filter- the filter with which all incoming Publish messages are filtered.- Returns:
- a
Mqtt3BlockingClient.Mqtt3Publishesinstance that can be used to receive the Publish messages on the calling thread. - See Also:
-
publishes
@NotNull @NotNull Mqtt3BlockingClient.Mqtt3Publishes publishes(@NotNull @NotNull MqttGlobalPublishFilter filter, boolean manualAcknowledgement) Globally consumes all incoming Publish messages matching the given filter.- Parameters:
filter- the filter with which all incoming Publish messages are filtered.manualAcknowledgement- whether the Publish messages are acknowledged manually.- Returns:
- a
Mqtt3BlockingClient.Mqtt3Publishesinstance that can be used to receive the Publish messages on the calling thread. - Since:
- 1.2
- See Also:
-
unsubscribe
Unsubscribes this client with the given Unsubscribe message.- Parameters:
unsubscribe- the Unsubscribe message sent to the broker.
-
unsubscribeWith
Fluent counterpart ofunsubscribe(Mqtt3Unsubscribe).Calling
Mqtt3UnsubscribeBuilder.SendVoid.Complete.send()on the returned builder has the same effect as callingunsubscribe(Mqtt3Unsubscribe)with the result ofMqtt3UnsubscribeBuilder.Complete.build().- Returns:
- the fluent builder for the Unsubscribe message.
- See Also:
-
publish
Publishes the given Publish message.- Parameters:
publish- the Publish message sent to the broker.
-
publishWith
Fluent counterpart ofpublish(Mqtt3Publish).Calling
Mqtt3PublishBuilder.SendVoid.Complete.send()on the returned builder has the same effect as callingpublish(Mqtt3Publish)with the result ofMqtt3PublishBuilder.Complete.build().- Returns:
- the fluent builder for the Unsubscribe message.
- See Also:
-
disconnect
void disconnect()Disconnects this client with the given Disconnect message. -
toBlocking
Description copied from interface:Mqtt3ClientTurns the API of this client into a blocking API.The blocking API can be used simultaneously with the other APIs.
- Specified by:
toBlockingin interfaceMqtt3Client- Returns:
- a blocking API for this client.
-