public class MQTTCommunication
extends java.lang.Object
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.
|
Modifier and Type | Method and Description |
---|---|
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.
|
public MQTTCommunication()
public MQTTCommunication(java.lang.String hostname, int port, java.lang.String username, java.lang.String password)
hostname
- the hostnameport
- the portusername
- the usernamepassword
- the passwordpublic double readValue(java.lang.String topic)
topic
- the topicpublic java.sql.Timestamp getLastUpdateTime(java.lang.String topic)
topic
- the topicpublic void writeValue(java.lang.String topic, double value)
topic
- the topicvalue
- the valuepublic void setLastUpdateTime(java.lang.String topic, java.sql.Timestamp time)
topic
- the topictime
- the timepublic void subscribe(java.util.ArrayList<java.lang.String> topics)
topics
- the topicspublic void publish(java.lang.String topic, java.lang.String message)
topic
- the topicmessage
- the messagepublic java.util.Set<java.lang.String> getKnownVariables()