Interface Publish
- All Known Subinterfaces:
RetainedPublish
@DoNotImplement public interface Publish
Represents a PUBLISH.
Contains all values of an MQTT 5 PUBLISH, but will also used to represent MQTT 3 publishes.
- Since:
- 4.0.0, CE 2019.1
-
Method Summary
Modifier and Type Method Description static PublishBuilderbuilder()Deprecated.UseBuilders.publish()instead@NotNull Optional<String>getContentType()If this property is present, this is the content type.@NotNull Optional<@Immutable ByteBuffer>getCorrelationData()If this property is present, this is the correlation data.@NotNull Optional<Long>getMessageExpiryInterval()If this property is present, this is the message expiry interval.@NotNull Optional<@Immutable ByteBuffer>getPayload()If this property is present, this is the payload.@NotNull Optional<PayloadFormatIndicator>getPayloadFormatIndicator()If this property is present, this is the payload format indicator.@NotNull QosgetQos()The quality of service level of the publish.@NotNull Optional<String>getResponseTopic()If this property is present, this is the response topic.booleangetRetain()Iftruethis message is a retained message, forfalsethis is just a normal publish.@NotNull StringgetTopic()The topic filter the message is published to.@Immutable @NotNull UserPropertiesgetUserProperties()TheUserPropertiesof the PUBLISH.
-
Method Details
-
builder
Deprecated.UseBuilders.publish()instead- Returns:
- A new
PublishBuilderto create aPublish. - Since:
- 4.0.0, CE 2019.1
-
getQos
The quality of service level of the publish.- Returns:
- The qos.
- Since:
- 4.0.0, CE 2019.1
-
getRetain
boolean getRetain()Iftruethis message is a retained message, forfalsethis is just a normal publish.- Returns:
- The retain flag.
- Since:
- 4.0.0, CE 2019.1
-
getTopic
The topic filter the message is published to.- Returns:
- The topic.
- Since:
- 4.0.0, CE 2019.1
-
getPayloadFormatIndicator
If this property is present, this is the payload format indicator.- Returns:
- An
Optionalthat contains the payload format indicator if present. - Since:
- 4.0.0, CE 2019.1
-
getMessageExpiryInterval
If this property is present, this is the message expiry interval.- Returns:
- An
Optionalthat contains the message expiry interval if present. - Since:
- 4.0.0, CE 2019.1
-
getResponseTopic
If this property is present, this is the response topic.- Returns:
- An
Optionalthat contains the response topic if present. - Since:
- 4.0.0, CE 2019.1
-
getCorrelationData
If this property is present, this is the correlation data.The ByteBuffer returned by this method is
read onlyand will throw aReadOnlyBufferExceptionif handled incorrectly.- Returns:
- An
Optionalthat contains the correlation data if present. - Since:
- 4.0.0, CE 2019.1
-
getContentType
If this property is present, this is the content type.- Returns:
- An
Optionalthat contains the content type if present. - Since:
- 4.0.0, CE 2019.1
-
getPayload
If this property is present, this is the payload.The ByteBuffer returned by this method is
read onlyand will throw aReadOnlyBufferExceptionif handled incorrectly.- Returns:
- An
Optionalthat contains the payload if present. - Since:
- 4.0.0, CE 2019.1
-
getUserProperties
TheUserPropertiesof the PUBLISH.- Returns:
- The user properties.
- Since:
- 4.0.0, CE 2019.1
-