Interface Mqtt3Publish
- All Superinterfaces:
Mqtt3Message
MQTT 3 Publish message. This message is translated from and to an MQTT 3 PUBLISH packet.
- Since:
- 1.0
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoidAcknowledges this Publish message.static @NotNull Mqtt3PublishBuilderbuilder()Creates a builder for a Publish message.extend()Creates a builder for extending this Publish message.byte @NotNull []getQos()getTopic()default @NotNull Mqtt3MessageTypegetType()booleanisRetain()
-
Field Details
-
DEFAULT_QOS
DefaultQoSlevel of a Publish message. It is chosen asMqttQos.AT_MOST_ONCEas the QoS level should be explicitly specified if special delivery guarantees are needed.
-
-
Method Details
-
builder
Creates a builder for a Publish message.- Returns:
- the created builder.
-
getTopic
- Returns:
- the topic of this Publish message.
-
getPayload
- Returns:
- the optional payload of this Publish message.
-
getPayloadAsBytes
byte @NotNull [] getPayloadAsBytes()- Returns:
- the payload of this Publish message as a byte array. Empty byte array if the payload is not present.
-
getQos
- Returns:
- the QoS of this Publish message.
-
isRetain
boolean isRetain()- Returns:
- whether this Publish message is a retained message.
-
acknowledge
void acknowledge()Acknowledges this Publish message.- Throws:
UnsupportedOperationException- if manual acknowledgement is not enabled.IllegalStateException- if the message is acknowledged more than once.- Since:
- 1.2
-
getType
- Specified by:
getTypein interfaceMqtt3Message- Returns:
- the type of this MQTT message.
-
extend
@NotNull Mqtt3PublishBuilder.Complete extend()Creates a builder for extending this Publish message.- Returns:
- the created builder.
-