Package com.hivemq.adapter.sdk.api
Interface ProtocolAdapterPublishBuilder
-
public interface ProtocolAdapterPublishBuilder
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description @NotNull CompletableFuture<ProtocolPublishResult>send()Sends the publish to the edge for publishing@NotNull ProtocolAdapterPublishBuilderwithAdapter(@NotNull ProtocolAdapter adapter)@NotNull ProtocolAdapterPublishBuilderwithContextInformation(@NotNull String key, @NotNull String value)Adds additional information to the publish@NotNull ProtocolAdapterPublishBuilderwithMessageExpiryInterval(long messageExpiryInterval)@NotNull ProtocolAdapterPublishBuilderwithPayload(byte @NotNull [] payload)@NotNull ProtocolAdapterPublishBuilderwithQoS(int qos)@NotNull ProtocolAdapterPublishBuilderwithRetain(boolean retained)@NotNull ProtocolAdapterPublishBuilderwithTopic(@NotNull String mqttTopic)@NotNull ProtocolAdapterPublishBuilderwithUserProperty(@NotNull String name, @NotNull String value)Adds a user property to the publisj
-
-
-
Method Detail
-
withTopic
@NotNull @NotNull ProtocolAdapterPublishBuilder withTopic(@NotNull @NotNull String mqttTopic)
- Parameters:
mqttTopic- the mqtt topic of the publish- Returns:
- the builder for fluent API
-
withPayload
@NotNull @NotNull ProtocolAdapterPublishBuilder withPayload(byte @NotNull [] payload)
- Parameters:
payload- the payload of the publish- Returns:
- the builder for fluent API
-
withQoS
@NotNull @NotNull ProtocolAdapterPublishBuilder withQoS(int qos)
- Parameters:
qos- the qos of the publish- Returns:
- the builder for fluent API
-
withMessageExpiryInterval
@NotNull @NotNull ProtocolAdapterPublishBuilder withMessageExpiryInterval(long messageExpiryInterval)
- Parameters:
messageExpiryInterval- the message expiry of the publish- Returns:
- the builder for fluent API
-
withUserProperty
@NotNull @NotNull ProtocolAdapterPublishBuilder withUserProperty(@NotNull @NotNull String name, @NotNull @NotNull String value)
Adds a user property to the publisj- Parameters:
name- the name of the user propertyvalue- the value of the user property- Returns:
- the builder for fluent API
-
withRetain
@NotNull @NotNull ProtocolAdapterPublishBuilder withRetain(boolean retained)
- Parameters:
retained- true: message gets published as a retained message, false: message gets published as a normal publish- Returns:
- the builder for fluent API
-
withContextInformation
@NotNull @NotNull ProtocolAdapterPublishBuilder withContextInformation(@NotNull @NotNull String key, @NotNull @NotNull String value)
Adds additional information to the publish- Parameters:
key- the key of the additional informationvalue- the value of the additional information- Returns:
- the builder for fluent API
-
withAdapter
@NotNull @NotNull ProtocolAdapterPublishBuilder withAdapter(@NotNull @NotNull ProtocolAdapter adapter)
- Parameters:
adapter- the adapter for which the publish gets created.- Returns:
- the builder for fluent API
-
send
@NotNull @NotNull CompletableFuture<ProtocolPublishResult> send()
Sends the publish to the edge for publishing- Returns:
- the builder for fluent API
-
-