Class AbstractBody

java.lang.Object
org.igniterealtime.jbosh.AbstractBody
Direct Known Subclasses:
ComposableBody, StaticBody

public abstract class AbstractBody extends 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 Details

    • AbstractBody

      AbstractBody()
      Restrict subclasses to the local package.
  • Method Details

    • getAttributeNames

      public final Set<BodyQName> getAttributeNames()
      Get a set of all defined attribute names.
      Returns:
      set of qualified attribute names
    • getAttribute

      public final 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 Map<BodyQName,String> getAttributes()
      Get a map of all defined attribute names with their corresponding values.
      Returns:
      map of qualified attributes
    • toXML

      public abstract 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