Class PendingPubAcks


  • public final class PendingPubAcks
    extends Object
    A class that handles PUBACKs for a particular MQTT endpoint.
    • 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 is null.
    • 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 is null.
      • 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 is null.