Class AbstractMqttClientManager<T,C>

java.lang.Object
org.springframework.integration.mqtt.core.AbstractMqttClientManager<T,C>
Type Parameters:
T - MQTT client type
C - 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.
since 7.2 in favor of the spring-integration-mqtt-client module.
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
  • Field Details

    • logger

      protected final org.apache.commons.logging.Log logger
      Deprecated, for removal: This API element is subject to removal in a future version.
    • lock

      protected final Lock lock
      Deprecated, for removal: This API element is subject to removal in a future version.
  • Constructor Details

    • AbstractMqttClientManager

      protected AbstractMqttClientManager(String clientId)
      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

      public String getUrl()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: ClientManager
      Return the managed client url.
      Specified by:
      getUrl in interface ClientManager<T,C>
      Returns:
      the managed client url, never null.
    • setUrl

      protected void setUrl(String url)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • getClientId

      public String getClientId()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: ClientManager
      Return the managed client id.
      Specified by:
      getClientId in interface ClientManager<T,C>
      Returns:
      the managed client id, never null.
    • getApplicationEventPublisher

      protected ApplicationEventPublisher getApplicationEventPublisher()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • setClient

      protected void setClient(@Nullable T client)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • getCallbacks

      protected Set<ClientManager.ConnectCallback> getCallbacks()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • getDefaultMessageHandlers

      protected <M> Set<ClientManager.DefaultMessageHandler<M>> getDefaultMessageHandlers()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • setCompletionTimeout

      public void setCompletionTimeout(long completionTimeout)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Set the completion timeout for operations. Default 30000L<T,C> milliseconds.
      Parameters:
      completionTimeout - The timeout.
      Since:
      6.0.3
    • getCompletionTimeout

      protected long getCompletionTimeout()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • setDisconnectCompletionTimeout

      public void setDisconnectCompletionTimeout(long completionTimeout)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Set the completion timeout when disconnecting. Default 5000L<T,C> milliseconds.
      Parameters:
      completionTimeout - The timeout.
      Since:
      6.0.3
    • 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 is ClientManager.QUIESCENT_TIMEOUT milliseconds.
      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: ClientManager
      If manual acknowledge has to be used; false by default.
      Specified by:
      isManualAcks in interface ClientManager<T,C>
      Returns:
      true if manual acknowledge has to be used.
    • getClient

      public @Nullable T getClient()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: ClientManager
      Return the managed client.
      Specified by:
      getClient in interface ClientManager<T,C>
      Returns:
      the managed client.
    • setApplicationEventPublisher

      public void setApplicationEventPublisher(ApplicationEventPublisher applicationEventPublisher)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      setApplicationEventPublisher in interface ApplicationEventPublisherAware
    • setBeanName

      public void setBeanName(String name)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      setBeanName in interface BeanNameAware
    • getBeanName

      public String getBeanName()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: MqttComponent
      Return this component's bean name.
      Specified by:
      getBeanName in interface MqttComponent<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 in SmartLifecycle. If the custom one is required, note that for the correct behavior it should be less than phase of AbstractMqttMessageDrivenChannelAdapter implementations. The default phase is DEFAULT_MANAGER_PHASE.
      Specified by:
      getPhase in interface Phased
      Specified by:
      getPhase in interface SmartLifecycle
      Returns:
      SmartLifecycle autostart phase
      See Also:
    • addCallback

      public void addCallback(ClientManager.ConnectCallback connectCallback)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: ClientManager
      Register a callback for the connectComplete event from the client.
      Specified by:
      addCallback in interface ClientManager<T,C>
      Parameters:
      connectCallback - a ClientManager.ConnectCallback to register.
    • removeCallback

      public boolean removeCallback(ClientManager.ConnectCallback connectCallback)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: ClientManager
      Remove the callback from registration.
      Specified by:
      removeCallback in interface ClientManager<T,C>
      Parameters:
      connectCallback - a ClientManager.ConnectCallback to 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: ClientManager
      Register a callback for the messageArrived event from the client.
      Specified by:
      addDefaultMessageHandler in interface ClientManager<T,C>
      Parameters:
      defaultMessageHandler - a ClientManager.DefaultMessageHandler to 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: ClientManager
      Remove the callback from registration.
      Specified by:
      removeDefaultMessageHandler in interface ClientManager<T,C>
      Parameters:
      defaultMessageHandler - a ClientManager.DefaultMessageHandler to unregister.
      Returns:
      true if callback was removed.
    • isRunning

      public boolean isRunning()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      isRunning in interface Lifecycle
    • 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 in SmartLifecycle. If the custom one is required, note that for the correct behavior it should be less than phase of AbstractMqttMessageDrivenChannelAdapter implementations.
      See Also: