Smack

org.jivesoftware.smackx.packet
Class DelayInformation

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

public class DelayInformation
extends 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 dealy.

For more information see JEP-91.

Author:
Gaston Dombiak

Field Summary
static SimpleDateFormat NEW_UTC_FORMAT
          New date format based on JEP-82 that some clients may use when sending delayed dates.
static SimpleDateFormat UTC_FORMAT
           
 
Constructor Summary
DelayInformation(Date stamp)
          Creates a new instance with the specified timestamp.
 
Method Summary
 String getElementName()
          Returns the root element name.
 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.
 String getNamespace()
          Returns the root element XML namespace.
 String getReason()
          Returns a natural-language description of the reason for the delay or null if this information is not available.
 Date getStamp()
          Returns the timstamp when the packet was originally sent.
 void setFrom(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(String reason)
          Sets a natural-language description of the reason for the delay or null if this information is not available.
 String toXML()
          Returns the XML reppresentation of the PacketExtension.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

UTC_FORMAT

public static SimpleDateFormat UTC_FORMAT

NEW_UTC_FORMAT

public static SimpleDateFormat NEW_UTC_FORMAT
New date format based on JEP-82 that some clients may use when sending delayed dates. JEP-91 is using a SHOULD other servers or clients may be using this format instead of the old UTC format.

Constructor Detail

DelayInformation

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

Method Detail

getFrom

public 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(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 Date getStamp()
Returns the timstamp when the packet was originally sent. The returned Date is be understood as UTC.

Returns:
the timstamp when the packet was originally sent.

getReason

public 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(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 String getElementName()
Description copied from interface: PacketExtension
Returns the root element name.

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

getNamespace

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

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

toXML

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

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

Smack

Copyright © 2003-2007 Jive Software.