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:
username
andpassword
used for authenticating the client: if provided, they will take precedence over the ones which may have been defined inmqtt_master_connector_conf.xml
or supplied through theMqttBrokerConfig
instance returned by an invocation ofMQTTCoolHook.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 inmqtt_master_connector_conf.xml
or supplied through theMqttBrokerConfig
instance returned by an invocation ofMQTTCoolHook.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 thepassword
to be used for authenticating with the target MQTT broker.java.lang.String
getUsername()
Gets theusername
to be used for authenticating with the target MQTT broker.MqttMessage
getWillMessage()
Gets theWill 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 theusername
to be used for authenticating with the target MQTT broker.- Returns:
- the
username
, ornull
if no credential is provided
-
getPassword
java.lang.String getPassword()Gets thepassword
to be used for authenticating with the target MQTT broker.- Returns:
- the
password
, ornull
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 theWill Message
to be stored by the MQTT broker.- Returns:
- the
Will Message
to 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:
true
if the client does not want to make the Session persistent
-