public class MqttPersistentData extends java.lang.Object implements MqttPersistable
Constructor and Description |
---|
MqttPersistentData(java.lang.String key,
byte[] header,
int hOffset,
int hLength,
byte[] payload,
int pOffset,
int pLength)
Construct a data object to pass across the MQTT client persistence interface.
|
Modifier and Type | Method and Description |
---|---|
byte[] |
getHeaderBytes()
Returns the header bytes in an array.
|
int |
getHeaderLength()
Returns the length of the header.
|
int |
getHeaderOffset()
Returns the offset of the header within the byte array returned by
MqttPersistable.getHeaderBytes() . |
java.lang.String |
getKey() |
byte[] |
getPayloadBytes()
Returns the payload bytes in an array.
|
int |
getPayloadLength()
Returns the length of the payload.
|
int |
getPayloadOffset()
Returns the offset of the payload within the byte array returned by
MqttPersistable.getPayloadBytes() . |
public MqttPersistentData(java.lang.String key, byte[] header, int hOffset, int hLength, byte[] payload, int pOffset, int pLength)
key
- The key which identifies this dataheader
- The message headerhOffset
- The start offset of the header bytes in header.hLength
- The length of the header in the header bytes array.payload
- The message payloadpOffset
- The start offset of the payload bytes in payload.pLength
- The length of the payload in the payload bytes array
when persisting the message.public java.lang.String getKey()
public byte[] getHeaderBytes()
MqttPersistable
MqttPersistable.getHeaderOffset()
and continue for MqttPersistable.getHeaderLength()
.getHeaderBytes
in interface MqttPersistable
public int getHeaderLength()
MqttPersistable
getHeaderLength
in interface MqttPersistable
public int getHeaderOffset()
MqttPersistable
MqttPersistable.getHeaderBytes()
.getHeaderOffset
in interface MqttPersistable
public byte[] getPayloadBytes()
MqttPersistable
MqttPersistable.getPayloadOffset()
and continue for MqttPersistable.getPayloadLength()
.getPayloadBytes
in interface MqttPersistable
public int getPayloadLength()
MqttPersistable
getPayloadLength
in interface MqttPersistable
public int getPayloadOffset()
MqttPersistable
MqttPersistable.getPayloadBytes()
.getPayloadOffset
in interface MqttPersistable