Package cool.mqtt.hooks
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:
usernameandpasswordused for authenticating the client: if provided, they will take precedence over the ones which may have been defined inmqtt_master_connector_conf.xmlor supplied through theMqttBrokerConfiginstance returned by an invocation ofMQTTCoolHook.resolveAlias(String).clean sessionflag, 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 inmqtt_master_connector_conf.xmlor supplied through theMqttBrokerConfiginstance returned by an invocation ofMQTTCoolHook.resolveAlias(String).
-
Method Summary
Modifier and Type Method Description intgetConnectionTimeout()Gets the connection timeout expressed in seconds.intgetKeepAlive()Gets the keep alive interval expressed in seconds.java.lang.StringgetPassword()Gets thepasswordto be used for authenticating with the target MQTT broker.java.lang.StringgetUsername()Gets theusernameto be used for authenticating with the target MQTT broker.MqttMessagegetWillMessage()Gets theWill Messageto be stored by the MQTT broker.booleanisCleanSession()Gets the clean session flag specified by the client on connection establishment.
-
Method Details
-
getUsername
java.lang.String getUsername()Gets theusernameto be used for authenticating with the target MQTT broker.- Returns:
- the
username, ornullif no credential is provided
-
getPassword
java.lang.String getPassword()Gets thepasswordto be used for authenticating with the target MQTT broker.- Returns:
- the
password, ornullif 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 theWill Messageto be stored by the MQTT broker.- Returns:
- the
Will Messageto be stored by the MQTT broker if any, ornull
-
isCleanSession
boolean isCleanSession()Gets the clean session flag specified by the client on connection establishment.- Returns:
trueif the client does not want to make the Session persistent
-