Class 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 single body 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 wrapper body 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.
    • Constructor Detail

      • AbstractBody

        AbstractBody()
        Restrict subclasses to the local package.
    • 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