Smack

org.jivesoftware.smackx.packet
Class DelayInformation

java.lang.Object
  extended by org.jivesoftware.smackx.packet.DelayInformation
All Implemented Interfaces:
PacketExtension
Direct Known Subclasses:
DelayInfo

public class DelayInformation
extends java.lang.Object
implements PacketExtension

Represents timestamp information about data stored for later delivery. A DelayInformation will always includes the timestamp when the packet was originally sent and may include more information such as the JID of the entity that originally sent the packet as well as the reason for the delay.

For more information see XEP-0091 and XEP-0203.

Author:
Gaston Dombiak

Field Summary
static java.text.DateFormat XEP_0091_UTC_FORMAT
          Date format according to the obsolete XEP-0091 specification.
 
Constructor Summary
DelayInformation(java.util.Date stamp)
          Creates a new instance with the specified timestamp.
 
Method Summary
 java.lang.String getElementName()
          Returns the root element name.
 java.lang.String getFrom()
          Returns the JID of the entity that originally sent the packet or that delayed the delivery of the packet or null if this information is not available.
 java.lang.String getNamespace()
          Returns the root element XML namespace.
 java.lang.String getReason()
          Returns a natural-language description of the reason for the delay or null if this information is not available.
 java.util.Date getStamp()
          Returns the timestamp when the packet was originally sent.
 void setFrom(java.lang.String from)
          Sets the JID of the entity that originally sent the packet or that delayed the delivery of the packet or null if this information is not available.
 void setReason(java.lang.String reason)
          Sets a natural-language description of the reason for the delay or null if this information is not available.
 java.lang.String toXML()
          Returns the XML representation of the PacketExtension.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

XEP_0091_UTC_FORMAT

public static final java.text.DateFormat XEP_0091_UTC_FORMAT
Date format according to the obsolete XEP-0091 specification. XEP-0091 recommends to use this old format for date-time instead of the one specified in XEP-0082.

Date formats are not synchronized. Since multiple threads access the format concurrently, it must be synchronized externally.

Constructor Detail

DelayInformation

public DelayInformation(java.util.Date stamp)
Creates a new instance with the specified timestamp.

Parameters:
stamp - the timestamp
Method Detail

getFrom

public java.lang.String getFrom()
Returns the JID of the entity that originally sent the packet or that delayed the delivery of the packet or null if this information is not available.

Returns:
the JID of the entity that originally sent the packet or that delayed the delivery of the packet.

setFrom

public void setFrom(java.lang.String from)
Sets the JID of the entity that originally sent the packet or that delayed the delivery of the packet or null if this information is not available.

Parameters:
from - the JID of the entity that originally sent the packet.

getStamp

public java.util.Date getStamp()
Returns the timestamp when the packet was originally sent. The returned Date is be understood as UTC.

Returns:
the timestamp when the packet was originally sent.

getReason

public java.lang.String getReason()
Returns a natural-language description of the reason for the delay or null if this information is not available.

Returns:
a natural-language description of the reason for the delay or null.

setReason

public void setReason(java.lang.String reason)
Sets a natural-language description of the reason for the delay or null if this information is not available.

Parameters:
reason - a natural-language description of the reason for the delay or null.

getElementName

public java.lang.String getElementName()
Description copied from interface: PacketExtension
Returns the root element name.

Specified by:
getElementName in interface PacketExtension
Returns:
the element name.

getNamespace

public java.lang.String getNamespace()
Description copied from interface: PacketExtension
Returns the root element XML namespace.

Specified by:
getNamespace in interface PacketExtension
Returns:
the namespace.

toXML

public java.lang.String toXML()
Description copied from interface: PacketExtension
Returns the XML representation of the PacketExtension.

Specified by:
toXML in interface PacketExtension
Returns:
the packet extension as XML.

Smack

Copyright © 2003-2007 Jive Software.