Class CarbonExtension
- java.lang.Object
-
- org.jivesoftware.smackx.carbons.packet.CarbonExtension
-
- All Implemented Interfaces:
Element
,ExtensionElement
,FullyQualifiedElement
,NamedElement
,XmlLangElement
public class CarbonExtension extends java.lang.Object implements ExtensionElement
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
CarbonExtension.Direction
Defines the direction of aCarbonExtension
message.static class
CarbonExtension.Private
Stanza extension indicating that a message may not be carbon-copied.
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
NAMESPACE
-
Constructor Summary
Constructors Constructor Description CarbonExtension(CarbonExtension.Direction dir, Forwarded<Message> fwd)
Construct a Carbon message extension.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static CarbonExtension
from(Message msg)
Obtain a Carbon from a message, if available.CarbonExtension.Direction
getDirection()
Get the direction (sent or received) of the carbon.java.lang.String
getElementName()
Returns the root element name.Forwarded<Message>
getForwarded()
Get the forwarded packet.static CarbonExtension
getFrom(Message msg)
Deprecated.usefrom(Message)
insteadjava.lang.String
getNamespace()
Returns the root element XML namespace.XmlStringBuilder
toXML(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.FullyQualifiedElement
getLanguage, getQName
-
-
-
-
Field Detail
-
NAMESPACE
public static final java.lang.String NAMESPACE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
CarbonExtension
public CarbonExtension(CarbonExtension.Direction dir, Forwarded<Message> fwd)
Construct a Carbon message extension.- Parameters:
dir
- Determines if the carbon is being sent/receivedfwd
- The forwarded message.
-
-
Method Detail
-
getDirection
public CarbonExtension.Direction getDirection()
Get the direction (sent or received) of the carbon.- Returns:
- the
CarbonExtension.Direction
of the carbon.
-
getForwarded
public Forwarded<Message> getForwarded()
Get the forwarded packet.- Returns:
- the
Forwarded
message contained in this Carbon.
-
getElementName
public java.lang.String getElementName()
Description copied from interface:NamedElement
Returns the root element name.- Specified by:
getElementName
in interfaceNamedElement
- Returns:
- the element name.
-
getNamespace
public java.lang.String getNamespace()
Description copied from interface:FullyQualifiedElement
Returns the root element XML namespace.- Specified by:
getNamespace
in interfaceFullyQualifiedElement
- Returns:
- the namespace.
-
toXML
public XmlStringBuilder toXML(XmlEnvironment enclosingNamespace)
-
getFrom
@Deprecated public static CarbonExtension getFrom(Message msg)
Deprecated.usefrom(Message)
insteadObtain a Carbon from a message, if available.Only
Message
instances can contain a Carbon extensions.- Parameters:
msg
- Message object to check for carbons- Returns:
- a Carbon if available, null otherwise.
-
from
public static CarbonExtension from(Message msg)
Obtain a Carbon from a message, if available.Only
Message
instances can contain a Carbon extensions.- Parameters:
msg
- Message object to check for carbons- Returns:
- a Carbon if available, null otherwise.
-
-