Class Mqtt5ClientManager
java.lang.Object
org.springframework.integration.mqtt.client.core.AbstractMqttClientManager<com.hivemq.client.mqtt.mqtt5.Mqtt5Client, com.hivemq.client.mqtt.mqtt5.Mqtt5ClientConfig>
org.springframework.integration.mqtt.client.core.Mqtt5ClientManager
- All Implemented Interfaces:
com.hivemq.client.mqtt.lifecycle.MqttClientConnectedListener, Aware, InitializingBean, ApplicationEventPublisherAware, Lifecycle, Phased, SmartLifecycle, ClientManager<com.hivemq.client.mqtt.mqtt5.Mqtt5Client>
public class Mqtt5ClientManager
extends AbstractMqttClientManager<com.hivemq.client.mqtt.mqtt5.Mqtt5Client, com.hivemq.client.mqtt.mqtt5.Mqtt5ClientConfig>
A client manager implementation for MQTT v5 protocol.
- Since:
- 7.2
- Author:
- Jiandong Ma
-
Nested Class Summary
Nested classes/interfaces inherited from interface ClientManager
ClientManager.ConnectCallback -
Field Summary
Fields inherited from class AbstractMqttClientManager
connectCallbacks, lock, logger, mqttClientConfigFields inherited from interface SmartLifecycle
DEFAULT_PHASE -
Constructor Summary
ConstructorsConstructorDescriptionMqtt5ClientManager(com.hivemq.client.mqtt.mqtt5.Mqtt5ClientConfig mqtt5ClientConfig) -
Method Summary
Modifier and TypeMethodDescriptionprotected com.hivemq.client.mqtt.mqtt5.Mqtt5ClientBuild the mqttClient using the suppliedMqttClientConfig.voidonConnected(com.hivemq.client.mqtt.lifecycle.MqttClientConnectedContext context) voidsetMqttConnect(com.hivemq.client.mqtt.mqtt5.message.connect.Mqtt5Connect mqttConnect) Set the Connect message.voidsetMqttDisconnect(com.hivemq.client.mqtt.mqtt5.message.disconnect.Mqtt5Disconnect mqttDisconnect) Set the Disconnect message.voidstart()voidstop()Methods inherited from class AbstractMqttClientManager
addCallback, afterPropertiesSet, createBaseClientBuilder, getApplicationEventPublisher, getClient, getPhase, isConnected, isRunning, removeCallback, setApplicationEventPublisher, setPhaseMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface SmartLifecycle
isAutoStartup, isPauseable, pause, restart, stop
-
Constructor Details
-
Mqtt5ClientManager
public Mqtt5ClientManager(com.hivemq.client.mqtt.mqtt5.Mqtt5ClientConfig mqtt5ClientConfig)
-
-
Method Details
-
buildClient
protected com.hivemq.client.mqtt.mqtt5.Mqtt5Client buildClient()Description copied from class:AbstractMqttClientManagerBuild the mqttClient using the suppliedMqttClientConfig.- Specified by:
buildClientin classAbstractMqttClientManager<com.hivemq.client.mqtt.mqtt5.Mqtt5Client, com.hivemq.client.mqtt.mqtt5.Mqtt5ClientConfig>- Returns:
- the mqttClient
-
setMqttConnect
public void setMqttConnect(com.hivemq.client.mqtt.mqtt5.message.connect.Mqtt5Connect mqttConnect) Set the Connect message.- Parameters:
mqttConnect- the mqttConnect
-
setMqttDisconnect
public void setMqttDisconnect(com.hivemq.client.mqtt.mqtt5.message.disconnect.Mqtt5Disconnect mqttDisconnect) Set the Disconnect message.- Parameters:
mqttDisconnect- the mqttDisconnect
-
start
public void start() -
stop
public void stop() -
onConnected
public void onConnected(com.hivemq.client.mqtt.lifecycle.MqttClientConnectedContext context)
-