org.apache.axis2.saaj
Class SOAPHeaderImpl

java.lang.Object
  extended by org.apache.axiom.om.impl.dom.NodeImpl
      extended by org.apache.axis2.saaj.NodeImplEx
          extended by org.apache.axis2.saaj.SOAPElementImpl
              extended by org.apache.axis2.saaj.SOAPHeaderImpl
All Implemented Interfaces:
java.lang.Cloneable, SOAPElement, SOAPHeader, org.apache.axiom.om.impl.OMNodeEx, org.apache.axiom.om.OMNode, org.w3c.dom.Element, org.w3c.dom.Node, org.w3c.dom.NodeList

public class SOAPHeaderImpl
extends SOAPElementImpl
implements SOAPHeader


Field Summary
 
Fields inherited from class org.apache.axis2.saaj.SOAPElementImpl
element
 
Fields inherited from class org.apache.axis2.saaj.NodeImplEx
parentElement
 
Fields inherited from class org.apache.axiom.om.impl.dom.NodeImpl
builder, done, factory, FIRSTCHILD, flags, NORMALIZED, OWNED, ownerNode, READONLY, SPECIFIED
 
Fields inherited from interface org.w3c.dom.Node
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_POSITION_CONTAINED_BY, DOCUMENT_POSITION_CONTAINS, DOCUMENT_POSITION_DISCONNECTED, DOCUMENT_POSITION_FOLLOWING, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, DOCUMENT_POSITION_PRECEDING, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE
 
Fields inherited from interface org.w3c.dom.Node
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_POSITION_CONTAINED_BY, DOCUMENT_POSITION_CONTAINS, DOCUMENT_POSITION_DISCONNECTED, DOCUMENT_POSITION_FOLLOWING, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, DOCUMENT_POSITION_PRECEDING, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE
 
Fields inherited from interface org.apache.axiom.om.OMNode
DTD_NODE, PI_NODE, SPACE_NODE
 
Constructor Summary
SOAPHeaderImpl(org.apache.axiom.soap.SOAPHeader header)
          Constructor
 
Method Summary
 SOAPElement addChildElement(Name name)
          Creates a new SOAPElement object initialized with the given Name object and adds the new element to this SOAPElement object.
 SOAPElement addChildElement(SOAPElement soapElement)
          Add a SOAPElement as a child of this SOAPElement instance.
 SOAPElement addChildElement(java.lang.String localName)
          Creates a new SOAPElement object initialized with the given String object and adds the new element to this SOAPElement object.
 SOAPElement addChildElement(java.lang.String localName, java.lang.String prefix)
          Creates a new SOAPElement object initialized with the specified local name and prefix and adds the new element to this SOAPElement object.
 SOAPElement addChildElement(java.lang.String localName, java.lang.String prefix, java.lang.String uri)
          Creates a new SOAPElement object initialized with the specified local name, prefix, and URI and adds the new element to this SOAPElement object.
 SOAPHeaderElement addHeaderElement(Name name)
          Creates a new SOAPHeaderElement object initialized with the specified name and adds it to this SOAPHeader object.
 SOAPHeaderElement addHeaderElement(QName qname)
           
 SOAPHeaderElement addNotUnderstoodHeaderElement(QName qname)
          Creates a new NotUnderstood SOAPHeaderElement object initialized with the specified name and adds it to this SOAPHeader object.
 SOAPElement addTextNode(java.lang.String text)
          Creates a new Text object initialized with the given String and adds it to this SOAPElement object.
 SOAPHeaderElement addUpgradeHeaderElement(java.util.Iterator iterator)
          Creates a new Upgrade SOAPHeaderElement object initialized with the specified List of supported SOAP URIs and adds it to this SOAPHeader object.
 SOAPHeaderElement addUpgradeHeaderElement(java.lang.String s)
           
 SOAPHeaderElement addUpgradeHeaderElement(java.lang.String[] as)
           
 org.apache.axiom.om.OMNode detach()
           
 void detachNode()
          Removes this Node object from the tree.
 java.util.Iterator examineAllHeaderElements()
          Returns an Iterator over all the SOAPHeaderElement objects in this SOAPHeader object.
 java.util.Iterator examineHeaderElements(java.lang.String actor)
          Returns a list of all the SOAPHeaderElement objects in this SOAPHeader object that have the the specified actor.
 java.util.Iterator examineMustUnderstandHeaderElements(java.lang.String actor)
          Returns an Iterator over all the SOAPHeaderElement objects in this SOAPHeader object that have the specified actor and that have a MustUnderstand attribute whose value is equivalent to true.
 java.util.Iterator extractAllHeaderElements()
          Returns an Iterator over all the SOAPHeaderElement objects in this SOAPHeader object and detaches them from this SOAPHeader object.
 java.util.Iterator extractHeaderElements(java.lang.String actor)
          Returns a list of all the SOAPHeaderElement objects in this SOAPHeader object that have the the specified actor and detaches them from this SOAPHeader object.
 java.util.Iterator getChildElements()
          Returns an iterator over all the immediate content of this element.
 java.util.Iterator getChildElements(Name name)
          Returns an iterator over all the child elements with the specified name.
 
Methods inherited from class org.apache.axis2.saaj.SOAPElementImpl
addAttribute, addAttribute, addChildElement, addNamespaceDeclaration, createQName, discard, getAllAttributes, getAllAttributesAsQNames, getAttribute, getAttributeNode, getAttributeNodeNS, getAttributeNS, getAttributes, getAttributeValue, getAttributeValue, getChildElements, getChildNodes, getElement, getElementName, getElementQName, getElementsByTagName, getElementsByTagNameNS, getEncodingStyle, getFirstChild, getLastChild, getLocalName, getNamespacePrefixes, getNamespaceURI, getNamespaceURI, getNextSibling, getNodeName, getNodeType, getOwnerDocument, getParentElement, getParentNode, getPrefix, getPreviousSibling, getTagName, getValue, getVisibleNamespacePrefixes, hasAttribute, hasAttributeNS, hasChildNodes, internalSerialize, internalSerializeAndConsume, removeAttribute, removeAttribute, removeAttribute, removeAttributeNode, removeAttributeNS, removeContents, removeNamespaceDeclaration, setAttribute, setAttributeNode, setAttributeNodeNS, setAttributeNS, setElementQName, setEncodingStyle, setParent, setParentElement, setValue, toString
 
Methods inherited from class org.apache.axis2.saaj.NodeImplEx
getParent, getSchemaTypeInfo, getType, recycleNode, setIdAttribute, setIdAttributeNode, setIdAttributeNS, setType
 
Methods inherited from class org.apache.axiom.om.impl.dom.NodeImpl
appendChild, build, buildWithAttachments, cloneNode, close, compareDocumentPosition, getBaseURI, getFeature, getLength, getNextOMSibling, getNodeValue, getOMFactory, getPreviousOMSibling, getTextContent, getUserData, hasAttributes, insertBefore, insertSiblingAfter, insertSiblingBefore, internalSerializeWithCache, isComplete, isDefaultNamespace, isEqualNode, isSameNode, isSupported, item, lookupNamespaceURI, lookupPrefix, normalize, removeChild, replaceChild, serialize, serialize, serialize, serialize, serialize, serializeAndConsume, serializeAndConsume, serializeAndConsume, serializeAndConsume, serializeAndConsume, setComplete, setNextOMSibling, setNodeValue, setOwnerDocument, setPrefix, setPreviousOMSibling, setTextContent, setUserData
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface javax.xml.soap.SOAPElement
addAttribute, addAttribute, addChildElement, addNamespaceDeclaration, createQName, getAllAttributes, getAllAttributesAsQNames, getAttributeValue, getAttributeValue, getChildElements, getElementName, getElementQName, getEncodingStyle, getNamespacePrefixes, getNamespaceURI, getVisibleNamespacePrefixes, removeAttribute, removeAttribute, removeContents, removeNamespaceDeclaration, setElementQName, setEncodingStyle
 
Methods inherited from interface javax.xml.soap.Node
getParentElement, getValue, recycleNode, setParentElement, setValue
 
Methods inherited from interface org.w3c.dom.Node
appendChild, cloneNode, compareDocumentPosition, getAttributes, getBaseURI, getChildNodes, getFeature, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, getTextContent, getUserData, hasAttributes, hasChildNodes, insertBefore, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, removeChild, replaceChild, setNodeValue, setPrefix, setTextContent, setUserData
 
Methods inherited from interface org.w3c.dom.Element
getAttribute, getAttributeNode, getAttributeNodeNS, getAttributeNS, getElementsByTagName, getElementsByTagNameNS, getSchemaTypeInfo, getTagName, hasAttribute, hasAttributeNS, removeAttribute, removeAttributeNode, removeAttributeNS, setAttribute, setAttributeNode, setAttributeNodeNS, setAttributeNS, setIdAttribute, setIdAttributeNode, setIdAttributeNS
 
Methods inherited from interface org.w3c.dom.Node
appendChild, cloneNode, compareDocumentPosition, getAttributes, getBaseURI, getChildNodes, getFeature, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, getTextContent, getUserData, hasAttributes, hasChildNodes, insertBefore, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, removeChild, replaceChild, setNodeValue, setPrefix, setTextContent, setUserData
 

Constructor Detail

SOAPHeaderImpl

public SOAPHeaderImpl(org.apache.axiom.soap.SOAPHeader header)
Constructor

Parameters:
header -
Method Detail

addChildElement

public SOAPElement addChildElement(java.lang.String localName)
                            throws SOAPException
Description copied from interface: SOAPElement
Creates a new SOAPElement object initialized with the given String object and adds the new element to this SOAPElement object.

Specified by:
addChildElement in interface SOAPElement
Overrides:
addChildElement in class SOAPElementImpl
Parameters:
localName - a String giving the local name for the element
Returns:
the new SOAPElement object that was created
Throws:
SOAPException - if there is an error in creating the SOAPElement object

addChildElement

public SOAPElement addChildElement(java.lang.String localName,
                                   java.lang.String prefix)
                            throws SOAPException
Description copied from interface: SOAPElement
Creates a new SOAPElement object initialized with the specified local name and prefix and adds the new element to this SOAPElement object.

Specified by:
addChildElement in interface SOAPElement
Overrides:
addChildElement in class SOAPElementImpl
Parameters:
localName - a String giving the local name for the new element
prefix - a String giving the namespace prefix for the new element
Returns:
the new SOAPElement object that was created
Throws:
SOAPException - if there is an error in creating the SOAPElement object

addChildElement

public SOAPElement addChildElement(java.lang.String localName,
                                   java.lang.String prefix,
                                   java.lang.String uri)
                            throws SOAPException
Description copied from interface: SOAPElement
Creates a new SOAPElement object initialized with the specified local name, prefix, and URI and adds the new element to this SOAPElement object.

Specified by:
addChildElement in interface SOAPElement
Overrides:
addChildElement in class SOAPElementImpl
Parameters:
localName - a String giving the local name for the new element
prefix - a String giving the namespace prefix for the new element
uri - a String giving the URI of the namespace to which the new element belongs
Returns:
the new SOAPElement object that was created
Throws:
SOAPException - if there is an error in creating the SOAPElement object

addChildElement

public SOAPElement addChildElement(Name name)
                            throws SOAPException
Description copied from interface: SOAPElement
Creates a new SOAPElement object initialized with the given Name object and adds the new element to this SOAPElement object.

Specified by:
addChildElement in interface SOAPElement
Overrides:
addChildElement in class SOAPElementImpl
Parameters:
name - a Name object with the XML name for the new element
Returns:
the new SOAPElement object that was created
Throws:
SOAPException - if there is an error in creating the SOAPElement object

addChildElement

public SOAPElement addChildElement(SOAPElement soapElement)
                            throws SOAPException
Description copied from interface: SOAPElement
Add a SOAPElement as a child of this SOAPElement instance. The SOAPElement is expected to be created by a SOAPElementFactory. Callers should not rely on the element instance being added as is into the XML tree. Implementations could end up copying the content of the SOAPElement passed into an instance of a different SOAPElement implementation. For instance if addChildElement() is called on a SOAPHeader, element will be copied into an instance of a SOAPHeaderElement.

The fragment rooted in element is either added as a whole or not at all, if there was an error.

The fragment rooted in element cannot contain elements named "Envelope", "Header" or "Body" and in the SOAP namespace. Any namespace prefixes present in the fragment should be fully resolved using appropriate namespace declarations within the fragment itself.

Specified by:
addChildElement in interface SOAPElement
Overrides:
addChildElement in class SOAPElementImpl
Parameters:
soapElement - the SOAPElement to be added as a new child
Returns:
an instance representing the new SOAP element that was actually added to the tree.
Throws:
SOAPException - if there was an error in adding this element as a child

addHeaderElement

public SOAPHeaderElement addHeaderElement(Name name)
                                   throws SOAPException
Creates a new SOAPHeaderElement object initialized with the specified name and adds it to this SOAPHeader object.

Specified by:
addHeaderElement in interface SOAPHeader
Parameters:
name - a Name object with the name of the new SOAPHeaderElement object
Returns:
the new SOAPHeaderElement object that was inserted into this SOAPHeader object
Throws:
SOAPException - if a SOAP error occurs

examineHeaderElements

public java.util.Iterator examineHeaderElements(java.lang.String actor)
Returns a list of all the SOAPHeaderElement 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:
examineHeaderElements in interface SOAPHeader
Parameters:
actor - a String giving the URI of the actor for which to search
Returns:
an Iterator object over all the SOAPHeaderElement objects that contain the specified actor
See Also:
extractHeaderElements(java.lang.String)

extractHeaderElements

public java.util.Iterator extractHeaderElements(java.lang.String actor)
Returns a list of all the SOAPHeaderElement objects in this SOAPHeader object that have the the specified actor and detaches them from this SOAPHeader object.

This method allows an actor 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 actor.

Specified by:
extractHeaderElements in interface SOAPHeader
Parameters:
actor - a String giving the URI of the actor for which to search
Returns:
an Iterator object over all the SOAPHeaderElement objects that contain the specified actor
See Also:
examineHeaderElements(java.lang.String)

examineMustUnderstandHeaderElements

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

Specified by:
examineMustUnderstandHeaderElements in interface SOAPHeader
Parameters:
actor - a String giving the URI of the actor for which to search
Returns:
an Iterator object over all the SOAPHeaderElement objects that contain the specified actor and are marked as MustUnderstand

examineAllHeaderElements

public java.util.Iterator examineAllHeaderElements()
Returns an Iterator over all the SOAPHeaderElement objects in this SOAPHeader object.

Specified by:
examineAllHeaderElements in interface SOAPHeader
Returns:
an Iterator object over all the SOAPHeaderElement objects contained by this SOAPHeader

extractAllHeaderElements

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

Specified by:
extractAllHeaderElements in interface SOAPHeader
Returns:
an Iterator object over all the SOAPHeaderElement objects contained by this SOAPHeader

addHeaderElement

public SOAPHeaderElement addHeaderElement(QName qname)
                                   throws SOAPException
Specified by:
addHeaderElement in interface SOAPHeader
Throws:
SOAPException

addNotUnderstoodHeaderElement

public SOAPHeaderElement addNotUnderstoodHeaderElement(QName qname)
                                                throws SOAPException
Creates a new NotUnderstood SOAPHeaderElement object initialized with the specified name and adds it to this SOAPHeader object. This operation is supported only by SOAP 1.2

Specified by:
addNotUnderstoodHeaderElement in interface SOAPHeader
Parameters:
name - - a QName object with the name of the SOAPHeaderElement object that was not understood.
Returns:
the new SOAPHeaderElement object that was inserted into this SOAPHeader object
Throws:
SOAPException- - if a SOAP error occurs. java.lang.UnsupportedOperationException - if this is a SOAP 1.1 Header.
SOAPException

addUpgradeHeaderElement

public SOAPHeaderElement addUpgradeHeaderElement(java.util.Iterator iterator)
                                          throws SOAPException
Creates a new Upgrade SOAPHeaderElement object initialized with the specified List of supported SOAP URIs and adds it to this SOAPHeader object. This operation is supported on both SOAP 1.1 and SOAP 1.2 header.

Specified by:
addUpgradeHeaderElement in interface SOAPHeader
Parameters:
supportedSOAPURIs - - an Iterator object with the URIs of SOAP versions supported.
Returns:
the new SOAPHeaderElement object that was inserted into this SOAPHeader object
Throws:
SOAPException - - if a SOAP error occurs.

addUpgradeHeaderElement

public SOAPHeaderElement addUpgradeHeaderElement(java.lang.String[] as)
                                          throws SOAPException
Specified by:
addUpgradeHeaderElement in interface SOAPHeader
Throws:
SOAPException

addUpgradeHeaderElement

public SOAPHeaderElement addUpgradeHeaderElement(java.lang.String s)
                                          throws SOAPException
Specified by:
addUpgradeHeaderElement in interface SOAPHeader
Throws:
SOAPException

addTextNode

public SOAPElement addTextNode(java.lang.String text)
                        throws SOAPException
Description copied from class: SOAPElementImpl
Creates a new Text object initialized with the given String and adds it to this SOAPElement object.

Specified by:
addTextNode in interface SOAPElement
Overrides:
addTextNode in class SOAPElementImpl
Parameters:
text - a String object with the textual content to be added
Returns:
the SOAPElement object into which the new Text object was inserted
Throws:
SOAPException - if there is an error in creating the new Text object

getChildElements

public java.util.Iterator getChildElements(Name name)
Description copied from interface: SOAPElement
Returns an iterator over all the child elements with the specified name.

Specified by:
getChildElements in interface SOAPElement
Overrides:
getChildElements in class SOAPElementImpl
Parameters:
name - a Name object with the name of the child elements to be returned
Returns:
an Iterator object over all the elements in this SOAPElement object with the specified name

getChildElements

public java.util.Iterator getChildElements()
Description copied from class: SOAPElementImpl
Returns an iterator over all the immediate content of this element. This includes Text objects as well as SOAPElement objects.

Specified by:
getChildElements in interface SOAPElement
Overrides:
getChildElements in class SOAPElementImpl
Returns:
an iterator over Text and SOAPElement contained within this SOAPElement object

detachNode

public void detachNode()
Description copied from class: NodeImplEx
Removes this Node object from the tree. Once removed, this node can be garbage collected if there are no application references to it.

Overrides:
detachNode in class SOAPElementImpl

detach

public org.apache.axiom.om.OMNode detach()
Specified by:
detach in interface org.apache.axiom.om.OMNode
Overrides:
detach in class SOAPElementImpl


Copyright © 2007 Apache Web Services Project. All Rights Reserved.