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
ConstructorsConstructorDescriptionMqttAsyncCallback(org.eclipse.paho.client.mqttv3.MqttAsyncClient mqttAsyncClient, MqttInjectHandler injectHandler, MqttConnectionFactory confac, org.eclipse.paho.client.mqttv3.MqttConnectOptions connectOptions, Properties mqttProperties) -
Method Summary
Modifier and TypeMethodDescriptionvoidconnectionLost(Throwable throwable) Handle losing connection with the server.voiddeliveryComplete(org.eclipse.paho.client.mqttv3.IMqttDeliveryToken iMqttDeliveryToken) org.eclipse.paho.client.mqttv3.MqttConnectOptionsgetName()get the inbound endpoint namevoidmessageArrived(String topic, org.eclipse.paho.client.mqttv3.MqttMessage mqttMessage) protected voidvoidsetMqttConnectionConsumer(MqttConnectionConsumer connectionConsumer) voidSet 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 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
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
-
getMqttConnectionConsumer
-
getMqttConnectionOptions
public org.eclipse.paho.client.mqttv3.MqttConnectOptions getMqttConnectionOptions() -
updateInjectHandler
-
shutdown
public void shutdown()- Overrides:
shutdownin classOneTimeTriggerAbstractCallback
-
setName
Set the inbound endpoint name- Parameters:
name-
-
getName
get the inbound endpoint name- Returns:
- name
-