Class AbstractMqttClientManager<T,C>
java.lang.Object
org.springframework.integration.mqtt.core.AbstractMqttClientManager<T,C>
- Type Parameters:
T- MQTT client typeC- MQTT connection options type (v5 or v3)
- All Implemented Interfaces:
Aware, BeanNameAware, ApplicationEventPublisherAware, Lifecycle, Phased, SmartLifecycle, ClientManager<T,C>, MqttComponent<C>
- Direct Known Subclasses:
Mqttv3ClientManager, Mqttv5ClientManager
@Deprecated(since="7.2",
forRemoval=true)
public abstract class AbstractMqttClientManager<T,C>
extends Object
implements ClientManager<T,C>, ApplicationEventPublisherAware
Deprecated, for removal: This API element is subject to removal in a future version.
Abstract class for MQTT client managers which can be a base for any common v3/v5 client manager implementation.
Contains some basic utility and implementation-agnostic fields and methods.
- Since:
- 6.0
- Author:
- Artem Vozhdayenko, Artem Bilan, Christian Tzolov, Jaehong Park
-
Nested Class Summary
Nested classes/interfaces inherited from interface ClientManager
ClientManager.ConnectCallback, ClientManager.DefaultMessageHandler<M> -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final LockDeprecated, for removal: This API element is subject to removal in a future version.protected final org.apache.commons.logging.LogDeprecated, for removal: This API element is subject to removal in a future version.Fields inherited from interface ClientManager
DEFAULT_COMPLETION_TIMEOUT, DISCONNECT_COMPLETION_TIMEOUT, QUIESCENT_TIMEOUTFields inherited from interface SmartLifecycle
DEFAULT_PHASE -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractMqttClientManager(String clientId) Deprecated, for removal: This API element is subject to removal in a future version. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddCallback(ClientManager.ConnectCallback connectCallback) Deprecated, for removal: This API element is subject to removal in a future version.Register a callback for theconnectCompleteevent from the client.<M> voidaddDefaultMessageHandler(ClientManager.DefaultMessageHandler<M> defaultMessageHandler) Deprecated, for removal: This API element is subject to removal in a future version.Register a callback for themessageArrivedevent from the client.protected ApplicationEventPublisherDeprecated, for removal: This API element is subject to removal in a future version.Deprecated, for removal: This API element is subject to removal in a future version.Return this component's bean name.protected Set<ClientManager.ConnectCallback> Deprecated, for removal: This API element is subject to removal in a future version.@Nullable TDeprecated, for removal: This API element is subject to removal in a future version.Return the managed client.Deprecated, for removal: This API element is subject to removal in a future version.Return the managed client id.protected longDeprecated, for removal: This API element is subject to removal in a future version.protected <M> Set<ClientManager.DefaultMessageHandler<M>> Deprecated, for removal: This API element is subject to removal in a future version.protected longDeprecated, for removal: This API element is subject to removal in a future version.intgetPhase()Deprecated, for removal: This API element is subject to removal in a future version.The phase of component auto-start inSmartLifecycle.protected longDeprecated, for removal: This API element is subject to removal in a future version.getUrl()Deprecated, for removal: This API element is subject to removal in a future version.Return the managed client url.booleanDeprecated, for removal: This API element is subject to removal in a future version.If manual acknowledge has to be used; false by default.booleanDeprecated, for removal: This API element is subject to removal in a future version.booleanremoveCallback(ClientManager.ConnectCallback connectCallback) Deprecated, for removal: This API element is subject to removal in a future version.Remove the callback from registration.<M> booleanremoveDefaultMessageHandler(ClientManager.DefaultMessageHandler<M> defaultMessageHandler) Deprecated, for removal: This API element is subject to removal in a future version.Remove the callback from registration.voidsetApplicationEventPublisher(ApplicationEventPublisher applicationEventPublisher) Deprecated, for removal: This API element is subject to removal in a future version.voidsetBeanName(String name) Deprecated, for removal: This API element is subject to removal in a future version.protected voidDeprecated, for removal: This API element is subject to removal in a future version.voidsetCompletionTimeout(long completionTimeout) Deprecated, for removal: This API element is subject to removal in a future version.Set the completion timeout for operations.voidsetDisconnectCompletionTimeout(long completionTimeout) Deprecated, for removal: This API element is subject to removal in a future version.Set the completion timeout when disconnecting.voidsetManualAcks(boolean manualAcks) Deprecated, for removal: This API element is subject to removal in a future version.voidsetPhase(int phase) Deprecated, for removal: This API element is subject to removal in a future version.Set the phase of component autostart inSmartLifecycle.voidsetQuiescentTimeout(long quiescentTimeout) Deprecated, for removal: This API element is subject to removal in a future version.Set the quiescentTimeout timeout when disconnecting.protected voidDeprecated, for removal: This API element is subject to removal in a future version.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ClientManager
isConnectedMethods inherited from interface MqttComponent
getConnectionInfoMethods inherited from interface SmartLifecycle
isAutoStartup, isPauseable, pause, restart, stop
-
Field Details
-
logger
protected final org.apache.commons.logging.Log loggerDeprecated, for removal: This API element is subject to removal in a future version. -
lock
Deprecated, for removal: This API element is subject to removal in a future version.
-
-
Constructor Details
-
AbstractMqttClientManager
Deprecated, for removal: This API element is subject to removal in a future version.
-
-
Method Details
-
setManualAcks
public void setManualAcks(boolean manualAcks) Deprecated, for removal: This API element is subject to removal in a future version. -
getUrl
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:ClientManagerReturn the managed client url.- Specified by:
getUrlin interfaceClientManager<T,C> - Returns:
- the managed client url, never null.
-
setUrl
Deprecated, for removal: This API element is subject to removal in a future version. -
getClientId
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:ClientManagerReturn the managed client id.- Specified by:
getClientIdin interfaceClientManager<T,C> - Returns:
- the managed client id, never null.
-
getApplicationEventPublisher
Deprecated, for removal: This API element is subject to removal in a future version. -
setClient
Deprecated, for removal: This API element is subject to removal in a future version. -
getCallbacks
Deprecated, for removal: This API element is subject to removal in a future version. -
getDefaultMessageHandlers
Deprecated, for removal: This API element is subject to removal in a future version. -
setCompletionTimeout
-
getCompletionTimeout
protected long getCompletionTimeout()Deprecated, for removal: This API element is subject to removal in a future version. -
setDisconnectCompletionTimeout
-
getDisconnectCompletionTimeout
protected long getDisconnectCompletionTimeout()Deprecated, for removal: This API element is subject to removal in a future version. -
setQuiescentTimeout
public void setQuiescentTimeout(long quiescentTimeout) Deprecated, for removal: This API element is subject to removal in a future version.Set the quiescentTimeout timeout when disconnecting. Default isClientManager.QUIESCENT_TIMEOUTmilliseconds.- Parameters:
quiescentTimeout- The timeout.- Since:
- 7.0.0
-
getQuiescentTimeout
protected long getQuiescentTimeout()Deprecated, for removal: This API element is subject to removal in a future version. -
isManualAcks
public boolean isManualAcks()Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:ClientManagerIf manual acknowledge has to be used; false by default.- Specified by:
isManualAcksin interfaceClientManager<T,C> - Returns:
- true if manual acknowledge has to be used.
-
getClient
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:ClientManagerReturn the managed client.- Specified by:
getClientin interfaceClientManager<T,C> - Returns:
- the managed client.
-
setApplicationEventPublisher
Deprecated, for removal: This API element is subject to removal in a future version.- Specified by:
setApplicationEventPublisherin interfaceApplicationEventPublisherAware
-
setBeanName
Deprecated, for removal: This API element is subject to removal in a future version.- Specified by:
setBeanNamein interfaceBeanNameAware
-
getBeanName
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:MqttComponentReturn this component's bean name.- Specified by:
getBeanNamein interfaceMqttComponent<T>- Returns:
- the bean name.
-
getPhase
public int getPhase()Deprecated, for removal: This API element is subject to removal in a future version.The phase of component auto-start inSmartLifecycle. If the custom one is required, note that for the correct behavior it should be less than phase ofAbstractMqttMessageDrivenChannelAdapterimplementations. The default phase isDEFAULT_MANAGER_PHASE.- Specified by:
getPhasein interfacePhased- Specified by:
getPhasein interfaceSmartLifecycle- Returns:
SmartLifecycleautostart phase- See Also:
-
addCallback
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:ClientManagerRegister a callback for theconnectCompleteevent from the client.- Specified by:
addCallbackin interfaceClientManager<T,C> - Parameters:
connectCallback- aClientManager.ConnectCallbackto register.
-
removeCallback
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:ClientManagerRemove the callback from registration.- Specified by:
removeCallbackin interfaceClientManager<T,C> - Parameters:
connectCallback- aClientManager.ConnectCallbackto unregister.- Returns:
- true if callback was removed.
-
addDefaultMessageHandler
public <M> void addDefaultMessageHandler(ClientManager.DefaultMessageHandler<M> defaultMessageHandler) Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:ClientManagerRegister a callback for themessageArrivedevent from the client.- Specified by:
addDefaultMessageHandlerin interfaceClientManager<T,C> - Parameters:
defaultMessageHandler- aClientManager.DefaultMessageHandlerto register.
-
removeDefaultMessageHandler
public <M> boolean removeDefaultMessageHandler(ClientManager.DefaultMessageHandler<M> defaultMessageHandler) Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:ClientManagerRemove the callback from registration.- Specified by:
removeDefaultMessageHandlerin interfaceClientManager<T,C> - Parameters:
defaultMessageHandler- aClientManager.DefaultMessageHandlerto unregister.- Returns:
- true if callback was removed.
-
isRunning
-
setPhase
public void setPhase(int phase) Deprecated, for removal: This API element is subject to removal in a future version.Set the phase of component autostart inSmartLifecycle. If the custom one is required, note that for the correct behavior it should be less than phase ofAbstractMqttMessageDrivenChannelAdapterimplementations.- See Also:
-
spring-integration-mqtt-clientmodule.