Package org.bluezoo.gumdrop.mqtt.client
Interface MQTTClientCallback
public interface MQTTClientCallback
Callback interface for MQTT client lifecycle events.
- Author:
- Chris Burdess
-
Method Summary
Modifier and TypeMethodDescriptionvoidconnected(boolean sessionPresent, int returnCode) Called when the CONNACK is received and the connection is established.voidconnectionLost(Exception cause) Called when the connection is lost.voidpublishComplete(int packetId) Called when a publish is acknowledged (QoS 1 PUBACK or QoS 2 PUBCOMP).voidsubscribeAcknowledged(int packetId, int[] grantedQoS) Called when a SUBACK is received.
-
Method Details
-
connected
void connected(boolean sessionPresent, int returnCode) Called when the CONNACK is received and the connection is established.- Parameters:
sessionPresent- whether a previous session exists on the serverreturnCode- the CONNACK return code (0 = accepted)
-
connectionLost
Called when the connection is lost.- Parameters:
cause- the exception, or null for clean disconnect
-
subscribeAcknowledged
void subscribeAcknowledged(int packetId, int[] grantedQoS) Called when a SUBACK is received.- Parameters:
packetId- the subscribe packet identifiergrantedQoS- the granted QoS levels
-
publishComplete
void publishComplete(int packetId) Called when a publish is acknowledged (QoS 1 PUBACK or QoS 2 PUBCOMP).- Parameters:
packetId- the publish packet identifier
-