Class MqttConfiguration

java.lang.Object
de.iip_ecosphere.platform.transport.spring.binder.mqttv5.MqttConfiguration

@ConfigurationProperties(prefix="mqtt")
public class MqttConfiguration
extends Object
Represents the configuration options of a MQTT v5 client.
Author:
Holger Eichelberger, SSE
  • Field Details

  • Constructor Details

  • Method Details

    • isFilteredTopic

      public boolean isFilteredTopic​(String topic)
      Returns whether topic is a filtered topic, i.e., we shall not subscribe to this topic.
      Parameters:
      topic - the topic name
      Returns:
      true if the topic is filtered (no subscription), false else
    • getFilteredTopics

      public List<String> getFilteredTopics()
      Returns all filtered topics.
      Returns:
      the filtered topics
      See Also:
      isFilteredTopic(String)
    • getHost

      public String getHost()
      Returns the broker host name.
      Returns:
      the broker host name
    • getBrokerString

      public String getBrokerString()
      Returns the broker connection string consisting of getSchema(), getHost() and getPort().
      Returns:
      the broker connection string
    • getPort

      public int getPort()
      Returns the broker port number.
      Returns:
      the broker port number to connect to
    • getSchema

      public String getSchema()
      Returns the connection schema.
      Returns:
      the connection schema ("tcp" by default)
    • getClientId

      public String getClientId()
      Returns the client identification.
      Returns:
      the client identification
    • getAutoClientId

      public boolean getAutoClientId()
      Returns whether making the client ID unique is enabled.
      Returns:
      true for enabled (default), false else
    • getKeepAlive

      public int getKeepAlive()
      Returns the keep-alive time between heartbeats.
      Returns:
      the keep-alive time in ms (60000 by default)
    • getActionTimeout

      public int getActionTimeout()
      Returns the action timeout to wait for the broker to complete an action.
      Returns:
      the action timeout in ms (1000 by default)
    • getQos

      public de.iip_ecosphere.platform.transport.connectors.basics.MqttQoS getQos()
      Returns the QoS level for sending.
      Returns:
      the QoS level
    • setHost

      public void setHost​(String host)
      Changes the broker host name. [required by Spring]
      Parameters:
      host - the broker host name
    • setPort

      public void setPort​(int port)
      Defines the broker port number. [required by Spring]
      Parameters:
      port - the broker port number to connect to
    • setSchema

      public void setSchema​(String schema)
      Changes the connection schema. [required by Spring]
      Parameters:
      schema - the connection schema
    • setClientId

      public void setClientId​(String clientId)
      Changes the client identification. [required by Spring]
      Parameters:
      clientId - the client identification
    • setAutoClientId

      public void setAutoClientId​(boolean autoClientId)
      Changes whether the client identification is expected to be unique or shall be made unique upon first connect. [required by Spring]
      Parameters:
      autoClientId - true (default) for make unique, false else
    • setKeepAlive

      public void setKeepAlive​(int keepAlive)
      Changes the keep-alive time between heartbeats. [required by Spring]
      Parameters:
      keepAlive - the keep-alive time in ms
    • setActionTimeout

      public void setActionTimeout​(int actionTimeout)
      Changes the action timeout to wait for the broker to complete an action. [required by Spring]
      Parameters:
      actionTimeout - the action timeout in ms
    • setFilteredTopics

      public void setFilteredTopics​(List<String> filteredTopics)
      Changes all filtered topics. [required by Spring]
      Parameters:
      filteredTopics - the new filtered topics
      See Also:
      isFilteredTopic(String)
    • setQos

      public void setQos​(String qos)
      Defines the QoS level.
      Parameters:
      qos - the QoS level, ignored if invalid, see MqttQoS
    • toTransportParameter

      public de.iip_ecosphere.platform.transport.connectors.TransportParameter toTransportParameter()
      Turns the actual configuration into a TransportParameter instance.
      Returns:
      the transport parameter instance