cool.mqtt.hooks.MqttConnectOptions Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of mqtt.cool-hook-java-api Show documentation
Show all versions of mqtt.cool-hook-java-api Show documentation
The Java API for developing MQTT.Cool Hooks
package cool.mqtt.hooks;
/**
* 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:
*
* - {@code username} and {@code 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 {@code MqttBrokerConfig} instance
* returned by an invocation of {@link MQTTCoolHook#resolveAlias(String)}.
* - {@code clean session} flag, which specifies how to handle the Session Persistence.
* - {@code 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 {@code MqttBrokerConfig} instance
* returned by an invocation of {@link MQTTCoolHook#resolveAlias(String)}.
*
*/
public interface MqttConnectOptions {
/**
* Gets the {@code username} to be used for authenticating with the target MQTT broker.
*
* @return the {@code username}, or {@code null} if no credential is provided
*/
String getUsername();
/**
* Gets the {@code password} to be used for authenticating with the target MQTT broker.
*
* @return the {@code password}, or {@code null} if no credential is provided
*/
String getPassword();
/**
* Gets the connection timeout expressed in seconds.
*
* @return the connection timeout expressed in seconds
*/
int getConnectionTimeout();
/**
* Gets the keep alive interval expressed in seconds.
*
* @return the keep alive interval expressed in seconds
*/
int getKeepAlive();
/**
* Gets the {@code Will Message} to be stored by the MQTT broker.
*
* @return the {@code Will Message} to be stored by the MQTT broker if any, or {@code null}
*/
MqttMessage getWillMessage();
/**
* Gets the clean session flag specified by the client on connection establishment.
*
* @return {@code true} if the client does not want to make the Session persistent
*/
boolean isCleanSession();
}