-
- All Implemented Interfaces:
-
org.eclipse.paho.client.mqttv3.IToken,org.eclipse.paho.client.mqttv3.MqttPersistable
public class MqttPublish extends MqttPersistableWireMessage implements IToken
An on-the-wire representation of an MQTT SEND message.
-
-
Field Summary
Fields Modifier and Type Field Description private MqttMessagemessageprivate StringtopicName
-
Constructor Summary
Constructors Constructor Description MqttPublish(String name, MqttMessage message)MqttPublish(byte info, Array<byte> data)Constructs a new MqttPublish object.
-
Method Summary
Modifier and Type Method Description MqttMessagegetMessage()StringgetTopicName()StringtoString()Array<byte>getPayload()Sub-classes should override this method to supply the payload bytes. intgetPayloadLength()Returns the length of the payload. voidsetMessageId(int msgId)Sets the MQTT message ID. booleanisMessageIdRequired()Returns whether or not this message needs to include a message ID. -
Methods inherited from class org.eclipse.paho.client.mqttv3.internal.wire.MqttPersistableWireMessage
getHeaderBytes, getHeaderLength, getHeaderOffset, getPayloadBytes, getPayloadOffset -
Methods inherited from class org.eclipse.paho.client.mqttv3.internal.wire.MqttWireMessage
createWireMessage, createWireMessage, getHeader, getKey, getMessageId, getToken, getType, isRetryable, packetName, setDuplicate, setToken -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
MqttPublish
MqttPublish(String name, MqttMessage message)
-
MqttPublish
MqttPublish(byte info, Array<byte> data)
Constructs a new MqttPublish object.- Parameters:
info- the message info bytedata- the variable header and payload bytes
-
-
Method Detail
-
getMessage
MqttMessage getMessage()
-
getTopicName
String getTopicName()
-
getPayload
Array<byte> getPayload()
Sub-classes should override this method to supply the payload bytes.
-
getPayloadLength
int getPayloadLength()
Returns the length of the payload.
-
setMessageId
void setMessageId(int msgId)
Sets the MQTT message ID.
-
isMessageIdRequired
boolean isMessageIdRequired()
Returns whether or not this message needs to include a message ID.
-
-
-
-