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_packetTypeFields inherited from class kr.ac.konkuk.ccslab.cm.event.mqttevent.CMMqttEvent
CONNACK, CONNECT, DISCONNECT, PINGREQ, PINGRESP, PUBACK, PUBCOMP, PUBLISH, PUBREC, PUBREL, SUBACK, SUBSCRIBE, UNSUBACK, UNSUBSCRIBEFields 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.intgets MQTT Packet ID.protected intbytegetQoS()Returns the QoS.Returns the Topic Name.protected intbooleanReturns if the DUP flag is set or not.booleanReturns if the RETAIN flag is set or not.protected voidprotected voidvoidsetAppMessage(String strMsg) Sets the Application Message.voidsetDupFlag(boolean bFlag) Sets the DUP flag.voidsetPacketID(int nID) sets MQTT Packet ID.voidsetQoS(byte qos) Sets the QoS.voidsetRetainFlag(boolean bFlag) Sets the RETAIN flag.voidsetTopicName(String strTopic) Sets the Topic Name.toString()Returns the string representation of the CMMqttEventFixedHeader.protected voidprotected voidMethods inherited from class kr.ac.konkuk.ccslab.cm.event.mqttevent.CMMqttEventFixedHeader
getBinaryString, getBinaryStringOfByte, getFixedHeaderByteNum, getFlag, getPacketType, getRemainingLength, marshallFixedHeader, setFixedHeader, setFlag, setPacketType, setRemainingLength, unmarshallFixedHeaderMethods inherited from class kr.ac.konkuk.ccslab.cm.event.mqttevent.CMMqttEvent
getByteNum, marshallBody, unmarshallBodyMethods 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:
getPacketIDin classCMMqttEvent- Returns:
- packet ID.
-
getVarHeaderByteNum
protected int getVarHeaderByteNum()- Specified by:
getVarHeaderByteNumin classCMMqttEvent
-
marshallVarHeader
protected void marshallVarHeader()- Specified by:
marshallVarHeaderin classCMMqttEvent
-
unmarshallVarHeader
- Specified by:
unmarshallVarHeaderin 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:
getPayloadByteNumin classCMMqttEvent
-
marshallPayload
protected void marshallPayload()- Specified by:
marshallPayloadin classCMMqttEvent
-
unmarshallPayload
- Specified by:
unmarshallPayloadin classCMMqttEvent
-
toString
Description copied from class:CMMqttEventFixedHeaderReturns the string representation of the CMMqttEventFixedHeader.- Overrides:
toStringin classCMMqttEventFixedHeader- Returns:
- string of this object.
-