Package software.amazon.awssdk.crt.mqtt
Interface MqttClientConnectionEvents
-
public interface MqttClientConnectionEvents
Interface used to receive connection events from the CRT
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default void
onConnectionClosed(OnConnectionClosedReturn data)
Called when the connection was disconnected and shutdown successfully.default void
onConnectionFailure(OnConnectionFailureReturn data)
Called on every unsuccessful connect and every unsuccessful disconnect.void
onConnectionInterrupted(int errorCode)
Called when the connection was lost (or disconnected), reconnect will be attempted automatically until disconnect() is calledvoid
onConnectionResumed(boolean sessionPresent)
Called whenever a reconnect succeeds; not called on an initial connect successdefault void
onConnectionSuccess(OnConnectionSuccessReturn data)
Called on every successful connect and every successful reconnect.
-
-
-
Method Detail
-
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
default void onConnectionSuccess(OnConnectionSuccessReturn data)
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
default void onConnectionFailure(OnConnectionFailureReturn data)
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
default void onConnectionClosed(OnConnectionClosedReturn data)
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.
-
-