Class CarbonExtension
- java.lang.Object
-
- org.jivesoftware.smackx.carbons.packet.CarbonExtension
-
- 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 CarbonExtension extends java.lang.Object implements org.jivesoftware.smack.packet.ExtensionElementStanza 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
Forwardedstanza in a sent or received element
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classCarbonExtension.DirectionDefines the direction of aCarbonExtensionmessage.static classCarbonExtension.PrivateStanza extension indicating that a message may not be carbon-copied.
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringNAMESPACE
-
Constructor Summary
Constructors Constructor Description CarbonExtension(CarbonExtension.Direction dir, org.jivesoftware.smackx.forward.packet.Forwarded fwd)Construct a Carbon message extension.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static CarbonExtensionfrom(org.jivesoftware.smack.packet.Message msg)Obtain a Carbon from a message, if available.CarbonExtension.DirectiongetDirection()Get the direction (sent or received) of the carbon.java.lang.StringgetElementName()org.jivesoftware.smackx.forward.packet.ForwardedgetForwarded()Get the forwarded packet.static CarbonExtensiongetFrom(org.jivesoftware.smack.packet.Message msg)Deprecated.usefrom(Message)insteadjava.lang.StringgetNamespace()org.jivesoftware.smack.util.XmlStringBuildertoXML(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace)
-
-
-
Field Detail
-
NAMESPACE
public static final java.lang.String NAMESPACE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
CarbonExtension
public CarbonExtension(CarbonExtension.Direction dir, org.jivesoftware.smackx.forward.packet.Forwarded 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.Directionof the carbon.
-
getForwarded
public org.jivesoftware.smackx.forward.packet.Forwarded getForwarded()
Get the forwarded packet.- Returns:
- the
Forwardedmessage contained in this Carbon.
-
getElementName
public java.lang.String getElementName()
- Specified by:
getElementNamein interfaceorg.jivesoftware.smack.packet.NamedElement
-
getNamespace
public java.lang.String getNamespace()
- Specified by:
getNamespacein interfaceorg.jivesoftware.smack.packet.FullyQualifiedElement
-
toXML
public org.jivesoftware.smack.util.XmlStringBuilder toXML(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace)
- Specified by:
toXMLin interfaceorg.jivesoftware.smack.packet.Element
-
getFrom
@Deprecated public static CarbonExtension getFrom(org.jivesoftware.smack.packet.Message msg)
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
public static CarbonExtension from(org.jivesoftware.smack.packet.Message msg)
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.
-
-