Class WillManager

java.lang.Object
org.bluezoo.gumdrop.mqtt.broker.WillManager

public class WillManager extends Object
Manages MQTT Last Will and Testament messages.

When a client connects with a will message, it is stored here. On unclean disconnect, the will message is published through the broker. On clean disconnect (DISCONNECT packet received), the will is cleared.

Author:
Chris Burdess
  • Constructor Details

    • WillManager

      public WillManager()
  • Method Details

    • set

      public void set(String clientId, String topic, MQTTMessageContent content, QoS qos, boolean retain)
      Stores a will message for the given client.
    • remove

      public WillManager.WillMessage remove(String clientId)
      Removes and returns the will message for the given client.
      Returns:
      the will message, or null if none was set
    • clear

      public void clear(String clientId)
      Clears the will for a client (called on clean disconnect).
    • has

      public boolean has(String clientId)
      Returns whether a will is set for the given client.