net.sf.xenqtt.message
Class SubAckMessage

java.lang.Object
  extended by net.sf.xenqtt.message.MqttMessage
      extended by net.sf.xenqtt.message.IdentifiableMqttMessage
          extended by net.sf.xenqtt.message.SubAckMessage

public final class SubAckMessage
extends IdentifiableMqttMessage

A SUBACK message is sent by the server to the client to confirm receipt of a SUBSCRIBE message.

A SUBACK message contains a list of granted QoS levels. The order of granted QoS levels in the SUBACK message matches the order of the topic names in the corresponding SUBSCRIBE message.


Constructor Summary
SubAckMessage(ByteBuffer buffer, int remainingLength)
          Used to construct a received message.
SubAckMessage(int messageId, QoS[] grantedQoses)
          Used to construct a message for sending
 
Method Summary
 QoS[] getGrantedQoses()
          Granted QoS levels.
 int getMessageId()
          The Message Identifier (Message ID) for the SUBSCRIBE message that is being acknowledged.
 void setMessageId(int messageId)
          Sets the message ID
 
Methods inherited from class net.sf.xenqtt.message.MqttMessage
byteBufferToHex, bytesToHex, equals, getMessageType, getQoS, getQoSLevel, getRemainingLength, hashCode, isAck, isAckable, isDuplicate, isRetain, setDuplicateFlag, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SubAckMessage

public SubAckMessage(ByteBuffer buffer,
                     int remainingLength)
Used to construct a received message.


SubAckMessage

public SubAckMessage(int messageId,
                     QoS[] grantedQoses)
Used to construct a message for sending

Method Detail

getMessageId

public int getMessageId()
The Message Identifier (Message ID) for the SUBSCRIBE message that is being acknowledged.

Overrides:
getMessageId in class IdentifiableMqttMessage
See Also:
IdentifiableMqttMessage.getMessageId()

setMessageId

public void setMessageId(int messageId)
Description copied from class: IdentifiableMqttMessage
Sets the message ID

Override this implementation for messages where the message ID is not at offset 2 of a fixed length message

Overrides:
setMessageId in class IdentifiableMqttMessage
See Also:
IdentifiableMqttMessage.setMessageId(int)

getGrantedQoses

public QoS[] getGrantedQoses()
Granted QoS levels. Each level corresponds to a topic name in the corresponding SUBSCRIBE message. The order of QoS levels in the SUBACK message matches the order of topic name and Requested QoS pairs in the SUBSCRIBE message. The Message ID in the variable header enables you to match SUBACK messages with the corresponding SUBSCRIBE messages.



Copyright © 2013. All Rights Reserved.