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.Object
Class representing a single message to or from the BOSH connection manager (CM). These messages consist of a singlebody
element (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 wrapperbody
element 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.String
getAttribute(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 BodyQName
getBodyQName()
Returns the qualified name of the root/wrapper element.abstract java.lang.String
toXML()
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
null
if 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
-
-