Stanza instead@Deprecated public interface Packet extends TopLevelStreamElement
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
ITEM
Deprecated.
|
static java.lang.String |
TEXT
Deprecated.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addExtension(ExtensionElement extension)
Deprecated.
Adds a stanza extension to the packet.
|
void |
addExtensions(java.util.Collection<ExtensionElement> extensions)
Deprecated.
Adds a collection of stanza extensions to the packet.
|
StanzaError |
getError()
Deprecated.
Returns the error associated with this packet, or
null if there are
no errors. |
ExtensionElement |
getExtension(java.lang.String namespace)
Deprecated.
Returns the first extension of this stanza that has the given namespace.
|
<PE extends ExtensionElement> |
getExtension(java.lang.String elementName,
java.lang.String namespace)
Deprecated.
Returns the first stanza extension that matches the specified element name and
namespace, or
null if it doesn't exist. |
java.util.List<ExtensionElement> |
getExtensions()
Deprecated.
Returns a copy of the stanza extensions attached to the packet.
|
java.util.Set<ExtensionElement> |
getExtensions(java.lang.String elementName,
java.lang.String namespace)
Deprecated.
Return a set of all extensions with the given element name and namespace.
|
java.lang.String |
getFrom()
Deprecated.
Returns who the stanza is being sent "from" or
null if
the value is not set. |
java.lang.String |
getLanguage()
Deprecated.
Returns the xml:lang of this Stanza, or null if one has not been set.
|
java.lang.String |
getPacketID()
Deprecated.
use
getStanzaId() instead. |
java.lang.String |
getStanzaId()
Deprecated.
Returns the unique ID of the stanza.
|
java.lang.String |
getTo()
Deprecated.
Returns who the stanza is being sent "to", or
null if
the value is not set. |
boolean |
hasExtension(java.lang.String namespace)
Deprecated.
Check if a stanza extension with the given namespace exists.
|
boolean |
hasExtension(java.lang.String elementName,
java.lang.String namespace)
Deprecated.
Check if a stanza extension with the given element and namespace exists.
|
ExtensionElement |
removeExtension(ExtensionElement extension)
Deprecated.
Removes a stanza extension from the packet.
|
ExtensionElement |
removeExtension(java.lang.String elementName,
java.lang.String namespace)
Deprecated.
Remove the stanza extension with the given elementName and namespace.
|
void |
setError(StanzaError error)
Deprecated.
Sets the error for this packet.
|
void |
setFrom(java.lang.String from)
Deprecated.
Sets who the stanza is being sent "from".
|
void |
setLanguage(java.lang.String language)
Deprecated.
Sets the xml:lang of this Stanza.
|
void |
setPacketID(java.lang.String packetID)
Deprecated.
use
setStanzaId(String) instead. |
void |
setStanzaId(java.lang.String id)
Deprecated.
Sets the unique ID of the packet.
|
void |
setTo(java.lang.String to)
Deprecated.
Sets who the stanza is being sent "to".
|
java.lang.String |
toString()
Deprecated.
|
static final java.lang.String TEXT
static final java.lang.String ITEM
java.lang.String getStanzaId()
null.null if the id is not available.@Deprecated java.lang.String getPacketID()
getStanzaId() instead.void setStanzaId(java.lang.String id)
null as the packet's id value.id - the unique ID for the packet.@Deprecated void setPacketID(java.lang.String packetID)
setStanzaId(String) instead.packetID - java.lang.String getTo()
null if
the value is not set. The XMPP protocol often makes the "to"
attribute optional, so it does not always need to be set.null if the
value has not been set.void setTo(java.lang.String to)
to - who the stanza is being sent to.java.lang.String getFrom()
null if
the value is not set. The XMPP protocol often makes the "from"
attribute optional, so it does not always need to be set.null if the
value has not been set.void setFrom(java.lang.String from)
from - who the stanza is being sent to.StanzaError getError()
null if there are
no errors.null if there isn't an error.void setError(StanzaError error)
error - the error to associate with this packet.java.lang.String getLanguage()
void setLanguage(java.lang.String language)
language - the xml:lang of this Stanza.java.util.List<ExtensionElement> getExtensions()
java.util.Set<ExtensionElement> getExtensions(java.lang.String elementName, java.lang.String namespace)
Changes to the returned set will update the stanza extensions, if the returned set is not the empty set.
elementName - the element name, must not be null.namespace - the namespace of the element(s), must not be null.ExtensionElement getExtension(java.lang.String namespace)
When possible, use getExtension(String, String) instead.
namespace - the namespace of the extension that is desired.<PE extends ExtensionElement> PE getExtension(java.lang.String elementName, java.lang.String namespace)
null if it doesn't exist. If the provided elementName is null,
only the namespace is matched. Stanza extensions are
are arbitrary XML sub-documents in standard XMPP packets. By default, a
DefaultPacketExtension instance will be returned for each extension. However,
PacketExtensionProvider instances can be registered with the
ProviderManager
class to handle custom parsing. In that case, the type of the Object
will be determined by the provider.PE - type of the ExtensionElement.elementName - the XML element name of the stanza extension. (May be null)namespace - the XML element namespace of the stanza extension.null if it doesn't exist.void addExtension(ExtensionElement extension)
extension - a stanza extension.void addExtensions(java.util.Collection<ExtensionElement> extensions)
extensions - a collection of stanza extensionsboolean hasExtension(java.lang.String elementName,
java.lang.String namespace)
The argument elementName may be null.
elementName - namespace - boolean hasExtension(java.lang.String namespace)
namespace - ExtensionElement removeExtension(java.lang.String elementName, java.lang.String namespace)
elementName - namespace - ExtensionElement removeExtension(ExtensionElement extension)
extension - the stanza extension to remove.java.lang.String toString()
toString in class java.lang.Object