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 PublishBuilder
builder()
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 Qos
getQos()
The quality of service level of the publish.@NotNull Optional<String>
getResponseTopic()
If this property is present, this is the response topic.boolean
getRetain()
Iftrue
this message is a retained message, forfalse
this is just a normal publish.@NotNull String
getTopic()
The topic filter the message is published to.@Immutable @NotNull UserProperties
getUserProperties()
TheUserProperties
of the PUBLISH.
-
-
-
Method Detail
-
builder
@Deprecated(since="4.4.0") static PublishBuilder builder()
Deprecated.UseBuilders.publish()
instead- Returns:
- A new
PublishBuilder
to 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()
Iftrue
this message is a retained message, forfalse
this 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
Optional
that 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
Optional
that 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
Optional
that 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 only
and will throw aReadOnlyBufferException
if handled incorrectly.- Returns:
- An
Optional
that 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
Optional
that 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 only
and will throw aReadOnlyBufferException
if handled incorrectly.- Returns:
- An
Optional
that contains the payload if present. - Since:
- 4.0.0, CE 2019.1
-
getUserProperties
@Immutable @NotNull @Immutable @NotNull UserProperties getUserProperties()
TheUserProperties
of the PUBLISH.- Returns:
- The user properties.
- Since:
- 4.0.0, CE 2019.1
-
-