Interface MqttConnAckMessage


public interface MqttConnAckMessage
Represents an MQTT CONNACK message.

MQTT 3.1.1: exposes code() and isSessionPresent(). MQTT 5.0: additionally exposes all CONNACK properties via typed accessors.

  • Method Details

    • create

      static MqttConnAckMessage create(MqttConnectReturnCode code, boolean isSessionPresent)
      Create a concrete instance of a Vert.x connack message
      Parameters:
      code - return code from the connection request
      isSessionPresent - 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 request
      isSessionPresent - whether an old session is present
      properties - MQTT properties (MQTT 5.0)
      Returns:
      the connack message
    • 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 null if 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 null if 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 null if absent (meaning QoS 2 is supported)
    • retainAvailable

      Boolean retainAvailable()
      Whether the server supports retained messages. (MQTT 5.0)
      Returns:
      false if the server does NOT support retain; null if 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 a SUBSCRIPTION_IDENTIFIER property in any SUBSCRIBE packet. If absent, subscription identifiers are supported (default = 1).

      Returns:
      false if subscription identifiers are NOT supported; null if 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:
      false if wildcard subscriptions are NOT supported; null if absent (meaning they ARE supported)
    • sharedSubscriptionAvailable

      Boolean sharedSubscriptionAvailable()
      Whether the server supports Shared Subscriptions. (MQTT 5.0 §3.2.2.3.14)

      If the server sends 0, the client MUST NOT send SUBSCRIBE packets with shared topic filters ($share/...). If absent, shared subscriptions are supported (default = 1).

      Returns:
      false if shared subscriptions are NOT supported; null if 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 null if 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 null if 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 null if 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 null if not present
    • userProperties

      Map<String,String> userProperties()
      User Properties returned by the server in the CONNACK. (MQTT 5.0)

      Note: MQTT 5.0 allows duplicate keys; duplicate values are silently collapsed to the last value when using this Map representation.

      Returns:
      key-value user properties, or null if not present
    • 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 null if 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 null if 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 null if not present
    • authenticationMethod

      String authenticationMethod()
      Authentication Method used during enhanced authentication. (MQTT 5.0)
      Returns:
      the authentication method name, or null if not present
    • authenticationData

      Buffer authenticationData()
      Authentication Data used during enhanced authentication. (MQTT 5.0)
      Returns:
      the authentication data, or null if not present