MQTT

## Class MQTTCommunication

- java.lang.Object
- - MQTT.MQTTCommunication

    public class MQTTCommunication
    extends java.lang.Object

The Class MQTTCommunication.

### Constructor Summary

Constructors
Constructor and Description
`MQTTCommunication()` Instantiates a new MQTT communication.
`MQTTCommunication(java.lang.String hostname, int port, java.lang.String username, java.lang.String password)` Instantiates a new MQTT communication.

### Method Summary

All Methods Instance Methods Concrete Methods
`java.util.Set<java.lang.String>` `getKnownVariables()` Gets the known variables.
`java.sql.Timestamp` `getLastUpdateTime(java.lang.String topic)` Gets the last update time.
`void` `publish(java.lang.String topic, java.lang.String message)` Publish.
`double` `readValue(java.lang.String topic)` Read value.
`void` `setLastUpdateTime(java.lang.String topic, java.sql.Timestamp time)` Sets the last update time.
`void` `subscribe(java.util.ArrayList<java.lang.String> topics)` Subscribe.
`void` `writeValue(java.lang.String topic, double value)` Write value.

### Methods inherited from class java.lang.Object

`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### MQTTCommunication

    public MQTTCommunication()

Instantiates a new MQTT communication.

#### MQTTCommunication

    public MQTTCommunication(java.lang.String hostname,
                             int port,
                             java.lang.String username,
                             java.lang.String password)

Instantiates a new MQTT communication.

Parameters:
  `hostname` - the hostname
  `port` - the port
  `username` - the username
  `password` - the password

### Method Detail

#### readValue

    public double readValue(java.lang.String topic)

Read value.

Parameters:
  `topic` - the topic
Returns:
  the double

#### getLastUpdateTime

    public java.sql.Timestamp getLastUpdateTime(java.lang.String topic)

Gets the last update time.

Parameters:
  `topic` - the topic
Returns:
  the last update time

#### writeValue

    public void writeValue(java.lang.String topic,
                           double value)

Write value.

Parameters:
  `topic` - the topic
  `value` - the value

#### setLastUpdateTime

    public void setLastUpdateTime(java.lang.String topic,
                                  java.sql.Timestamp time)

Sets the last update time.

Parameters:
  `topic` - the topic
  `time` - the time

#### subscribe

    public void subscribe(java.util.ArrayList<java.lang.String> topics)

Subscribe.

Parameters:
  `topics` - the topics

#### publish

    public void publish(java.lang.String topic,
                        java.lang.String message)

Publish.

Parameters:
  `topic` - the topic
  `message` - the message

#### getKnownVariables

    public java.util.Set<java.lang.String> getKnownVariables()

Gets the known variables.

Returns:
  the known variables