public final class DelayedDelivery
extends java.lang.Object
The implementation of the <delay/>
element in the urn:xmpp:delay
namespace.
This class is immutable.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.
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
NAMESPACE
urn:xmpp:delay
|
Constructor and Description |
---|
DelayedDelivery(java.time.Instant timestamp)
Creates a element with only a timestamp attribute.
|
DelayedDelivery(java.time.Instant timestamp,
Jid from,
java.lang.String reason)
Creates a delayed delivery element with all attributes.
|
Modifier and Type | Method and 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).
|
java.lang.String |
getReason()
Gets the natural-language description of the reason for the delay.
|
java.time.Instant |
getTimeStamp()
Gets the time when the XML stanza was originally sent.
|
static java.time.Instant |
sendDate(Stanza stanza)
Gets the original send date of a stanza, i.e.
|
java.lang.String |
toString() |
public static final java.lang.String NAMESPACE
urn:xmpp:delay
public DelayedDelivery(java.time.Instant timestamp)
Creates a element with only a timestamp attribute.
timestamp
- The timestamp.public DelayedDelivery(java.time.Instant timestamp, Jid from, java.lang.String reason)
Creates a delayed delivery element with all attributes.
timestamp
- The timestamp.from
- The sender.reason
- The reason.public static java.time.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.
stanza
- The stanza.Instant.now()
.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).
public final java.time.Instant getTimeStamp()
Gets the time when the XML stanza was originally sent.
public final java.lang.String getReason()
Gets the natural-language description of the reason for the delay.
public final java.lang.String toString()
toString
in class java.lang.Object
Copyright © 2014–2019 XMPP.rocks. All rights reserved.