src/share/jaxws_classes/javax/xml/soap/SOAPHeader.java

Fri, 04 Oct 2013 16:21:34 +0100

author
mkos
date
Fri, 04 Oct 2013 16:21:34 +0100
changeset 408
b0610cd08440
parent 368
0989ad8c0860
child 637
9c07ef4934dd
permissions
-rw-r--r--

8025054: Update JAX-WS RI integration to 2.2.9-b130926.1035
Reviewed-by: chegar

ohair@286 1 /*
alanb@368 2 * Copyright (c) 2004, 2012, Oracle and/or its affiliates. All rights reserved.
ohair@286 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
ohair@286 4 *
ohair@286 5 * This code is free software; you can redistribute it and/or modify it
ohair@286 6 * under the terms of the GNU General Public License version 2 only, as
ohair@286 7 * published by the Free Software Foundation. Oracle designates this
ohair@286 8 * particular file as subject to the "Classpath" exception as provided
ohair@286 9 * by Oracle in the LICENSE file that accompanied this code.
ohair@286 10 *
ohair@286 11 * This code is distributed in the hope that it will be useful, but WITHOUT
ohair@286 12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
ohair@286 13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
ohair@286 14 * version 2 for more details (a copy is included in the LICENSE file that
ohair@286 15 * accompanied this code).
ohair@286 16 *
ohair@286 17 * You should have received a copy of the GNU General Public License version
ohair@286 18 * 2 along with this work; if not, write to the Free Software Foundation,
ohair@286 19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
ohair@286 20 *
ohair@286 21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
ohair@286 22 * or visit www.oracle.com if you need additional information or have any
ohair@286 23 * questions.
ohair@286 24 */
ohair@286 25
ohair@286 26 package javax.xml.soap;
ohair@286 27
ohair@286 28 import java.util.Iterator;
ohair@286 29
ohair@286 30 import javax.xml.namespace.QName;
ohair@286 31
ohair@286 32 /**
ohair@286 33 * A representation of the SOAP header
ohair@286 34 * element. A SOAP header element consists of XML data that affects
ohair@286 35 * the way the application-specific content is processed by the message
ohair@286 36 * provider. For example, transaction semantics, authentication information,
ohair@286 37 * and so on, can be specified as the content of a <code>SOAPHeader</code>
ohair@286 38 * object.
ohair@286 39 * <P>
ohair@286 40 * A <code>SOAPEnvelope</code> object contains an empty
ohair@286 41 * <code>SOAPHeader</code> object by default. If the <code>SOAPHeader</code>
ohair@286 42 * object, which is optional, is not needed, it can be retrieved and deleted
ohair@286 43 * with the following line of code. The variable <i>se</i> is a
ohair@286 44 * <code>SOAPEnvelope</code> object.
ohair@286 45 * <PRE>
ohair@286 46 * se.getHeader().detachNode();
ohair@286 47 * </PRE>
ohair@286 48 *
ohair@286 49 * A <code>SOAPHeader</code> object is created with the <code>SOAPEnvelope</code>
ohair@286 50 * method <code>addHeader</code>. This method, which creates a new header and adds it
ohair@286 51 * to the envelope, may be called only after the existing header has been removed.
ohair@286 52 *
ohair@286 53 * <PRE>
ohair@286 54 * se.getHeader().detachNode();
ohair@286 55 * SOAPHeader sh = se.addHeader();
ohair@286 56 * </PRE>
ohair@286 57 * <P>
ohair@286 58 * A <code>SOAPHeader</code> object can have only <code>SOAPHeaderElement</code>
ohair@286 59 * objects as its immediate children. The method <code>addHeaderElement</code>
ohair@286 60 * creates a new <code>HeaderElement</code> object and adds it to the
ohair@286 61 * <code>SOAPHeader</code> object. In the following line of code, the
ohair@286 62 * argument to the method <code>addHeaderElement</code> is a <code>Name</code>
ohair@286 63 * object that is the name for the new <code>HeaderElement</code> object.
ohair@286 64 * <PRE>
ohair@286 65 * SOAPHeaderElement shElement = sh.addHeaderElement(name);
ohair@286 66 * </PRE>
ohair@286 67 *
ohair@286 68 * @see SOAPHeaderElement
ohair@286 69 */
ohair@286 70 public interface SOAPHeader extends SOAPElement {
ohair@286 71 /**
ohair@286 72 * Creates a new <code>SOAPHeaderElement</code> object initialized with the
ohair@286 73 * specified name and adds it to this <code>SOAPHeader</code> object.
ohair@286 74 *
ohair@286 75 * @param name a <code>Name</code> object with the name of the new
ohair@286 76 * <code>SOAPHeaderElement</code> object
ohair@286 77 * @return the new <code>SOAPHeaderElement</code> object that was
ohair@286 78 * inserted into this <code>SOAPHeader</code> object
ohair@286 79 * @exception SOAPException if a SOAP error occurs
ohair@286 80 * @see SOAPHeader#addHeaderElement(javax.xml.namespace.QName)
ohair@286 81 */
ohair@286 82 public SOAPHeaderElement addHeaderElement(Name name)
ohair@286 83 throws SOAPException;
ohair@286 84
ohair@286 85 /**
ohair@286 86 * Creates a new <code>SOAPHeaderElement</code> object initialized with the
ohair@286 87 * specified qname and adds it to this <code>SOAPHeader</code> object.
ohair@286 88 *
ohair@286 89 * @param qname a <code>QName</code> object with the qname of the new
ohair@286 90 * <code>SOAPHeaderElement</code> object
ohair@286 91 * @return the new <code>SOAPHeaderElement</code> object that was
ohair@286 92 * inserted into this <code>SOAPHeader</code> object
ohair@286 93 * @exception SOAPException if a SOAP error occurs
ohair@286 94 * @see SOAPHeader#addHeaderElement(Name)
ohair@286 95 * @since SAAJ 1.3
ohair@286 96 */
ohair@286 97 public SOAPHeaderElement addHeaderElement(QName qname)
ohair@286 98 throws SOAPException;
ohair@286 99
ohair@286 100 /**
ohair@286 101 * Returns an <code>Iterator</code> over all the <code>SOAPHeaderElement</code> objects
ohair@286 102 * in this <code>SOAPHeader</code> object
ohair@286 103 * that have the specified <i>actor</i> and that have a MustUnderstand attribute
ohair@286 104 * whose value is equivalent to <code>true</code>.
ohair@286 105 * <p>
ohair@286 106 * In SOAP 1.2 the <i>env:actor</i> attribute is replaced by the <i>env:role</i>
ohair@286 107 * attribute, but with essentially the same semantics.
ohair@286 108 *
ohair@286 109 * @param actor a <code>String</code> giving the URI of the <code>actor</code> / <code>role</code>
ohair@286 110 * for which to search
ohair@286 111 * @return an <code>Iterator</code> object over all the
ohair@286 112 * <code>SOAPHeaderElement</code> objects that contain the specified
ohair@286 113 * <code>actor</code> / <code>role</code> and are marked as MustUnderstand
ohair@286 114 * @see #examineHeaderElements
ohair@286 115 * @see #extractHeaderElements
ohair@286 116 * @see SOAPConstants#URI_SOAP_ACTOR_NEXT
ohair@286 117 *
ohair@286 118 * @since SAAJ 1.2
ohair@286 119 */
ohair@286 120 public Iterator examineMustUnderstandHeaderElements(String actor);
ohair@286 121
ohair@286 122 /**
ohair@286 123 * Returns an <code>Iterator</code> over all the <code>SOAPHeaderElement</code> objects
ohair@286 124 * in this <code>SOAPHeader</code> object
ohair@286 125 * that have the specified <i>actor</i>.
ohair@286 126 *
ohair@286 127 * An <i>actor</i> is a global attribute that indicates the intermediate
ohair@286 128 * parties that should process a message before it reaches its ultimate
ohair@286 129 * receiver. An actor receives the message and processes it before sending
ohair@286 130 * it on to the next actor. The default actor is the ultimate intended
ohair@286 131 * recipient for the message, so if no actor attribute is included in a
ohair@286 132 * <code>SOAPHeader</code> object, it is sent to the ultimate receiver
ohair@286 133 * along with the message body.
ohair@286 134 * <p>
ohair@286 135 * In SOAP 1.2 the <i>env:actor</i> attribute is replaced by the <i>env:role</i>
ohair@286 136 * attribute, but with essentially the same semantics.
ohair@286 137 *
ohair@286 138 * @param actor a <code>String</code> giving the URI of the <code>actor</code> / <code>role</code>
ohair@286 139 * for which to search
ohair@286 140 * @return an <code>Iterator</code> object over all the
ohair@286 141 * <code>SOAPHeaderElement</code> objects that contain the specified
ohair@286 142 * <code>actor</code> / <code>role</code>
ohair@286 143 * @see #extractHeaderElements
ohair@286 144 * @see SOAPConstants#URI_SOAP_ACTOR_NEXT
ohair@286 145 */
ohair@286 146 public Iterator examineHeaderElements(String actor);
ohair@286 147
ohair@286 148 /**
ohair@286 149 * Returns an <code>Iterator</code> over all the <code>SOAPHeaderElement</code> objects
ohair@286 150 * in this <code>SOAPHeader</code> object
ohair@286 151 * that have the specified <i>actor</i> and detaches them
ohair@286 152 * from this <code>SOAPHeader</code> object.
ohair@286 153 * <P>
ohair@286 154 * This method allows an actor to process the parts of the
ohair@286 155 * <code>SOAPHeader</code> object that apply to it and to remove
ohair@286 156 * them before passing the message on to the next actor.
ohair@286 157 * <p>
ohair@286 158 * In SOAP 1.2 the <i>env:actor</i> attribute is replaced by the <i>env:role</i>
ohair@286 159 * attribute, but with essentially the same semantics.
ohair@286 160 *
ohair@286 161 * @param actor a <code>String</code> giving the URI of the <code>actor</code> / <code>role</code>
ohair@286 162 * for which to search
ohair@286 163 * @return an <code>Iterator</code> object over all the
ohair@286 164 * <code>SOAPHeaderElement</code> objects that contain the specified
ohair@286 165 * <code>actor</code> / <code>role</code>
ohair@286 166 *
ohair@286 167 * @see #examineHeaderElements
ohair@286 168 * @see SOAPConstants#URI_SOAP_ACTOR_NEXT
ohair@286 169 */
ohair@286 170 public Iterator extractHeaderElements(String actor);
ohair@286 171
ohair@286 172 /**
ohair@286 173 * Creates a new NotUnderstood <code>SOAPHeaderElement</code> object initialized
ohair@286 174 * with the specified name and adds it to this <code>SOAPHeader</code> object.
ohair@286 175 * This operation is supported only by SOAP 1.2.
ohair@286 176 *
ohair@286 177 * @param name a <code>QName</code> object with the name of the
ohair@286 178 * <code>SOAPHeaderElement</code> object that was not understood.
ohair@286 179 * @return the new <code>SOAPHeaderElement</code> object that was
ohair@286 180 * inserted into this <code>SOAPHeader</code> object
ohair@286 181 * @exception SOAPException if a SOAP error occurs.
ohair@286 182 * @exception UnsupportedOperationException if this is a SOAP 1.1 Header.
ohair@286 183 * @since SAAJ 1.3
ohair@286 184 */
ohair@286 185 public SOAPHeaderElement addNotUnderstoodHeaderElement(QName name)
ohair@286 186 throws SOAPException;
ohair@286 187
ohair@286 188 /**
ohair@286 189 * Creates a new Upgrade <code>SOAPHeaderElement</code> object initialized
ohair@286 190 * with the specified List of supported SOAP URIs and adds it to this
ohair@286 191 * <code>SOAPHeader</code> object.
ohair@286 192 * This operation is supported on both SOAP 1.1 and SOAP 1.2 header.
ohair@286 193 *
ohair@286 194 * @param supportedSOAPURIs an <code>Iterator</code> object with the URIs of SOAP
ohair@286 195 * versions supported.
ohair@286 196 * @return the new <code>SOAPHeaderElement</code> object that was
ohair@286 197 * inserted into this <code>SOAPHeader</code> object
ohair@286 198 * @exception SOAPException if a SOAP error occurs.
ohair@286 199 * @since SAAJ 1.3
ohair@286 200 */
ohair@286 201 public SOAPHeaderElement addUpgradeHeaderElement(Iterator supportedSOAPURIs)
ohair@286 202 throws SOAPException;
ohair@286 203
ohair@286 204 /**
ohair@286 205 * Creates a new Upgrade <code>SOAPHeaderElement</code> object initialized
ohair@286 206 * with the specified array of supported SOAP URIs and adds it to this
ohair@286 207 * <code>SOAPHeader</code> object.
ohair@286 208 * This operation is supported on both SOAP 1.1 and SOAP 1.2 header.
ohair@286 209 *
ohair@286 210 * @param supportedSoapUris an array of the URIs of SOAP versions supported.
ohair@286 211 * @return the new <code>SOAPHeaderElement</code> object that was
ohair@286 212 * inserted into this <code>SOAPHeader</code> object
ohair@286 213 * @exception SOAPException if a SOAP error occurs.
ohair@286 214 * @since SAAJ 1.3
ohair@286 215 */
ohair@286 216 public SOAPHeaderElement addUpgradeHeaderElement(String[] supportedSoapUris)
ohair@286 217 throws SOAPException;
ohair@286 218
ohair@286 219 /**
ohair@286 220 * Creates a new Upgrade <code>SOAPHeaderElement</code> object initialized
ohair@286 221 * with the specified supported SOAP URI and adds it to this
ohair@286 222 * <code>SOAPHeader</code> object.
ohair@286 223 * This operation is supported on both SOAP 1.1 and SOAP 1.2 header.
ohair@286 224 *
ohair@286 225 * @param supportedSoapUri the URI of SOAP the version that is supported.
ohair@286 226 * @return the new <code>SOAPHeaderElement</code> object that was
ohair@286 227 * inserted into this <code>SOAPHeader</code> object
ohair@286 228 * @exception SOAPException if a SOAP error occurs.
ohair@286 229 * @since SAAJ 1.3
ohair@286 230 */
ohair@286 231 public SOAPHeaderElement addUpgradeHeaderElement(String supportedSoapUri)
ohair@286 232 throws SOAPException;
ohair@286 233
ohair@286 234 /**
ohair@286 235 * Returns an <code>Iterator</code> over all the <code>SOAPHeaderElement</code> objects
ohair@286 236 * in this <code>SOAPHeader</code> object.
ohair@286 237 *
ohair@286 238 * @return an <code>Iterator</code> object over all the
ohair@286 239 * <code>SOAPHeaderElement</code> objects contained by this
ohair@286 240 * <code>SOAPHeader</code>
ohair@286 241 * @see #extractAllHeaderElements
ohair@286 242 *
ohair@286 243 * @since SAAJ 1.2
ohair@286 244 */
ohair@286 245 public Iterator examineAllHeaderElements();
ohair@286 246
ohair@286 247 /**
ohair@286 248 * Returns an <code>Iterator</code> over all the <code>SOAPHeaderElement</code> objects
ohair@286 249 * in this <code>SOAPHeader</code> object and detaches them
ohair@286 250 * from this <code>SOAPHeader</code> object.
ohair@286 251 *
ohair@286 252 * @return an <code>Iterator</code> object over all the
ohair@286 253 * <code>SOAPHeaderElement</code> objects contained by this
ohair@286 254 * <code>SOAPHeader</code>
ohair@286 255 *
ohair@286 256 * @see #examineAllHeaderElements
ohair@286 257 *
ohair@286 258 * @since SAAJ 1.2
ohair@286 259 */
ohair@286 260 public Iterator extractAllHeaderElements();
ohair@286 261
ohair@286 262 }

mercurial