Class Forwarded

  • All Implemented Interfaces:
    org.jivesoftware.smack.packet.Element, org.jivesoftware.smack.packet.ExtensionElement, org.jivesoftware.smack.packet.FullyQualifiedElement, org.jivesoftware.smack.packet.NamedElement, org.jivesoftware.smack.packet.XmlLangElement

    public class Forwarded
    extends java.lang.Object
    implements org.jivesoftware.smack.packet.ExtensionElement
    Stanza extension for XEP-0297: Stanza Forwarding.
    See Also:
    XEP-0297: Stanza Forwarding
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String ELEMENT  
      static java.lang.String NAMESPACE  
      static javax.xml.namespace.QName QNAME  
    • Constructor Summary

      Constructors 
      Constructor Description
      Forwarded​(org.jivesoftware.smack.packet.Stanza fwdPacket)
      Creates a new Forwarded stanza extension.
      Forwarded​(DelayInformation delay, org.jivesoftware.smack.packet.Stanza fwdPacket)
      Creates a new Forwarded stanza extension.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static java.util.List<org.jivesoftware.smack.packet.Message> extractMessagesFrom​(java.util.Collection<Forwarded> forwardedCollection)
      Extract messages in a collection of forwarded elements.
      static Forwarded from​(org.jivesoftware.smack.packet.Stanza packet)
      Get the forwarded extension.
      DelayInformation getDelayInformation()
      get the timestamp of the forwarded packet.
      java.lang.String getElementName()  
      org.jivesoftware.smack.packet.Stanza getForwardedStanza()
      Get the forwarded Stanza found in this extension.
      java.lang.String getNamespace()  
      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.FullyQualifiedElement

        getLanguage, getQName
    • Field Detail

      • QNAME

        public static final javax.xml.namespace.QName QNAME
    • Constructor Detail

      • Forwarded

        public Forwarded​(DelayInformation delay,
                         org.jivesoftware.smack.packet.Stanza fwdPacket)
        Creates a new Forwarded stanza extension.
        Parameters:
        delay - an optional DelayInformation timestamp of the packet.
        fwdPacket - the stanza that is forwarded (required).
      • Forwarded

        public Forwarded​(org.jivesoftware.smack.packet.Stanza fwdPacket)
        Creates a new Forwarded stanza extension.
        Parameters:
        fwdPacket - the stanza that is forwarded (required).
    • Method Detail

      • getElementName

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

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

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

        public org.jivesoftware.smack.packet.Stanza getForwardedStanza()
        Get the forwarded Stanza found in this extension.
        Returns:
        the Stanza (typically a message) that was forwarded.
      • getDelayInformation

        public DelayInformation getDelayInformation()
        get the timestamp of the forwarded packet.
        Returns:
        the DelayInformation representing the time when the original stanza was sent. May be null.
      • from

        public static Forwarded from​(org.jivesoftware.smack.packet.Stanza packet)
        Get the forwarded extension.
        Parameters:
        packet - TODO javadoc me please
        Returns:
        the Forwarded extension or null
      • extractMessagesFrom

        public static java.util.List<org.jivesoftware.smack.packet.Message> extractMessagesFrom​(java.util.Collection<Forwarded> forwardedCollection)
        Extract messages in a collection of forwarded elements. Note that it is required that the Forwarded in the given collection only contain Message stanzas.
        Parameters:
        forwardedCollection - the collection to extract from.
        Returns:
        a list a the extracted messages.
        Since:
        4.3.0