Class CMMqttEventSUBSCRIBE


public class CMMqttEventSUBSCRIBE extends CMMqttEventFixedHeader
This class represents a CM event that is the variable header and payload of MQTT SUBSCRIBE packet.
See Also:
  • Constructor Details

    • CMMqttEventSUBSCRIBE

      public CMMqttEventSUBSCRIBE()
      Creates an instance of the CMMqttEventSUBSCRIBE class.
    • CMMqttEventSUBSCRIBE

      public CMMqttEventSUBSCRIBE(ByteBuffer msg)
  • 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:
      getPacketID in class CMMqttEvent
      Returns:
      Packet ID.
    • getVarHeaderByteNum

      protected int getVarHeaderByteNum()
      Specified by:
      getVarHeaderByteNum in class CMMqttEvent
    • marshallVarHeader

      protected void marshallVarHeader()
      Specified by:
      marshallVarHeader in class CMMqttEvent
    • unmarshallVarHeader

      protected void unmarshallVarHeader(ByteBuffer buf)
      Specified by:
      unmarshallVarHeader in class CMMqttEvent
    • setTopicQoSList

      public void setTopicQoSList(CMList<CMMqttTopicQoS> topicQoSList)
      Sets the list of Topic Filter / QoS pairs.
      Parameters:
      topicQoSList - - the list of Topic Filter / QoS pairs.
    • getTopicQoSList

      public CMList<CMMqttTopicQoS> getTopicQoSList()
      Returns the list of Topic Filter / QoS pairs.
      Returns:
      the list of Topic Filter / QoS pairs.
    • addTopicQoS

      public boolean addTopicQoS(String strTopic, byte qos)
      Adds the Topic Filter / QoS pair to the list.
      Parameters:
      strTopic - - the Topic Filter
      qos - - the QoS
      Returns:
      true if the Topic Filter / QoS pair is successfully added; false otherwise.
    • removeTopicQoS

      public boolean removeTopicQoS(String strTopic)
      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:
      getPayloadByteNum in class CMMqttEvent
    • marshallPayload

      protected void marshallPayload()
      Specified by:
      marshallPayload in class CMMqttEvent
    • unmarshallPayload

      protected void unmarshallPayload(ByteBuffer buf)
      Specified by:
      unmarshallPayload in class CMMqttEvent
    • toString

      public String toString()
      Description copied from class: CMMqttEventFixedHeader
      Returns the string representation of the CMMqttEventFixedHeader.
      Overrides:
      toString in class CMMqttEventFixedHeader
      Returns:
      string of this object.