java.lang.Object
com.sun.xml.messaging.saaj.soap.impl.ElementImpl
com.sun.xml.messaging.saaj.soap.impl.HeaderImpl
All Implemented Interfaces:
Node, SOAPBodyElement, SOAPElement, SOAPHeader, Element, Node
Direct Known Subclasses:
Header1_1Impl, Header1_2Impl

public abstract class HeaderImpl extends ElementImpl implements SOAPHeader
  • Field Details

    • MUST_UNDERSTAND_ONLY

      protected static final boolean MUST_UNDERSTAND_ONLY
      See Also:
  • Constructor Details

  • Method Details

    • createHeaderElement

      protected abstract SOAPHeaderElement createHeaderElement(Name name) throws SOAPException
      Throws:
      SOAPException
    • createHeaderElement

      protected abstract SOAPHeaderElement createHeaderElement(QName name) throws SOAPException
      Throws:
      SOAPException
    • getNotUnderstoodName

      protected abstract NameImpl getNotUnderstoodName()
    • getUpgradeName

      protected abstract NameImpl getUpgradeName()
    • getSupportedEnvelopeName

      protected abstract NameImpl getSupportedEnvelopeName()
    • addHeaderElement

      public SOAPHeaderElement addHeaderElement(Name name) throws SOAPException
      Description copied from interface: SOAPHeader
      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
      See Also:
    • addHeaderElement

      public SOAPHeaderElement addHeaderElement(QName name) throws SOAPException
      Description copied from interface: SOAPHeader
      Creates a new SOAPHeaderElement object initialized with the specified qname and adds it to this SOAPHeader object.
      Specified by:
      addHeaderElement in interface SOAPHeader
      Parameters:
      name - a QName object with the qname of the new SOAPHeaderElement object
      Returns:
      the new SOAPHeaderElement object that was inserted into this SOAPHeader object
      Throws:
      SOAPException - if a SOAP error occurs
      See Also:
    • addElement

      protected SOAPElement addElement(Name name) throws SOAPException
      Overrides:
      addElement in class ElementImpl
      Throws:
      SOAPException
    • addElement

      protected SOAPElement addElement(QName name) throws SOAPException
      Overrides:
      addElement in class ElementImpl
      Throws:
      SOAPException
    • examineHeaderElements

      public Iterator<SOAPHeaderElement> examineHeaderElements(String actor)
      Description copied from interface: SOAPHeader
      Returns an Iterator over all the SOAPHeaderElement objects in this SOAPHeader object that have the specified actor.

      An actor is a global attribute that indicates the intermediate parties that should process a message before it reaches its ultimate receiver. An actor receives the message and processes it before sending it on 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, it is sent to the ultimate receiver along with the message body.

      In SOAP 1.2 the env:actor attribute is replaced by the env:role attribute, but with essentially the same semantics.

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

      public Iterator<SOAPHeaderElement> extractHeaderElements(String actor)
      Description copied from interface: SOAPHeader
      Returns an Iterator over all the SOAPHeaderElement objects in this SOAPHeader object that have the specified actor and detaches them from this SOAPHeader object.

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

      In SOAP 1.2 the env:actor attribute is replaced by the env:role attribute, but with essentially the same semantics.

      Specified by:
      extractHeaderElements in interface SOAPHeader
      Parameters:
      actor - a String giving the URI of the actor / role for which to search
      Returns:
      an Iterator object over all the SOAPHeaderElement objects that contain the specified actor / role
      See Also:
    • getHeaderElementsForActor

      protected Iterator<SOAPHeaderElement> getHeaderElementsForActor(String actor, boolean detach, boolean mustUnderstand)
    • getHeaderElements

      protected Iterator<SOAPHeaderElement> getHeaderElements(String actor, boolean detach, boolean mustUnderstand)
    • setParentElement

      public void setParentElement(SOAPElement element) throws SOAPException
      Description copied from interface: Node
      Sets the parent of this Node object to the given SOAPElement object.
      Specified by:
      setParentElement in interface Node
      Overrides:
      setParentElement in class ElementImpl
      Parameters:
      element - the SOAPElement object to be set as the parent of this Node object
      Throws:
      SOAPException - if there is a problem in setting the parent to the given element
      See Also:
    • addChildElement

      public SOAPElement addChildElement(String localName) throws SOAPException
      Description copied from interface: SOAPElement
      Creates a new SOAPElement object initialized with the specified local name and adds the new element to this SOAPElement object. The new SOAPElement inherits any in-scope default namespace.
      Specified by:
      addChildElement in interface SOAPElement
      Overrides:
      addChildElement in class ElementImpl
      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
    • examineAllHeaderElements

      public Iterator<SOAPHeaderElement> examineAllHeaderElements()
      Description copied from interface: SOAPHeader
      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
      See Also:
    • examineMustUnderstandHeaderElements

      public Iterator<SOAPHeaderElement> examineMustUnderstandHeaderElements(String actor)
      Description copied from interface: SOAPHeader
      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.

      In SOAP 1.2 the env:actor attribute is replaced by the env:role attribute, but with essentially the same semantics.

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

      public Iterator<SOAPHeaderElement> extractAllHeaderElements()
      Description copied from interface: SOAPHeader
      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
      See Also:
    • addUpgradeHeaderElement

      public SOAPHeaderElement addUpgradeHeaderElement(Iterator<String> supportedSoapUris) throws SOAPException
      Description copied from interface: SOAPHeader
      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(String supportedSoapUri) throws SOAPException
      Description copied from interface: SOAPHeader
      Creates a new Upgrade SOAPHeaderElement object initialized with the specified supported SOAP URI 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:
      supportedSoapUri - the URI of SOAP the version that is supported.
      Returns:
      the new SOAPHeaderElement object that was inserted into this SOAPHeader object
      Throws:
      SOAPException - if a SOAP error occurs.
    • addUpgradeHeaderElement

      public SOAPHeaderElement addUpgradeHeaderElement(String[] supportedSoapUris) throws SOAPException
      Description copied from interface: SOAPHeader
      Creates a new Upgrade SOAPHeaderElement object initialized with the specified array 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 array of 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.
    • convertToSoapElement

      protected SOAPElement convertToSoapElement(Element element)
      Overrides:
      convertToSoapElement in class ElementImpl
    • setElementQName

      public SOAPElement setElementQName(QName newName) throws SOAPException
      Description copied from interface: SOAPElement
      Changes the name of this Element to newName if possible. SOAP Defined elements such as SOAPEnvelope, SOAPHeader, SOAPBody etc. cannot have their names changed using this method. Any attempt to do so will result in a SOAPException being thrown.

      Callers should not rely on the element instance being renamed as is. Implementations could end up copying the content of the SOAPElement to a renamed instance.

      Specified by:
      setElementQName in interface SOAPElement
      Overrides:
      setElementQName in class ElementImpl
      Parameters:
      newName - the new name for the Element.
      Returns:
      The renamed Node
      Throws:
      SOAPException - if changing the name of this Element is not allowed.