Package com.hivemq.adapter.sdk.api
Interface ProtocolAdapterPublishBuilder
public interface ProtocolAdapterPublishBuilder
-
Method Summary
Modifier and TypeMethodDescriptionsend()Sends the publish to the edge for publishingwithAdapter(@NotNull ProtocolAdapter adapter) withContextInformation(@NotNull String key, @NotNull String value) Adds additional information to the publishwithMessageExpiryInterval(long messageExpiryInterval) withPayload(byte @NotNull [] payload) withQoS(int qos) withRetain(boolean retained) withUserProperty(@NotNull String name, @NotNull String value) Adds a user property to the publisj
-
Method Details
-
withTopic
- Parameters:
mqttTopic- the mqtt topic of the publish- Returns:
- the builder for fluent API
-
withPayload
- Parameters:
payload- the payload of the publish- Returns:
- the builder for fluent API
-
withQoS
- 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
- 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
Sends the publish to the edge for publishing- Returns:
- the builder for fluent API
-