Package org.igniterealtime.jbosh
Class AbstractBody
- java.lang.Object
-
- org.igniterealtime.jbosh.AbstractBody
-
- Direct Known Subclasses:
ComposableBody,StaticBody
public abstract class AbstractBody extends java.lang.ObjectClass representing a single message to or from the BOSH connection manager (CM). These messages consist of a singlebodyelement (qualified within the BOSH namespace:http://jabber.org/protocol/httpbind) and contain zero or more child elements (of any namespace). These child elements constitute the message payload. In addition to the message payload, the attributes of the wrapperbodyelement may also need to be used as part of the communication protocol being implemented on top of BOSH, or to define additional namespaces used by the child "payload" elements. These attributes are exposed via accessors.
-
-
Constructor Summary
Constructors Constructor Description AbstractBody()Restrict subclasses to the local package.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetAttribute(BodyQName attr)Get the value of the specified attribute.java.util.Set<BodyQName>getAttributeNames()Get a set of all defined attribute names.abstract java.util.Map<BodyQName,java.lang.String>getAttributes()Get a map of all defined attribute names with their corresponding values.(package private) static BodyQNamegetBodyQName()Returns the qualified name of the root/wrapper element.abstract java.lang.StringtoXML()Get an XML String representation of this message.
-
-
-
Method Detail
-
getAttributeNames
public final java.util.Set<BodyQName> getAttributeNames()
Get a set of all defined attribute names.- Returns:
- set of qualified attribute names
-
getAttribute
public final java.lang.String getAttribute(BodyQName attr)
Get the value of the specified attribute.- Parameters:
attr- name of the attribute to retriece- Returns:
- attribute value, or
nullif not defined
-
getAttributes
public abstract java.util.Map<BodyQName,java.lang.String> getAttributes()
Get a map of all defined attribute names with their corresponding values.- Returns:
- map of qualified attributes
-
toXML
public abstract java.lang.String toXML()
Get an XML String representation of this message.- Returns:
- XML string representing the body message
-
getBodyQName
static BodyQName getBodyQName()
Returns the qualified name of the root/wrapper element.- Returns:
- qualified name
-
-