Smack

org.jivesoftware.smackx.packet
Class DelayInfo

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

public class DelayInfo
extends DelayInformation

A decorator for the DelayInformation class to transparently support both the new Delay Delivery specification XEP-0203 and the old one XEP-0091. Existing code can be backward compatible.

Author:
Robin Collier

Field Summary
 
Fields inherited from class org.jivesoftware.smackx.packet.DelayInformation
XEP_0091_UTC_FORMAT
 
Constructor Summary
DelayInfo(DelayInformation delay)
          Creates a new instance with given delay information.
 
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 timestamp 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 representation of the PacketExtension.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DelayInfo

public DelayInfo(DelayInformation delay)
Creates a new instance with given delay information.

Parameters:
delay - the delay information
Method Detail

getFrom

public String getFrom()
Description copied from class: DelayInformation
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.

Overrides:
getFrom in class DelayInformation
Returns:
the JID of the entity that originally sent the packet or that delayed the delivery of the packet.

getReason

public String getReason()
Description copied from class: DelayInformation
Returns a natural-language description of the reason for the delay or null if this information is not available.

Overrides:
getReason in class DelayInformation
Returns:
a natural-language description of the reason for the delay or null.

getStamp

public Date getStamp()
Description copied from class: DelayInformation
Returns the timestamp when the packet was originally sent. The returned Date is be understood as UTC.

Overrides:
getStamp in class DelayInformation
Returns:
the timestamp when the packet was originally sent.

setFrom

public void setFrom(String from)
Description copied from class: DelayInformation
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.

Overrides:
setFrom in class DelayInformation
Parameters:
from - the JID of the entity that originally sent the packet.

setReason

public void setReason(String reason)
Description copied from class: DelayInformation
Sets a natural-language description of the reason for the delay or null if this information is not available.

Overrides:
setReason in class DelayInformation
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
Overrides:
getElementName in class DelayInformation
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
Overrides:
getNamespace in class DelayInformation
Returns:
the namespace.

toXML

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

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

Smack

Copyright © 2003-2007 Jive Software.