KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > axis2 > soap > SOAPHeader


1 /*
2  * Copyright 2004,2005 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16 package org.apache.axis2.soap;
17
18 import org.apache.axis2.om.OMElement;
19 import org.apache.axis2.om.OMException;
20 import org.apache.axis2.om.OMNamespace;
21
22 import java.util.ArrayList JavaDoc;
23 import java.util.Iterator JavaDoc;
24
25 /**
26  * Interface SOAPHeader
27  */

28 public interface SOAPHeader extends OMElement {
29     /**
30      * Creates a new <CODE>SOAPHeaderBlock</CODE> object
31      * initialized with the specified name and adds it to this
32      * <CODE>SOAPHeader</CODE> object.
33      *
34      * @param localName
35      * @param ns
36      * @return the new <CODE>SOAPHeaderBlock</CODE> object that
37      * was inserted into this <CODE>SOAPHeader</CODE>
38      * object
39      * @throws org.apache.axis2.om.OMException if a SOAP error occurs
40      */

41     public abstract SOAPHeaderBlock addHeaderBlock(
42             String JavaDoc localName, OMNamespace ns) throws OMException;
43
44     /**
45      * Returns a list of all the <CODE>SOAPHeaderBlock</CODE>
46      * objects in this <CODE>SOAPHeader</CODE> object that have the
47      * the specified role. An role is a global attribute that
48      * indicates the intermediate parties to whom the message should
49      * be sent. An role receives the message and then sends it to
50      * the next role. The default role is the ultimate intended
51      * recipient for the message, so if no role attribute is
52      * included in a <CODE>SOAPHeader</CODE> object, the message is
53      * sent to its ultimate destination.
54      *
55      * @param role a <CODE>String</CODE> giving the
56      * URI of the role for which to search
57      * @return an <CODE>Iterator</CODE> object over all the <CODE>
58      * SOAPHeaderBlock</CODE> objects that contain the
59      * specified role
60      * @see #extractHeaderBlocks(java.lang.String) extractHeaderBlocks(java.lang.String)
61      */

62     public abstract Iterator JavaDoc examineHeaderBlocks(String JavaDoc role);
63
64     /**
65      * Returns a list of all the <CODE>SOAPHeaderBlock</CODE>
66      * objects in this <CODE>SOAPHeader</CODE> object that have
67      * the the specified role and detaches them from this <CODE>
68      * SOAPHeader</CODE> object.
69      * <P>This method allows an role to process only the parts of
70      * the <CODE>SOAPHeader</CODE> object that apply to it and to
71      * remove them before passing the message on to the next
72      * role.
73      *
74      * @param role a <CODE>String</CODE> giving the
75      * URI of the role for which to search
76      * @return an <CODE>Iterator</CODE> object over all the <CODE>
77      * SOAPHeaderBlock</CODE> objects that contain the
78      * specified role
79      * @see #examineHeaderBlocks(java.lang.String) examineHeaderBlocks(java.lang.String)
80      */

81     public abstract Iterator JavaDoc extractHeaderBlocks(String JavaDoc role);
82
83     /**
84      * Returns an <code>Iterator</code> over all the
85      * <code>SOAPHeaderBlock</code> objects in this <code>SOAPHeader</code>
86      * object that have the specified role and that have a MustUnderstand
87      * attribute whose value is equivalent to <code>true</code>.
88      *
89      * @param role a <code>String</code> giving the URI of the role for which
90      * to search
91      * @return an <code>Iterator</code> object over all the
92      * <code>SOAPHeaderBlock</code> objects that contain the
93      * specified role and are marked as MustUnderstand
94      */

95     public abstract Iterator JavaDoc examineMustUnderstandHeaderBlocks(String JavaDoc role);
96
97     /**
98      * Returns an <code>Iterator</code> over all the
99      * <code>SOAPHeaderBlock</code> objects in this <code>SOAPHeader</code>
100      * object.
101      *
102      * @return an <code>Iterator</code> object over all the
103      * <code>SOAPHeaderBlock</code> objects contained by this
104      * <code>SOAPHeader</code>
105      */

106     public abstract Iterator JavaDoc examineAllHeaderBlocks();
107
108     /**
109      * Returns an <code>Iterator</code> over all the
110      * <code>SOAPHeaderBlock</code> objects in this <code>SOAPHeader </code>
111      * object and detaches them from this <code>SOAPHeader</code> object.
112      *
113      * @return an <code>Iterator</code> object over all the
114      * <code>SOAPHeaderBlock</code> objects contained by this
115      * <code>SOAPHeader</code>
116      */

117     public abstract Iterator JavaDoc extractAllHeaderBlocks();
118     
119     /**
120      * Return all the Headers that has the Namespace URI to given NS URI
121      * @param nsURI
122      * @return
123      */

124     public ArrayList JavaDoc getHeaderBolcksWithNSURI(String JavaDoc nsURI);
125 }
126
Popular Tags