public abstract class MqttWireMessage
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static byte |
MESSAGE_TYPE_CONNACK |
static byte |
MESSAGE_TYPE_CONNECT |
static byte |
MESSAGE_TYPE_DISCONNECT |
static byte |
MESSAGE_TYPE_PINGREQ |
static byte |
MESSAGE_TYPE_PINGRESP |
static byte |
MESSAGE_TYPE_PUBACK |
static byte |
MESSAGE_TYPE_PUBCOMP |
static byte |
MESSAGE_TYPE_PUBLISH |
static byte |
MESSAGE_TYPE_PUBREC |
static byte |
MESSAGE_TYPE_PUBREL |
static byte |
MESSAGE_TYPE_SUBACK |
static byte |
MESSAGE_TYPE_SUBSCRIBE |
static byte |
MESSAGE_TYPE_UNSUBACK |
static byte |
MESSAGE_TYPE_UNSUBSCRIBE |
Constructor and Description |
---|
MqttWireMessage(byte type) |
Modifier and Type | Method and Description |
---|---|
static MqttWireMessage |
createWireMessage(byte[] bytes) |
static MqttWireMessage |
createWireMessage(MqttPersistable data) |
byte[] |
getHeader() |
java.lang.String |
getKey()
Returns a key associated with the message.
|
int |
getMessageId()
Returns the MQTT message ID.
|
byte[] |
getPayload()
Sub-classes should override this method to supply the payload bytes.
|
byte |
getType()
Returns the type of the message.
|
boolean |
isMessageIdRequired()
Returns whether or not this message needs to include a message ID.
|
boolean |
isRetryable() |
void |
setDuplicate(boolean duplicate) |
void |
setMessageId(int msgId)
Sets the MQTT message ID.
|
java.lang.String |
toString() |
public static final byte MESSAGE_TYPE_CONNECT
public static final byte MESSAGE_TYPE_CONNACK
public static final byte MESSAGE_TYPE_PUBLISH
public static final byte MESSAGE_TYPE_PUBACK
public static final byte MESSAGE_TYPE_PUBREC
public static final byte MESSAGE_TYPE_PUBREL
public static final byte MESSAGE_TYPE_PUBCOMP
public static final byte MESSAGE_TYPE_SUBSCRIBE
public static final byte MESSAGE_TYPE_SUBACK
public static final byte MESSAGE_TYPE_UNSUBSCRIBE
public static final byte MESSAGE_TYPE_UNSUBACK
public static final byte MESSAGE_TYPE_PINGREQ
public static final byte MESSAGE_TYPE_PINGRESP
public static final byte MESSAGE_TYPE_DISCONNECT
public byte[] getPayload() throws MqttException
MqttException
public byte getType()
public int getMessageId()
public void setMessageId(int msgId)
public java.lang.String getKey()
public byte[] getHeader() throws MqttException
MqttException
public boolean isMessageIdRequired()
public static MqttWireMessage createWireMessage(MqttPersistable data) throws MqttException
MqttException
public static MqttWireMessage createWireMessage(byte[] bytes) throws MqttException
MqttException
public boolean isRetryable()
public void setDuplicate(boolean duplicate)
public java.lang.String toString()
toString
in class java.lang.Object