org.eclipse.paho.client.mqttv3.internal
Class MqttPersistentData

java.lang.Object
  extended by org.eclipse.paho.client.mqttv3.internal.MqttPersistentData
All Implemented Interfaces:
MqttPersistable

public class MqttPersistentData
extends Object
implements MqttPersistable


Constructor Summary
MqttPersistentData(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.
 
Method Summary
 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().
 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().
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MqttPersistentData

public MqttPersistentData(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. When this Object is passed to the persistence implementation the key is used by the client to identify the persisted data to which further update or deletion requests are targeted.
When this Object is created for returning to the client when it is recovering its state from persistence the key is not required to be set. The client can determine the key from the data.

Parameters:
key - The key which identifies this data
header - The message header
hOffset - The start offset of the header bytes in header.
hLength - The length of the header in the header bytes array.
payload - The message payload
pOffset - The start offset of the payload bytes in payload.
pLength - The length of the payload in the payload bytes array when persisting the message.
Method Detail

getKey

public String getKey()

getHeaderBytes

public byte[] getHeaderBytes()
Description copied from interface: MqttPersistable
Returns the header bytes in an array. The bytes start at MqttPersistable.getHeaderOffset() and continue for MqttPersistable.getHeaderLength().

Specified by:
getHeaderBytes in interface MqttPersistable
Returns:
the header bytes.

getHeaderLength

public int getHeaderLength()
Description copied from interface: MqttPersistable
Returns the length of the header.

Specified by:
getHeaderLength in interface MqttPersistable
Returns:
the header length

getHeaderOffset

public int getHeaderOffset()
Description copied from interface: MqttPersistable
Returns the offset of the header within the byte array returned by MqttPersistable.getHeaderBytes().

Specified by:
getHeaderOffset in interface MqttPersistable
Returns:
the header offset.

getPayloadBytes

public byte[] getPayloadBytes()
Description copied from interface: MqttPersistable
Returns the payload bytes in an array. The bytes start at MqttPersistable.getPayloadOffset() and continue for MqttPersistable.getPayloadLength().

Specified by:
getPayloadBytes in interface MqttPersistable
Returns:
the payload bytes.

getPayloadLength

public int getPayloadLength()
Description copied from interface: MqttPersistable
Returns the length of the payload.

Specified by:
getPayloadLength in interface MqttPersistable
Returns:
the payload length.

getPayloadOffset

public int getPayloadOffset()
Description copied from interface: MqttPersistable
Returns the offset of the payload within the byte array returned by MqttPersistable.getPayloadBytes().

Specified by:
getPayloadOffset in interface MqttPersistable
Returns:
the payload offset.


Copyright © 2013. All Rights Reserved.