Class MqttEndpoint
- All Implemented Interfaces:
MutinyDelegate
original
non Mutiny-ified interface using Vert.x codegen.-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionMqttEndpoint
(io.vertx.mqtt.MqttEndpoint delegate) MqttEndpoint
(Object delegate) -
Method Summary
Modifier and TypeMethodDescriptionaccept()
accept
(boolean sessionPresent) accept
(boolean sessionPresent, io.netty.handler.codec.mqtt.MqttProperties properties) io.vertx.mqtt.MqttAuth
auth()
autoKeepAlive
(boolean isAutoKeepAlive) void
close()
closeHandler
(Runnable handler) io.netty.handler.codec.mqtt.MqttProperties
disconnect
(io.vertx.mqtt.messages.codes.MqttDisconnectReasonCode code, io.netty.handler.codec.mqtt.MqttProperties properties) disconnectHandler
(Runnable handler) boolean
exceptionHandler
(Consumer<Throwable> handler) io.vertx.mqtt.MqttEndpoint
int
hashCode()
boolean
boolean
boolean
boolean
boolean
isSsl()
boolean
int
int
static MqttEndpoint
newInstance
(io.vertx.mqtt.MqttEndpoint arg) pingHandler
(Runnable handler) pong()
int
io.smallrye.mutiny.Uni<Integer>
publish
(String topic, Buffer payload, io.netty.handler.codec.mqtt.MqttQoS qosLevel, boolean isDup, boolean isRetain) Sends the PUBLISH message to the remote MQTT serverio.smallrye.mutiny.Uni<Integer>
publish
(String topic, Buffer payload, io.netty.handler.codec.mqtt.MqttQoS qosLevel, boolean isDup, boolean isRetain, int messageId) Sends the PUBLISH message to the remote MQTT server explicitly specifying the messageIdio.smallrye.mutiny.Uni<Integer>
publish
(String topic, Buffer payload, io.netty.handler.codec.mqtt.MqttQoS qosLevel, boolean isDup, boolean isRetain, int messageId, io.netty.handler.codec.mqtt.MqttProperties properties) Sends the PUBLISH message to the remote MQTT server explicitly specifying the messageIdpublishAcknowledge
(int publishMessageId) publishAcknowledge
(int publishMessageId, io.vertx.mqtt.messages.codes.MqttPubAckReasonCode reasonCode, io.netty.handler.codec.mqtt.MqttProperties properties) publishAcknowledgeHandler
(Consumer<Integer> handler) publishAndAwait
(String topic, Buffer payload, io.netty.handler.codec.mqtt.MqttQoS qosLevel, boolean isDup, boolean isRetain) Blocking variant ofpublish(String,io.vertx.mutiny.core.buffer.Buffer,MqttQoS,boolean,boolean)
.publishAndAwait
(String topic, Buffer payload, io.netty.handler.codec.mqtt.MqttQoS qosLevel, boolean isDup, boolean isRetain, int messageId) Blocking variant ofpublish(String,io.vertx.mutiny.core.buffer.Buffer,MqttQoS,boolean,boolean,int)
.publishAndAwait
(String topic, Buffer payload, io.netty.handler.codec.mqtt.MqttQoS qosLevel, boolean isDup, boolean isRetain, int messageId, io.netty.handler.codec.mqtt.MqttProperties properties) publishAndForget
(String topic, Buffer payload, io.netty.handler.codec.mqtt.MqttQoS qosLevel, boolean isDup, boolean isRetain) Variant ofpublish(String,io.vertx.mutiny.core.buffer.Buffer,MqttQoS,boolean,boolean)
that ignores the result of the operation.publishAndForget
(String topic, Buffer payload, io.netty.handler.codec.mqtt.MqttQoS qosLevel, boolean isDup, boolean isRetain, int messageId) Variant ofpublish(String,io.vertx.mutiny.core.buffer.Buffer,MqttQoS,boolean,boolean,int)
that ignores the result of the operation.publishAndForget
(String topic, Buffer payload, io.netty.handler.codec.mqtt.MqttQoS qosLevel, boolean isDup, boolean isRetain, int messageId, io.netty.handler.codec.mqtt.MqttProperties properties) Variant ofpublish(String,io.vertx.mutiny.core.buffer.Buffer,MqttQoS,boolean,boolean,int,MqttProperties)
that ignores the result of the operation.publishAutoAck
(boolean isPublishAutoAck) publishComplete
(int publishMessageId) publishComplete
(int publishMessageId, io.vertx.mqtt.messages.codes.MqttPubCompReasonCode reasonCode, io.netty.handler.codec.mqtt.MqttProperties properties) publishCompletionHandler
(Consumer<Integer> handler) publishHandler
(Consumer<MqttPublishMessage> handler) publishReceived
(int publishMessageId) publishReceived
(int publishMessageId, io.vertx.mqtt.messages.codes.MqttPubRecReasonCode reasonCode, io.netty.handler.codec.mqtt.MqttProperties properties) publishReceivedHandler
(Consumer<Integer> handler) publishRelease
(int publishMessageId) publishRelease
(int publishMessageId, io.vertx.mqtt.messages.codes.MqttPubRelReasonCode reasonCode, io.netty.handler.codec.mqtt.MqttProperties properties) publishReleaseHandler
(Consumer<Integer> handler) reject
(io.netty.handler.codec.mqtt.MqttConnectReturnCode returnCode) reject
(io.netty.handler.codec.mqtt.MqttConnectReturnCode returnCode, io.netty.handler.codec.mqtt.MqttProperties properties) setClientIdentifier
(String clientIdentifier) subscribeAcknowledge
(int subscribeMessageId, List<io.netty.handler.codec.mqtt.MqttQoS> grantedQoSLevels) subscribeAcknowledge
(int subscribeMessageId, List<io.vertx.mqtt.messages.codes.MqttSubAckReasonCode> reasonCodes, io.netty.handler.codec.mqtt.MqttProperties properties) subscribeHandler
(Consumer<MqttSubscribeMessage> handler) void
subscriptionAutoAck
(boolean isSubscriptionAutoAck) toString()
unsubscribeAcknowledge
(int unsubscribeMessageId) unsubscribeAcknowledge
(int unsubscribeMessageId, List<io.vertx.mqtt.messages.codes.MqttUnsubAckReasonCode> reasonCodes, io.netty.handler.codec.mqtt.MqttProperties properties) unsubscribeHandler
(Consumer<MqttUnsubscribeMessage> handler) io.vertx.mqtt.MqttWill
will()
-
Field Details
-
__TYPE_ARG
-
-
Constructor Details
-
MqttEndpoint
public MqttEndpoint(io.vertx.mqtt.MqttEndpoint delegate) -
MqttEndpoint
-
-
Method Details
-
getDelegate
public io.vertx.mqtt.MqttEndpoint getDelegate()- Specified by:
getDelegate
in interfaceMutinyDelegate
- Returns:
- the delegate used by this Mutiny object of generated type
-
toString
-
equals
-
hashCode
public int hashCode() -
close
public void close() -
remoteAddress
- Returns:
- the remote address for this socket
-
localAddress
- Returns:
- the local address for this socket
-
isSsl
public boolean isSsl()- Returns:
- true if this
MqttEndpoint
is encrypted via SSL/TLS.
-
httpHeaders
- Returns:
- the HTTP headers
-
httpRequestURI
- Returns:
- the HTTP request uri
-
clientIdentifier
- Returns:
- the client identifier as provided by the remote MQTT client
-
auth
public io.vertx.mqtt.MqttAuth auth()- Returns:
- the Authentication information as provided by the remote MQTT client
-
will
public io.vertx.mqtt.MqttWill will()- Returns:
- the Will information as provided by the remote MQTT client
-
protocolVersion
public int protocolVersion()- Returns:
- the protocol version required by the remote MQTT client
-
protocolName
- Returns:
- the protocol name provided by the remote MQTT client
-
isCleanSession
public boolean isCleanSession()- Returns:
- true when clean session is requested by the remote MQTT client
-
keepAliveTimeSeconds
public int keepAliveTimeSeconds()- Returns:
- the keep alive timeout (in seconds) specified by the remote MQTT client
-
lastMessageId
public int lastMessageId()- Returns:
- the message identifier used for last published message
-
subscriptionAutoAck
public void subscriptionAutoAck(boolean isSubscriptionAutoAck) - Parameters:
isSubscriptionAutoAck
- auto acknowledge status
-
isSubscriptionAutoAck
public boolean isSubscriptionAutoAck()- Returns:
- true when auto acknowledge status for subscription/unsubscription requests
-
publishAutoAck
- Parameters:
isPublishAutoAck
- auto acknowledge status- Returns:
- a reference to this, so the API can be used fluently
-
isPublishAutoAck
public boolean isPublishAutoAck()- Returns:
- auto acknowledge status for publishing (in/out)
-
autoKeepAlive
- Parameters:
isAutoKeepAlive
- auto keep alive- Returns:
- a reference to this, so the API can be used fluently
-
isAutoKeepAlive
public boolean isAutoKeepAlive()- Returns:
- the auto keep alive status (sending ping response)
-
isConnected
public boolean isConnected()- Returns:
- if the connection between remote client and local endpoint is established/open
-
setClientIdentifier
- Parameters:
clientIdentifier
- the client identifier- Returns:
- a reference to this, so the API can be used fluently
-
disconnectHandler
- Parameters:
handler
- the handler- Returns:
-
disconnectMessageHandler
- Parameters:
handler
- the handler- Returns:
-
subscribeHandler
- Parameters:
handler
- the handler- Returns:
-
unsubscribeHandler
- Parameters:
handler
- the handler- Returns:
-
publishHandler
- Parameters:
handler
- the handler- Returns:
-
publishAcknowledgeHandler
- Parameters:
handler
- the handler- Returns:
-
publishAcknowledgeMessageHandler
- Parameters:
handler
- the handler- Returns:
-
publishReceivedHandler
- Parameters:
handler
- the handler- Returns:
-
publishReceivedMessageHandler
- Parameters:
handler
- the handler- Returns:
-
publishReleaseHandler
- Parameters:
handler
- the handler- Returns:
-
publishReleaseMessageHandler
- Parameters:
handler
- the handler- Returns:
-
publishCompletionHandler
- Parameters:
handler
- the handler- Returns:
-
publishCompletionMessageHandler
- Parameters:
handler
- the handler- Returns:
-
pingHandler
- Parameters:
handler
- the handler- Returns:
-
closeHandler
- Parameters:
handler
- the handler- Returns:
-
exceptionHandler
- Parameters:
handler
- the handler- Returns:
-
accept
- Returns:
- the instance of MqttEndpoint to chain method calls.
-
accept
- Parameters:
sessionPresent
- if a previous session is present- Returns:
- a reference to this, so the API can be used fluently
-
reject
- Parameters:
returnCode
- the connect return code- Returns:
- a reference to this, so the API can be used fluently
-
subscribeAcknowledge
public MqttEndpoint subscribeAcknowledge(int subscribeMessageId, List<io.netty.handler.codec.mqtt.MqttQoS> grantedQoSLevels) - Parameters:
subscribeMessageId
- identifier of the SUBSCRIBE message to acknowledgegrantedQoSLevels
- granted QoS levels for the requested topics- Returns:
- a reference to this, so the API can be used fluently
-
unsubscribeAcknowledge
- Parameters:
unsubscribeMessageId
- identifier of the UNSUBSCRIBE message to acknowledge- Returns:
- a reference to this, so the API can be used fluently
-
publishAcknowledge
- Parameters:
publishMessageId
- identifier of the PUBLISH message to acknowledge- Returns:
- a reference to this, so the API can be used fluently
-
publishReceived
- Parameters:
publishMessageId
- identifier of the PUBLISH message to acknowledge- Returns:
- a reference to this, so the API can be used fluently
-
publishRelease
- Parameters:
publishMessageId
- identifier of the PUBLISH message to acknowledge- Returns:
- a reference to this, so the API can be used fluently
-
publishComplete
- Parameters:
publishMessageId
- identifier of the PUBLISH message to acknowledge- Returns:
- a reference to this, so the API can be used fluently
-
publish
@CheckReturnValue public io.smallrye.mutiny.Uni<Integer> publish(String topic, Buffer payload, io.netty.handler.codec.mqtt.MqttQoS qosLevel, boolean isDup, boolean isRetain) Sends the PUBLISH message to the remote MQTT serverUnlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Parameters:
topic
- topic on which the message is publishedpayload
- message payloadqosLevel
- QoS levelisDup
- if the message is a duplicateisRetain
- if the message needs to be retained- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
publishAndAwait
public Integer publishAndAwait(String topic, Buffer payload, io.netty.handler.codec.mqtt.MqttQoS qosLevel, boolean isDup, boolean isRetain) Blocking variant ofpublish(String,io.vertx.mutiny.core.buffer.Buffer,MqttQoS,boolean,boolean)
.This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Parameters:
topic
- topic on which the message is publishedpayload
- message payloadqosLevel
- QoS levelisDup
- if the message is a duplicateisRetain
- if the message needs to be retained- Returns:
- the Integer instance produced by the operation.
-
publishAndForget
public MqttEndpoint publishAndForget(String topic, Buffer payload, io.netty.handler.codec.mqtt.MqttQoS qosLevel, boolean isDup, boolean isRetain) Variant ofpublish(String,io.vertx.mutiny.core.buffer.Buffer,MqttQoS,boolean,boolean)
that ignores the result of the operation.This method subscribes on the result of
publish(String,io.vertx.mutiny.core.buffer.Buffer,MqttQoS,boolean,boolean)
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation frompublish(String,io.vertx.mutiny.core.buffer.Buffer,MqttQoS,boolean,boolean)
but you don't need to compose it with other operations.- Parameters:
topic
- topic on which the message is publishedpayload
- message payloadqosLevel
- QoS levelisDup
- if the message is a duplicateisRetain
- if the message needs to be retained- Returns:
- the instance of MqttEndpoint to chain method calls.
-
publish
@CheckReturnValue public io.smallrye.mutiny.Uni<Integer> publish(String topic, Buffer payload, io.netty.handler.codec.mqtt.MqttQoS qosLevel, boolean isDup, boolean isRetain, int messageId) Sends the PUBLISH message to the remote MQTT server explicitly specifying the messageIdUnlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Parameters:
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 ID- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
publishAndAwait
public Integer publishAndAwait(String topic, Buffer payload, io.netty.handler.codec.mqtt.MqttQoS qosLevel, boolean isDup, boolean isRetain, int messageId) Blocking variant ofpublish(String,io.vertx.mutiny.core.buffer.Buffer,MqttQoS,boolean,boolean,int)
.This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Parameters:
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 ID- Returns:
- the Integer instance produced by the operation.
-
publishAndForget
public MqttEndpoint publishAndForget(String topic, Buffer payload, io.netty.handler.codec.mqtt.MqttQoS qosLevel, boolean isDup, boolean isRetain, int messageId) Variant ofpublish(String,io.vertx.mutiny.core.buffer.Buffer,MqttQoS,boolean,boolean,int)
that ignores the result of the operation.This method subscribes on the result of
publish(String,io.vertx.mutiny.core.buffer.Buffer,MqttQoS,boolean,boolean,int)
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation frompublish(String,io.vertx.mutiny.core.buffer.Buffer,MqttQoS,boolean,boolean,int)
but you don't need to compose it with other operations.- Parameters:
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 ID- Returns:
- the instance of MqttEndpoint to chain method calls.
-
pong
- Returns:
- a reference to this, so the API can be used fluently
-
connectProperties
public io.netty.handler.codec.mqtt.MqttProperties connectProperties()- Returns:
- MQTT properties of the CONNECT message
-
accept
public MqttEndpoint accept(boolean sessionPresent, io.netty.handler.codec.mqtt.MqttProperties properties) - Parameters:
sessionPresent
- if a previous session is presentproperties
- CONNACK message properties (MQTT5)- Returns:
- a reference to this, so the API can be used fluently
-
reject
public MqttEndpoint reject(io.netty.handler.codec.mqtt.MqttConnectReturnCode returnCode, io.netty.handler.codec.mqtt.MqttProperties properties) - Parameters:
returnCode
- the connect return codeproperties
- CONNACK message properties- Returns:
- a reference to this, so the API can be used fluently
-
subscribeAcknowledge
public MqttEndpoint subscribeAcknowledge(int subscribeMessageId, List<io.vertx.mqtt.messages.codes.MqttSubAckReasonCode> reasonCodes, io.netty.handler.codec.mqtt.MqttProperties properties) - Parameters:
subscribeMessageId
- identifier of the SUBSCRIBE message to acknowledgereasonCodes
- reason codesproperties
- MQTT message properties- Returns:
- a reference to this, so the API can be used fluently
-
unsubscribeAcknowledge
public MqttEndpoint unsubscribeAcknowledge(int unsubscribeMessageId, List<io.vertx.mqtt.messages.codes.MqttUnsubAckReasonCode> reasonCodes, io.netty.handler.codec.mqtt.MqttProperties properties) - Parameters:
unsubscribeMessageId
- identifier of the UNSUBSCRIBE message to acknowledgereasonCodes
- reason codesproperties
- MQTT message properties- Returns:
- a reference to this, so the API can be used fluently
-
publishAcknowledge
public MqttEndpoint publishAcknowledge(int publishMessageId, io.vertx.mqtt.messages.codes.MqttPubAckReasonCode reasonCode, io.netty.handler.codec.mqtt.MqttProperties properties) -
publishReceived
public MqttEndpoint publishReceived(int publishMessageId, io.vertx.mqtt.messages.codes.MqttPubRecReasonCode reasonCode, io.netty.handler.codec.mqtt.MqttProperties properties) - Parameters:
publishMessageId
- identifier of the PUBLISH message to acknowledgereasonCode
- code of the outcomeproperties
- MQTT properties- Returns:
- a reference to this, so the API can be used fluently
-
publishRelease
public MqttEndpoint publishRelease(int publishMessageId, io.vertx.mqtt.messages.codes.MqttPubRelReasonCode reasonCode, io.netty.handler.codec.mqtt.MqttProperties properties) - Parameters:
publishMessageId
- identifier of the PUBLISH message to acknowledgereasonCode
- reason codeproperties
- MQTT message properties- Returns:
- a reference to this, so the API can be used fluently
-
publishComplete
public MqttEndpoint publishComplete(int publishMessageId, io.vertx.mqtt.messages.codes.MqttPubCompReasonCode reasonCode, io.netty.handler.codec.mqtt.MqttProperties properties) - Parameters:
publishMessageId
- identifier of the PUBLISH message to acknowledgereasonCode
- reason codeproperties
- MQTT message properties- Returns:
- a reference to this, so the API can be used fluently
-
publish
@CheckReturnValue public io.smallrye.mutiny.Uni<Integer> publish(String topic, Buffer payload, io.netty.handler.codec.mqtt.MqttQoS qosLevel, boolean isDup, boolean isRetain, int messageId, io.netty.handler.codec.mqtt.MqttProperties properties) Sends the PUBLISH message to the remote MQTT server explicitly specifying the messageIdUnlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Parameters:
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 properties- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
publishAndAwait
public Integer publishAndAwait(String topic, Buffer payload, io.netty.handler.codec.mqtt.MqttQoS qosLevel, boolean isDup, boolean isRetain, int messageId, io.netty.handler.codec.mqtt.MqttProperties properties) Blocking variant ofpublish(String,io.vertx.mutiny.core.buffer.Buffer,MqttQoS,boolean,boolean,int,MqttProperties)
.This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Parameters:
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 properties- Returns:
- the Integer instance produced by the operation.
-
publishAndForget
public MqttEndpoint publishAndForget(String topic, Buffer payload, io.netty.handler.codec.mqtt.MqttQoS qosLevel, boolean isDup, boolean isRetain, int messageId, io.netty.handler.codec.mqtt.MqttProperties properties) Variant ofpublish(String,io.vertx.mutiny.core.buffer.Buffer,MqttQoS,boolean,boolean,int,MqttProperties)
that ignores the result of the operation.This method subscribes on the result of
publish(String,io.vertx.mutiny.core.buffer.Buffer,MqttQoS,boolean,boolean,int,MqttProperties)
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation frompublish(String,io.vertx.mutiny.core.buffer.Buffer,MqttQoS,boolean,boolean,int,MqttProperties)
but you don't need to compose it with other operations.- Parameters:
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 properties- Returns:
- the instance of MqttEndpoint to chain method calls.
-
disconnect
public MqttEndpoint disconnect(io.vertx.mqtt.messages.codes.MqttDisconnectReasonCode code, io.netty.handler.codec.mqtt.MqttProperties properties) - Parameters:
code
- reason codeproperties
- MQTT message properties- Returns:
- a reference to this, so the API can be used fluently
-
newInstance
-