Class MqttAsyncCallback

java.lang.Object
org.wso2.carbon.inbound.endpoint.common.OneTimeTriggerAbstractCallback
org.wso2.carbon.inbound.endpoint.protocol.mqtt.MqttAsyncCallback
All Implemented Interfaces:
org.eclipse.paho.client.mqttv3.MqttCallback

public class MqttAsyncCallback extends OneTimeTriggerAbstractCallback implements org.eclipse.paho.client.mqttv3.MqttCallback
MQTT Asynchronous call back handler
  • Constructor Details

    • MqttAsyncCallback

      public MqttAsyncCallback(org.eclipse.paho.client.mqttv3.MqttAsyncClient mqttAsyncClient, MqttInjectHandler injectHandler, MqttConnectionFactory confac, org.eclipse.paho.client.mqttv3.MqttConnectOptions connectOptions, Properties mqttProperties)
  • Method Details

    • connectionLost

      public void connectionLost(Throwable throwable)
      Handle losing connection with the server. Here we just print it to the test console.
      Specified by:
      connectionLost in interface org.eclipse.paho.client.mqttv3.MqttCallback
      Parameters:
      throwable - Throwable connection lost
    • reConnect

      protected void reConnect()
      Specified by:
      reConnect in class OneTimeTriggerAbstractCallback
    • messageArrived

      public void messageArrived(String topic, org.eclipse.paho.client.mqttv3.MqttMessage mqttMessage) throws org.eclipse.paho.client.mqttv3.MqttException
      Specified by:
      messageArrived in interface org.eclipse.paho.client.mqttv3.MqttCallback
      Throws:
      org.eclipse.paho.client.mqttv3.MqttException
    • deliveryComplete

      public void deliveryComplete(org.eclipse.paho.client.mqttv3.IMqttDeliveryToken iMqttDeliveryToken)
      Specified by:
      deliveryComplete in interface org.eclipse.paho.client.mqttv3.MqttCallback
    • setMqttConnectionConsumer

      public void setMqttConnectionConsumer(MqttConnectionConsumer connectionConsumer)
    • getMqttConnectionConsumer

      public MqttConnectionConsumer getMqttConnectionConsumer()
    • getMqttConnectionOptions

      public org.eclipse.paho.client.mqttv3.MqttConnectOptions getMqttConnectionOptions()
    • updateInjectHandler

      public void updateInjectHandler(MqttInjectHandler injectHandler)
    • shutdown

      public void shutdown()
      Overrides:
      shutdown in class OneTimeTriggerAbstractCallback
    • setName

      public void setName(String name)
      Set the inbound endpoint name
      Parameters:
      name -
    • getName

      public String getName()
      get the inbound endpoint name
      Returns:
      name