|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.xenqtt.message.MqttMessage
net.sf.xenqtt.message.IdentifiableMqttMessage
net.sf.xenqtt.message.UnsubscribeMessage
public final class UnsubscribeMessage
An UNSUBSCRIBE message is sent by the client to the server to unsubscribe from named topics.
The server sends an UNSUBACK to a client in response to an UNSUBSCRIBE message.
Constructor Summary | |
---|---|
UnsubscribeMessage(ByteBuffer buffer,
int remainingLength)
Used to construct a received message. |
|
UnsubscribeMessage(int messageId,
String[] topics)
Used to construct a message for sending |
Method Summary | |
---|---|
int |
getMessageId()
The message identifier is present in the variable header of the following MQTT messages: PUBLISH, PUBACK, PUBREC, PUBREL, PUBCOMP, SUBSCRIBE, SUBACK, UNSUBSCRIBE, UNSUBACK. |
String[] |
getTopics()
The topics to unsubscribe from. |
void |
setMessageId(int messageId)
Sets the message ID |
Methods inherited from class net.sf.xenqtt.message.MqttMessage |
---|
byteBufferToHex, bytesToHex, equals, getMessageType, getQoS, getQoSLevel, getRemainingLength, isAck, isAckable, isDuplicate, isRetain, setDuplicateFlag, toString |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public UnsubscribeMessage(ByteBuffer buffer, int remainingLength)
public UnsubscribeMessage(int messageId, String[] topics)
Method Detail |
---|
public int getMessageId()
IdentifiableMqttMessage
The Message Identifier (Message ID) field is only present in messages where the QoS bits in the fixed header indicate QoS levels 1 or 2. See section on Quality of Service levels and flows for more information.
The Message ID is a 16-bit unsigned integer that must be unique amongst the set of "in flight" messages in a particular direction of communication. It typically increases by exactly one from one message to the next, but is not required to do so.
A client will maintain its own list of Message IDs separate to the Message IDs used by the server it is connected to. It is possible for a client to send a PUBLISH with Message ID 1 at the same time as receiving a PUBLISH with Message ID 1.
Do not use Message ID 0. It is reserved as an invalid Message ID.
Override this implementation for messages where the message ID is not at offset 2 of a fixed length message
getMessageId
in class IdentifiableMqttMessage
IdentifiableMqttMessage.getMessageId()
public void setMessageId(int messageId)
IdentifiableMqttMessage
Override this implementation for messages where the message ID is not at offset 2 of a fixed length message
setMessageId
in class IdentifiableMqttMessage
IdentifiableMqttMessage.setMessageId(int)
public String[] getTopics()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |