Class CMMqttEventPUBLISH
java.lang.Object
kr.ac.konkuk.ccslab.cm.entity.CMObject
kr.ac.konkuk.ccslab.cm.event.CMEvent
kr.ac.konkuk.ccslab.cm.event.mqttevent.CMMqttEvent
kr.ac.konkuk.ccslab.cm.event.mqttevent.CMMqttEventFixedHeader
kr.ac.konkuk.ccslab.cm.event.mqttevent.CMMqttEventPUBLISH
This class represents a CM event that belongs to the variable header and payload of
MQTT PUBLISH packet.
-
Field Summary
Fields inherited from class kr.ac.konkuk.ccslab.cm.event.mqttevent.CMMqttEventFixedHeader
m_flag, m_nRemainingLength, m_packetType
Fields inherited from class kr.ac.konkuk.ccslab.cm.event.mqttevent.CMMqttEvent
CONNACK, CONNECT, DISCONNECT, PINGREQ, PINGRESP, PUBACK, PUBCOMP, PUBLISH, PUBREC, PUBREL, SUBACK, SUBSCRIBE, UNSUBACK, UNSUBSCRIBE
Fields inherited from class kr.ac.konkuk.ccslab.cm.event.CMEvent
m_bytes, m_nByteNum, m_nID, m_strDistributionGroup, m_strDistributionSession, m_strHandlerGroup, m_strHandlerSession, m_strReceiver, m_strSender
-
Constructor Summary
ConstructorsConstructorDescriptionCreates an instance of the CMMqttEventPUBLISH class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the Application Message.int
gets MQTT Packet ID.protected int
byte
getQoS()
Returns the QoS.Returns the Topic Name.protected int
boolean
Returns if the DUP flag is set or not.boolean
Returns if the RETAIN flag is set or not.protected void
protected void
void
setAppMessage
(String strMsg) Sets the Application Message.void
setDupFlag
(boolean bFlag) Sets the DUP flag.void
setPacketID
(int nID) sets MQTT Packet ID.void
setQoS
(byte qos) Sets the QoS.void
setRetainFlag
(boolean bFlag) Sets the RETAIN flag.void
setTopicName
(String strTopic) Sets the Topic Name.toString()
Returns the string representation of the CMMqttEventFixedHeader.protected void
protected void
Methods inherited from class kr.ac.konkuk.ccslab.cm.event.mqttevent.CMMqttEventFixedHeader
getBinaryString, getBinaryStringOfByte, getFixedHeaderByteNum, getFlag, getPacketType, getRemainingLength, marshallFixedHeader, setFixedHeader, setFlag, setPacketType, setRemainingLength, unmarshallFixedHeader
Methods inherited from class kr.ac.konkuk.ccslab.cm.event.mqttevent.CMMqttEvent
getByteNum, marshallBody, unmarshallBody
Methods inherited from class kr.ac.konkuk.ccslab.cm.event.CMEvent
allocate, equals, getDistributionGroup, getDistributionSession, getHandlerGroup, getHandlerSession, getID, getInt2BytesFromByteBuffer, getReceiver, getSender, getStringFromByteBuffer, marshall, marshallHeader, putInt2BytesToByteBuffer, putStringToByteBuffer, setByteNum, setDistributionGroup, setDistributionSession, setHandlerGroup, setHandlerSession, setID, setReceiver, setSender, unmarshall, unmarshallHeader
-
Constructor Details
-
CMMqttEventPUBLISH
public CMMqttEventPUBLISH()Creates an instance of the CMMqttEventPUBLISH class. -
CMMqttEventPUBLISH
-
-
Method Details
-
setDupFlag
public void setDupFlag(boolean bFlag) Sets the DUP flag.- Parameters:
bFlag
- - the DUP flag
-
isDupFlag
public boolean isDupFlag()Returns if the DUP flag is set or not.- Returns:
- true if the DUP flag is set; false otherwise.
-
setQoS
public void setQoS(byte qos) Sets the QoS.- Parameters:
qos
- - QoS
-
getQoS
public byte getQoS()Returns the QoS.- Returns:
- QoS.
-
setRetainFlag
public void setRetainFlag(boolean bFlag) Sets the RETAIN flag.- Parameters:
bFlag
- - the RETAIN flag
-
isRetainFlag
public boolean isRetainFlag()Returns if the RETAIN flag is set or not.- Returns:
- true if the RETAIN flag is set; false otherwise.
-
setTopicName
Sets the Topic Name.- Parameters:
strTopic
- - the Topic Name
-
getTopicName
Returns the Topic Name.- Returns:
- the Topic Name.
-
setPacketID
public void setPacketID(int nID) sets MQTT Packet ID.- Parameters:
nID
- - packet ID.
-
getPacketID
public int getPacketID()gets MQTT Packet ID.- Overrides:
getPacketID
in classCMMqttEvent
- Returns:
- packet ID.
-
getVarHeaderByteNum
protected int getVarHeaderByteNum()- Specified by:
getVarHeaderByteNum
in classCMMqttEvent
-
marshallVarHeader
protected void marshallVarHeader()- Specified by:
marshallVarHeader
in classCMMqttEvent
-
unmarshallVarHeader
- Specified by:
unmarshallVarHeader
in classCMMqttEvent
-
setAppMessage
Sets the Application Message.- Parameters:
strMsg
- - the Application Message
-
getAppMessage
Returns the Application Message.- Returns:
- the Application Message.
-
getPayloadByteNum
protected int getPayloadByteNum()- Specified by:
getPayloadByteNum
in classCMMqttEvent
-
marshallPayload
protected void marshallPayload()- Specified by:
marshallPayload
in classCMMqttEvent
-
unmarshallPayload
- Specified by:
unmarshallPayload
in classCMMqttEvent
-
toString
Description copied from class:CMMqttEventFixedHeader
Returns the string representation of the CMMqttEventFixedHeader.- Overrides:
toString
in classCMMqttEventFixedHeader
- Returns:
- string of this object.
-