Package org.eclipse.hono.adapter.mqtt
Class PendingPubAcks
- java.lang.Object
-
- org.eclipse.hono.adapter.mqtt.PendingPubAcks
-
public final class PendingPubAcks extends Object
A class that handles PUBACKs for a particular MQTT endpoint.
-
-
Constructor Summary
Constructors Constructor Description PendingPubAcks(io.vertx.core.Vertx vertx)Creates a new PendingPubAcks instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(Integer msgId, io.vertx.core.Handler<Integer> onAckHandler, io.vertx.core.Handler<Void> onAckTimeoutHandler, long waitingForAckTimeout)Registers handlers to be invoked when the published message with the given id is either acknowledged or a timeout occurs.voidhandlePubAck(Integer msgId)Invoked when a device sends an MQTT PUBACK packet.
-
-
-
Constructor Detail
-
PendingPubAcks
public PendingPubAcks(io.vertx.core.Vertx vertx)
Creates a new PendingPubAcks instance.- Parameters:
vertx- The Vert.x instance to execute timers with.- Throws:
NullPointerException- if vertx isnull.
-
-
Method Detail
-
handlePubAck
public void handlePubAck(Integer msgId)
Invoked when a device sends an MQTT PUBACK packet.- Parameters:
msgId- The message/packet id of the message published with QoS 1.- Throws:
NullPointerException- if msgId isnull.
-
add
public void add(Integer msgId, io.vertx.core.Handler<Integer> onAckHandler, io.vertx.core.Handler<Void> onAckTimeoutHandler, long waitingForAckTimeout)
Registers handlers to be invoked when the published message with the given id is either acknowledged or a timeout occurs.- Parameters:
msgId- The id of the message that has been published.onAckHandler- Handler to invoke when the device has acknowledged the message.onAckTimeoutHandler- Handler to invoke when there is a timeout waiting for the acknowledgement from the device.waitingForAckTimeout- The timeout to wait for the acknowledgement from the device.- Throws:
NullPointerException- if any of the parameters isnull.
-
-