Interface ConnectPacket

    • Method Detail

      • getMqttVersion

        @NotNull MqttVersion getMqttVersion()
        The MqttVersion the clients wants to use for the connection.
        Returns:
        The MQTT version.
        Since:
        4.0.0, CE 2019.1
      • getClientId

        @NotNull String getClientId()
        The client identifier the client wants to use.

        An MQTT 5 client may send an empty string.

        Returns:
        The client identifier.
        Since:
        4.0.0, CE 2019.1
      • getCleanStart

        boolean getCleanStart()
        Flag that indicates if the existing session for the client should be continued (false) or the existing session should be overwritten (true). Has no effect if no session for the client exists.

        For an MQTT 3 client, this MQTT 5 property can be interpreted as followed:

        • cleanSession = true -> cleanStart = true
        • cleanSession = false -> cleanStart = false
        Returns:
        The clean start flag.
        Since:
        4.0.0, CE 2019.1
      • getSessionExpiryInterval

        long getSessionExpiryInterval()
        Duration in seconds how long session for the client is stored.

        For an MQTT 3 client, this MQTT 5 property can be interpreted as followed:

        • cleanSession = true -> sessionExpiryInterval = 0
        • cleanSession = false -> sessionExpiryInterval = The configured <session-expiry> in the <mqtt> config in the config.xml. Default: 4294967295
        Returns:
        The session expiry interval.
        Since:
        4.0.0, CE 2019.1
      • getKeepAlive

        int getKeepAlive()
        An interval in seconds in which the client has to send any MQTT control packet, so that HiveMQ doesn't end the connection.
        Returns:
        The keep alive.
        Since:
        4.0.0, CE 2019.1
      • getReceiveMaximum

        int getReceiveMaximum()
        The limit of QoS 1 and QoS 2 Publishes that the client 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.0.0, CE 2019.1
      • getMaximumPacketSize

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

        For an MQTT 3 client this MQTT 5 property will always be 268435460 bytes (protocol limit for the packet size).

        Returns:
        The maximum packet size.
        Since:
        4.0.0, CE 2019.1
      • getTopicAliasMaximum

        int getTopicAliasMaximum()
        The maximum amount of topic alias the client allows for this connection.

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

        Returns:
        The topic alias maximum.
        Since:
        4.0.0, CE 2019.1
      • getRequestResponseInformation

        boolean getRequestResponseInformation()
        This flag indicates if the client wants to receive Response Information in the CONNACK packet (true) or not (false).

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

        Returns:
        The request response information flag.
        Since:
        4.0.0, CE 2019.1
      • getRequestProblemInformation

        boolean getRequestProblemInformation()
        This flag indicates if the server may sent Reason String or User Properties in the case of failures. If true server may sent these in any MQTT packet, for false they may only be sent in a PUBLISH, CONNACK, or DISCONNECT packet.

        For an MQTT 3 client this MQTT 5 property will always be false. This can be ignored for MQTT 3 clients.

        Returns:
        The request problem information flag.
        Since:
        4.0.0, CE 2019.1
      • getAuthenticationMethod

        @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 property can be set in the ConnectInboundInterceptor.

        Returns:
        An Optional that contains the authentication method if present.
        Since:
        4.0.0, CE 2019.1
      • getUserProperties

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

        For an MQTT 3 client this property can be set in the ConnectInboundInterceptor.

        Returns:
        The user properties.
        Since:
        4.0.0, CE 2019.1
      • getUserName

        @NotNull Optional<String> getUserName()
        If this property is present, this is the username for the client.
        Returns:
        An Optional that contains the username if present.
        Since:
        4.0.0, CE 2019.1