Class DelayInformation
- java.lang.Object
-
- org.jivesoftware.smackx.delay.packet.DelayInformation
-
- All Implemented Interfaces:
org.jivesoftware.smack.packet.Element
,org.jivesoftware.smack.packet.ExtensionElement
,org.jivesoftware.smack.packet.NamedElement
,org.jivesoftware.smack.packet.XmlElement
,org.jivesoftware.smack.packet.XmlLangElement
public class DelayInformation extends java.lang.Object implements org.jivesoftware.smack.packet.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(java.util.Date stamp)
DelayInformation(java.util.Date stamp, java.lang.String from, java.lang.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(org.jivesoftware.smack.packet.Stanza packet)
Return delay information from the given stanza.java.lang.String
getElementName()
java.lang.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(org.jivesoftware.smack.packet.Stanza packet)
Deprecated.usefrom(Stanza)
insteadjava.lang.String
getNamespace()
java.lang.String
getReason()
Returns a natural-language description of the reason for the delay ornull
if this information is not available.java.util.Date
getStamp()
Returns the timestamp when the stanza was originally sent.org.jivesoftware.smack.util.XmlStringBuilder
toXML(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace)
-
-
-
Field Detail
-
ELEMENT
public static final java.lang.String ELEMENT
- See Also:
- Constant Field Values
-
NAMESPACE
public static final java.lang.String NAMESPACE
- See Also:
- Constant Field Values
-
QNAME
public static final javax.xml.namespace.QName QNAME
-
-
Constructor Detail
-
DelayInformation
public DelayInformation(java.util.Date stamp, java.lang.String from, java.lang.String reason)
Creates a new instance with the specified timestamp.- Parameters:
stamp
- the timestampfrom
- senderreason
- reason of delay.
-
DelayInformation
public DelayInformation(java.util.Date stamp)
-
-
Method Detail
-
getFrom
public java.lang.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 java.util.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 java.lang.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 java.lang.String getElementName()
- Specified by:
getElementName
in interfaceorg.jivesoftware.smack.packet.NamedElement
-
getNamespace
public java.lang.String getNamespace()
- Specified by:
getNamespace
in interfaceorg.jivesoftware.smack.packet.XmlElement
-
toXML
public org.jivesoftware.smack.util.XmlStringBuilder toXML(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace)
- Specified by:
toXML
in interfaceorg.jivesoftware.smack.packet.Element
-
getFrom
@Deprecated public static DelayInformation getFrom(org.jivesoftware.smack.packet.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(org.jivesoftware.smack.packet.Stanza packet)
Return delay information from the given stanza.- Parameters:
packet
- TODO javadoc me please- Returns:
- the DelayInformation or null
-
-