public class MqttMessage extends Object
Constructor and Description |
---|
MqttMessage(String topic)
Constructor that takes the topic of the Message
|
MqttMessage(String topic,
byte[] payload)
Constructor that takes the topic of the Message and payload
|
MqttMessage(String topic,
org.eclipse.paho.client.mqttv3.MqttMessage mqttMessage)
Constructor that takes the topic of the Message and a PAHO MqttMessage
|
Modifier and Type | Method and Description |
---|---|
org.eclipse.paho.client.mqttv3.MqttMessage |
getMqttMessage()
Gets the PAHO MqttMessage from an existing message
|
byte[] |
getPayload()
Returns the Message Payload
|
MqttQos |
getQos()
Gets the Qos value of the Message
|
String |
getTopic()
Gets the topic of the message
|
static int |
retrieveQosValue(MqttQos qos)
Converts the MqttQOS value to a integer representation
|
void |
setPayload(byte[] payload)
Sets the Message Payload
|
void |
setQos(MqttQos qos)
Sets the Qos value of the Message
|
void |
setTopic(String topic)
Sets the topic of the message
|
public MqttMessage(String topic)
topic
- The topic of the messagepublic MqttMessage(String topic, org.eclipse.paho.client.mqttv3.MqttMessage mqttMessage)
topic
- The topic of the messagemqttMessage
- The mqtt messagepublic MqttMessage(String topic, byte[] payload)
topic
- The topic of the messagepayload
- The payload of the messagepublic static int retrieveQosValue(MqttQos qos)
qos
- MqttQos valuepublic void setTopic(String topic)
topic
- The topic of the messagepublic String getTopic()
public byte[] getPayload()
public void setPayload(byte[] payload)
payload
- the message in byte[]public void setQos(MqttQos qos)
qos
- the quality of servicepublic MqttQos getQos()
public org.eclipse.paho.client.mqttv3.MqttMessage getMqttMessage()
Copyright © 2022. All rights reserved.