Interface WillPublishPacket
-
- All Superinterfaces:
PublishPacket
- All Known Subinterfaces:
ModifiableWillPublish
@DoNotImplement public interface WillPublishPacket extends PublishPacket
Contains all information for the Will Publish that is part of a CONNECT packet.- Since:
- 4.0.0, CE 2019.1
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description static @NotNull WillPublishBuilder
builder()
A builder that can be used to create an MQTT 5WillPublishPacket
.long
getTimestamp()
The timestamp when the CONNECT packet with the Will Publish arrived at the broker.long
getWillDelay()
Delay in seconds before the Will Publish is sent.-
Methods inherited from interface com.hivemq.extension.sdk.api.packets.publish.PublishPacket
getContentType, getCorrelationData, getDupFlag, getMessageExpiryInterval, getPacketId, getPayload, getPayloadFormatIndicator, getQos, getResponseTopic, getRetain, getSubscriptionIdentifiers, getTopic, getUserProperties
-
-
-
-
Method Detail
-
builder
@NotNull static @NotNull WillPublishBuilder builder()
A builder that can be used to create an MQTT 5WillPublishPacket
.- Returns:
- A new
WillPublishBuilder
to create a Will Publish. - Since:
- 4.0.0, CE 2019.1
-
getWillDelay
long getWillDelay()
Delay in seconds before the Will Publish is sent.- Returns:
- The will delay.
- Since:
- 4.0.0, CE 2019.1
-
getTimestamp
long getTimestamp()
The timestamp when the CONNECT packet with the Will Publish arrived at the broker.When the Will Publish is sent to subscribers (after the client disconnected ungracefully and the Will delay has passed) the created PUBLISH packet will carry the timestamp that represents the moment when the delivery started.
The returned timestamp is a UNIX timestamp since midnight, January 1, 1970 UTC in milliseconds.
- Specified by:
getTimestamp
in interfacePublishPacket
- Returns:
- The timestamp.
- Since:
- 4.4.0, CE 2020.4
-
-