Package software.amazon.awssdk.crt.mqtt
Interface MqttClientConnectionEvents
public interface MqttClientConnectionEvents
Interface used to receive connection events from the CRT
-
Method Summary
Modifier and TypeMethodDescriptiondefault voidCalled when the connection was disconnected and shutdown successfully.default voidCalled on every unsuccessful connect and every unsuccessful disconnect.voidonConnectionInterrupted(int errorCode) Called when the connection was lost (or disconnected), reconnect will be attempted automatically until disconnect() is calledvoidonConnectionResumed(boolean sessionPresent) Called whenever a reconnect succeeds; not called on an initial connect successdefault voidCalled on every successful connect and every successful reconnect.
-
Method Details
-
onConnectionInterrupted
void onConnectionInterrupted(int errorCode) Called when the connection was lost (or disconnected), reconnect will be attempted automatically until disconnect() is called- Parameters:
errorCode- AWS CRT error code, pass toCRT.awsErrorString(int)for a human readable error
-
onConnectionResumed
void onConnectionResumed(boolean sessionPresent) Called whenever a reconnect succeeds; not called on an initial connect success- Parameters:
sessionPresent- true if the session has been resumed, false if the session is clean
-
onConnectionSuccess
Called on every successful connect and every successful reconnect. Optional and is not required to be defined.- Parameters:
data- The data sent from the client alongside the successful connection callback.
-
onConnectionFailure
Called on every unsuccessful connect and every unsuccessful disconnect. Optional and is not required to be defined.- Parameters:
data- The data sent from the client alongside the failed connection callback.
-
onConnectionClosed
Called when the connection was disconnected and shutdown successfully. Optional and is not required to be defined.- Parameters:
data- The data sent from the client alongside the successful disconnect.
-