@NonNullByDefault public interface MqttConnectionObserver
Implement this interface to get notified of connection state changes. Register this observer at .
- Markus Rathgeb - Initial contribution, David Graeff - Rewritten
connectionStateChangedInform the observer if a connection could be established or if a connection is lost. This will be issued in the context of the Mqtt client thread and requires that the control is returned quickly to not stall the Mqtt thread.
state- The new connection state
error- An exception object (might be a MqttException) with the reason why a connection failed.