Interface ClientManager<T,C>

Type Parameters:
T - MQTT client type
C - MQTT connection options type (v5 or v3)
All Superinterfaces:
Aware, BeanNameAware, Lifecycle, MqttComponent<C>, Phased, SmartLifecycle
All Known Implementing Classes:
AbstractMqttClientManager, Mqttv3ClientManager, Mqttv5ClientManager

@Deprecated(since="7.2", forRemoval=true) public interface ClientManager<T,C> extends SmartLifecycle, MqttComponent<C>
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.
A utility abstraction over MQTT client which can be used in any MQTT-related component without need to handle generic client callbacks, reconnects etc. Using this manager in multiple MQTT integrations will preserve a single connection.
Since:
6.0
Author:
Artem Vozhdayenko, Artem Bilan, Jiri Soucek, Jiandong Ma, Jaehong Park
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static interface 
    Deprecated, for removal: This API element is subject to removal in a future version.
    A contract for a custom callback on connectComplete event from the client.
    static interface 
    Deprecated, for removal: This API element is subject to removal in a future version.
    A contract for a default message handler on the messageArrived event from the client.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final long
    Deprecated, for removal: This API element is subject to removal in a future version.
    The default completion timeout in milliseconds.
    static final long
    Deprecated, for removal: This API element is subject to removal in a future version.
    The default disconnect completion timeout in milliseconds.
    static final Long
    Deprecated, for removal: This API element is subject to removal in a future version.
     

    Fields inherited from interface SmartLifecycle

    DEFAULT_PHASE
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
    Register a callback for the connectComplete event from the client.
    <M> void
    Deprecated, for removal: This API element is subject to removal in a future version.
    Register a callback for the messageArrived event from the client.
    @Nullable T
    Deprecated, 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.
    Deprecated, for removal: This API element is subject to removal in a future version.
    Return the managed client url.
    boolean
    Deprecated, for removal: This API element is subject to removal in a future version.
    Return the managed clients isConnected.
    boolean
    Deprecated, for removal: This API element is subject to removal in a future version.
    If manual acknowledge has to be used; false by default.
    boolean
    Deprecated, for removal: This API element is subject to removal in a future version.
    Remove the callback from registration.
    <M> boolean
    Deprecated, for removal: This API element is subject to removal in a future version.
    Remove the callback from registration.

    Methods inherited from interface BeanNameAware

    setBeanName

    Methods inherited from interface Lifecycle

    isRunning, start, stop

    Methods inherited from interface MqttComponent

    getBeanName, getConnectionInfo

    Methods inherited from interface SmartLifecycle

    getPhase, isAutoStartup, isPauseable, pause, restart, stop
  • Field Details

    • DEFAULT_COMPLETION_TIMEOUT

      static final long DEFAULT_COMPLETION_TIMEOUT
      Deprecated, for removal: This API element is subject to removal in a future version.
      The default completion timeout in milliseconds.
      See Also:
    • QUIESCENT_TIMEOUT

      static final Long QUIESCENT_TIMEOUT
      Deprecated, for removal: This API element is subject to removal in a future version.
    • DISCONNECT_COMPLETION_TIMEOUT

      static final long DISCONNECT_COMPLETION_TIMEOUT
      Deprecated, for removal: This API element is subject to removal in a future version.
      The default disconnect completion timeout in milliseconds.
      See Also:
  • Method Details

    • getClient

      @Nullable T getClient()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Return the managed client.
      Returns:
      the managed client.
    • getUrl

      String getUrl()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Return the managed client url.
      Returns:
      the managed client url, never null.
      Since:
      7.0
    • getClientId

      String getClientId()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Return the managed client id.
      Returns:
      the managed client id, never null.
      Since:
      7.0
    • isManualAcks

      boolean isManualAcks()
      Deprecated, for removal: This API element is subject to removal in a future version.
      If manual acknowledge has to be used; false by default.
      Returns:
      true if manual acknowledge has to be used.
    • addCallback

      void addCallback(ClientManager.ConnectCallback connectCallback)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Register a callback for the connectComplete event from the client.
      Parameters:
      connectCallback - a ClientManager.ConnectCallback to register.
    • removeCallback

      boolean removeCallback(ClientManager.ConnectCallback connectCallback)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Remove the callback from registration.
      Parameters:
      connectCallback - a ClientManager.ConnectCallback to unregister.
      Returns:
      true if callback was removed.
    • addDefaultMessageHandler

      <M> void addDefaultMessageHandler(ClientManager.DefaultMessageHandler<M> defaultMessageHandler)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Register a callback for the messageArrived event from the client.
      Parameters:
      defaultMessageHandler - a ClientManager.DefaultMessageHandler to register.
      Since:
      6.5.6
    • removeDefaultMessageHandler

      <M> boolean removeDefaultMessageHandler(ClientManager.DefaultMessageHandler<M> defaultMessageHandler)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Remove the callback from registration.
      Parameters:
      defaultMessageHandler - a ClientManager.DefaultMessageHandler to unregister.
      Returns:
      true if callback was removed.
      Since:
      6.5.6
    • isConnected

      boolean isConnected()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Return the managed clients isConnected.
      Returns:
      the managed clients isConnected.
      Since:
      6.4