Class ConnAckPacket


  • public class ConnAckPacket
    extends java.lang.Object
    Data model of an MQTT5 CONNACK packet.
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  ConnAckPacket.ConnectReasonCode
      Server return code for connect attempts.
    • Constructor Summary

      Constructors 
      Constructor Description
      ConnAckPacket()  
    • Method Summary

      All Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      java.lang.String getAssignedClientIdentifier()
      Returns a client identifier assigned to this connection by the server.
      java.lang.Long getMaximumPacketSize()
      Returns the maximum packet size, in bytes, that the server is willing to accept.
      QOS getMaximumQOS()
      Returns the maximum message delivery quality of service that the server will allow on this connection.
      ConnAckPacket.ConnectReasonCode getReasonCode()
      Returns an indicator that is either success or the reason for failure for the connection attempt.
      java.lang.String getReasonString()
      Returns additional diagnostic information about the result of the connection attempt.
      java.lang.Integer getReceiveMaximum()
      Returns the maximum amount of in-flight QoS 1 or 2 messages that the server is willing to handle at once.
      java.lang.String getResponseInformation()
      Returns a value that can be used in the creation of a response topic associated with this connection.
      java.lang.Boolean getRetainAvailable()
      Returns an indicator whether the server supports retained messages.
      java.lang.Integer getServerKeepAlive()
      Deprecated.
      prefer getServerKeepAliveSeconds
      java.lang.Integer getServerKeepAliveSeconds()
      Returns server-requested override of the keep alive interval, in seconds.
      java.lang.String getServerReference()
      Returns property indicating an alternate server that the client may temporarily or permanently attempt to connect to instead of the configured endpoint.
      java.lang.Long getSessionExpiryInterval()
      Deprecated.
      prefer getSessionExpiryIntervalSeconds
      java.lang.Long getSessionExpiryIntervalSeconds()
      Returns a time interval, in seconds, that the server will persist this connection's MQTT session state for.
      boolean getSessionPresent()
      Returns true if the client rejoined an existing session on the server, false otherwise.
      java.lang.Boolean getSharedSubscriptionsAvailable()
      Returns whether the server supports shared subscription topic filters.
      java.lang.Boolean getSubscriptionIdentifiersAvailable()
      Returns whether the server supports subscription identifiers.
      java.lang.Integer getTopicAliasMaximum()
      Returns the maximum topic alias value that the server will accept from the client.
      java.util.List<UserProperty> getUserProperties()
      Returns a list of MQTT5 user properties included with the packet.
      java.lang.Boolean getWildcardSubscriptionsAvailable()
      Returns whether the server supports wildcard subscriptions.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ConnAckPacket

        public ConnAckPacket()
    • Method Detail

      • getSessionPresent

        public boolean getSessionPresent()
        Returns true if the client rejoined an existing session on the server, false otherwise. See MQTT5 Session Present
        Returns:
        True if the client rejoined an existing session on the server, false otherwise.
      • getReasonCode

        public ConnAckPacket.ConnectReasonCode getReasonCode()
        Returns an indicator that is either success or the reason for failure for the connection attempt. See MQTT5 Connect Reason Code
        Returns:
        Code indicating either success or the reason for failure for the connection attempt.
      • getSessionExpiryIntervalSeconds

        public java.lang.Long getSessionExpiryIntervalSeconds()
        Returns a time interval, in seconds, that the server will persist this connection's MQTT session state for. If present, this value overrides any session expiry specified in the preceding ConnectPacket. See MQTT5 Session Expiry Interval
        Returns:
        A time interval, in seconds, that the server will persist this connection's MQTT session state for.
      • getSessionExpiryInterval

        public java.lang.Long getSessionExpiryInterval()
        Deprecated.
        prefer getSessionExpiryIntervalSeconds
        Returns a time interval, in seconds, that the server will persist this connection's MQTT session state for. If present, this value overrides any session expiry specified in the preceding ConnectPacket. See MQTT5 Session Expiry Interval
        Returns:
        A time interval, in seconds, that the server will persist this connection's MQTT session state for.
      • getReceiveMaximum

        public java.lang.Integer getReceiveMaximum()
        Returns the maximum amount of in-flight QoS 1 or 2 messages that the server is willing to handle at once. If omitted or null, the limit is based on the valid MQTT packet id space (65535). See MQTT5 Receive Maximum
        Returns:
        The maximum amount of in-flight QoS 1 or 2 messages that the server is willing to handle at once.
      • getMaximumQOS

        public QOS getMaximumQOS()
        Returns the maximum message delivery quality of service that the server will allow on this connection. See MQTT5 Maximum QoS
        Returns:
        The maximum message delivery quality of service that the server will allow on this connection.
      • getRetainAvailable

        public java.lang.Boolean getRetainAvailable()
        Returns an indicator whether the server supports retained messages. If null, retained messages are supported. See MQTT5 Retain Available
        Returns:
        Whether the server supports retained messages
      • getMaximumPacketSize

        public java.lang.Long getMaximumPacketSize()
        Returns the maximum packet size, in bytes, that the server is willing to accept. If null, there is no limit beyond what is imposed by the MQTT spec itself. See MQTT5 Maximum Packet Size
        Returns:
        The maximum packet size, in bytes, that the server is willing to accept.
      • getAssignedClientIdentifier

        public java.lang.String getAssignedClientIdentifier()
        Returns a client identifier assigned to this connection by the server. Only valid when the client id of the preceding ConnectPacket was left empty. See MQTT5 Assigned Client Identifier
        Returns:
        Client identifier assigned to this connection by the server
      • getTopicAliasMaximum

        public java.lang.Integer getTopicAliasMaximum()
        Returns the maximum topic alias value that the server will accept from the client. See MQTT5 Topic Alias Maximum
        Returns:
        maximum allowed topic alias value
      • getReasonString

        public java.lang.String getReasonString()
        Returns additional diagnostic information about the result of the connection attempt. See MQTT5 Reason String
        Returns:
        Additional diagnostic information about the result of the connection attempt.
      • getUserProperties

        public java.util.List<UserProperty> getUserProperties()
        Returns a list of MQTT5 user properties included with the packet. See MQTT5 User Property
        Returns:
        List of MQTT5 user properties included with the packet.
      • getWildcardSubscriptionsAvailable

        public java.lang.Boolean getWildcardSubscriptionsAvailable()
        Returns whether the server supports wildcard subscriptions. If null, wildcard subscriptions are supported. See MQTT5 Wildcard Subscriptions Available
        Returns:
        Whether the server supports wildcard subscriptions.
      • getSubscriptionIdentifiersAvailable

        public java.lang.Boolean getSubscriptionIdentifiersAvailable()
        Returns whether the server supports subscription identifiers. If null, subscription identifiers are supported. See MQTT5 Subscription Identifiers Available
        Returns:
        whether the server supports subscription identifiers.
      • getSharedSubscriptionsAvailable

        public java.lang.Boolean getSharedSubscriptionsAvailable()
        Returns whether the server supports shared subscription topic filters. If null, shared subscriptions are supported. See MQTT5 Shared Subscriptions Available
        Returns:
        whether the server supports shared subscription topic filters.
      • getServerKeepAliveSeconds

        public java.lang.Integer getServerKeepAliveSeconds()
        Returns server-requested override of the keep alive interval, in seconds. If null, the keep alive value sent by the client should be used. See MQTT5 Server Keep Alive
        Returns:
        Server-requested override of the keep alive interval, in seconds
      • getServerKeepAlive

        public java.lang.Integer getServerKeepAlive()
        Deprecated.
        prefer getServerKeepAliveSeconds
        Returns server-requested override of the keep alive interval, in seconds. If null, the keep alive value sent by the client should be used. See MQTT5 Server Keep Alive
        Returns:
        Server-requested override of the keep alive interval, in seconds
      • getResponseInformation

        public java.lang.String getResponseInformation()
        Returns a value that can be used in the creation of a response topic associated with this connection. MQTT5-based request/response is outside the purview of the MQTT5 spec and this client. See MQTT5 Response Information
        Returns:
        A value that can be used in the creation of a response topic associated with this connection.
      • getServerReference

        public java.lang.String getServerReference()
        Returns property indicating an alternate server that the client may temporarily or permanently attempt to connect to instead of the configured endpoint. Will only be set if the reason code indicates another server may be used (ServerMoved, UseAnotherServer). See MQTT5 Server Reference
        Returns:
        Property indicating an alternate server that the client may temporarily or permanently attempt to connect to instead of the configured endpoint.