Interface ConnackPacket

All Known Subinterfaces:
ModifiableConnackPacket

public interface ConnackPacket
Represents a CONNACK packet.

Contains all values of an MQTT 5 CONNACK, but will also used to represent MQTT 3 connack packets.

Since:
4.2.0, CE 2020.1
  • Method Details

    • getSessionExpiryInterval

      @NotNull @NotNull Optional<Long> getSessionExpiryInterval()
      Duration in seconds how long session for the client is stored.

      For an MQTT 3 client this Optional for the MQTT 5 property will always be empty.

      Returns:
      An Optional that contains the session expiry interval.
      Since:
      4.2.0, CE 2020.1
    • getServerKeepAlive

      @NotNull @NotNull Optional<Integer> getServerKeepAlive()
      An interval in seconds in which the client has to send any MQTT control packet, so that HiveMQ doesn't end the connection.

      For an MQTT 3 client this Optional for the MQTT 5 property will always be empty.

      Returns:
      An Optional that contains the server keep alive.
      Since:
      4.2.0, CE 2020.1
    • getReceiveMaximum

      int getReceiveMaximum()
      The limit of QoS 1 and QoS 2 Publishes that the server is willing to process concurrently.

      For an MQTT 3 client this MQTT 5 property will always be 65,535.

      Returns:
      The receive maximum.
      Since:
      4.2.0, CE 2020.1
    • getMaximumPacketSize

      int getMaximumPacketSize()
      The maximum packet size in bytes for an MQTT Control Packet, the server is willing to accept.

      For an MQTT 3 client this MQTT 5 property will always be the configured <max-packet-size> in the <mqtt> config in the config.xml Default: 268435460 bytes.

      Returns:
      The maximum packet size.
      Since:
      4.2.0, CE 2020.1
    • getTopicAliasMaximum

      int getTopicAliasMaximum()
      The maximum amount of topic aliases the server allows for this connection.

      For an MQTT 3 client this MQTT 5 property will always be 0.

      Returns:
      The topic alias maximum.
      Since:
      4.2.0, CE 2020.1
    • getMaximumQoS

      @NotNull @NotNull Optional<Qos> getMaximumQoS()
      The maximum quality of service level (QoS) the server allows for this connection.

      For an MQTT 3 client this Optional for the MQTT 5 property will always be empty.

      Returns:
      An Optional that contains the QoS maximum.
      Since:
      4.2.0, CE 2020.1
    • getUserProperties

      @NotNull @NotNull UserProperties getUserProperties()
      The user properties from the CONNACK packet.

      The properties will always be empty for an MQTT 3 client.

      Returns:
      The user properties.
      Since:
      4.2.0, CE 2020.1
    • getReasonCode

      The reason code from the CONNACK packet.

      Returns:
      The connack reason code.
      Since:
      4.2.0, CE 2020.1
      See Also:
      How reason codes are translated from MQTT 5 to MQTT 3.
    • getSessionPresent

      boolean getSessionPresent()
      The session present flag from the CONNACK packet.
      Returns:
      True if a session was already present for this client, else false.
      Since:
      4.2.0, CE 2020.1
    • getRetainAvailable

      boolean getRetainAvailable()
      The retain available flag from the CONNACK packet.

      For an MQTT 3 client this MQTT 5 property is always true.

      Returns:
      True if retained messages are allowed by HiveMQ, else false.
      Since:
      4.2.0, CE 2020.1
    • getAssignedClientIdentifier

      @NotNull @NotNull Optional<String> getAssignedClientIdentifier()
      The assigned client identifier of the CONNACK packet.

      For an MQTT 3 client this Optional for the MQTT 5 property will always be empty.

      For an MQTT 5 client this property is present when HiveMQ assigned the client identifier.

      Returns:
      An Optional that contains the assigned client identifier if present.
      Since:
      4.2.0, CE 2020.1
    • getReasonString

      @NotNull @NotNull Optional<String> getReasonString()
      The reason string of the CONNACK packet.

      For an MQTT 3 client this Optional for the MQTT 5 property will always be empty.

      Returns:
      An Optional containing the connack reason string if present.
      Since:
      4.2.0, CE 2020.1
    • getWildCardSubscriptionAvailable

      boolean getWildCardSubscriptionAvailable()
      The wildcard subscription available flag from the CONNACK packet.

      For an MQTT 3 client this MQTT 5 property is always true.

      Returns:
      True if wildcard subscriptions are allowed by HiveMQ, else false.
      Since:
      4.2.0, CE 2020.1
    • getSubscriptionIdentifiersAvailable

      boolean getSubscriptionIdentifiersAvailable()
      The subscription identifier available flag from the CONNACK packet.

      For an MQTT 3 client this MQTT 5 property is always true.

      Returns:
      True if subscription identifiers are allowed by HiveMQ, else false.
      Since:
      4.2.0, CE 2020.1
    • getSharedSubscriptionsAvailable

      boolean getSharedSubscriptionsAvailable()
      The shared subscriptions available flag from the CONNACK packet.

      For an MQTT 3 client this MQTT 5 property is always true.

      Returns:
      True if shared subscriptions are allowed by HiveMQ, else false.
      Since:
      4.2.0, CE 2020.1
    • getResponseInformation

      @NotNull @NotNull Optional<String> getResponseInformation()
      The response information of the CONNACK packet.

      For an MQTT 3 client this Optional for the MQTT 5 property will always be empty.

      Returns:
      An Optional containing the response information if present.
      Since:
      4.2.0, CE 2020.1
    • getServerReference

      @NotNull @NotNull Optional<String> getServerReference()
      The server reference of the CONNACK packet.

      For an MQTT 3 client this Optional for the MQTT 5 property will always be empty.

      Returns:
      An Optional containing the server reference if present.
      Since:
      4.2.0, CE 2020.1
    • getAuthenticationMethod

      @NotNull @NotNull Optional<String> getAuthenticationMethod()
      If this property is present, the string contains the authentication method that should be used for the extended authentication.

      For an MQTT 3 client this Optional for the MQTT 5 property will always be empty.

      Returns:
      An Optional that contains the authentication method if present.
      Since:
      4.2.0, CE 2020.1
    • getAuthenticationData

      @NotNull @NotNull Optional<@Immutable ByteBuffer> getAuthenticationData()
      If this property is present, the ByteBuffer contains the data used for the extended authentication. The contents of this data are defined by the authentication method.

      For an MQTT 3 client this Optional for the MQTT 5 property will always be empty.

      The ByteBuffer returned by this method is read only and will throw a ReadOnlyBufferException if handled incorrectly.

      Returns:
      An Optional that contains the authentication data if present.
      Since:
      4.2.0, CE 2020.1