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 void
connectionLost(Throwable throwable)
Handle losing connection with the server.void
deliveryComplete(org.eclipse.paho.client.mqttv3.IMqttDeliveryToken iMqttDeliveryToken)
MqttConnectionConsumer
getMqttConnectionConsumer()
org.eclipse.paho.client.mqttv3.MqttConnectOptions
getMqttConnectionOptions()
String
getName()
get the inbound endpoint namevoid
messageArrived(String topic, org.eclipse.paho.client.mqttv3.MqttMessage mqttMessage)
protected void
reConnect()
void
setMqttConnectionConsumer(MqttConnectionConsumer connectionConsumer)
void
setName(String name)
Set the inbound endpoint namevoid
shutdown()
void
updateInjectHandler(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:
connectionLost
in interfaceorg.eclipse.paho.client.mqttv3.MqttCallback
- Parameters:
throwable
- Throwable connection lost
-
reConnect
protected void reConnect()
- Specified by:
reConnect
in classOneTimeTriggerAbstractCallback
-
messageArrived
public void messageArrived(String topic, org.eclipse.paho.client.mqttv3.MqttMessage mqttMessage) throws org.eclipse.paho.client.mqttv3.MqttException
- Specified by:
messageArrived
in 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:
deliveryComplete
in 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:
shutdown
in 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
-
-