From 5ccb3d6c2be53a769eafe949d48f9311e4f109a1 Mon Sep 17 00:00:00 2001 From: Tejas Nandanikar <13401502+tejas-n@users.noreply.github.com> Date: Mon, 12 Aug 2024 21:58:49 +1000 Subject: [PATCH] Update docs for Mqtt5BlockingClient --- .../mqtt/mqtt5/Mqtt5BlockingClient.java | 25 ++++++++++++++++--- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/hivemq/client/mqtt/mqtt5/Mqtt5BlockingClient.java b/src/main/java/com/hivemq/client/mqtt/mqtt5/Mqtt5BlockingClient.java index 50e228347..2ff50493b 100644 --- a/src/main/java/com/hivemq/client/mqtt/mqtt5/Mqtt5BlockingClient.java +++ b/src/main/java/com/hivemq/client/mqtt/mqtt5/Mqtt5BlockingClient.java @@ -60,8 +60,15 @@ public interface Mqtt5BlockingClient extends Mqtt5Client { * * @param connect the Connect message sent to the broker. * @return the ConnAck message if it does not contain an Error Code (connected successfully). + * @throws com.hivemq.client.mqtt.exceptions.ConnectionFailedException if an error occurs before the Connect + * message could be sent. + * @throws com.hivemq.client.mqtt.exceptions.ConnectionClosedException if the connection is closed after the + * Connect message has been sent but before a + * ConnAck message has been received * @throws com.hivemq.client.mqtt.mqtt5.exceptions.Mqtt5ConnAckException wrapping the ConnAck message if it contains * an Error Code. + * @throws com.hivemq.client.mqtt.exceptions.MqttClientStateException if the client is already connecting or + * connected */ @NotNull Mqtt5ConnAck connect(@NotNull Mqtt5Connect connect); @@ -153,10 +160,20 @@ public interface Mqtt5BlockingClient extends Mqtt5Client { * @param publish the Publish message sent to the broker. * @return the {@link Mqtt5PublishResult} if the Publish message was successfully published (no acknowledgement * message contains an Error Code, {@link Mqtt5PublishResult#getError()} will always be absent). - * @throws com.hivemq.client.mqtt.mqtt5.exceptions.Mqtt5PubAckException wrapping the corresponding PubAck message if - * it contains an Error Code. - * @throws com.hivemq.client.mqtt.mqtt5.exceptions.Mqtt5PubRecException wrapping the corresponding PubRec message if - * it contains an Error Code. + * @throws com.hivemq.client.mqtt.mqtt5.exceptions.Mqtt5PubAckException for QoS 1 if the PubAck message contained + * an error code (the PubAck message is + * contained in the exception) + * @throws com.hivemq.client.mqtt.mqtt5.exceptions.Mqtt5PubRecException for QoS 2 if the PubRec message contained + * an error code (the PubRec message is + * contained in the exception) + * @throws com.hivemq.client.mqtt.exceptions.ConnectionClosedException for QoS 0 if the connection was closed + * during writing the message to the + * transport + * @throws com.hivemq.client.mqtt.exceptions.MqttSessionExpiredException if the session expired before the message + * has been acknowledged completely + * @throws com.hivemq.client.mqtt.exceptions.MqttEncodeException if the maximum packet size was exceeded + * @throws com.hivemq.client.mqtt.exceptions.MqttClientStateException if the client is not connected and also not + * reconnecting */ @NotNull Mqtt5PublishResult publish(@NotNull Mqtt5Publish publish);