Interface MqttConnectOptions


public interface MqttConnectOptions
A wrapper of the connection parameters actually used by the MQTT.Cool server while establishing the end-to-end connection between the client and the target MQTT broker.

The client may specify the following options on its behalf:

  • username and password used for authenticating the client: if provided, they will take precedence over the ones which may have been defined in mqtt_master_connector_conf.xml or supplied through the MqttBrokerConfig instance returned by an invocation of MQTTCoolHook.resolveAlias(String).
  • clean session flag, which specifies how to handle the Session Persistence.
  • Will Message, which allows to publish a message in case of connection issues on the client side; if provided, it will take precedence over the one which may have been defined in mqtt_master_connector_conf.xml or supplied through the MqttBrokerConfig instance returned by an invocation of MQTTCoolHook.resolveAlias(String).
  • Method Summary

    Modifier and Type Method Description
    int getConnectionTimeout()
    Gets the connection timeout expressed in seconds.
    int getKeepAlive()
    Gets the keep alive interval expressed in seconds.
    java.lang.String getPassword()
    Gets the password to be used for authenticating with the target MQTT broker.
    java.lang.String getUsername()
    Gets the username to be used for authenticating with the target MQTT broker.
    MqttMessage getWillMessage()
    Gets the Will Message to be stored by the MQTT broker.
    boolean isCleanSession()
    Gets the clean session flag specified by the client on connection establishment.
  • Method Details

    • getUsername

      java.lang.String getUsername()
      Gets the username to be used for authenticating with the target MQTT broker.
      Returns:
      the username, or null if no credential is provided
    • getPassword

      java.lang.String getPassword()
      Gets the password to be used for authenticating with the target MQTT broker.
      Returns:
      the password, or null if no credential is provided
    • getConnectionTimeout

      int getConnectionTimeout()
      Gets the connection timeout expressed in seconds.
      Returns:
      the connection timeout expressed in seconds
    • getKeepAlive

      int getKeepAlive()
      Gets the keep alive interval expressed in seconds.
      Returns:
      the keep alive interval expressed in seconds
    • getWillMessage

      MqttMessage getWillMessage()
      Gets the Will Message to be stored by the MQTT broker.
      Returns:
      the Will Message to be stored by the MQTT broker if any, or null
    • isCleanSession

      boolean isCleanSession()
      Gets the clean session flag specified by the client on connection establishment.
      Returns:
      true if the client does not want to make the Session persistent