Interface MqttConnAckMessage
MQTT 3.1.1: exposes code() and isSessionPresent().
MQTT 5.0: additionally exposes all CONNACK properties via typed accessors.
-
Method Summary
Modifier and TypeMethodDescriptionClient Identifier assigned by the server.Authentication Data used during enhanced authentication.Authentication Method used during enhanced authentication.code()static MqttConnAckMessagecreate(MqttConnectReturnCode code, boolean isSessionPresent) Create a concrete instance of a Vert.x connack messagestatic MqttConnAckMessagecreate(MqttConnectReturnCode code, boolean isSessionPresent, MqttProperties properties) Create a concrete instance of a Vert.x connack message with MQTT properties.booleanMaximum packet size the server is willing to accept, in bytes.Maximum QoS level the server supports.Raw access to MQTT properties.Human-readable reason string for the result of the connection attempt.Receive Maximum: the maximum number of QoS 1 and QoS 2 publications the server is willing to process concurrently.Response Information used to construct the Response Topic.Whether the server supports retained messages.Keep Alive interval (in seconds) assigned by the server.Server Reference: another server the client should use to reconnect.Session Expiry Interval in seconds assigned by the server.Whether the server supports Shared Subscriptions.Whether the server supports Subscription Identifiers.Topic Alias Maximum: the highest value accepted by the server as a Topic Alias.User Properties returned by the server in the CONNACK.Whether the server supports Wildcard Subscriptions.
-
Method Details
-
create
Create a concrete instance of a Vert.x connack message- Parameters:
code- return code from the connection requestisSessionPresent- whether an old session is present- Returns:
- the connack message
-
create
static MqttConnAckMessage create(MqttConnectReturnCode code, boolean isSessionPresent, MqttProperties properties) Create a concrete instance of a Vert.x connack message with MQTT properties.- Parameters:
code- return code from the connection requestisSessionPresent- whether an old session is presentproperties- MQTT properties (MQTT 5.0)- Returns:
- the connack message
-
code
MqttConnectReturnCode code()- Returns:
- return code from the connection request
-
isSessionPresent
boolean isSessionPresent()- Returns:
- whether an old session is present on the server
-
properties
MqttProperties properties()Raw access to MQTT properties. Use the typed accessors below when possible.- Returns:
- the raw MqttProperties object
-
sessionExpiryInterval
Long sessionExpiryInterval()Session Expiry Interval in seconds assigned by the server. (MQTT 5.0)If present, overrides the value sent by the client in the CONNECT packet.
- Returns:
- the session expiry interval, or
nullif not present
-
receiveMaximum
Integer receiveMaximum()Receive Maximum: the maximum number of QoS 1 and QoS 2 publications the server is willing to process concurrently. (MQTT 5.0)- Returns:
- the receive maximum, or
nullif not present
-
maximumQos
Integer maximumQos()Maximum QoS level the server supports. (MQTT 5.0)0 = QoS 0 only, 1 = QoS 0 and 1. If absent, QoS 2 is supported.
- Returns:
- 0 or 1, or
nullif absent (meaning QoS 2 is supported)
-
retainAvailable
Boolean retainAvailable()Whether the server supports retained messages. (MQTT 5.0)- Returns:
falseif the server does NOT support retain;nullif absent (meaning retain IS supported)
-
subscriptionIdentifierAvailable
Boolean subscriptionIdentifierAvailable()Whether the server supports Subscription Identifiers. (MQTT 5.0)If the server sends
0, the client MUST NOT include aSUBSCRIPTION_IDENTIFIERproperty in any SUBSCRIBE packet. If absent, subscription identifiers are supported (default = 1).- Returns:
falseif subscription identifiers are NOT supported;nullif absent (meaning they ARE supported)
-
wildcardSubscriptionAvailable
Boolean wildcardSubscriptionAvailable()Whether the server supports Wildcard Subscriptions. (MQTT 5.0 §3.2.2.3.11)If the server sends
0, the client MUST NOT send SUBSCRIBE packets with wildcard topic filters. If absent, wildcard subscriptions are supported (default = 1).- Returns:
falseif wildcard subscriptions are NOT supported;nullif absent (meaning they ARE supported)
-
maximumPacketSize
Long maximumPacketSize()Maximum packet size the server is willing to accept, in bytes. (MQTT 5.0)- Returns:
- the maximum packet size, or
nullif not present (meaning no limit)
-
assignedClientIdentifier
String assignedClientIdentifier()Client Identifier assigned by the server. (MQTT 5.0)Present only when the client connected with an empty ClientID and the server assigned one.
- Returns:
- the assigned client identifier, or
nullif not present
-
topicAliasMaximum
Integer topicAliasMaximum()Topic Alias Maximum: the highest value accepted by the server as a Topic Alias. (MQTT 5.0)- Returns:
- the topic alias maximum, or
nullif not present (meaning 0, i.e. no aliases)
-
reasonString
String reasonString()Human-readable reason string for the result of the connection attempt. (MQTT 5.0)- Returns:
- the reason string, or
nullif not present
-
userProperties
-
serverKeepAlive
Integer serverKeepAlive()Keep Alive interval (in seconds) assigned by the server. (MQTT 5.0)If present, the client MUST use this value instead of the one it sent.
- Returns:
- the server keep alive, or
nullif the client-requested value should be used
-
responseInformation
String responseInformation()Response Information used to construct the Response Topic. (MQTT 5.0)Only returned if the client set Request Response Information = 1 in CONNECT.
- Returns:
- the response information string, or
nullif not present
-
serverReference
String serverReference()Server Reference: another server the client should use to reconnect. (MQTT 5.0)Present when the server wants the client to use a different server.
- Returns:
- the server reference, or
nullif not present
-
authenticationMethod
String authenticationMethod()Authentication Method used during enhanced authentication. (MQTT 5.0)- Returns:
- the authentication method name, or
nullif not present
-
authenticationData
Buffer authenticationData()Authentication Data used during enhanced authentication. (MQTT 5.0)- Returns:
- the authentication data, or
nullif not present
-