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
-
-
Field Summary
-
Fields inherited from class org.wso2.carbon.inbound.endpoint.common.OneTimeTriggerAbstractCallback
tenantDomain
-
-
Constructor Summary
Constructors Constructor Description MqttAsyncCallback(org.eclipse.paho.client.mqttv3.MqttAsyncClient mqttAsyncClient, MqttInjectHandler injectHandler, MqttConnectionFactory confac, org.eclipse.paho.client.mqttv3.MqttConnectOptions connectOptions, Properties mqttProperties)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidconnectionLost(Throwable throwable)Handle losing connection with the server.voiddeliveryComplete(org.eclipse.paho.client.mqttv3.IMqttDeliveryToken iMqttDeliveryToken)MqttConnectionConsumergetMqttConnectionConsumer()org.eclipse.paho.client.mqttv3.MqttConnectOptionsgetMqttConnectionOptions()StringgetName()get the inbound endpoint namevoidmessageArrived(String topic, org.eclipse.paho.client.mqttv3.MqttMessage mqttMessage)protected voidreConnect()voidsetMqttConnectionConsumer(MqttConnectionConsumer connectionConsumer)voidsetName(String name)Set the inbound endpoint namevoidshutdown()voidupdateInjectHandler(MqttInjectHandler injectHandler)-
Methods inherited from class org.wso2.carbon.inbound.endpoint.common.OneTimeTriggerAbstractCallback
handleReconnection, isCallbackSuspended, isInboundRunnerMode, releaseCallbackSuspension, setInboundRunnerMode, setTenantDomain, startInboundTenantLoading
-
-
-
-
Constructor Detail
-
MqttAsyncCallback
public MqttAsyncCallback(org.eclipse.paho.client.mqttv3.MqttAsyncClient mqttAsyncClient, MqttInjectHandler injectHandler, MqttConnectionFactory confac, org.eclipse.paho.client.mqttv3.MqttConnectOptions connectOptions, Properties mqttProperties)
-
-
Method Detail
-
connectionLost
public void connectionLost(Throwable throwable)
Handle losing connection with the server. Here we just print it to the test console.- Specified by:
connectionLostin interfaceorg.eclipse.paho.client.mqttv3.MqttCallback- Parameters:
throwable- Throwable connection lost
-
reConnect
protected void reConnect()
- Specified by:
reConnectin classOneTimeTriggerAbstractCallback
-
messageArrived
public void messageArrived(String topic, org.eclipse.paho.client.mqttv3.MqttMessage mqttMessage) throws org.eclipse.paho.client.mqttv3.MqttException
- Specified by:
messageArrivedin interfaceorg.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:
deliveryCompletein interfaceorg.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:
shutdownin classOneTimeTriggerAbstractCallback
-
setName
public void setName(String name)
Set the inbound endpoint name- Parameters:
name-
-
getName
public String getName()
get the inbound endpoint name- Returns:
- name
-
-