public class MqttEndpointImpl extends Object implements MqttEndpoint
| Constructor and Description |
|---|
MqttEndpointImpl(NetSocketInternal conn,
String clientIdentifier,
MqttAuth auth,
MqttWill will,
boolean isCleanSession,
int protocolVersion,
String protocolName,
int keepAliveTimeoutSeconds)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
MqttEndpoint |
accept()
Like
MqttEndpoint.accept(boolean) with no session is present. |
MqttEndpointImpl |
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
|
MqttEndpointImpl |
closeHandler(Handler<Void> handler)
Set a close handler.
|
MqttEndpointImpl |
disconnectHandler(Handler<Void> handler)
Set a disconnect handler on the MQTT endpoint.
|
MqttEndpointImpl |
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() |
MqttEndpointImpl |
pingHandler(Handler<Void> handler)
Set the pingreq handler on the MQTT endpoint.
|
MqttEndpointImpl |
pong()
Sends the PINGRESP message to the remote MQTT client
|
String |
protocolName() |
int |
protocolVersion() |
MqttEndpointImpl |
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
|
MqttEndpointImpl |
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
|
MqttEndpointImpl |
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
|
MqttEndpointImpl |
publishAcknowledge(int publishMessageId)
Sends the PUBACK message to the remote MQTT client
|
MqttEndpointImpl |
publishAcknowledgeHandler(Handler<Integer> handler)
Set the puback handler on the MQTT endpoint.
|
MqttEndpoint |
publishAutoAck(boolean isPublishAutoAck)
Enable/disable publishing (in/out) auto acknowledge
|
MqttEndpointImpl |
publishComplete(int publishMessageId)
Sends the PUBCOMP message to the remote MQTT client
|
MqttEndpointImpl |
publishCompletionHandler(Handler<Integer> handler)
Set the pubcomp handler on the MQTT endpoint.
|
MqttEndpointImpl |
publishHandler(Handler<MqttPublishMessage> handler)
Set the publish handler on the MQTT endpoint.
|
MqttEndpointImpl |
publishReceived(int publishMessageId)
Sends the PUBREC message to the remote MQTT client
|
MqttEndpointImpl |
publishReceivedHandler(Handler<Integer> handler)
Set the pubrec handler on the MQTT endpoint.
|
MqttEndpointImpl |
publishRelease(int publishMessageId)
Sends the PUBREL message to the remote MQTT client
|
MqttEndpointImpl |
publishReleaseHandler(Handler<Integer> handler)
Set the pubrel handler on the MQTT endpoint.
|
MqttEndpointImpl |
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() |
MqttEndpointImpl |
subscribeAcknowledge(int subscribeMessageId,
List<io.netty.handler.codec.mqtt.MqttQoS> grantedQoSLevels)
Sends the SUBACK message to the remote MQTT client
|
MqttEndpointImpl |
subscribeHandler(Handler<MqttSubscribeMessage> handler)
Set a subscribe handler on the MQTT endpoint.
|
void |
subscriptionAutoAck(boolean isSubscriptionAutoAck)
Enable/disable subscription/unsubscription requests auto acknowledge
|
MqttEndpointImpl |
unsubscribeAcknowledge(int unsubscribeMessageId)
Sends the UNSUBACK message to the remote MQTT client
|
MqttEndpointImpl |
unsubscribeHandler(Handler<MqttUnsubscribeMessage> handler)
Set a unsubscribe handler on the MQTT endpoint.
|
MqttWill |
will() |
public MqttEndpointImpl(NetSocketInternal conn, String clientIdentifier, MqttAuth auth, MqttWill will, boolean isCleanSession, int protocolVersion, String protocolName, int keepAliveTimeoutSeconds)
conn - connection instance with the remote MQTT clientclientIdentifier - client identifier of the remoteauth - instance with the authentication informationwill - instance with the will informationisCleanSession - if the sessione should be cleaned or notprotocolVersion - protocol version required by the clientprotocolName - protocol name sent by the clientkeepAliveTimeoutSeconds - keep alive timeout (in seconds)public String clientIdentifier()
clientIdentifier in interface MqttEndpointpublic MqttAuth auth()
auth in interface MqttEndpointpublic MqttWill will()
will in interface MqttEndpointpublic boolean isCleanSession()
isCleanSession in interface MqttEndpointpublic int protocolVersion()
protocolVersion in interface MqttEndpointpublic String protocolName()
protocolName in interface MqttEndpointpublic int keepAliveTimeSeconds()
keepAliveTimeSeconds in interface MqttEndpointpublic int lastMessageId()
lastMessageId in interface MqttEndpointpublic void subscriptionAutoAck(boolean isSubscriptionAutoAck)
MqttEndpointsubscriptionAutoAck in interface MqttEndpointisSubscriptionAutoAck - auto acknowledge statuspublic boolean isSubscriptionAutoAck()
isSubscriptionAutoAck in interface MqttEndpointpublic MqttEndpoint publishAutoAck(boolean isPublishAutoAck)
MqttEndpointpublishAutoAck in interface MqttEndpointisPublishAutoAck - auto acknowledge statuspublic boolean isPublishAutoAck()
isPublishAutoAck in interface MqttEndpointpublic MqttEndpoint autoKeepAlive(boolean isAutoKeepAlive)
MqttEndpointautoKeepAlive in interface MqttEndpointisAutoKeepAlive - auto keep alivepublic boolean isAutoKeepAlive()
isAutoKeepAlive in interface MqttEndpointpublic boolean isConnected()
isConnected in interface MqttEndpointpublic MqttEndpoint setClientIdentifier(String clientIdentifier)
MqttEndpointsetClientIdentifier in interface MqttEndpointclientIdentifier - the client identifierpublic MqttEndpointImpl disconnectHandler(Handler<Void> handler)
MqttEndpointdisconnectHandler in interface MqttEndpointhandler - the handlerpublic MqttEndpointImpl subscribeHandler(Handler<MqttSubscribeMessage> handler)
MqttEndpointsubscribeHandler in interface MqttEndpointhandler - the handlerpublic MqttEndpointImpl unsubscribeHandler(Handler<MqttUnsubscribeMessage> handler)
MqttEndpointunsubscribeHandler in interface MqttEndpointhandler - the handlerpublic MqttEndpointImpl publishHandler(Handler<MqttPublishMessage> handler)
MqttEndpointpublishHandler in interface MqttEndpointhandler - the handlerpublic MqttEndpointImpl publishAcknowledgeHandler(Handler<Integer> handler)
MqttEndpointpublishAcknowledgeHandler in interface MqttEndpointhandler - the handlerpublic MqttEndpointImpl publishReceivedHandler(Handler<Integer> handler)
MqttEndpointpublishReceivedHandler in interface MqttEndpointhandler - the handlerpublic MqttEndpointImpl publishReleaseHandler(Handler<Integer> handler)
MqttEndpointpublishReleaseHandler in interface MqttEndpointhandler - the handlerpublic MqttEndpointImpl publishCompletionHandler(Handler<Integer> handler)
MqttEndpointpublishCompletionHandler in interface MqttEndpointhandler - the handlerpublic MqttEndpointImpl pingHandler(Handler<Void> handler)
MqttEndpointpingHandler in interface MqttEndpointhandler - the handlerpublic MqttEndpointImpl closeHandler(Handler<Void> handler)
MqttEndpointcloseHandler in interface MqttEndpointhandler - the handlerpublic MqttEndpointImpl exceptionHandler(Handler<Throwable> handler)
MqttEndpointexceptionHandler in interface MqttEndpointhandler - the handlerpublic MqttEndpoint accept()
MqttEndpointMqttEndpoint.accept(boolean) with no session is present.accept in interface MqttEndpointpublic MqttEndpointImpl accept(boolean sessionPresent)
MqttEndpointMqttEndpoint.reject(MqttConnectReturnCode) for refusing connectionaccept in interface MqttEndpointsessionPresent - if a previous session is presentpublic MqttEndpointImpl reject(io.netty.handler.codec.mqtt.MqttConnectReturnCode returnCode)
MqttEndpointMqttEndpoint.accept(boolean) for accepting connectionreject in interface MqttEndpointreturnCode - the connect return codepublic MqttEndpointImpl subscribeAcknowledge(int subscribeMessageId, List<io.netty.handler.codec.mqtt.MqttQoS> grantedQoSLevels)
MqttEndpointsubscribeAcknowledge in interface MqttEndpointsubscribeMessageId - identifier of the SUBSCRIBE message to acknowledgegrantedQoSLevels - granted QoS levels for the requested topicspublic MqttEndpointImpl unsubscribeAcknowledge(int unsubscribeMessageId)
MqttEndpointunsubscribeAcknowledge in interface MqttEndpointunsubscribeMessageId - identifier of the UNSUBSCRIBE message to acknowledgepublic MqttEndpointImpl publishAcknowledge(int publishMessageId)
MqttEndpointpublishAcknowledge in interface MqttEndpointpublishMessageId - identifier of the PUBLISH message to acknowledgepublic MqttEndpointImpl publishReceived(int publishMessageId)
MqttEndpointpublishReceived in interface MqttEndpointpublishMessageId - identifier of the PUBLISH message to acknowledgepublic MqttEndpointImpl publishRelease(int publishMessageId)
MqttEndpointpublishRelease in interface MqttEndpointpublishMessageId - identifier of the PUBLISH message to acknowledgepublic MqttEndpointImpl publishComplete(int publishMessageId)
MqttEndpointpublishComplete in interface MqttEndpointpublishMessageId - identifier of the PUBLISH message to acknowledgepublic MqttEndpointImpl publish(String topic, Buffer payload, io.netty.handler.codec.mqtt.MqttQoS qosLevel, boolean isDup, boolean isRetain)
MqttEndpointpublish in interface MqttEndpointtopic - 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 retainedpublic MqttEndpointImpl publish(String topic, Buffer payload, io.netty.handler.codec.mqtt.MqttQoS qosLevel, boolean isDup, boolean isRetain, Handler<AsyncResult<Integer>> publishSentHandler)
MqttEndpointpublish in interface MqttEndpointtopic - 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 packetIdpublic MqttEndpointImpl publish(String topic, Buffer payload, io.netty.handler.codec.mqtt.MqttQoS qosLevel, boolean isDup, boolean isRetain, int messageId, Handler<AsyncResult<Integer>> publishSentHandler)
MqttEndpointpublish in interface MqttEndpointtopic - 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 packetIdpublic MqttEndpointImpl pong()
MqttEndpointpong in interface MqttEndpointpublic void close()
MqttEndpointclose in interface MqttEndpointpublic SocketAddress localAddress()
localAddress in interface MqttEndpointpublic SocketAddress remoteAddress()
remoteAddress in interface MqttEndpointpublic boolean isSsl()
isSsl in interface MqttEndpointMqttEndpoint is encrypted via SSL/TLS.public SSLSession sslSession()
sslSession in interface MqttEndpointSSLSessionCopyright © 2020. All rights reserved.