Class CMMqttEventSUBSCRIBE
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.CMMqttEventSUBSCRIBE
This class represents a CM event that is the variable header and payload of
MQTT SUBSCRIBE 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 CMMqttEventSUBSCRIBE class. -
Method Summary
Modifier and TypeMethodDescriptionbooleanaddTopicQoS(String strTopic, byte qos) Adds the Topic Filter / QoS pair to the list.intgets MQTT Packet ID.protected intReturns the list of Topic Filter / QoS pairs.protected intprotected voidprotected voidvoidRemoves all Topic Filter / QoS pairs from the list.booleanremoveTopicQoS(String strTopic) Removes the Topic Filter / QoS pair from the list.voidsetPacketID(int nID) sets MQTT Packet ID.voidsetTopicQoSList(CMList<CMMqttTopicQoS> topicQoSList) Sets the list of Topic Filter / QoS pairs.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
-
CMMqttEventSUBSCRIBE
public CMMqttEventSUBSCRIBE()Creates an instance of the CMMqttEventSUBSCRIBE class. -
CMMqttEventSUBSCRIBE
-
-
Method Details
-
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
-
setTopicQoSList
Sets the list of Topic Filter / QoS pairs.- Parameters:
topicQoSList- - the list of Topic Filter / QoS pairs.
-
getTopicQoSList
Returns the list of Topic Filter / QoS pairs.- Returns:
- the list of Topic Filter / QoS pairs.
-
addTopicQoS
Adds the Topic Filter / QoS pair to the list.- Parameters:
strTopic- - the Topic Filterqos- - the QoS- Returns:
- true if the Topic Filter / QoS pair is successfully added; false otherwise.
-
removeTopicQoS
Removes the Topic Filter / QoS pair from the list.- Parameters:
strTopic- - the Topic Filter- Returns:
- true if the Topic Filter / QoS pair is successfully removed; false otherwise.
-
removeAllTopicQoS
public void removeAllTopicQoS()Removes all Topic Filter / QoS pairs from the list. -
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.
-