Class HivemqV5Configuration

java.lang.Object
de.iip_ecosphere.platform.transport.spring.BasicConfiguration
de.iip_ecosphere.platform.transport.spring.binder.hivemqv5.HivemqV5Configuration

@ConfigurationProperties(prefix="mqtt") public class HivemqV5Configuration extends de.iip_ecosphere.platform.transport.spring.BasicConfiguration
Represents the configuration options of a HiveMq client.
Author:
Holger Eichelberger, SSE
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private boolean
     
    private String
     
    private List<String>
     
    private int
     
    private String
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Returns whether making the client ID unique is enabled.
    Returns the client identification.
    Returns all filtered topics.
    int
    Returns the keep-alive time between heartbeats.
    com.hivemq.client.mqtt.datatypes.MqttQos
    Returns the QoS level for sending.
    boolean
    Returns whether topic is a filtered topic, i.e., we shall not subscribe to this topic.
    void
    setAutoClientId(boolean autoClientId)
    Changes whether the client identification is expected to be unique or shall be made unique upon first connect.
    void
    setClientId(String clientId)
    Changes the client identification.
    void
    setFilteredTopics(List<String> filteredTopics)
    Changes all filtered topics.
    void
    setKeepAlive(int keepAlive)
    Changes the keep-alive time between heartbeats.
    void
    Defines the QoS level.
    de.iip_ecosphere.platform.transport.connectors.TransportParameter
    Turns the actual configuration into a TransportParameter instance.

    Methods inherited from class de.iip_ecosphere.platform.transport.spring.BasicConfiguration

    createTlsContext, createTransportParameterBuilder, createTrustManagerFactory, getAuthenticationKey, getHost, getHostnameVerification, getKeyAlias, getKeystoreKey, getPort, setAuthenticationKey, setHost, setHostnameVerification, setKeyAlias, setKeystoreKey, setPort, useTls

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • clientId

      private String clientId
    • autoClientId

      private boolean autoClientId
    • keepAlive

      private int keepAlive
    • filteredTopics

      private List<String> filteredTopics
    • qos

      private String qos
  • Constructor Details

    • HivemqV5Configuration

      public HivemqV5Configuration()
  • 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:
    • 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)
    • getQos

      public com.hivemq.client.mqtt.datatypes.MqttQos getQos()
      Returns the QoS level for sending.
      Returns:
      the QoS level
    • 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
    • setFilteredTopics

      public void setFilteredTopics(List<String> filteredTopics)
      Changes all filtered topics. [required by Spring]
      Parameters:
      filteredTopics - the new filtered topics
      See Also:
    • 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.
      Overrides:
      toTransportParameter in class de.iip_ecosphere.platform.transport.spring.BasicConfiguration
      Returns:
      the transport parameter instance