public class MqttClientOptions
extends io.vertx.core.net.NetClientOptions
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_ACK_TIMEOUT |
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_CONNECT_TIMEOUT, DEFAULT_METRICS_NAME, DEFAULT_TRUST_ALL
DEFAULT_ENABLED_SECURE_TRANSPORT_PROTOCOLS, DEFAULT_IDLE_TIMEOUT, DEFAULT_IDLE_TIMEOUT_TIME_UNIT, 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_KEEP_ALIVE, DEFAULT_TCP_NO_DELAY, DEFAULT_TCP_QUICKACK, DEFAULT_USE_ALPN
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 |
getKeepAliveInterval() |
int |
getMaxInflightQueue() |
int |
getMaxMessageSize() |
String |
getPassword() |
String |
getUsername() |
String |
getWillMessage() |
int |
getWillQoS() |
String |
getWillTopic() |
boolean |
hasPassword() |
boolean |
hasUsername() |
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.
|
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 |
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)
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
|
String |
toString() |
addNonProxyHost, getApplicationLayerProtocols, getHostnameVerificationAlgorithm, getReconnectAttempts, getReconnectInterval, removeEnabledSecureTransportProtocol, setApplicationLayerProtocols, setConnectTimeout, setEnabledSecureTransportProtocols, setHostnameVerificationAlgorithm, setIdleTimeoutUnit, setJdkSslEngineOptions, setLocalAddress, setLogActivity, setMetricsName, setNonProxyHosts, setOpenSslEngineOptions, setProxyOptions, setReconnectAttempts, setReconnectInterval, setReuseAddress, setReusePort, setSendBufferSize, setSoLinger, setSslEngineOptions, setSslHandshakeTimeout, setSslHandshakeTimeoutUnit, setTcpCork, setTcpFastOpen, setTcpKeepAlive, setTcpNoDelay, setTcpQuickAck, setTrafficClass, setUseAlpn
getConnectTimeout, getLocalAddress, getMetricsName, getNonProxyHosts, getProxyOptions, isTrustAll, toJson
getCrlPaths, getCrlValues, getEnabledCipherSuites, getEnabledSecureTransportProtocols, getIdleTimeout, getIdleTimeoutUnit, getJdkSslEngineOptions, getKeyCertOptions, getKeyStoreOptions, getOpenSslEngineOptions, getPemKeyCertOptions, getPemTrustOptions, getPfxKeyCertOptions, getPfxTrustOptions, getSoLinger, getSslEngineOptions, getSslHandshakeTimeout, getSslHandshakeTimeoutUnit, getTrustOptions, getTrustStoreOptions, isSsl, isTcpCork, isTcpFastOpen, isTcpKeepAlive, isTcpNoDelay, isTcpQuickAck, isUseAlpn
public 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 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()
public String getWillMessage()
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 publishedpublic MqttClientOptions setWillMessage(String 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 isAutoKeepAlive()
public boolean isAutoGeneratedClientId()
public int getMaxMessageSize()
public MqttClientOptions setReceiveBufferSize(int receiveBufferSize)
setReceiveBufferSize
in class io.vertx.core.net.NetClientOptions
public 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.NetClientOptions
public MqttClientOptions setSsl(boolean ssl)
setSsl
in class io.vertx.core.net.NetClientOptions
public MqttClientOptions setTrustStoreOptions(io.vertx.core.net.JksOptions options)
setTrustStoreOptions
in class io.vertx.core.net.NetClientOptions
public MqttClientOptions setTrustAll(boolean trustAll)
setTrustAll
in class io.vertx.core.net.NetClientOptions
public MqttClientOptions setKeyCertOptions(io.vertx.core.net.KeyCertOptions options)
setKeyCertOptions
in class io.vertx.core.net.NetClientOptions
public MqttClientOptions setKeyStoreOptions(io.vertx.core.net.JksOptions options)
setKeyStoreOptions
in class io.vertx.core.net.NetClientOptions
public MqttClientOptions setPfxKeyCertOptions(io.vertx.core.net.PfxOptions options)
setPfxKeyCertOptions
in class io.vertx.core.net.NetClientOptions
public MqttClientOptions setPemKeyCertOptions(io.vertx.core.net.PemKeyCertOptions options)
setPemKeyCertOptions
in class io.vertx.core.net.NetClientOptions
public MqttClientOptions setTrustOptions(io.vertx.core.net.TrustOptions options)
setTrustOptions
in class io.vertx.core.net.NetClientOptions
public MqttClientOptions setPemTrustOptions(io.vertx.core.net.PemTrustOptions options)
setPemTrustOptions
in class io.vertx.core.net.NetClientOptions
public MqttClientOptions setPfxTrustOptions(io.vertx.core.net.PfxOptions options)
setPfxTrustOptions
in class io.vertx.core.net.NetClientOptions
public MqttClientOptions addEnabledCipherSuite(String suite)
addEnabledCipherSuite
in class io.vertx.core.net.NetClientOptions
public MqttClientOptions addEnabledSecureTransportProtocol(String protocol)
addEnabledSecureTransportProtocol
in class io.vertx.core.net.NetClientOptions
public MqttClientOptions addCrlPath(String crlPath) throws NullPointerException
addCrlPath
in class io.vertx.core.net.NetClientOptions
NullPointerException
public MqttClientOptions addCrlValue(io.vertx.core.buffer.Buffer crlValue) throws NullPointerException
addCrlValue
in class io.vertx.core.net.NetClientOptions
NullPointerException
Copyright © 2021 Eclipse. All rights reserved.