Smack

org.jivesoftware.smackx.forward
Class Forwarded

java.lang.Object
  extended by org.jivesoftware.smackx.forward.Forwarded
All Implemented Interfaces:
PacketExtension

public class Forwarded
extends java.lang.Object
implements PacketExtension

Packet extension for XEP-0297: Stanza Forwarding.

Author:
Georg Lukas

Field Summary
static java.lang.String ELEMENT_NAME
           
static java.lang.String NAMESPACE
           
 
Constructor Summary
Forwarded(DelayInfo delay, Packet fwdPacket)
          Creates a new Forwarded packet extension.
Forwarded(Packet fwdPacket)
          Creates a new Forwarded packet extension.
 
Method Summary
 DelayInfo getDelayInfo()
          get the timestamp of the forwarded packet.
 java.lang.String getElementName()
          Returns the root element name.
 Packet getForwardedPacket()
          get the packet forwarded by this stanza.
 java.lang.String getNamespace()
          Returns the root element XML namespace.
 java.lang.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
 

Field Detail

NAMESPACE

public static final java.lang.String NAMESPACE
See Also:
Constant Field Values

ELEMENT_NAME

public static final java.lang.String ELEMENT_NAME
See Also:
Constant Field Values
Constructor Detail

Forwarded

public Forwarded(DelayInfo delay,
                 Packet fwdPacket)
Creates a new Forwarded packet extension.

Parameters:
delay - an optional DelayInfo timestamp of the packet.
fwdPacket - the packet that is forwarded (required).

Forwarded

public Forwarded(Packet fwdPacket)
Creates a new Forwarded packet extension.

Parameters:
delay - an optional DelayInfo timestamp of the packet.
fwdPacket - the packet that is forwarded (required).
Method Detail

getElementName

public java.lang.String getElementName()
Description copied from interface: PacketExtension
Returns the root element name.

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

getNamespace

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

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

toXML

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

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

getForwardedPacket

public Packet getForwardedPacket()
get the packet forwarded by this stanza.

Returns:
the Packet instance (typically a message) that was forwarded.

getDelayInfo

public DelayInfo getDelayInfo()
get the timestamp of the forwarded packet.

Returns:
the DelayInfo representing the time when the original packet was sent. May be null.

Smack

Copyright © 2003-2007 Jive Software.