Package org.bluezoo.gumdrop.mqtt.broker
Class WillManager
java.lang.Object
org.bluezoo.gumdrop.mqtt.broker.WillManager
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
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidClears the will for a client (called on clean disconnect).booleanReturns whether a will is set for the given client.Removes and returns the will message for the given client.voidset(String clientId, String topic, MQTTMessageContent content, QoS qos, boolean retain) Stores a will message for the given client.
-
Constructor Details
-
WillManager
public WillManager()
-
-
Method Details
-
set
Stores a will message for the given client. -
remove
Removes and returns the will message for the given client.- Returns:
- the will message, or null if none was set
-
clear
Clears the will for a client (called on clean disconnect). -
has
Returns whether a will is set for the given client.
-