public interface MqttEndpoint
Modifier and Type | Method and Description |
---|---|
MqttEndpoint |
accept()
Like
accept(boolean) with no session is present. |
MqttEndpoint |
accept(boolean sessionPresent)
Sends the CONNACK message to the remote MQTT client with "connection accepted"
return code.
|
MqttAuth |
auth() |
MqttEndpoint |
autoKeepAlive(boolean isAutoKeepAlive)
Enable/disable auto keep alive (sending ping response)
|
String |
clientIdentifier() |
void |
close()
Close the endpoint, so the connection with remote MQTT client
|
MqttEndpoint |
closeHandler(Handler<Void> handler)
Set a close handler.
|
MqttEndpoint |
disconnectHandler(Handler<Void> handler)
Set a disconnect handler on the MQTT endpoint.
|
MqttEndpoint |
exceptionHandler(Handler<Throwable> handler)
Set an exception handler.
|
boolean |
isAutoKeepAlive() |
boolean |
isCleanSession() |
boolean |
isConnected() |
boolean |
isPublishAutoAck() |
boolean |
isSsl() |
boolean |
isSubscriptionAutoAck() |
int |
keepAliveTimeSeconds() |
int |
lastMessageId() |
SocketAddress |
localAddress() |
MqttEndpoint |
pingHandler(Handler<Void> handler)
Set the pingreq handler on the MQTT endpoint.
|
MqttEndpoint |
pong()
Sends the PINGRESP message to the remote MQTT client
|
String |
protocolName() |
int |
protocolVersion() |
MqttEndpoint |
publish(String topic,
Buffer payload,
io.netty.handler.codec.mqtt.MqttQoS qosLevel,
boolean isDup,
boolean isRetain)
Sends the PUBLISH message to the remote MQTT client
|
MqttEndpoint |
publish(String topic,
Buffer payload,
io.netty.handler.codec.mqtt.MqttQoS qosLevel,
boolean isDup,
boolean isRetain,
Handler<AsyncResult<Integer>> publishSentHandler)
Sends the PUBLISH message to the remote MQTT server
|
MqttEndpoint |
publish(String topic,
Buffer payload,
io.netty.handler.codec.mqtt.MqttQoS qosLevel,
boolean isDup,
boolean isRetain,
int messageId,
Handler<AsyncResult<Integer>> publishSentHandler)
Sends the PUBLISH message to the remote MQTT server explicitly specifying the messageId
|
MqttEndpoint |
publishAcknowledge(int publishMessageId)
Sends the PUBACK message to the remote MQTT client
|
MqttEndpoint |
publishAcknowledgeHandler(Handler<Integer> handler)
Set the puback handler on the MQTT endpoint.
|
MqttEndpoint |
publishAutoAck(boolean isPublishAutoAck)
Enable/disable publishing (in/out) auto acknowledge
|
MqttEndpoint |
publishComplete(int publishMessageId)
Sends the PUBCOMP message to the remote MQTT client
|
MqttEndpoint |
publishCompletionHandler(Handler<Integer> handler)
Set the pubcomp handler on the MQTT endpoint.
|
MqttEndpoint |
publishHandler(Handler<MqttPublishMessage> handler)
Set the publish handler on the MQTT endpoint.
|
MqttEndpoint |
publishReceived(int publishMessageId)
Sends the PUBREC message to the remote MQTT client
|
MqttEndpoint |
publishReceivedHandler(Handler<Integer> handler)
Set the pubrec handler on the MQTT endpoint.
|
MqttEndpoint |
publishRelease(int publishMessageId)
Sends the PUBREL message to the remote MQTT client
|
MqttEndpoint |
publishReleaseHandler(Handler<Integer> handler)
Set the pubrel handler on the MQTT endpoint.
|
MqttEndpoint |
reject(io.netty.handler.codec.mqtt.MqttConnectReturnCode returnCode)
Sends the CONNACK message to the remote MQTT client rejecting the connection
request with specified return code.
|
SocketAddress |
remoteAddress() |
MqttEndpoint |
setClientIdentifier(String clientIdentifier)
Set client identifier if not provided by the remote MQTT client (zero-bytes)
|
SSLSession |
sslSession() |
MqttEndpoint |
subscribeAcknowledge(int subscribeMessageId,
List<io.netty.handler.codec.mqtt.MqttQoS> grantedQoSLevels)
Sends the SUBACK message to the remote MQTT client
|
MqttEndpoint |
subscribeHandler(Handler<MqttSubscribeMessage> handler)
Set a subscribe handler on the MQTT endpoint.
|
void |
subscriptionAutoAck(boolean isSubscriptionAutoAck)
Enable/disable subscription/unsubscription requests auto acknowledge
|
MqttEndpoint |
unsubscribeAcknowledge(int unsubscribeMessageId)
Sends the UNSUBACK message to the remote MQTT client
|
MqttEndpoint |
unsubscribeHandler(Handler<MqttUnsubscribeMessage> handler)
Set a unsubscribe handler on the MQTT endpoint.
|
MqttWill |
will() |
void close()
SocketAddress remoteAddress()
SocketAddress localAddress()
boolean isSsl()
MqttEndpoint
is encrypted via SSL/TLS.SSLSession sslSession()
SSLSession
String clientIdentifier()
MqttAuth auth()
MqttWill will()
int protocolVersion()
String protocolName()
boolean isCleanSession()
int keepAliveTimeSeconds()
int lastMessageId()
void subscriptionAutoAck(boolean isSubscriptionAutoAck)
isSubscriptionAutoAck
- auto acknowledge statusboolean isSubscriptionAutoAck()
MqttEndpoint publishAutoAck(boolean isPublishAutoAck)
isPublishAutoAck
- auto acknowledge statusboolean isPublishAutoAck()
MqttEndpoint autoKeepAlive(boolean isAutoKeepAlive)
isAutoKeepAlive
- auto keep aliveboolean isAutoKeepAlive()
boolean isConnected()
MqttEndpoint setClientIdentifier(String clientIdentifier)
clientIdentifier
- the client identifierMqttEndpoint disconnectHandler(Handler<Void> handler)
handler
- the handlerMqttEndpoint subscribeHandler(Handler<MqttSubscribeMessage> handler)
handler
- the handlerMqttEndpoint unsubscribeHandler(Handler<MqttUnsubscribeMessage> handler)
handler
- the handlerMqttEndpoint publishHandler(Handler<MqttPublishMessage> handler)
handler
- the handlerMqttEndpoint publishAcknowledgeHandler(Handler<Integer> handler)
handler
- the handlerMqttEndpoint publishReceivedHandler(Handler<Integer> handler)
handler
- the handlerMqttEndpoint publishReleaseHandler(Handler<Integer> handler)
handler
- the handlerMqttEndpoint publishCompletionHandler(Handler<Integer> handler)
handler
- the handlerMqttEndpoint pingHandler(Handler<Void> handler)
handler
- the handlerMqttEndpoint closeHandler(Handler<Void> handler)
handler
- the handlerMqttEndpoint exceptionHandler(Handler<Throwable> handler)
handler
- the handlerMqttEndpoint accept()
accept(boolean)
with no session is present.MqttEndpoint accept(boolean sessionPresent)
reject(MqttConnectReturnCode)
for refusing connectionsessionPresent
- if a previous session is presentMqttEndpoint reject(io.netty.handler.codec.mqtt.MqttConnectReturnCode returnCode)
accept(boolean)
for accepting connectionreturnCode
- the connect return codeMqttEndpoint subscribeAcknowledge(int subscribeMessageId, List<io.netty.handler.codec.mqtt.MqttQoS> grantedQoSLevels)
subscribeMessageId
- identifier of the SUBSCRIBE message to acknowledgegrantedQoSLevels
- granted QoS levels for the requested topicsMqttEndpoint unsubscribeAcknowledge(int unsubscribeMessageId)
unsubscribeMessageId
- identifier of the UNSUBSCRIBE message to acknowledgeMqttEndpoint publishAcknowledge(int publishMessageId)
publishMessageId
- identifier of the PUBLISH message to acknowledgeMqttEndpoint publishReceived(int publishMessageId)
publishMessageId
- identifier of the PUBLISH message to acknowledgeMqttEndpoint publishRelease(int publishMessageId)
publishMessageId
- identifier of the PUBLISH message to acknowledgeMqttEndpoint publishComplete(int publishMessageId)
publishMessageId
- identifier of the PUBLISH message to acknowledgeMqttEndpoint publish(String topic, Buffer payload, io.netty.handler.codec.mqtt.MqttQoS qosLevel, boolean isDup, boolean isRetain)
topic
- topic on which the message is publishedpayload
- message payloadqosLevel
- quality of service levelisDup
- if the message is a duplicateisRetain
- if the message needs to be retainedMqttEndpoint publish(String topic, Buffer payload, io.netty.handler.codec.mqtt.MqttQoS qosLevel, boolean isDup, boolean isRetain, Handler<AsyncResult<Integer>> publishSentHandler)
topic
- 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 a packetIdMqttEndpoint publish(String topic, Buffer payload, io.netty.handler.codec.mqtt.MqttQoS qosLevel, boolean isDup, boolean isRetain, int messageId, Handler<AsyncResult<Integer>> publishSentHandler)
topic
- topic on which the message is publishedpayload
- message payloadqosLevel
- QoS levelisDup
- if the message is a duplicateisRetain
- if the message needs to be retainedmessageId
- message IDpublishSentHandler
- handler called after PUBLISH packet sent with a packetIdMqttEndpoint pong()
Copyright © 2023 Eclipse. All rights reserved.