org.apache.axiom.soap.impl.llom
Class SOAPHeaderImpl

java.lang.Object
  extended by org.apache.axiom.om.impl.llom.OMNodeImpl
      extended by org.apache.axiom.om.impl.llom.OMElementImpl
          extended by org.apache.axiom.soap.impl.llom.SOAPElement
              extended by org.apache.axiom.soap.impl.llom.SOAPHeaderImpl
All Implemented Interfaces:
org.apache.axiom.om.impl.OMContainerEx, org.apache.axiom.om.impl.OMNodeEx, org.apache.axiom.om.OMConstants, org.apache.axiom.om.OMContainer, org.apache.axiom.om.OMElement, org.apache.axiom.om.OMNode, org.apache.axiom.soap.SOAPHeader
Direct Known Subclasses:
SOAP11HeaderImpl, SOAP12HeaderImpl

public abstract class SOAPHeaderImpl
extends SOAPElement
implements org.apache.axiom.soap.SOAPHeader

A class representing the SOAP Header, primarily allowing access to the contained HeaderBlocks.


Nested Class Summary
(package private)  class SOAPHeaderImpl.HeaderIterator
          An Iterator which walks the header list as needed, potentially filtering as we traverse.
 
Field Summary
(package private) static org.apache.commons.logging.Log log
           
 
Fields inherited from class org.apache.axiom.om.impl.llom.OMElementImpl
attributes, DEFAULT_DEFAULT_NS_OBJECT, firstChild, lastChild, localName, namespaces, noPrefixNamespaceCounter, ns
 
Fields inherited from class org.apache.axiom.om.impl.llom.OMNodeImpl
builder, done, factory, nextSibling, nodeType, parent, previousSibling
 
Fields inherited from interface org.apache.axiom.om.OMNode
CDATA_SECTION_NODE, COMMENT_NODE, DTD_NODE, ELEMENT_NODE, ENTITY_REFERENCE_NODE, PI_NODE, SPACE_NODE, TEXT_NODE
 
Fields inherited from interface org.apache.axiom.om.OMConstants
ARRAY_ITEM_LOCALNAME, ARRAY_ITEM_NS_PREFIX, ARRAY_ITEM_NSURI, ARRAY_ITEM_QNAME, DATA_HANDLER, DEFAULT_CHAR_SET_ENCODING, DEFAULT_DEFAULT_NAMESPACE, DEFAULT_XML_VERSION, IS_BINARY, IS_DATA_HANDLERS_AWARE, PULL_TYPE_BUILDER, PUSH_TYPE_BUILDER, XMLNS_NS_PREFIX, XMLNS_NS_URI, XMLNS_PREFIX, XMLNS_URI
 
Constructor Summary
protected SOAPHeaderImpl(org.apache.axiom.om.OMNamespace ns, org.apache.axiom.soap.SOAPFactory factory)
           
  SOAPHeaderImpl(org.apache.axiom.soap.SOAPEnvelope envelope, org.apache.axiom.om.OMXMLParserWrapper builder, org.apache.axiom.soap.SOAPFactory factory)
          Constructor SOAPHeaderImpl
  SOAPHeaderImpl(org.apache.axiom.soap.SOAPEnvelope envelope, org.apache.axiom.soap.SOAPFactory factory)
           
 
Method Summary
 void addChild(org.apache.axiom.om.OMNode child)
          Adds child to the element.
abstract  org.apache.axiom.soap.SOAPHeaderBlock addHeaderBlock(java.lang.String localName, org.apache.axiom.om.OMNamespace ns)
          Creates a new SOAPHeaderBlock object initialized with the specified name and adds it to this SOAPHeader object.
protected  void checkParent(org.apache.axiom.om.OMElement parent)
          This has to be implemented by all the derived classes to check for the correct parent.
 java.util.Iterator examineAllHeaderBlocks()
          Returns an Iterator over all the SOAPHeaderBlock objects in this SOAPHeader object.
 java.util.Iterator examineHeaderBlocks(java.lang.String role)
          Returns a list of all the SOAPHeaderBlock objects in this SOAPHeader object that have the the specified actor.
 java.util.Iterator examineMustUnderstandHeaderBlocks(java.lang.String actor)
          Returns an Iterator over all the SOAPHeaderBlock objects in this SOAPHeader object that have the specified actor and that have a MustUnderstand attribute whose value is equivalent to true.
static java.lang.String exceptionToString(java.lang.Throwable e)
           
 java.util.Iterator extractAllHeaderBlocks()
          Returns an Iterator over all the SOAPHeaderBlock objects in this SOAPHeader object and detaches them from this SOAPHeader object.
abstract  java.util.Iterator extractHeaderBlocks(java.lang.String role)
          Returns a list of all the SOAPHeaderBlock objects in this SOAPHeader object that have the the specified role and detaches them from this SOAPHeader object.
 java.util.ArrayList getHeaderBlocksWithNSURI(java.lang.String nsURI)
           
 java.util.Iterator getHeadersToProcess(org.apache.axiom.soap.RolePlayer rolePlayer)
          Get the appropriate set of headers for a RolePlayer.
 java.util.Iterator getHeadersToProcess(org.apache.axiom.soap.RolePlayer rolePlayer, java.lang.String namespace)
          Get the appropriate set of headers for a RolePlayer.
 
Methods inherited from class org.apache.axiom.soap.impl.llom.SOAPElement
registerContentHandler, setParent
 
Methods inherited from class org.apache.axiom.om.impl.llom.OMElementImpl
addAttribute, addAttribute, build, buildNext, buildWithAttachments, cloneOMElement, declareDefaultNamespace, declareNamespace, declareNamespace, detach, discard, findNamespace, findNamespaceURI, getAllAttributes, getAllDeclaredNamespaces, getAttribute, getAttributeValue, getBuilder, getChildElements, getChildren, getChildrenWithLocalName, getChildrenWithName, getChildrenWithNamespaceURI, getDefaultNamespace, getFirstChildWithName, getFirstElement, getFirstOMChild, getLineNumber, getLocalName, getNamespace, getNextOMSibling, getQName, getText, getTextAsQName, getTrimmedText, getType, getXMLStreamReader, getXMLStreamReaderWithoutCaching, internalSerialize, internalSerialize, internalSerializeAndConsume, isComplete, notifyChildComplete, removeAttribute, resolveQName, setBuilder, setFirstChild, setLastChild, setLineNumber, setLocalName, setNamespace, setNamespaceWithNoFindInCurrentScope, setText, setText, toString, toStringWithConsume
 
Methods inherited from class org.apache.axiom.om.impl.llom.OMNodeImpl
close, getOMFactory, getParent, getPreviousOMSibling, importNode, insertSiblingAfter, insertSiblingBefore, serialize, serialize, serialize, serialize, serialize, serializeAndConsume, serializeAndConsume, serializeAndConsume, serializeAndConsume, serializeAndConsume, setComplete, setNextOMSibling, setPreviousOMSibling, setType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.axiom.om.OMElement
addAttribute, addAttribute, cloneOMElement, declareDefaultNamespace, declareNamespace, declareNamespace, findNamespace, findNamespaceURI, getAllAttributes, getAllDeclaredNamespaces, getAttribute, getAttributeValue, getBuilder, getChildElements, getDefaultNamespace, getFirstElement, getLineNumber, getLocalName, getNamespace, getQName, getText, getTextAsQName, getXMLStreamReader, getXMLStreamReaderWithoutCaching, removeAttribute, resolveQName, setBuilder, setFirstChild, setLineNumber, setLocalName, setNamespace, setNamespaceWithNoFindInCurrentScope, setText, setText, toString, toStringWithConsume
 
Methods inherited from interface org.apache.axiom.om.OMNode
build, buildWithAttachments, close, detach, discard, getNextOMSibling, getOMFactory, getParent, getPreviousOMSibling, getType, insertSiblingAfter, insertSiblingBefore, isComplete, serialize, serialize, serialize, serialize, serialize, serializeAndConsume, serializeAndConsume, serializeAndConsume, serializeAndConsume, serializeAndConsume
 
Methods inherited from interface org.apache.axiom.om.OMContainer
buildNext, getChildren, getChildrenWithLocalName, getChildrenWithName, getChildrenWithNamespaceURI, getFirstChildWithName, getFirstOMChild, isComplete
 
Methods inherited from interface org.apache.axiom.om.impl.OMContainerEx
setComplete
 

Field Detail

log

static org.apache.commons.logging.Log log
Constructor Detail

SOAPHeaderImpl

protected SOAPHeaderImpl(org.apache.axiom.om.OMNamespace ns,
                         org.apache.axiom.soap.SOAPFactory factory)

SOAPHeaderImpl

public SOAPHeaderImpl(org.apache.axiom.soap.SOAPEnvelope envelope,
                      org.apache.axiom.soap.SOAPFactory factory)
               throws org.apache.axiom.soap.SOAPProcessingException
Throws:
org.apache.axiom.soap.SOAPProcessingException

SOAPHeaderImpl

public SOAPHeaderImpl(org.apache.axiom.soap.SOAPEnvelope envelope,
                      org.apache.axiom.om.OMXMLParserWrapper builder,
                      org.apache.axiom.soap.SOAPFactory factory)
Constructor SOAPHeaderImpl

Parameters:
envelope -
builder -
Method Detail

addHeaderBlock

public abstract org.apache.axiom.soap.SOAPHeaderBlock addHeaderBlock(java.lang.String localName,
                                                                     org.apache.axiom.om.OMNamespace ns)
                                                              throws org.apache.axiom.om.OMException
Creates a new SOAPHeaderBlock object initialized with the specified name and adds it to this SOAPHeader object.

Specified by:
addHeaderBlock in interface org.apache.axiom.soap.SOAPHeader
Parameters:
localName -
ns -
Returns:
the new SOAPHeaderBlock object that was inserted into this SOAPHeader object
Throws:
org.apache.axiom.om.OMException - if a SOAP error occurs
org.apache.axiom.om.OMException

getHeadersToProcess

public java.util.Iterator getHeadersToProcess(org.apache.axiom.soap.RolePlayer rolePlayer)
Get the appropriate set of headers for a RolePlayer.

The RolePlayer indicates whether it is the ultimate destination (in which case headers with no role or the explicit UltimateDestination role will be included), and any non-standard roles it supports. Headers targeted to "next" will always be included, and those targeted to "none" (for SOAP 1.2) will never be included.

Specified by:
getHeadersToProcess in interface org.apache.axiom.soap.SOAPHeader
Returns:
an Iterator over all the HeaderBlocks this RolePlayer should process.

getHeadersToProcess

public java.util.Iterator getHeadersToProcess(org.apache.axiom.soap.RolePlayer rolePlayer,
                                              java.lang.String namespace)
Get the appropriate set of headers for a RolePlayer.

The RolePlayer indicates whether it is the ultimate destination (in which case headers with no role or the explicit UltimateDestination role will be included), and any non-standard roles it supports. Headers targeted to "next" will always be included, and those targeted to "none" (for SOAP 1.2) will never be included.

Specified by:
getHeadersToProcess in interface org.apache.axiom.soap.SOAPHeader
Parameters:
rolePlayer - a RolePlayer containing our role configuration
namespace - if specified, we'll only return headers from this namespace
Returns:
an Iterator over all the HeaderBlocks this RolePlayer should process.

examineHeaderBlocks

public java.util.Iterator examineHeaderBlocks(java.lang.String role)
Returns a list of all the SOAPHeaderBlock objects in this SOAPHeader object that have the the specified actor. An actor is a global attribute that indicates the intermediate parties to whom the message should be sent. An actor receives the message and then sends it to the next actor. The default actor is the ultimate intended recipient for the message, so if no actor attribute is included in a SOAPHeader object, the message is sent to its ultimate destination.

Specified by:
examineHeaderBlocks in interface org.apache.axiom.soap.SOAPHeader
Parameters:
role - a String giving the URI of the actor for which to search
Returns:
an Iterator object over all the SOAPHeaderBlock objects that contain the specified actor
See Also:
extractHeaderBlocks(java.lang.String)

extractHeaderBlocks

public abstract java.util.Iterator extractHeaderBlocks(java.lang.String role)
Returns a list of all the SOAPHeaderBlock objects in this SOAPHeader object that have the the specified role and detaches them from this SOAPHeader object.

This method allows an role to process only the parts of the SOAPHeader object that apply to it and to remove them before passing the message on to the next role.

Specified by:
extractHeaderBlocks in interface org.apache.axiom.soap.SOAPHeader
Parameters:
role - a String giving the URI of the role for which to search
Returns:
an Iterator object over all the SOAPHeaderBlock objects that contain the specified role
See Also:
examineHeaderBlocks(java.lang.String)

examineMustUnderstandHeaderBlocks

public java.util.Iterator examineMustUnderstandHeaderBlocks(java.lang.String actor)
Returns an Iterator over all the SOAPHeaderBlock objects in this SOAPHeader object that have the specified actor and that have a MustUnderstand attribute whose value is equivalent to true.

Specified by:
examineMustUnderstandHeaderBlocks in interface org.apache.axiom.soap.SOAPHeader
Parameters:
actor - a String giving the URI of the actor for which to search
Returns:
an Iterator object over all the SOAPHeaderBlock objects that contain the specified actor and are marked as MustUnderstand

examineAllHeaderBlocks

public java.util.Iterator examineAllHeaderBlocks()
Returns an Iterator over all the SOAPHeaderBlock objects in this SOAPHeader object. Not that this will return elements containing the QName (http://schemas.xmlsoap.org/soap/envelope/, Header)

Specified by:
examineAllHeaderBlocks in interface org.apache.axiom.soap.SOAPHeader
Returns:
an Iterator object over all the SOAPHeaderBlock objects contained by this SOAPHeader

extractAllHeaderBlocks

public java.util.Iterator extractAllHeaderBlocks()
Returns an Iterator over all the SOAPHeaderBlock objects in this SOAPHeader object and detaches them from this SOAPHeader object.

Specified by:
extractAllHeaderBlocks in interface org.apache.axiom.soap.SOAPHeader
Returns:
an Iterator object over all the SOAPHeaderBlock objects contained by this SOAPHeader

getHeaderBlocksWithNSURI

public java.util.ArrayList getHeaderBlocksWithNSURI(java.lang.String nsURI)
Specified by:
getHeaderBlocksWithNSURI in interface org.apache.axiom.soap.SOAPHeader

checkParent

protected void checkParent(org.apache.axiom.om.OMElement parent)
                    throws org.apache.axiom.soap.SOAPProcessingException
Description copied from class: SOAPElement
This has to be implemented by all the derived classes to check for the correct parent.

Specified by:
checkParent in class SOAPElement
Throws:
org.apache.axiom.soap.SOAPProcessingException

addChild

public void addChild(org.apache.axiom.om.OMNode child)
Description copied from class: OMElementImpl
Adds child to the element. One can decide whether to append the child or to add to the front of the children list.

Specified by:
addChild in interface org.apache.axiom.om.OMContainer
Overrides:
addChild in class OMElementImpl

exceptionToString

public static java.lang.String exceptionToString(java.lang.Throwable e)