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 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.

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

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     
    static final String
     
    static final QName
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
    DelayInformation(Date stamp, String from, String reason)
    Creates a new instance with the specified timestamp.
  • Method Summary

    Modifier and Type
    Method
    Description
    from(org.jivesoftware.smack.packet.Stanza packet)
    Return delay information from the given stanza.
     
    Returns the JID of the entity that originally sent the stanza or that delayed the delivery of the stanza or null if this information is not available.
    getFrom(org.jivesoftware.smack.packet.Stanza packet)
    Deprecated.
    use from(Stanza) instead
     
    Returns a natural-language description of the reason for the delay or null if this information is not available.
    Returns the timestamp when the stanza was originally sent.
    org.jivesoftware.smack.util.XmlStringBuilder
    toXML(org.jivesoftware.smack.packet.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.Element

    toXML, toXML

    Methods inherited from interface org.jivesoftware.smack.packet.XmlElement

    getLanguage, getQName
  • Field Details

  • Constructor Details

    • DelayInformation

      public DelayInformation(Date stamp, String from, String reason)
      Creates a new instance with the specified timestamp.
      Parameters:
      stamp - the timestamp
      from - sender
      reason - reason of delay.
    • DelayInformation

      public DelayInformation(Date stamp)
  • Method Details

    • getFrom

      public String getFrom()
      Returns the JID of the entity that originally sent the stanza or that delayed the delivery of the stanza or null 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 or null if this information is not available.
      Returns:
      a natural-language description of the reason for the delay or null.
    • getElementName

      public String getElementName()
      Specified by:
      getElementName in interface org.jivesoftware.smack.packet.NamedElement
    • getNamespace

      public String getNamespace()
      Specified by:
      getNamespace in interface org.jivesoftware.smack.packet.XmlElement
    • toXML

      public org.jivesoftware.smack.util.XmlStringBuilder toXML(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace)
      Specified by:
      toXML in interface org.jivesoftware.smack.packet.Element
    • getFrom

      @Deprecated public static DelayInformation getFrom(org.jivesoftware.smack.packet.Stanza packet)
      Deprecated.
      use from(Stanza) instead
      Return 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