Class DelayInformation
- java.lang.Object
-
- org.jivesoftware.smackx.delay.packet.DelayInformation
-
- All Implemented Interfaces:
Element
,ExtensionElement
,FullyQualifiedElement
,NamedElement
,XmlLangElement
public class DelayInformation extends Object implements ExtensionElement
Represents timestamp information about data stored for later delivery. A DelayInformation will always includes the timestamp when the stanza was originally sent and may include more information such as the JID of the entity that originally sent the stanza as well as the reason for the delay.
-
-
Constructor Summary
Constructors Constructor Description DelayInformation(Date stamp)
DelayInformation(Date stamp, String from, String reason)
Creates a new instance with the specified timestamp.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static DelayInformation
from(Stanza packet)
Return delay information from the given stanza.String
getElementName()
Returns the root element name.String
getFrom()
Returns the JID of the entity that originally sent the stanza or that delayed the delivery of the stanza ornull
if this information is not available.static DelayInformation
getFrom(Stanza packet)
Deprecated.usefrom(Stanza)
insteadString
getNamespace()
Returns the root element XML namespace.String
getReason()
Returns a natural-language description of the reason for the delay ornull
if this information is not available.Date
getStamp()
Returns the timestamp when the stanza was originally sent.XmlStringBuilder
toXML(XmlEnvironment enclosingNamespace)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.jivesoftware.smack.packet.FullyQualifiedElement
getLanguage, getQName
-
-
-
-
Field Detail
-
ELEMENT
public static final String ELEMENT
- See Also:
- Constant Field Values
-
NAMESPACE
public static final String NAMESPACE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
DelayInformation
public DelayInformation(Date stamp, String from, String reason)
Creates a new instance with the specified timestamp.- Parameters:
stamp
- the timestampfrom
- senderreason
- reason of delay.
-
DelayInformation
public DelayInformation(Date stamp)
-
-
Method Detail
-
getFrom
public String getFrom()
Returns the JID of the entity that originally sent the stanza or that delayed the delivery of the stanza ornull
if this information is not available.- Returns:
- the JID of the entity that originally sent the stanza or that delayed the delivery of the packet.
-
getStamp
public Date getStamp()
Returns the timestamp when the stanza was originally sent. The returned Date is be understood as UTC.- Returns:
- the timestamp when the stanza was originally sent.
-
getReason
public String getReason()
Returns a natural-language description of the reason for the delay ornull
if this information is not available.- Returns:
- a natural-language description of the reason for the delay or
null
.
-
getElementName
public String getElementName()
Description copied from interface:NamedElement
Returns the root element name.- Specified by:
getElementName
in interfaceNamedElement
- Returns:
- the element name.
-
getNamespace
public String getNamespace()
Description copied from interface:FullyQualifiedElement
Returns the root element XML namespace.- Specified by:
getNamespace
in interfaceFullyQualifiedElement
- Returns:
- the namespace.
-
toXML
public XmlStringBuilder toXML(XmlEnvironment enclosingNamespace)
-
getFrom
@Deprecated public static DelayInformation getFrom(Stanza packet)
Deprecated.usefrom(Stanza)
insteadReturn delay information from the given stanza.- Parameters:
packet
- TODO javadoc me please- Returns:
- the DelayInformation or null
-
from
public static DelayInformation from(Stanza packet)
Return delay information from the given stanza.- Parameters:
packet
- TODO javadoc me please- Returns:
- the DelayInformation or null
-
-