Class DelayedDelivery
- java.lang.Object
-
- rocks.xmpp.extensions.delay.model.DelayedDelivery
-
public final class DelayedDelivery extends Object
The implementation of the<delay/>
element in theurn:xmpp:delay
namespace.The XML namespace defined herein is used to provide timestamp information about data stored for later delivery. The most common uses of this namespace are to stamp:
- A message that is sent to an offline entity and stored for later delivery (see Best Practices for Handling Offline Messages).
- The last available presence stanza sent by a connected client to a server.
- Messages cached by a Multi-User Chat room for delivery to new participants when they join the room.
- See Also:
- XEP-0203: Delayed Delivery, XML Schema
-
-
Constructor Summary
Constructors Constructor Description DelayedDelivery(Instant timestamp)
Creates a element with only a timestamp attribute.DelayedDelivery(Instant timestamp, Jid from, String reason)
Creates a delayed delivery element with all attributes.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Jid
getFrom()
Gets the Jabber ID of the entity that originally sent the XML stanza or that delayed the delivery of the stanza (e.g., the address of a multi-user chat room).String
getReason()
Gets the natural-language description of the reason for the delay.Instant
getTimeStamp()
Gets the time when the XML stanza was originally sent.static Instant
sendDate(Stanza stanza)
Gets the original send date of a stanza, i.e.String
toString()
-
-
-
Field Detail
-
NAMESPACE
public static final String NAMESPACE
urn:xmpp:delay- See Also:
- Constant Field Values
-
-
Constructor Detail
-
DelayedDelivery
public DelayedDelivery(Instant timestamp)
Creates a element with only a timestamp attribute.- Parameters:
timestamp
- The timestamp.
-
-
Method Detail
-
sendDate
public static Instant sendDate(Stanza stanza)
Gets the original send date of a stanza, i.e.Instant.now()
, if no delayed deliver information is available or the timestamp of delayed delivery.- Parameters:
stanza
- The stanza.- Returns:
- The original send date of a stanza or
Instant.now()
.
-
getFrom
public final Jid getFrom()
Gets the Jabber ID of the entity that originally sent the XML stanza or that delayed the delivery of the stanza (e.g., the address of a multi-user chat room).- Returns:
- The entity who originally sent the XML stanza.
-
getTimeStamp
public final Instant getTimeStamp()
Gets the time when the XML stanza was originally sent.- Returns:
- The time when the XML stanza was originally sent.
-
getReason
public final String getReason()
Gets the natural-language description of the reason for the delay.- Returns:
- The natural-language description of the reason for the delay.
-
-