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.
|
MqttEndpoint |
accept(boolean sessionPresent,
MqttProperties properties)
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.
|
MqttProperties |
connectProperties() |
MqttEndpoint |
disconnect(MqttDisconnectReasonCode code,
MqttProperties properties)
Sends the DISCONNECT message to the remote MQTT client
|
MqttEndpoint |
disconnectHandler(Handler<Void> handler)
Set a disconnect handler on the MQTT endpoint.
|
MqttEndpoint |
disconnectMessageHandler(Handler<MqttDisconnectMessage> handler)
Set a disconnect handler on the MQTT endpoint.
|
MqttEndpoint |
exceptionHandler(Handler<Throwable> handler)
Set an exception handler.
|
MultiMap |
httpHeaders()
Returns the HTTP headers sent by the client when a WebSocket transport is used otherwise
null |
String |
httpRequestURI()
Returns the HTTP request URI sent by the client when a WebSocket transport is used otherwise
null |
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() |
Future<Integer> |
publish(String topic,
Buffer payload,
MqttQoS qosLevel,
boolean isDup,
boolean isRetain)
Sends the PUBLISH message to the remote MQTT client
|
MqttEndpoint |
publish(String topic,
Buffer payload,
MqttQoS qosLevel,
boolean isDup,
boolean isRetain,
Handler<AsyncResult<Integer>> publishSentHandler)
Sends the PUBLISH message to the remote MQTT server
|
Future<Integer> |
publish(String topic,
Buffer payload,
MqttQoS qosLevel,
boolean isDup,
boolean isRetain,
int messageId)
Like
publish(String, Buffer, MqttQoS, boolean, boolean, int, Handler) but returns a Future of the asynchronous result |
MqttEndpoint |
publish(String topic,
Buffer payload,
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
|
Future<Integer> |
publish(String topic,
Buffer payload,
MqttQoS qosLevel,
boolean isDup,
boolean isRetain,
int messageId,
MqttProperties properties)
Like
publish(String, Buffer, MqttQoS, boolean, boolean, int, MqttProperties, Handler) but returns a Future of the asynchronous result |
MqttEndpoint |
publish(String topic,
Buffer payload,
MqttQoS qosLevel,
boolean isDup,
boolean isRetain,
int messageId,
MqttProperties properties,
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 |
publishAcknowledge(int publishMessageId,
MqttPubAckReasonCode reasonCode,
MqttProperties properties) |
MqttEndpoint |
publishAcknowledgeHandler(Handler<Integer> handler)
Set the puback handler on the MQTT endpoint.
|
MqttEndpoint |
publishAcknowledgeMessageHandler(Handler<MqttPubAckMessage> 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 |
publishComplete(int publishMessageId,
MqttPubCompReasonCode reasonCode,
MqttProperties properties)
Sends the PUBCOMP message to the remote MQTT client
|
MqttEndpoint |
publishCompletionHandler(Handler<Integer> handler)
Set the pubcomp handler on the MQTT endpoint.
|
MqttEndpoint |
publishCompletionMessageHandler(Handler<MqttPubCompMessage> 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 |
publishReceived(int publishMessageId,
MqttPubRecReasonCode reasonCode,
MqttProperties properties)
Sends the PUBREC message to the remote MQTT client
|
MqttEndpoint |
publishReceivedHandler(Handler<Integer> handler)
Set the pubrec handler on the MQTT endpoint.
|
MqttEndpoint |
publishReceivedMessageHandler(Handler<MqttPubRecMessage> handler)
Set the pubrec handler on the MQTT endpoint.
|
MqttEndpoint |
publishRelease(int publishMessageId)
Sends the PUBREL message to the remote MQTT client
|
MqttEndpoint |
publishRelease(int publishMessageId,
MqttPubRelReasonCode reasonCode,
MqttProperties properties)
Sends the PUBREL message to the remote MQTT client
|
MqttEndpoint |
publishReleaseHandler(Handler<Integer> handler)
Set the pubrel handler on the MQTT endpoint.
|
MqttEndpoint |
publishReleaseMessageHandler(Handler<MqttPubRelMessage> handler)
Set the pubrel handler on the MQTT endpoint.
|
MqttEndpoint |
reject(MqttConnectReturnCode returnCode)
Sends the CONNACK message to the remote MQTT client rejecting the connection
request with specified return code.
|
MqttEndpoint |
reject(MqttConnectReturnCode returnCode,
MqttProperties properties)
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<MqttQoS> grantedQoSLevels)
Sends the SUBACK message to the remote MQTT client
|
MqttEndpoint |
subscribeAcknowledge(int subscribeMessageId,
List<MqttSubAckReasonCode> reasonCodes,
MqttProperties properties)
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 |
unsubscribeAcknowledge(int unsubscribeMessageId,
List<MqttUnsubAckReasonCode> reasonCodes,
MqttProperties properties)
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.MultiMap httpHeaders()
null
String httpRequestURI()
null
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()
MqttProperties connectProperties()
MqttEndpoint setClientIdentifier(String clientIdentifier)
clientIdentifier
- the client identifierMqttEndpoint disconnectHandler(Handler<Void> handler)
handler
- the handlerMqttEndpoint disconnectMessageHandler(Handler<MqttDisconnectMessage> 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 publishAcknowledgeMessageHandler(Handler<MqttPubAckMessage> handler)
handler
- the handlerMqttEndpoint publishReceivedHandler(Handler<Integer> handler)
handler
- the handlerMqttEndpoint publishReceivedMessageHandler(Handler<MqttPubRecMessage> handler)
handler
- the handlerMqttEndpoint publishReleaseHandler(Handler<Integer> handler)
handler
- the handlerMqttEndpoint publishReleaseMessageHandler(Handler<MqttPubRelMessage> handler)
handler
- the handlerMqttEndpoint publishCompletionHandler(Handler<Integer> handler)
handler
- the handlerMqttEndpoint publishCompletionMessageHandler(Handler<MqttPubCompMessage> 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 accept(boolean sessionPresent, MqttProperties properties)
reject(MqttConnectReturnCode)
for refusing connectionsessionPresent
- if a previous session is presentproperties
- CONNACK message properties (MQTT5)MqttEndpoint reject(MqttConnectReturnCode returnCode)
accept(boolean)
for accepting connectionreturnCode
- the connect return codeMqttEndpoint reject(MqttConnectReturnCode returnCode, MqttProperties properties)
accept(boolean)
for accepting connectionreturnCode
- the connect return codeproperties
- CONNACK message propertiesMqttEndpoint subscribeAcknowledge(int subscribeMessageId, List<MqttQoS> grantedQoSLevels)
subscribeMessageId
- identifier of the SUBSCRIBE message to acknowledgegrantedQoSLevels
- granted QoS levels for the requested topicsMqttEndpoint subscribeAcknowledge(int subscribeMessageId, List<MqttSubAckReasonCode> reasonCodes, MqttProperties properties)
subscribeMessageId
- identifier of the SUBSCRIBE message to acknowledgereasonCodes
- reason codesproperties
- MQTT message propertiesMqttEndpoint unsubscribeAcknowledge(int unsubscribeMessageId)
unsubscribeMessageId
- identifier of the UNSUBSCRIBE message to acknowledgeMqttEndpoint unsubscribeAcknowledge(int unsubscribeMessageId, List<MqttUnsubAckReasonCode> reasonCodes, MqttProperties properties)
unsubscribeMessageId
- identifier of the UNSUBSCRIBE message to acknowledgereasonCodes
- reason codesproperties
- MQTT message propertiesMqttEndpoint publishAcknowledge(int publishMessageId)
publishMessageId
- identifier of the PUBLISH message to acknowledgeMqttEndpoint publishAcknowledge(int publishMessageId, MqttPubAckReasonCode reasonCode, MqttProperties properties)
MqttEndpoint publishReceived(int publishMessageId)
publishMessageId
- identifier of the PUBLISH message to acknowledgeMqttEndpoint publishReceived(int publishMessageId, MqttPubRecReasonCode reasonCode, MqttProperties properties)
publishMessageId
- identifier of the PUBLISH message to acknowledgereasonCode
- code of the outcomeproperties
- MQTT propertiesMqttEndpoint publishRelease(int publishMessageId)
publishMessageId
- identifier of the PUBLISH message to acknowledgeMqttEndpoint publishRelease(int publishMessageId, MqttPubRelReasonCode reasonCode, MqttProperties properties)
publishMessageId
- identifier of the PUBLISH message to acknowledgereasonCode
- reason codeproperties
- MQTT message propertiesMqttEndpoint publishComplete(int publishMessageId)
publishMessageId
- identifier of the PUBLISH message to acknowledgeMqttEndpoint publishComplete(int publishMessageId, MqttPubCompReasonCode reasonCode, MqttProperties properties)
publishMessageId
- identifier of the PUBLISH message to acknowledgereasonCode
- reason codeproperties
- MQTT message propertiesFuture<Integer> publish(String topic, Buffer payload, 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 retainedFuture
completed after PUBLISH packet sent with a packetIdMqttEndpoint publish(String topic, Buffer payload, 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 packetIdFuture<Integer> publish(String topic, Buffer payload, MqttQoS qosLevel, boolean isDup, boolean isRetain, int messageId)
publish(String, Buffer, MqttQoS, boolean, boolean, int, Handler)
but returns a Future
of the asynchronous resultFuture<Integer> publish(String topic, Buffer payload, MqttQoS qosLevel, boolean isDup, boolean isRetain, int messageId, MqttProperties properties)
publish(String, Buffer, MqttQoS, boolean, boolean, int, MqttProperties, Handler)
but returns a Future
of the asynchronous resultMqttEndpoint publish(String topic, Buffer payload, 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 publish(String topic, Buffer payload, MqttQoS qosLevel, boolean isDup, boolean isRetain, int messageId, MqttProperties properties, 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 IDproperties
- PUBLISH message propertiespublishSentHandler
- handler called after PUBLISH packet sent with a packetIdMqttEndpoint pong()
MqttEndpoint disconnect(MqttDisconnectReasonCode code, MqttProperties properties)
code
- reason codeproperties
- MQTT message propertiesCopyright © 2024 Eclipse. All rights reserved.