Class MqttEndpoint
- java.lang.Object
-
- io.vertx.mutiny.mqtt.MqttEndpoint
-
public class MqttEndpoint extends Object
Represents an MQTT endpoint for point-to-point communication with the remote MQTT client NOTE: This class has been automatically generated from theoriginal
non Mutiny-ified interface using Vert.x codegen.
-
-
Field Summary
Fields Modifier and Type Field Description static TypeArg<MqttEndpoint>
__TYPE_ARG
-
Constructor Summary
Constructors Constructor Description MqttEndpoint(io.vertx.mqtt.MqttEndpoint delegate)
MqttEndpoint(Object delegate)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description MqttEndpoint
accept()
MqttEndpoint
accept(boolean sessionPresent)
io.vertx.mqtt.MqttAuth
auth()
MqttEndpoint
autoKeepAlive(boolean isAutoKeepAlive)
String
clientIdentifier()
void
close()
MqttEndpoint
closeHandler(Runnable handler)
MqttEndpoint
disconnectHandler(Runnable handler)
boolean
equals(Object o)
MqttEndpoint
exceptionHandler(Consumer<Throwable> handler)
io.vertx.mqtt.MqttEndpoint
getDelegate()
int
hashCode()
boolean
isAutoKeepAlive()
boolean
isCleanSession()
boolean
isConnected()
boolean
isPublishAutoAck()
boolean
isSsl()
boolean
isSubscriptionAutoAck()
int
keepAliveTimeSeconds()
int
lastMessageId()
SocketAddress
localAddress()
static MqttEndpoint
newInstance(io.vertx.mqtt.MqttEndpoint arg)
MqttEndpoint
pingHandler(Runnable handler)
MqttEndpoint
pong()
String
protocolName()
int
protocolVersion()
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 messageIdMqttEndpoint
publishAcknowledge(int publishMessageId)
MqttEndpoint
publishAcknowledgeHandler(Consumer<Integer> handler)
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)
.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)
.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.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.MqttEndpoint
publishAutoAck(boolean isPublishAutoAck)
MqttEndpoint
publishComplete(int publishMessageId)
MqttEndpoint
publishCompletionHandler(Consumer<Integer> handler)
MqttEndpoint
publishHandler(Consumer<MqttPublishMessage> handler)
MqttEndpoint
publishReceived(int publishMessageId)
MqttEndpoint
publishReceivedHandler(Consumer<Integer> handler)
MqttEndpoint
publishRelease(int publishMessageId)
MqttEndpoint
publishReleaseHandler(Consumer<Integer> handler)
MqttEndpoint
reject(io.netty.handler.codec.mqtt.MqttConnectReturnCode returnCode)
SocketAddress
remoteAddress()
MqttEndpoint
setClientIdentifier(String clientIdentifier)
MqttEndpoint
subscribeAcknowledge(int subscribeMessageId, List<io.netty.handler.codec.mqtt.MqttQoS> grantedQoSLevels)
MqttEndpoint
subscribeHandler(Consumer<MqttSubscribeMessage> handler)
void
subscriptionAutoAck(boolean isSubscriptionAutoAck)
String
toString()
MqttEndpoint
unsubscribeAcknowledge(int unsubscribeMessageId)
MqttEndpoint
unsubscribeHandler(Consumer<MqttUnsubscribeMessage> handler)
io.vertx.mqtt.MqttWill
will()
-
-
-
Field Detail
-
__TYPE_ARG
public static final TypeArg<MqttEndpoint> __TYPE_ARG
-
-
Constructor Detail
-
MqttEndpoint
public MqttEndpoint(io.vertx.mqtt.MqttEndpoint delegate)
-
MqttEndpoint
public MqttEndpoint(Object delegate)
-
-
Method Detail
-
getDelegate
public io.vertx.mqtt.MqttEndpoint getDelegate()
-
close
public void close()
-
remoteAddress
public SocketAddress remoteAddress()
- Returns:
- the remote address for this socket
-
localAddress
public SocketAddress localAddress()
- Returns:
- the local address for this socket
-
isSsl
public boolean isSsl()
- Returns:
- true if this
MqttEndpoint
is encrypted via SSL/TLS.
-
clientIdentifier
public String 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
public String 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
public MqttEndpoint publishAutoAck(boolean isPublishAutoAck)
- 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
public MqttEndpoint autoKeepAlive(boolean isAutoKeepAlive)
- 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
public MqttEndpoint setClientIdentifier(String clientIdentifier)
- Parameters:
clientIdentifier
- the client identifier- Returns:
- a reference to this, so the API can be used fluently
-
disconnectHandler
public MqttEndpoint disconnectHandler(Runnable handler)
- Parameters:
handler
- the handler- Returns:
-
subscribeHandler
public MqttEndpoint subscribeHandler(Consumer<MqttSubscribeMessage> handler)
- Parameters:
handler
- the handler- Returns:
-
unsubscribeHandler
public MqttEndpoint unsubscribeHandler(Consumer<MqttUnsubscribeMessage> handler)
- Parameters:
handler
- the handler- Returns:
-
publishHandler
public MqttEndpoint publishHandler(Consumer<MqttPublishMessage> handler)
- Parameters:
handler
- the handler- Returns:
-
publishAcknowledgeHandler
public MqttEndpoint publishAcknowledgeHandler(Consumer<Integer> handler)
- Parameters:
handler
- the handler- Returns:
-
publishReceivedHandler
public MqttEndpoint publishReceivedHandler(Consumer<Integer> handler)
- Parameters:
handler
- the handler- Returns:
-
publishReleaseHandler
public MqttEndpoint publishReleaseHandler(Consumer<Integer> handler)
- Parameters:
handler
- the handler- Returns:
-
publishCompletionHandler
public MqttEndpoint publishCompletionHandler(Consumer<Integer> handler)
- Parameters:
handler
- the handler- Returns:
-
pingHandler
public MqttEndpoint pingHandler(Runnable handler)
- Parameters:
handler
- the handler- Returns:
-
closeHandler
public MqttEndpoint closeHandler(Runnable handler)
- Parameters:
handler
- the handler- Returns:
-
exceptionHandler
public MqttEndpoint exceptionHandler(Consumer<Throwable> handler)
- Parameters:
handler
- the handler- Returns:
-
accept
public MqttEndpoint accept()
- Returns:
- the instance of MqttEndpoint to chain method calls.
-
accept
public MqttEndpoint accept(boolean sessionPresent)
- Parameters:
sessionPresent
- if a previous session is present- Returns:
- a reference to this, so the API can be used fluently
-
reject
public MqttEndpoint reject(io.netty.handler.codec.mqtt.MqttConnectReturnCode returnCode)
- 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
public MqttEndpoint unsubscribeAcknowledge(int unsubscribeMessageId)
- Parameters:
unsubscribeMessageId
- identifier of the UNSUBSCRIBE message to acknowledge- Returns:
- a reference to this, so the API can be used fluently
-
publishAcknowledge
public MqttEndpoint publishAcknowledge(int publishMessageId)
- Parameters:
publishMessageId
- identifier of the PUBLISH message to acknowledge- Returns:
- a reference to this, so the API can be used fluently
-
publishReceived
public MqttEndpoint publishReceived(int publishMessageId)
- Parameters:
publishMessageId
- identifier of the PUBLISH message to acknowledge- Returns:
- a reference to this, so the API can be used fluently
-
publishRelease
public MqttEndpoint publishRelease(int publishMessageId)
- Parameters:
publishMessageId
- identifier of the PUBLISH message to acknowledge- Returns:
- a reference to this, so the API can be used fluently
-
publishComplete
public MqttEndpoint publishComplete(int publishMessageId)
- Parameters:
publishMessageId
- identifier of the PUBLISH message to acknowledge- Returns:
- a reference to this, so the API can be used fluently
-
publish
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
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
public MqttEndpoint pong()
- Returns:
- a reference to this, so the API can be used fluently
-
newInstance
public static MqttEndpoint newInstance(io.vertx.mqtt.MqttEndpoint arg)
-
-