Class NegotiatedSettings


  • public class NegotiatedSettings
    extends java.lang.Object
    MQTT behavior settings that are dynamically negotiated as part of the CONNECT/CONNACK exchange. While you can infer all of these values from a combination of (1) defaults as specified in the MQTT5 spec (2) your CONNECT settings (3) the CONNACK from the broker the client instead does the combining for you and emits a NegotiatedSettings object with final, authoritative values. Negotiated settings are communicated with every successful connection establishment.
    • Constructor Detail

      • NegotiatedSettings

        public NegotiatedSettings()
    • Method Detail

      • getMaximumQOS

        public QOS getMaximumQOS()
        Returns:
        Returns the maximum QoS allowed for publishes on this connection instance
      • getSessionExpiryIntervalSeconds

        public long getSessionExpiryIntervalSeconds()
        Returns:
        Returns the amount of time in seconds the server will retain the MQTT session after a disconnect.
      • getSessionExpiryInterval

        public long getSessionExpiryInterval()
        Deprecated.
        prefer getSessionExpiryIntervalSeconds instead
        Returns:
        Returns the amount of time in seconds the server will retain the MQTT session after a disconnect.
      • getReceiveMaximumFromServer

        public int getReceiveMaximumFromServer()
        Returns:
        Returns the number of in-flight QoS 1 and QoS 2 publications the server is willing to process concurrently.
      • getMaximumPacketSizeToServer

        public long getMaximumPacketSizeToServer()
        Returns:
        Returns the maximum packet size the server is willing to accept.
      • getTopicAliasMaximumToServer

        public int getTopicAliasMaximumToServer()
        Returns:
        returns the maximum allowed topic alias value on publishes sent from client to server
      • getTopicAliasMaximumToClient

        public int getTopicAliasMaximumToClient()
        Returns:
        returns the maximum allowed topic alias value on publishes sent from server to client
      • getServerKeepAliveSeconds

        public int getServerKeepAliveSeconds()
        Returns the maximum amount of time in seconds between client packets. The client should use PINGREQs to ensure this limit is not breached. The server will disconnect the client for inactivity if no MQTT packet is received in a time interval equal to 1.5 x this value.
        Returns:
        The maximum amount of time in seconds between client packets.
      • getServerKeepAlive

        public int getServerKeepAlive()
        Deprecated.
        prefer getServerKeepAliveSeconds
        Returns the maximum amount of time in seconds between client packets. The client should use PINGREQs to ensure this limit is not breached. The server will disconnect the client for inactivity if no MQTT packet is received in a time interval equal to 1.5 x this value.
        Returns:
        The maximum amount of time in seconds between client packets.
      • getRetainAvailable

        public boolean getRetainAvailable()
        Returns:
        Returns whether the server supports retained messages.
      • getWildcardSubscriptionsAvailable

        public boolean getWildcardSubscriptionsAvailable()
        Returns:
        Returns whether the server supports wildcard subscriptions.
      • getSubscriptionIdentifiersAvailable

        public boolean getSubscriptionIdentifiersAvailable()
        Returns:
        Returns whether the server supports subscription identifiers
      • getSharedSubscriptionsAvailable

        public boolean getSharedSubscriptionsAvailable()
        Returns:
        Returns whether the server supports shared subscriptions
      • getRejoinedSession

        public boolean getRejoinedSession()
        Returns:
        Returns whether the client has rejoined an existing session.
      • getAssignedClientID

        public java.lang.String getAssignedClientID()
        Returns the final client id in use by the newly-established connection. This will be the configured client id if one was given in the configuration, otherwise, if no client id was specified, this will be the client id assigned by the server. Reconnection attempts will always use the auto-assigned client id, allowing for auto-assigned session resumption.
        Returns:
        The final client id in use by the newly-established connection