Class CMMqttEventUNSUBSCRIBE


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

    • CMMqttEventUNSUBSCRIBE

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

      public CMMqttEventUNSUBSCRIBE(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
    • setTopicList

      public void setTopicList(CMList<String> topicList)
      Sets the list of Topic Filters.
      Parameters:
      topicList - - the list of Topic Filters
    • getTopicList

      public CMList<String> getTopicList()
      Returns the list of Topic Filters.
      Returns:
      the list of Topic Filters.
    • addTopic

      public boolean addTopic(String strTopic)
      Adds the Topic Filter to the list.
      Parameters:
      strTopic - - the Topic Filter
      Returns:
      true if the Topic Filter is successfully added; false otherwise.
    • removeTopic

      public boolean removeTopic(String strTopic)
      Removes the Topic Filter from the list.
      Parameters:
      strTopic - - the Topic Filter
      Returns:
      true if the Topic Filter is successfully removed; false otherwise.
    • removeAllTopic

      public void removeAllTopic()
      Removes all Topic Filters 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.