|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.xenqtt.message.MqttMessage
public class MqttMessage
This is a generic MQTT message. Extending classes support more specific message types
Constructor Summary | |
---|---|
MqttMessage(MqttMessage copyFrom)
Creates a copy of the copyFrom message. |
Method Summary | |
---|---|
static String |
byteBufferToHex(ByteBuffer buffer)
|
static String |
bytesToHex(byte[] bytes)
|
boolean |
equals(Object obj)
|
MessageType |
getMessageType()
The type of message |
QoS |
getQoS()
The level of assurance for delivery of an IdentifiableMqttMessage . |
int |
getQoSLevel()
The raw integer value for the level of assurance for delivery of a PUBLISH message. |
int |
getRemainingLength()
Represents the number of bytes remaining within the current message, including data in the variable header and the payload. |
int |
hashCode()
|
boolean |
isAck()
|
boolean |
isAckable()
|
boolean |
isDuplicate()
This flag is set when the client or server attempts to re-deliver a PUBLISH, PUBREL, SUBSCRIBE or UNSUBSCRIBE message. |
boolean |
isRetain()
This flag is only used on PUBLISH messages. |
void |
setDuplicateFlag()
Sets the duplicate flag on this message. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public MqttMessage(MqttMessage copyFrom)
Method Detail |
---|
public static String byteBufferToHex(ByteBuffer buffer)
public static String bytesToHex(byte[] bytes)
public final boolean isAckable()
getQoSLevel()
> 0public final boolean isAck()
ConnAckMessage
.public final MessageType getMessageType()
public final boolean isDuplicate()
The recipient should treat this flag as a hint as to whether the message may have been previously received. It should not be relied on to detect duplicates.
public final QoS getQoS()
IdentifiableMqttMessage
.
public final int getQoSLevel()
public final boolean isRetain()
When a new subscription is established on a topic, the last retained message on that topic should be sent to the subscriber with the Retain flag set. If there is no retained message, nothing is sent
This is useful where publishers send messages on a "report by exception" basis, where it might be some time between messages. This allows new subscribers to instantly receive data with the retained, or Last Known Good, value.
When a server sends a PUBLISH to a client as a result of a subscription that already existed when the original PUBLISH arrived, the Retain flag should not be set, regardless of the Retain flag of the original PUBLISH. This allows a client to distinguish messages that are being received because they were retained and those that are being received "live".
Retained messages should be kept over restarts of the server.
A server may delete a retained message if it receives a message with a zero-length payload and the Retain flag set on the same topic.
public final int getRemainingLength()
public final void setDuplicateFlag()
public int hashCode()
hashCode
in class Object
Object.hashCode()
public boolean equals(Object obj)
equals
in class Object
Object.equals(java.lang.Object)
public String toString()
toString
in class Object
Object.toString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |