Package io.netty.handler.codec.mqtt
Class MqttPublishMessage
- java.lang.Object
-
- io.netty.handler.codec.mqtt.MqttMessage
-
- io.netty.handler.codec.mqtt.MqttPublishMessage
-
- All Implemented Interfaces:
ByteBufHolder,ReferenceCounted
public class MqttPublishMessage extends MqttMessage implements ByteBufHolder
See MQTTV3.1/publish
-
-
Field Summary
-
Fields inherited from class io.netty.handler.codec.mqtt.MqttMessage
DISCONNECT, PINGREQ, PINGRESP
-
-
Constructor Summary
Constructors Constructor Description MqttPublishMessage(MqttFixedHeader mqttFixedHeader, MqttPublishVariableHeader variableHeader, ByteBuf payload)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ByteBufcontent()Return the data which is held by thisByteBufHolder.MqttPublishMessagecopy()Creates a deep copy of thisByteBufHolder.MqttPublishMessageduplicate()Duplicates thisByteBufHolder.ByteBufpayload()intrefCnt()Returns the reference count of this object.booleanrelease()Decreases the reference count by1and deallocates this object if the reference count reaches at0.booleanrelease(int decrement)Decreases the reference count by the specifieddecrementand deallocates this object if the reference count reaches at0.MqttPublishMessagereplace(ByteBuf content)Returns a newByteBufHolderwhich contains the specifiedcontent.MqttPublishMessageretain()Increases the reference count by1.MqttPublishMessageretain(int increment)Increases the reference count by the specifiedincrement.MqttPublishMessageretainedDuplicate()Duplicates thisByteBufHolder.MqttPublishMessagetouch()Records the current access location of this object for debugging purposes.MqttPublishMessagetouch(java.lang.Object hint)Records the current access location of this object with an additional arbitrary information for debugging purposes.MqttPublishVariableHeadervariableHeader()-
Methods inherited from class io.netty.handler.codec.mqtt.MqttMessage
decoderResult, fixedHeader, toString
-
-
-
-
Constructor Detail
-
MqttPublishMessage
public MqttPublishMessage(MqttFixedHeader mqttFixedHeader, MqttPublishVariableHeader variableHeader, ByteBuf payload)
-
-
Method Detail
-
variableHeader
public MqttPublishVariableHeader variableHeader()
- Overrides:
variableHeaderin classMqttMessage
-
payload
public ByteBuf payload()
- Overrides:
payloadin classMqttMessage
-
content
public ByteBuf content()
Description copied from interface:ByteBufHolderReturn the data which is held by thisByteBufHolder.- Specified by:
contentin interfaceByteBufHolder
-
copy
public MqttPublishMessage copy()
Description copied from interface:ByteBufHolderCreates a deep copy of thisByteBufHolder.- Specified by:
copyin interfaceByteBufHolder
-
duplicate
public MqttPublishMessage duplicate()
Description copied from interface:ByteBufHolderDuplicates thisByteBufHolder. Be aware that this will not automatically callByteBufHolder.retain().- Specified by:
duplicatein interfaceByteBufHolder
-
retainedDuplicate
public MqttPublishMessage retainedDuplicate()
Description copied from interface:ByteBufHolderDuplicates thisByteBufHolder. This method returns a retained duplicate unlikeByteBufHolder.duplicate().- Specified by:
retainedDuplicatein interfaceByteBufHolder- See Also:
ByteBuf.retainedDuplicate()
-
replace
public MqttPublishMessage replace(ByteBuf content)
Description copied from interface:ByteBufHolderReturns a newByteBufHolderwhich contains the specifiedcontent.- Specified by:
replacein interfaceByteBufHolder
-
refCnt
public int refCnt()
Description copied from interface:ReferenceCountedReturns the reference count of this object. If0, it means this object has been deallocated.- Specified by:
refCntin interfaceReferenceCounted
-
retain
public MqttPublishMessage retain()
Description copied from interface:ReferenceCountedIncreases the reference count by1.- Specified by:
retainin interfaceByteBufHolder- Specified by:
retainin interfaceReferenceCounted
-
retain
public MqttPublishMessage retain(int increment)
Description copied from interface:ReferenceCountedIncreases the reference count by the specifiedincrement.- Specified by:
retainin interfaceByteBufHolder- Specified by:
retainin interfaceReferenceCounted
-
touch
public MqttPublishMessage touch()
Description copied from interface:ReferenceCountedRecords the current access location of this object for debugging purposes. If this object is determined to be leaked, the information recorded by this operation will be provided to you viaResourceLeakDetector. This method is a shortcut totouch(null).- Specified by:
touchin interfaceByteBufHolder- Specified by:
touchin interfaceReferenceCounted
-
touch
public MqttPublishMessage touch(java.lang.Object hint)
Description copied from interface:ReferenceCountedRecords the current access location of this object with an additional arbitrary information for debugging purposes. If this object is determined to be leaked, the information recorded by this operation will be provided to you viaResourceLeakDetector.- Specified by:
touchin interfaceByteBufHolder- Specified by:
touchin interfaceReferenceCounted
-
release
public boolean release()
Description copied from interface:ReferenceCountedDecreases the reference count by1and deallocates this object if the reference count reaches at0.- Specified by:
releasein interfaceReferenceCounted- Returns:
trueif and only if the reference count became0and this object has been deallocated
-
release
public boolean release(int decrement)
Description copied from interface:ReferenceCountedDecreases the reference count by the specifieddecrementand deallocates this object if the reference count reaches at0.- Specified by:
releasein interfaceReferenceCounted- Returns:
trueif and only if the reference count became0and this object has been deallocated
-
-