Class CMMqttEventPUBLISH


public class CMMqttEventPUBLISH extends CMMqttEventFixedHeader
This class represents a CM event that belongs to the variable header and payload of MQTT PUBLISH packet.
See Also:
  • Constructor Details

    • CMMqttEventPUBLISH

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

      public CMMqttEventPUBLISH(ByteBuffer msg)
  • 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

      public void setTopicName(String strTopic)
      Sets the Topic Name.
      Parameters:
      strTopic - - the Topic Name
    • getTopicName

      public String 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 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
    • setAppMessage

      public void setAppMessage(String strMsg)
      Sets the Application Message.
      Parameters:
      strMsg - - the Application Message
    • getAppMessage

      public String getAppMessage()
      Returns the Application Message.
      Returns:
      the Application Message.
    • 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.