public final class MqttMessage extends Object
Constructor and Description |
---|
MqttMessage(String topic,
byte[] payload)
Deprecated.
Use alternate constructor.
|
MqttMessage(String topic,
byte[] payload,
QualityOfService qos)
Constructs a new message.
|
MqttMessage(String topic,
byte[] payload,
QualityOfService qos,
boolean retain)
Constructs a new message.
|
MqttMessage(String topic,
byte[] payload,
QualityOfService qos,
boolean retain,
boolean dup)
Constructs a new message.
|
Modifier and Type | Method and Description |
---|---|
boolean |
getDup()
Gets the DUP flag.
|
byte[] |
getPayload()
Gets the message payload
|
QualityOfService |
getQos()
Gets the
QualityOfService . |
boolean |
getRetain()
Gets the retain flag.
|
String |
getTopic()
Gets the topic associated with this message
|
public MqttMessage(String topic, byte[] payload, QualityOfService qos, boolean retain, boolean dup)
topic
- Message topic.payload
- Message payload.qos
- QualityOfService
. When sending, the
QualityOfService
to use for delivery. When receiving,
the QualityOfService
used for delivery.retain
- Retain flag. When sending, whether the message should be
retained by the broker and delivered to future subscribers.
When receiving, whether the message was sent as a result of a
new subscription being made.dup
- DUP flag. Ignored when sending. When receiving, indicates
whether this might be re-delivery of an earlier attempt to
send the message.public MqttMessage(String topic, byte[] payload, QualityOfService qos, boolean retain)
topic
- Message topic.payload
- Message payload.qos
- QualityOfService
. When sending, the
QualityOfService
to use for delivery. When receiving,
the QualityOfService
used for delivery.retain
- Retain flag. When sending, whether the message should be
retained by the broker and delivered to future subscribers.
When receiving, whether the message was sent as a result of a
new subscription being made.public MqttMessage(String topic, byte[] payload, QualityOfService qos)
topic
- Message topic.payload
- Message payload.qos
- QualityOfService
. When sending, the
QualityOfService
to use for delivery. When receiving,
the QualityOfService
used for delivery.@Deprecated public MqttMessage(String topic, byte[] payload)
public String getTopic()
public byte[] getPayload()
public QualityOfService getQos()
QualityOfService
. When sending, the QualityOfService
to use for delivery. When receiving, the QualityOfService
used for
delivery.QualityOfService
public boolean getRetain()
public boolean getDup()
Copyright © 2021. All rights reserved.