001    /*
002     * Licensed to the Apache Software Foundation (ASF) under one
003     * or more contributor license agreements. See the NOTICE file
004     * distributed with this work for additional information
005     * regarding copyright ownership. The ASF licenses this file
006     * to you under the Apache License, Version 2.0 (the
007     * "License"); you may not use this file except in compliance
008     * with the License. You may obtain a copy of the License at
009     *
010     * http://www.apache.org/licenses/LICENSE-2.0
011     *
012     * Unless required by applicable law or agreed to in writing,
013     * software distributed under the License is distributed on an
014     * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
015     * KIND, either express or implied. See the License for the
016     * specific language governing permissions and limitations
017     * under the License.
018     */
019    package javax.xml.soap;
020    
021    /**
022     * <P>An object representing the contents in the SOAP header part of the SOAP envelope. The
023     * immediate children of a <CODE> SOAPHeader</CODE> object can be represented only as <CODE>
024     * SOAPHeaderElement</CODE> objects.</P>
025     * <p/>
026     * <P>A <CODE>SOAPHeaderElement</CODE> object can have other <CODE>SOAPElement</CODE> objects as its
027     * children.</P>
028     */
029    public interface SOAPHeaderElement extends SOAPElement {
030    
031        /**
032         * Sets the actor associated with this <CODE> SOAPHeaderElement</CODE> object to the specified
033         * actor. The default value of an actor is: <CODE> SOAPConstants.URI_SOAP_ACTOR_NEXT</CODE>
034         *
035         * @param actorURI a <CODE>String</CODE> giving the URI of the actor to set
036         * @throws IllegalArgumentException
037         *          if there is a problem in setting the actor.
038         * @see #getActor() getActor()
039         */
040        public abstract void setActor(String actorURI);
041    
042        /**
043         * Returns the uri of the actor associated with this <CODE> SOAPHeaderElement</CODE> object.
044         *
045         * @return a <CODE>String</CODE> giving the URI of the actor
046         * @see #setActor(String) setActor(java.lang.String)
047         */
048        public abstract String getActor();
049    
050        /**
051         * Sets the mustUnderstand attribute for this <CODE> SOAPHeaderElement</CODE> object to be on or
052         * off.
053         * <p/>
054         * <P>If the mustUnderstand attribute is on, the actor who receives the
055         * <CODE>SOAPHeaderElement</CODE> must process it correctly. This ensures, for example, that if
056         * the <CODE> SOAPHeaderElement</CODE> object modifies the message, that the message is being
057         * modified correctly.</P>
058         *
059         * @param mustUnderstand <CODE>true</CODE> to set the mustUnderstand attribute on;
060         *                       <CODE>false</CODE> to turn if off
061         * @throws IllegalArgumentException
062         *          if there is a problem in setting the actor.
063         * @see #getMustUnderstand() getMustUnderstand()
064         */
065        public abstract void setMustUnderstand(boolean mustUnderstand);
066    
067        /**
068         * Returns whether the mustUnderstand attribute for this <CODE>SOAPHeaderElement</CODE> object
069         * is turned on.
070         *
071         * @return <CODE>true</CODE> if the mustUnderstand attribute of this
072         *         <CODE>SOAPHeaderElement</CODE> object is turned on; <CODE>false</CODE> otherwise
073         */
074        public abstract boolean getMustUnderstand();
075    
076        public abstract void setRole(String s)
077                throws SOAPException;
078    
079        public abstract String getRole();
080    
081        public abstract void setRelay(boolean flag)
082                throws SOAPException;
083    
084        public abstract boolean getRelay();
085    }