@DoNotImplement public interface Mqtt5Publish extends Mqtt5Message
Modifier and Type | Field and Description |
---|---|
static @NotNull MqttQos |
DEFAULT_QOS
Default
QoS level of a Publish message. |
Modifier and Type | Method and Description |
---|---|
void |
acknowledge()
Acknowledges this Publish message.
|
@NotNull Mqtt5WillPublish |
asWill()
Transforms this Publish message into a Will Publish with the same properties.
|
static @NotNull Mqtt5PublishBuilder |
builder()
Creates a builder for a Publish message.
|
Mqtt5PublishBuilder.Complete |
extend()
Creates a builder for extending this Publish message.
|
@NotNull Optional<MqttUtf8String> |
getContentType() |
@NotNull Optional<ByteBuffer> |
getCorrelationData() |
@NotNull OptionalLong |
getMessageExpiryInterval() |
@NotNull Optional<ByteBuffer> |
getPayload() |
byte[] |
getPayloadAsBytes() |
@NotNull Optional<Mqtt5PayloadFormatIndicator> |
getPayloadFormatIndicator() |
@NotNull MqttQos |
getQos() |
@NotNull Optional<MqttTopic> |
getResponseTopic() |
@NotNull MqttTopic |
getTopic() |
default @NotNull Mqtt5MessageType |
getType() |
@NotNull Mqtt5UserProperties |
getUserProperties() |
boolean |
isRetain() |
@NotNull static final @NotNull MqttQos DEFAULT_QOS
QoS
level of a Publish message. It is chosen as MqttQos.AT_MOST_ONCE
as the QoS
level should be explicitly specified if special delivery guarantees are needed.@NotNull static @NotNull Mqtt5PublishBuilder builder()
@NotNull @NotNull Optional<ByteBuffer> getPayload()
byte[] getPayloadAsBytes()
boolean isRetain()
@NotNull @NotNull OptionalLong getMessageExpiryInterval()
@NotNull @NotNull Optional<Mqtt5PayloadFormatIndicator> getPayloadFormatIndicator()
@NotNull @NotNull Optional<MqttUtf8String> getContentType()
@NotNull @NotNull Optional<MqttTopic> getResponseTopic()
@NotNull @NotNull Optional<ByteBuffer> getCorrelationData()
@NotNull @NotNull Mqtt5UserProperties getUserProperties()
void acknowledge()
UnsupportedOperationException
- if manual acknowledgement is not enabled.IllegalStateException
- if the message is acknowledged more than once.@NotNull default @NotNull Mqtt5MessageType getType()
getType
in interface Mqtt5Message
@NotNull @NotNull Mqtt5WillPublish asWill()
Mqtt5PublishBuilder.Complete extend()