public class MqttClientImpl extends Object implements MqttClient
| Constructor and Description |
|---|
MqttClientImpl(Vertx vertx,
MqttClientOptions options)
Constructor
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcreate, createpublic MqttClientImpl(Vertx vertx, MqttClientOptions options)
vertx - Vert.x instanceoptions - MQTT client optionspublic MqttClient connect(int port, String host, Handler<AsyncResult<MqttConnAckMessage>> connectHandler)
MqttClient.connect(int, String, Handler) for more detailsconnect in interface MqttClientport - port of the MQTT serverhost - hostname/ip address of the MQTT serverconnectHandler - handler called when the asynchronous connect call endspublic MqttClient connect(int port, String host, String serverName, Handler<AsyncResult<MqttConnAckMessage>> connectHandler)
MqttClient.connect(int, String, String, Handler) for more detailsconnect in interface MqttClientport - port of the MQTT serverhost - hostname/ip address of the MQTT serverserverName - the SNI server nameconnectHandler - handler called when the asynchronous connect call endspublic MqttClient disconnect()
MqttClient.disconnect() for more detailsdisconnect in interface MqttClientpublic MqttClient disconnect(Handler<AsyncResult<Void>> disconnectHandler)
MqttClient.disconnect(Handler) for more detailsdisconnect in interface MqttClientdisconnectHandler - handler called when asynchronous disconnect call endspublic MqttClient publish(String topic, Buffer payload, io.netty.handler.codec.mqtt.MqttQoS qosLevel, boolean isDup, boolean isRetain)
MqttClient.publish(String, Buffer, MqttQoS, boolean, boolean) for more detailspublish in interface MqttClienttopic - topic on which the message is publishedpayload - message payloadqosLevel - QoS levelisDup - if the message is a duplicateisRetain - if the message needs to be retainedpublic MqttClient publish(String topic, Buffer payload, io.netty.handler.codec.mqtt.MqttQoS qosLevel, boolean isDup, boolean isRetain, Handler<AsyncResult<Integer>> publishSentHandler)
MqttClient.publish(String, Buffer, MqttQoS, boolean, boolean, Handler) for more detailspublish in interface MqttClienttopic - topic on which the message is publishedpayload - message payloadqosLevel - QoS levelisDup - if the message is a duplicateisRetain - if the message needs to be retainedpublishSentHandler - handler called after PUBLISH packet sent with packetid (not when QoS 0)public MqttClient publishCompletionHandler(Handler<Integer> publishCompletionHandler)
MqttClient.publishCompletionHandler(Handler) for more detailspublishCompletionHandler in interface MqttClientpublishCompletionHandler - handler called with the packetIdpublic MqttClient publishHandler(Handler<MqttPublishMessage> publishHandler)
MqttClient.publishHandler(Handler) for more detailspublishHandler in interface MqttClientpublishHandler - handler to callpublic MqttClient subscribeCompletionHandler(Handler<MqttSubAckMessage> subscribeCompletionHandler)
MqttClient.subscribeCompletionHandler(Handler) for more detailssubscribeCompletionHandler in interface MqttClientsubscribeCompletionHandler - handler to call. List inside is a granted QoS arraypublic MqttClient subscribe(String topic, int qos)
MqttClient.subscribe(String, int) for more detailssubscribe in interface MqttClienttopic - topic you subscribe onqos - QoS levelpublic MqttClient subscribe(String topic, int qos, Handler<AsyncResult<Integer>> subscribeSentHandler)
MqttClient.subscribe(String, int, Handler) for more detailssubscribe in interface MqttClienttopic - topic you subscribe onqos - QoS levelsubscribeSentHandler - handler called after SUBSCRIBE packet sent with packetidpublic MqttClient subscribe(Map<String,Integer> topics)
MqttClient.subscribe(Map) for more detailssubscribe in interface MqttClienttopics - topics and related QoS levels to subscribe topublic MqttClient subscribe(Map<String,Integer> topics, Handler<AsyncResult<Integer>> subscribeSentHandler)
MqttClient.subscribe(Map, Handler) for more detailssubscribe in interface MqttClienttopics - topics you subscribe onsubscribeSentHandler - handler called after SUBSCRIBE packet sent with packetidpublic MqttClient unsubscribeCompletionHandler(Handler<Integer> unsubscribeCompletionHandler)
MqttClient.unsubscribeCompletionHandler(Handler) for more detailsunsubscribeCompletionHandler in interface MqttClientunsubscribeCompletionHandler - handler to call with the packetidpublic MqttClient unsubscribe(String topic, Handler<AsyncResult<Integer>> unsubscribeSentHandler)
MqttClient.unsubscribe(String, Handler) )} for more detailsunsubscribe in interface MqttClienttopic - Topic you want to unsubscribe fromunsubscribeSentHandler - handler called after UNSUBSCRIBE packet sentpublic MqttClient unsubscribe(String topic)
MqttClient.unsubscribe(String) )} for more detailsunsubscribe in interface MqttClienttopic - Topic you want to unsubscribe frompublic MqttClient pingResponseHandler(Handler<Void> pingResponseHandler)
MqttClient.pingResponseHandler(Handler) for more detailspingResponseHandler in interface MqttClientpingResponseHandler - handler to callpublic MqttClient exceptionHandler(Handler<Throwable> handler)
MqttClient.exceptionHandler(Handler) for more detailsexceptionHandler in interface MqttClienthandler - the exception handlerpublic MqttClient closeHandler(Handler<Void> closeHandler)
MqttClient.closeHandler(Handler) for more detailscloseHandler in interface MqttClientcloseHandler - handler to callpublic MqttClient ping()
MqttClient.ping() for more detailsping in interface MqttClientpublic String clientId()
clientId in interface MqttClientpublic boolean isConnected()
isConnected in interface MqttClientCopyright © 2020. All rights reserved.