Class Forwarded<S extends Stanza>
java.lang.Object
org.jivesoftware.smackx.forward.packet.Forwarded<S>
- All Implemented Interfaces:
Element, ExtensionElement, NamedElement, XmlElement, XmlLangElement
Stanza extension for XEP-0297: Stanza Forwarding.
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionForwarded(DelayInformation delay, S forwardedStanza) Deprecated.Creates a new Forwarded stanza extension.Forwarded(S forwardedStanza, DelayInformation delay) Creates a new Forwarded stanza extension. -
Method Summary
Modifier and TypeMethodDescriptionextractMessagesFrom(Collection<Forwarded<Message>> forwardedCollection) Extract messages in a collection of forwarded elements.static Forwarded<?> Get the forwarded extension.get the timestamp of the forwarded packet.Returns the root element name.Get the forwarded Stanza found in this extension.Returns the root element XML namespace.booleanisForwarded(Class<? extends Stanza> stanzaClass) Check if this is forwarding a stanza of the provided class.toXML(XmlEnvironment enclosingNamespace) Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface XmlElement
getLanguage, getQName
-
Field Details
-
NAMESPACE
-
ELEMENT
-
QNAME
-
-
Constructor Details
-
Forwarded
Deprecated.useForwarded(Stanza, DelayInformation)instead.Creates a new Forwarded stanza extension.- Parameters:
delay- an optionalDelayInformationtimestamp of the packet.forwardedStanza- the stanza that is forwarded (required).
-
Forwarded
-
Forwarded
Creates a new Forwarded stanza extension.- Parameters:
forwardedStanza- the stanza that is forwarded (required).delay- an optionalDelayInformationtimestamp of the packet.
-
-
Method Details
-
getElementName
Description copied from interface:NamedElementReturns the root element name.- Specified by:
getElementNamein interfaceNamedElement- Returns:
- the element name.
-
getNamespace
Description copied from interface:XmlElementReturns the root element XML namespace.- Specified by:
getNamespacein interfaceXmlElement- Returns:
- the namespace.
-
toXML
-
getForwardedStanza
Get the forwarded Stanza found in this extension.- Returns:
- the
Stanza(typically a message) that was forwarded.
-
getDelayInformation
get the timestamp of the forwarded packet.- Returns:
- the
DelayInformationrepresenting the time when the original stanza was sent. May be null.
-
isForwarded
Check if this is forwarding a stanza of the provided class.- Parameters:
stanzaClass- the class to check for.- Returns:
trueif this is forwarding a stanza of the provided class.- Since:
- 4.4
-
from
-
extractMessagesFrom
-
Forwarded(Stanza, DelayInformation)instead.