aoqi@0: /* aoqi@0: * Copyright (c) 2004, 2012, Oracle and/or its affiliates. All rights reserved. aoqi@0: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. aoqi@0: * aoqi@0: * This code is free software; you can redistribute it and/or modify it aoqi@0: * under the terms of the GNU General Public License version 2 only, as aoqi@0: * published by the Free Software Foundation. Oracle designates this aoqi@0: * particular file as subject to the "Classpath" exception as provided aoqi@0: * by Oracle in the LICENSE file that accompanied this code. aoqi@0: * aoqi@0: * This code is distributed in the hope that it will be useful, but WITHOUT aoqi@0: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or aoqi@0: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License aoqi@0: * version 2 for more details (a copy is included in the LICENSE file that aoqi@0: * accompanied this code). aoqi@0: * aoqi@0: * You should have received a copy of the GNU General Public License version aoqi@0: * 2 along with this work; if not, write to the Free Software Foundation, aoqi@0: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. aoqi@0: * aoqi@0: * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA aoqi@0: * or visit www.oracle.com if you need additional information or have any aoqi@0: * questions. aoqi@0: */ aoqi@0: aoqi@0: package javax.xml.soap; aoqi@0: aoqi@0: /** aoqi@0: * An object representing the contents in the SOAP header part of the aoqi@0: * SOAP envelope. aoqi@0: * The immediate children of a SOAPHeader object can aoqi@0: * be represented only as SOAPHeaderElement objects. aoqi@0: *

aoqi@0: * A SOAPHeaderElement object can have other aoqi@0: * SOAPElement objects as its children. aoqi@0: */ aoqi@0: public interface SOAPHeaderElement extends SOAPElement { aoqi@0: aoqi@0: /** aoqi@0: * Sets the actor associated with this SOAPHeaderElement aoqi@0: * object to the specified actor. The default value of an actor is: aoqi@0: * SOAPConstants.URI_SOAP_ACTOR_NEXT aoqi@0: *

aoqi@0: * If this SOAPHeaderElement supports SOAP 1.2 then this call is aoqi@0: * equivalent to {@link #setRole(String)} aoqi@0: * aoqi@0: * @param actorURI a String giving the URI of the actor aoqi@0: * to set aoqi@0: * aoqi@0: * @exception IllegalArgumentException if there is a problem in aoqi@0: * setting the actor. aoqi@0: * aoqi@0: * @see #getActor aoqi@0: */ aoqi@0: public void setActor(String actorURI); aoqi@0: aoqi@0: /** aoqi@0: * Sets the Role associated with this SOAPHeaderElement aoqi@0: * object to the specified Role. aoqi@0: * aoqi@0: * @param uri - the URI of the Role aoqi@0: * aoqi@0: * @throws SOAPException if there is an error in setting the role aoqi@0: * aoqi@0: * @exception UnsupportedOperationException if this message does not aoqi@0: * support the SOAP 1.2 concept of Fault Role. aoqi@0: * aoqi@0: * @since SAAJ 1.3 aoqi@0: */ aoqi@0: public void setRole(String uri) throws SOAPException; aoqi@0: aoqi@0: /** aoqi@0: * Returns the uri of the actor attribute of this aoqi@0: * SOAPHeaderElement. aoqi@0: *

aoqi@0: * If this SOAPHeaderElement supports SOAP 1.2 then this call is aoqi@0: * equivalent to {@link #getRole()} aoqi@0: * @return a String giving the URI of the actor aoqi@0: * @see #setActor aoqi@0: */ aoqi@0: public String getActor(); aoqi@0: aoqi@0: /** aoqi@0: * Returns the value of the Role attribute of this aoqi@0: * SOAPHeaderElement. aoqi@0: * aoqi@0: * @return a String giving the URI of the Role aoqi@0: * aoqi@0: * @exception UnsupportedOperationException if this message does not aoqi@0: * support the SOAP 1.2 concept of Fault Role. aoqi@0: * aoqi@0: * @since SAAJ 1.3 aoqi@0: */ aoqi@0: public String getRole(); aoqi@0: aoqi@0: /** aoqi@0: * Sets the mustUnderstand attribute for this SOAPHeaderElement aoqi@0: * object to be either true or false. aoqi@0: *

aoqi@0: * If the mustUnderstand attribute is on, the actor who receives the aoqi@0: * SOAPHeaderElement must process it correctly. This aoqi@0: * ensures, for example, that if the SOAPHeaderElement aoqi@0: * object modifies the message, that the message is being modified correctly. aoqi@0: * aoqi@0: * @param mustUnderstand true to set the mustUnderstand aoqi@0: * attribute to true; false to set it to false aoqi@0: * aoqi@0: * @exception IllegalArgumentException if there is a problem in aoqi@0: * setting the mustUnderstand attribute aoqi@0: * @see #getMustUnderstand aoqi@0: * @see #setRelay aoqi@0: */ aoqi@0: public void setMustUnderstand(boolean mustUnderstand); aoqi@0: aoqi@0: /** aoqi@0: * Returns the boolean value of the mustUnderstand attribute for this aoqi@0: * SOAPHeaderElement. aoqi@0: * aoqi@0: * @return true if the mustUnderstand attribute of this aoqi@0: * SOAPHeaderElement object is turned on; false aoqi@0: * otherwise aoqi@0: */ aoqi@0: public boolean getMustUnderstand(); aoqi@0: aoqi@0: /** aoqi@0: * Sets the relay attribute for this SOAPHeaderElement to be aoqi@0: * either true or false. aoqi@0: *

aoqi@0: * The SOAP relay attribute is set to true to indicate that the SOAP header aoqi@0: * block must be relayed by any node that is targeted by the header block aoqi@0: * but not actually process it. This attribute is ignored on header blocks aoqi@0: * whose mustUnderstand attribute is set to true or that are targeted at aoqi@0: * the ultimate reciever (which is the default). The default value of this aoqi@0: * attribute is false. aoqi@0: * aoqi@0: * @param relay the new value of the relay attribute aoqi@0: * aoqi@0: * @exception SOAPException if there is a problem in setting the aoqi@0: * relay attribute. aoqi@0: * @exception UnsupportedOperationException if this message does not aoqi@0: * support the SOAP 1.2 concept of Relay attribute. aoqi@0: * aoqi@0: * @see #setMustUnderstand aoqi@0: * @see #getRelay aoqi@0: * aoqi@0: * @since SAAJ 1.3 aoqi@0: */ aoqi@0: public void setRelay(boolean relay) throws SOAPException; aoqi@0: aoqi@0: /** aoqi@0: * Returns the boolean value of the relay attribute for this aoqi@0: * SOAPHeaderElement aoqi@0: * aoqi@0: * @return true if the relay attribute is turned on; aoqi@0: * false otherwise aoqi@0: * aoqi@0: * @exception UnsupportedOperationException if this message does not aoqi@0: * support the SOAP 1.2 concept of Relay attribute. aoqi@0: * aoqi@0: * @see #getMustUnderstand aoqi@0: * @see #setRelay aoqi@0: * aoqi@0: * @since SAAJ 1.3 aoqi@0: */ aoqi@0: public boolean getRelay(); aoqi@0: }