1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/src/share/jaxws_classes/javax/xml/soap/SOAPHeaderElement.java Tue Mar 06 16:09:35 2012 -0800 1.3 @@ -0,0 +1,166 @@ 1.4 +/* 1.5 + * Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved. 1.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 1.7 + * 1.8 + * This code is free software; you can redistribute it and/or modify it 1.9 + * under the terms of the GNU General Public License version 2 only, as 1.10 + * published by the Free Software Foundation. Oracle designates this 1.11 + * particular file as subject to the "Classpath" exception as provided 1.12 + * by Oracle in the LICENSE file that accompanied this code. 1.13 + * 1.14 + * This code is distributed in the hope that it will be useful, but WITHOUT 1.15 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 1.16 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 1.17 + * version 2 for more details (a copy is included in the LICENSE file that 1.18 + * accompanied this code). 1.19 + * 1.20 + * You should have received a copy of the GNU General Public License version 1.21 + * 2 along with this work; if not, write to the Free Software Foundation, 1.22 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 1.23 + * 1.24 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 1.25 + * or visit www.oracle.com if you need additional information or have any 1.26 + * questions. 1.27 + */ 1.28 + 1.29 +package javax.xml.soap; 1.30 + 1.31 +/** 1.32 + * An object representing the contents in the SOAP header part of the 1.33 + * SOAP envelope. 1.34 + * The immediate children of a <code>SOAPHeader</code> object can 1.35 + * be represented only as <code>SOAPHeaderElement</code> objects. 1.36 + * <P> 1.37 + * A <code>SOAPHeaderElement</code> object can have other 1.38 + * <code>SOAPElement</code> objects as its children. 1.39 + */ 1.40 +public interface SOAPHeaderElement extends SOAPElement { 1.41 + 1.42 + /** 1.43 + * Sets the actor associated with this <code>SOAPHeaderElement</code> 1.44 + * object to the specified actor. The default value of an actor is: 1.45 + * <code>SOAPConstants.URI_SOAP_ACTOR_NEXT</code> 1.46 + * <P> 1.47 + * If this <code>SOAPHeaderElement</code> supports SOAP 1.2 then this call is 1.48 + * equivalent to {@link #setRole(String)} 1.49 + * 1.50 + * @param actorURI a <code>String</code> giving the URI of the actor 1.51 + * to set 1.52 + * 1.53 + * @exception IllegalArgumentException if there is a problem in 1.54 + * setting the actor. 1.55 + * 1.56 + * @see #getActor 1.57 + */ 1.58 + public void setActor(String actorURI); 1.59 + 1.60 + /** 1.61 + * Sets the <code>Role</code> associated with this <code>SOAPHeaderElement</code> 1.62 + * object to the specified <code>Role</code>. 1.63 + * 1.64 + * @param uri - the URI of the <code>Role</code> 1.65 + * 1.66 + * @throws SOAPException if there is an error in setting the role 1.67 + * 1.68 + * @exception UnsupportedOperationException if this message does not 1.69 + * support the SOAP 1.2 concept of Fault Role. 1.70 + * 1.71 + * @since SAAJ 1.3 1.72 + */ 1.73 + public void setRole(String uri) throws SOAPException; 1.74 + 1.75 + /** 1.76 + * Returns the uri of the <i>actor</i> attribute of this 1.77 + * <code>SOAPHeaderElement</code>. 1.78 + *<P> 1.79 + * If this <code>SOAPHeaderElement</code> supports SOAP 1.2 then this call is 1.80 + * equivalent to {@link #getRole()} 1.81 + * @return a <code>String</code> giving the URI of the actor 1.82 + * @see #setActor 1.83 + */ 1.84 + public String getActor(); 1.85 + 1.86 + /** 1.87 + * Returns the value of the <i>Role</i> attribute of this 1.88 + * <code>SOAPHeaderElement</code>. 1.89 + * 1.90 + * @return a <code>String</code> giving the URI of the <code>Role</code> 1.91 + * 1.92 + * @exception UnsupportedOperationException if this message does not 1.93 + * support the SOAP 1.2 concept of Fault Role. 1.94 + * 1.95 + * @since SAAJ 1.3 1.96 + */ 1.97 + public String getRole(); 1.98 + 1.99 + /** 1.100 + * Sets the mustUnderstand attribute for this <code>SOAPHeaderElement</code> 1.101 + * object to be either true or false. 1.102 + * <P> 1.103 + * If the mustUnderstand attribute is on, the actor who receives the 1.104 + * <code>SOAPHeaderElement</code> must process it correctly. This 1.105 + * ensures, for example, that if the <code>SOAPHeaderElement</code> 1.106 + * object modifies the message, that the message is being modified correctly. 1.107 + * 1.108 + * @param mustUnderstand <code>true</code> to set the mustUnderstand 1.109 + * attribute to true; <code>false</code> to set it to false 1.110 + * 1.111 + * @exception IllegalArgumentException if there is a problem in 1.112 + * setting the mustUnderstand attribute 1.113 + * @see #getMustUnderstand 1.114 + * @see #setRelay 1.115 + */ 1.116 + public void setMustUnderstand(boolean mustUnderstand); 1.117 + 1.118 + /** 1.119 + * Returns the boolean value of the mustUnderstand attribute for this 1.120 + * <code>SOAPHeaderElement</code>. 1.121 + * 1.122 + * @return <code>true</code> if the mustUnderstand attribute of this 1.123 + * <code>SOAPHeaderElement</code> object is turned on; <code>false</code> 1.124 + * otherwise 1.125 + */ 1.126 + public boolean getMustUnderstand(); 1.127 + 1.128 + /** 1.129 + * Sets the <i>relay</i> attribute for this <code>SOAPHeaderElement</code> to be 1.130 + * either true or false. 1.131 + * <P> 1.132 + * The SOAP relay attribute is set to true to indicate that the SOAP header 1.133 + * block must be relayed by any node that is targeted by the header block 1.134 + * but not actually process it. This attribute is ignored on header blocks 1.135 + * whose mustUnderstand attribute is set to true or that are targeted at 1.136 + * the ultimate reciever (which is the default). The default value of this 1.137 + * attribute is <code>false</code>. 1.138 + * 1.139 + * @param relay the new value of the <i>relay</i> attribute 1.140 + * 1.141 + * @exception SOAPException if there is a problem in setting the 1.142 + * relay attribute. 1.143 + * @exception UnsupportedOperationException if this message does not 1.144 + * support the SOAP 1.2 concept of Relay attribute. 1.145 + * 1.146 + * @see #setMustUnderstand 1.147 + * @see #getRelay 1.148 + * 1.149 + * @since SAAJ 1.3 1.150 + */ 1.151 + public void setRelay(boolean relay) throws SOAPException; 1.152 + 1.153 + /** 1.154 + * Returns the boolean value of the <i>relay</i> attribute for this 1.155 + * <code>SOAPHeaderElement</code> 1.156 + * 1.157 + * @return <code>true</code> if the relay attribute is turned on; 1.158 + * <code>false</code> otherwise 1.159 + * 1.160 + * @exception UnsupportedOperationException if this message does not 1.161 + * support the SOAP 1.2 concept of Relay attribute. 1.162 + * 1.163 + * @see #getMustUnderstand 1.164 + * @see #setRelay 1.165 + * 1.166 + * @since SAAJ 1.3 1.167 + */ 1.168 + public boolean getRelay(); 1.169 +}