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
All Methods Static Methods Instance Methods Abstract Methods Deprecated Methods 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 Detail
-
builder
@Deprecated(since="4.4.0") static PublishBuilder builder()
Deprecated.UseBuilders.publish()instead- Returns:
- A new
PublishBuilderto create aPublish. - Since:
- 4.0.0, CE 2019.1
-
getQos
@NotNull Qos 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
@NotNull String getTopic()
The topic filter the message is published to.- Returns:
- The topic.
- Since:
- 4.0.0, CE 2019.1
-
getPayloadFormatIndicator
@NotNull Optional<PayloadFormatIndicator> 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
@NotNull Optional<Long> 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
@NotNull Optional<String> 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
@NotNull Optional<@Immutable ByteBuffer> 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
@NotNull Optional<String> 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
@NotNull Optional<@Immutable ByteBuffer> 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
@Immutable @NotNull @Immutable @NotNull UserProperties getUserProperties()
TheUserPropertiesof the PUBLISH.- Returns:
- The user properties.
- Since:
- 4.0.0, CE 2019.1
-
-