MqttMessage Class
- java.
lang. Object - com.
microsoft. azure. sdk. iot. provisioning. device. transport. mqtt. MqttMessage
- com.
public class MqttMessage
Constructor Summary
Constructor | 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 |
Method Summary
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 |
Mqtt |
getQos()
Gets the Qos value of the Message |
String |
getTopic()
Gets the topic of the message |
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 |
Constructor Details
MqttMessage
public MqttMessage(String topic)
Constructor that takes the topic of the Message
Parameters:
MqttMessage
public MqttMessage(String topic, byte[] payload)
Constructor that takes the topic of the Message and payload
Parameters:
MqttMessage
public MqttMessage(String topic, org.eclipse.paho.client.mqttv3.MqttMessage mqttMessage)
Constructor that takes the topic of the Message and a PAHO MqttMessage
Parameters:
Method Details
getMqttMessage
public org.eclipse.paho.client.mqttv3.MqttMessage getMqttMessage()
Gets the PAHO MqttMessage from an existing message
Returns:
getPayload
public byte [] getPayload()
Returns the Message Payload
Returns:
getQos
public MqttQos getQos()
Gets the Qos value of the Message
Returns:
getTopic
public String getTopic()
Gets the topic of the message
Returns:
retrieveQosValue
public static int retrieveQosValue(MqttQos qos)
Converts the MqttQOS value to a integer representation
Parameters:
Returns:
setPayload
public void setPayload(byte[] payload)
Sets the Message Payload
Parameters:
setQos
public void setQos(MqttQos qos)
Sets the Qos value of the Message
Parameters:
setTopic
public void setTopic(String topic)
Sets the topic of the message
Parameters:
Applies to
Azure SDK for Java