public class MqttClientOptions
extends io.vertx.core.net.NetClientOptions
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_ACK_TIMEOUT |
static boolean |
DEFAULT_AUTO_ACK |
static boolean |
DEFAULT_CLEAN_SESSION |
static String |
DEFAULT_HOST |
static int |
DEFAULT_KEEP_ALIVE_INTERVAL |
static int |
DEFAULT_MAX_INFLIGHT_QUEUE |
static int |
DEFAULT_MAX_MESSAGE_SIZE |
static int |
DEFAULT_PORT |
static int |
DEFAULT_TSL_PORT |
static boolean |
DEFAULT_WILL_FLAG |
static int |
DEFAULT_WILL_QOS |
static boolean |
DEFAULT_WILL_RETAIN |
DEFAULT_HOSTNAME_VERIFICATION_ALGORITHM, DEFAULT_RECONNECT_ATTEMPTS, DEFAULT_RECONNECT_INTERVAL, DEFAULT_REGISTER_WRITE_HANDLERDEFAULT_CONNECT_TIMEOUT, DEFAULT_METRICS_NAME, DEFAULT_TRUST_ALLDEFAULT_ENABLED_SECURE_TRANSPORT_PROTOCOLS, DEFAULT_IDLE_TIMEOUT, DEFAULT_IDLE_TIMEOUT_TIME_UNIT, DEFAULT_READ_IDLE_TIMEOUT, DEFAULT_SO_LINGER, DEFAULT_SSL, DEFAULT_SSL_ENGINE, DEFAULT_SSL_HANDSHAKE_TIMEOUT, DEFAULT_SSL_HANDSHAKE_TIMEOUT_TIME_UNIT, DEFAULT_TCP_CORK, DEFAULT_TCP_FAST_OPEN, DEFAULT_TCP_KEEAPLIVE_INTERVAL_SECONDS, DEFAULT_TCP_KEEP_ALIVE, DEFAULT_TCP_KEEPALIVE_COUNT, DEFAULT_TCP_KEEPALIVE_IDLE_SECONDS, DEFAULT_TCP_NO_DELAY, DEFAULT_TCP_QUICKACK, DEFAULT_TCP_USER_TIMEOUT, DEFAULT_USE_ALPN, DEFAULT_WRITE_IDLE_TIMEOUT| Constructor and Description |
|---|
MqttClientOptions()
Default constructor
|
MqttClientOptions(io.vertx.core.json.JsonObject json)
Create an instance of MqttClientOptions from JSON
|
MqttClientOptions(MqttClientOptions other)
Copy constructor
|
| Modifier and Type | Method and Description |
|---|---|
MqttClientOptions |
addCrlPath(String crlPath) |
MqttClientOptions |
addCrlValue(io.vertx.core.buffer.Buffer crlValue) |
MqttClientOptions |
addEnabledCipherSuite(String suite) |
MqttClientOptions |
addEnabledSecureTransportProtocol(String protocol) |
int |
getAckTimeout()
Gets the time in seconds after which the client stops waiting for a PUBACK, PUBREC
or PUBCOMP packet from the server in response to a packet it has sent.
|
String |
getClientId() |
int |
getIdleTimeout() |
int |
getKeepAliveInterval() |
int |
getMaxInflightQueue() |
int |
getMaxMessageSize() |
String |
getPassword() |
String |
getUsername() |
String |
getWillMessage()
Deprecated.
|
io.vertx.core.buffer.Buffer |
getWillMessageBytes() |
int |
getWillQoS() |
String |
getWillTopic() |
boolean |
hasPassword() |
boolean |
hasUsername() |
boolean |
isAutoAck() |
boolean |
isAutoGeneratedClientId() |
boolean |
isAutoKeepAlive() |
boolean |
isCleanSession() |
boolean |
isWillFlag() |
boolean |
isWillRetain() |
MqttClientOptions |
setAckTimeout(int ackTimeoutSeconds)
Sets the time in seconds after which the client will stop waiting for a PUBACK, PUBREC
or PUBCOMP packet from the server in response to a packet it has sent.
|
void |
setAutoAck(boolean autoAck)
Set to false to let the application code to ack the message via
MqttPublishMessage#ack(). |
MqttClientOptions |
setAutoGeneratedClientId(boolean isAutoGeneratedClientId)
Set if the MQTT client must generate clientId automatically
(default is true)
|
MqttClientOptions |
setAutoKeepAlive(boolean isAutoKeepAlive)
Set if the MQTT client must handle PINGREQ automatically
(default is true)
|
MqttClientOptions |
setCleanSession(boolean cleanSession)
Set to start with a clean session (or not)
|
MqttClientOptions |
setClientId(String clientId)
Set the client identifier
|
MqttClientOptions |
setHostnameVerificationAlgorithm(String hostnameVerificationAlgorithm) |
MqttClientOptions |
setIdleTimeout(int idleTimeout)
Deprecated.
|
MqttClientOptions |
setKeepAliveInterval(int keepAliveInterval)
Set the keep alive interval in seconds
|
MqttClientOptions |
setKeyCertOptions(io.vertx.core.net.KeyCertOptions options) |
MqttClientOptions |
setKeyStoreOptions(io.vertx.core.net.JksOptions options) |
MqttClientOptions |
setMaxInflightQueue(int maxInflightQueue)
Set max count of unacknowledged messages
|
MqttClientOptions |
setMaxMessageSize(int maxMessageSize)
Set max MQTT message size
|
MqttClientOptions |
setPassword(String password)
Set the password
|
MqttClientOptions |
setPemKeyCertOptions(io.vertx.core.net.PemKeyCertOptions options) |
MqttClientOptions |
setPemTrustOptions(io.vertx.core.net.PemTrustOptions options) |
MqttClientOptions |
setPfxKeyCertOptions(io.vertx.core.net.PfxOptions options) |
MqttClientOptions |
setPfxTrustOptions(io.vertx.core.net.PfxOptions options) |
MqttClientOptions |
setReceiveBufferSize(int receiveBufferSize) |
MqttClientOptions |
setSsl(boolean ssl) |
MqttClientOptions |
setTrustAll(boolean trustAll) |
MqttClientOptions |
setTrustOptions(io.vertx.core.net.TrustOptions options) |
MqttClientOptions |
setTrustStoreOptions(io.vertx.core.net.JksOptions options) |
MqttClientOptions |
setUsername(String username)
Set the username
|
MqttClientOptions |
setWillFlag(boolean willFlag)
Set if will information are provided on connection
|
MqttClientOptions |
setWillMessage(String willMessage)
Deprecated.
|
MqttClientOptions |
setWillMessageBytes(io.vertx.core.buffer.Buffer willMessage)
Set the content of the will message
|
MqttClientOptions |
setWillQoS(int willQoS)
Set the QoS level for the will message
|
MqttClientOptions |
setWillRetain(boolean willRetain)
Set if the will message must be retained
|
MqttClientOptions |
setWillTopic(String willTopic)
Set the topic on which the will message will be published
|
io.vertx.core.json.JsonObject |
toJson() |
String |
toString() |
addNonProxyHost, getApplicationLayerProtocols, getHostnameVerificationAlgorithm, getReconnectAttempts, getReconnectInterval, isRegisterWriteHandler, removeEnabledCipherSuite, removeEnabledSecureTransportProtocol, setActivityLogDataFormat, setApplicationLayerProtocols, setConnectTimeout, setEnabledSecureTransportProtocols, setIdleTimeoutUnit, setJdkSslEngineOptions, setLocalAddress, setLogActivity, setMetricsName, setNonProxyHosts, setOpenSslEngineOptions, setProxyOptions, setReadIdleTimeout, setReconnectAttempts, setReconnectInterval, setRegisterWriteHandler, setReuseAddress, setReusePort, setSendBufferSize, setSoLinger, setSslEngineOptions, setSslHandshakeTimeout, setSslHandshakeTimeoutUnit, setTcpCork, setTcpFastOpen, setTcpKeepAlive, setTcpNoDelay, setTcpQuickAck, setTrafficClass, setUseAlpn, setWriteIdleTimeoutgetConnectTimeout, getLocalAddress, getMetricsName, getNonProxyHosts, getProxyOptions, isTrustAll, setTcpUserTimeoutgetCrlPaths, getCrlValues, getEnabledCipherSuites, getEnabledSecureTransportProtocols, getIdleTimeoutUnit, getJdkSslEngineOptions, getKeyCertOptions, getKeyStoreOptions, getOpenSslEngineOptions, getPemKeyCertOptions, getPemTrustOptions, getPfxKeyCertOptions, getPfxTrustOptions, getReadIdleTimeout, getSoLinger, getSslEngineOptions, getSslHandshakeTimeout, getSslHandshakeTimeoutUnit, getSslOptions, getTcpKeepAliveCount, getTcpKeepAliveIdleSeconds, getTcpKeepAliveIntervalSeconds, getTcpUserTimeout, getTrustOptions, getTrustStoreOptions, getWriteIdleTimeout, isSsl, isTcpCork, isTcpFastOpen, isTcpKeepAlive, isTcpNoDelay, isTcpQuickAck, isUseAlpn, setTcpKeepAliveCount, setTcpKeepAliveIdleSeconds, setTcpKeepAliveIntervalSecondspublic static final int DEFAULT_PORT
public static final int DEFAULT_TSL_PORT
public static final String DEFAULT_HOST
public static final int DEFAULT_WILL_QOS
public static final int DEFAULT_KEEP_ALIVE_INTERVAL
public static final int DEFAULT_MAX_INFLIGHT_QUEUE
public static final boolean DEFAULT_CLEAN_SESSION
public static final boolean DEFAULT_WILL_FLAG
public static final boolean DEFAULT_WILL_RETAIN
public static final int DEFAULT_MAX_MESSAGE_SIZE
public static final int DEFAULT_ACK_TIMEOUT
public static final boolean DEFAULT_AUTO_ACK
public MqttClientOptions()
public MqttClientOptions(io.vertx.core.json.JsonObject json)
json - the JSONpublic MqttClientOptions(MqttClientOptions other)
other - the options to copypublic boolean hasUsername()
public boolean hasPassword()
public boolean isCleanSession()
public boolean isWillFlag()
public boolean isWillRetain()
public int getWillQoS()
public int getKeepAliveInterval()
public String getUsername()
public String getPassword()
public String getClientId()
public String getWillTopic()
@Deprecated public String getWillMessage()
public io.vertx.core.buffer.Buffer getWillMessageBytes()
public MqttClientOptions setClientId(String clientId)
clientId - client identifierpublic MqttClientOptions setUsername(String username)
username - usernamepublic MqttClientOptions setPassword(String password)
password - passwordpublic MqttClientOptions setWillTopic(String willTopic)
willTopic - topic on which the will message will be published@Deprecated public MqttClientOptions setWillMessage(String willMessage)
willMessage - content of the will messagepublic MqttClientOptions setWillMessageBytes(io.vertx.core.buffer.Buffer willMessage)
willMessage - content of the will messagepublic MqttClientOptions setCleanSession(boolean cleanSession)
cleanSession - if clean session should be activatedpublic MqttClientOptions setWillFlag(boolean willFlag)
willFlag - if will information are provided on connectionpublic MqttClientOptions setWillQoS(int willQoS)
willQoS - QoS level for the will messagepublic MqttClientOptions setWillRetain(boolean willRetain)
willRetain - if thw will message must be retainedpublic MqttClientOptions setKeepAliveInterval(int keepAliveInterval)
keepAliveInterval - keep alive interval in secondspublic int getAckTimeout()
The default value of this property is 10s.
public MqttClientOptions setAckTimeout(int ackTimeoutSeconds)
The default value of this property is -1 which indicates that the client should wait an unlimited time for the server's acknowledgement.
ackTimeoutSeconds - timeout in secondsIllegalArgumentException - if the timeout is 0 or < -1.public int getMaxInflightQueue()
public MqttClientOptions setMaxInflightQueue(int maxInflightQueue)
maxInflightQueue - max count of unacknowledged messagespublic MqttClientOptions setAutoKeepAlive(boolean isAutoKeepAlive)
isAutoKeepAlive - ping request handled automaticallypublic MqttClientOptions setAutoGeneratedClientId(boolean isAutoGeneratedClientId)
isAutoGeneratedClientId - clientId generated automaticallypublic boolean isAutoAck()
public void setAutoAck(boolean autoAck)
MqttPublishMessage#ack().
If true, the ack (PUBACK/PUBCOMP) will be sent by vertx-mqtt before MqttClient#publishHandler() execution.
(default is true)autoAck - public boolean isAutoKeepAlive()
public boolean isAutoGeneratedClientId()
public int getMaxMessageSize()
public MqttClientOptions setReceiveBufferSize(int receiveBufferSize)
setReceiveBufferSize in class io.vertx.core.net.NetClientOptionspublic MqttClientOptions setMaxMessageSize(int maxMessageSize)
maxMessageSize - max MQTT message size@Deprecated public MqttClientOptions setIdleTimeout(int idleTimeout)
setKeepAliveInterval(int) (int)}. Use it instead.setIdleTimeout in class io.vertx.core.net.NetClientOptionspublic int getIdleTimeout()
getIdleTimeout in class io.vertx.core.net.TCPSSLOptionspublic MqttClientOptions setSsl(boolean ssl)
setSsl in class io.vertx.core.net.NetClientOptionspublic MqttClientOptions setTrustStoreOptions(io.vertx.core.net.JksOptions options)
setTrustStoreOptions in class io.vertx.core.net.NetClientOptionspublic MqttClientOptions setHostnameVerificationAlgorithm(String hostnameVerificationAlgorithm)
setHostnameVerificationAlgorithm in class io.vertx.core.net.NetClientOptionspublic MqttClientOptions setTrustAll(boolean trustAll)
setTrustAll in class io.vertx.core.net.NetClientOptionspublic MqttClientOptions setKeyCertOptions(io.vertx.core.net.KeyCertOptions options)
setKeyCertOptions in class io.vertx.core.net.NetClientOptionspublic MqttClientOptions setKeyStoreOptions(io.vertx.core.net.JksOptions options)
setKeyStoreOptions in class io.vertx.core.net.NetClientOptionspublic MqttClientOptions setPfxKeyCertOptions(io.vertx.core.net.PfxOptions options)
setPfxKeyCertOptions in class io.vertx.core.net.NetClientOptionspublic MqttClientOptions setPemKeyCertOptions(io.vertx.core.net.PemKeyCertOptions options)
setPemKeyCertOptions in class io.vertx.core.net.NetClientOptionspublic MqttClientOptions setTrustOptions(io.vertx.core.net.TrustOptions options)
setTrustOptions in class io.vertx.core.net.NetClientOptionspublic MqttClientOptions setPemTrustOptions(io.vertx.core.net.PemTrustOptions options)
setPemTrustOptions in class io.vertx.core.net.NetClientOptionspublic MqttClientOptions setPfxTrustOptions(io.vertx.core.net.PfxOptions options)
setPfxTrustOptions in class io.vertx.core.net.NetClientOptionspublic MqttClientOptions addEnabledCipherSuite(String suite)
addEnabledCipherSuite in class io.vertx.core.net.NetClientOptionspublic MqttClientOptions addEnabledSecureTransportProtocol(String protocol)
addEnabledSecureTransportProtocol in class io.vertx.core.net.NetClientOptionspublic MqttClientOptions addCrlPath(String crlPath) throws NullPointerException
addCrlPath in class io.vertx.core.net.NetClientOptionsNullPointerExceptionpublic MqttClientOptions addCrlValue(io.vertx.core.buffer.Buffer crlValue) throws NullPointerException
addCrlValue in class io.vertx.core.net.NetClientOptionsNullPointerExceptionpublic io.vertx.core.json.JsonObject toJson()
toJson in class io.vertx.core.net.NetClientOptionsCopyright © 2024 Eclipse. All rights reserved.