public interface IMqttActionListener
A listener is registered on an MqttToken and a token is associated with an action like connect or publish. When used with tokens on the MqttAsyncClient the listener will be called back on the MQTT client's thread. The listener will be informed if the action succeeds or fails. It is important that the listener returns control quickly otherwise the operation of the MQTT client will be stalled.
Modifier and Type | Method and Description |
---|---|
void |
onFailure(IMqttToken asyncActionToken,
java.lang.Throwable exception)
This method is invoked when an action fails.
|
void |
onSuccess(IMqttToken asyncActionToken)
This method is invoked when an action has completed successfully.
|
void onSuccess(IMqttToken asyncActionToken)
asyncActionToken
- associated with the action that has completedvoid onFailure(IMqttToken asyncActionToken, java.lang.Throwable exception)
asyncActionToken
- associated with the action that has failed