Class CarbonExtension
java.lang.Object
org.jivesoftware.smackx.carbons.packet.CarbonExtension
- All Implemented Interfaces:
org.jivesoftware.smack.packet.Element,org.jivesoftware.smack.packet.NamedElement,org.jivesoftware.smack.packet.XmlElement,org.jivesoftware.smack.packet.XmlLangElement
Stanza extension for XEP-0280: Message Carbons. The extension
XEP-0280 is
meant to synchronize a message flow to multiple presences of a user.
It accomplishes this by wrapping a Forwarded stanza in a sent
or received element
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumDefines the direction of aCarbonExtensionmessage.static final classStanza extension indicating that a message may not be carbon-copied. -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCarbonExtension(CarbonExtension.Direction dir, org.jivesoftware.smackx.forward.packet.Forwarded<org.jivesoftware.smack.packet.Message> fwd) Construct a Carbon message extension. -
Method Summary
Modifier and TypeMethodDescriptionstatic CarbonExtensionfrom(org.jivesoftware.smack.packet.Message msg) Obtain a Carbon from a message, if available.Get the direction (sent or received) of the carbon.org.jivesoftware.smackx.forward.packet.Forwarded<org.jivesoftware.smack.packet.Message>Get the forwarded packet.static CarbonExtensiongetFrom(org.jivesoftware.smack.packet.Message msg) Deprecated.org.jivesoftware.smack.util.XmlStringBuildertoXML(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.jivesoftware.smack.packet.Element
toXML, toXMLMethods inherited from interface org.jivesoftware.smack.packet.XmlElement
getLanguage, getQName
-
Field Details
-
NAMESPACE
- See Also:
-
-
Constructor Details
-
CarbonExtension
public CarbonExtension(CarbonExtension.Direction dir, org.jivesoftware.smackx.forward.packet.Forwarded<org.jivesoftware.smack.packet.Message> fwd) Construct a Carbon message extension.- Parameters:
dir- Determines if the carbon is being sent/receivedfwd- The forwarded message.
-
-
Method Details
-
getDirection
Get the direction (sent or received) of the carbon.- Returns:
- the
CarbonExtension.Directionof the carbon.
-
getForwarded
public org.jivesoftware.smackx.forward.packet.Forwarded<org.jivesoftware.smack.packet.Message> getForwarded()Get the forwarded packet.- Returns:
- the
Forwardedmessage contained in this Carbon.
-
getElementName
- Specified by:
getElementNamein interfaceorg.jivesoftware.smack.packet.NamedElement
-
getNamespace
- Specified by:
getNamespacein interfaceorg.jivesoftware.smack.packet.XmlElement
-
toXML
public org.jivesoftware.smack.util.XmlStringBuilder toXML(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace) - Specified by:
toXMLin interfaceorg.jivesoftware.smack.packet.Element
-
getFrom
Deprecated.usefrom(Message)insteadObtain a Carbon from a message, if available.Only
Messageinstances can contain a Carbon extensions.- Parameters:
msg- Message object to check for carbons- Returns:
- a Carbon if available, null otherwise.
-
from
Obtain a Carbon from a message, if available.Only
Messageinstances can contain a Carbon extensions.- Parameters:
msg- Message object to check for carbons- Returns:
- a Carbon if available, null otherwise.
-
from(Message)instead