KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > geronimo > webservices > Handler


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

17 package org.apache.geronimo.webservices;
18
19 import java.util.ArrayList JavaDoc;
20
21 public class Handler {
22     private String JavaDoc handlerName;
23     private String JavaDoc handlerClass;
24     private ArrayList JavaDoc soapHeaderList = new ArrayList JavaDoc();
25     private ArrayList JavaDoc soapRoleList = new ArrayList JavaDoc();
26
27     public String JavaDoc getHandlerName() {
28         return handlerName;
29     }
30
31     public void setHandlerName(String JavaDoc handlerName) {
32         this.handlerName = handlerName;
33     }
34
35     public String JavaDoc getHandlerClass() {
36         return handlerClass;
37     }
38
39     public void setHandlerClass(String JavaDoc handlerClass) {
40         this.handlerClass = handlerClass;
41     }
42
43
44     public void addSoapHeader(String JavaDoc soapHeader) throws IndexOutOfBoundsException JavaDoc {
45         soapHeaderList.add(soapHeader);
46     }
47
48     public void addSoapHeader(int index, String JavaDoc soapHeader) throws IndexOutOfBoundsException JavaDoc {
49         soapHeaderList.add(index, soapHeader);
50     }
51
52     public boolean removeSoapHeader(String JavaDoc soapHeader) {
53         return soapHeaderList.remove(soapHeader);
54     }
55
56     public String JavaDoc getSoapHeader(int index) throws IndexOutOfBoundsException JavaDoc {
57         if ((index < 0) || (index > soapHeaderList.size())) {
58             throw new IndexOutOfBoundsException JavaDoc();
59         }
60         return (String JavaDoc) soapHeaderList.get(index);
61     }
62
63     public String JavaDoc[] getSoapHeader() {
64         int size = soapHeaderList.size();
65         String JavaDoc[] mArray = new String JavaDoc[size];
66         for (int index = 0; index < size; index++) {
67             mArray[index] = (String JavaDoc) soapHeaderList.get(index);
68         }
69         return mArray;
70     }
71
72     public void setSoapHeader(int index, String JavaDoc soapHeader) throws IndexOutOfBoundsException JavaDoc {
73         if ((index < 0) || (index > soapHeaderList.size())) {
74             throw new IndexOutOfBoundsException JavaDoc();
75         }
76         soapHeaderList.set(index, soapHeader);
77     }
78
79     public void setSoapHeader(String JavaDoc[] soapHeaderArray) {
80         soapHeaderList.clear();
81         for (int i = 0; i < soapHeaderArray.length; i++) {
82             String JavaDoc soapHeader = soapHeaderArray[i];
83             soapHeaderList.add(soapHeader);
84         }
85     }
86
87     public void clearSoapHeader() {
88         soapHeaderList.clear();
89     }
90
91
92     public void addSoapRole(String JavaDoc soapRole) throws IndexOutOfBoundsException JavaDoc {
93         soapRoleList.add(soapRole);
94     }
95
96     public void addSoapRole(int index, String JavaDoc soapRole) throws IndexOutOfBoundsException JavaDoc {
97         soapRoleList.add(index, soapRole);
98     }
99
100     public boolean removeSoapRole(String JavaDoc soapRole) {
101         return soapRoleList.remove(soapRole);
102     }
103
104     public String JavaDoc getSoapRole(int index) throws IndexOutOfBoundsException JavaDoc {
105         if ((index < 0) || (index > soapRoleList.size())) {
106             throw new IndexOutOfBoundsException JavaDoc();
107         }
108         return (String JavaDoc) soapRoleList.get(index);
109     }
110
111     public String JavaDoc[] getSoapRole() {
112         int size = soapRoleList.size();
113         String JavaDoc[] mArray = new String JavaDoc[size];
114         for (int index = 0; index < size; index++) {
115             mArray[index] = (String JavaDoc) soapRoleList.get(index);
116         }
117         return mArray;
118     }
119
120     public void setSoapRole(int index, String JavaDoc soapRole) throws IndexOutOfBoundsException JavaDoc {
121         if ((index < 0) || (index > soapRoleList.size())) {
122             throw new IndexOutOfBoundsException JavaDoc();
123         }
124         soapRoleList.set(index, soapRole);
125     }
126
127     public void setSoapRole(String JavaDoc[] soapRoleArray) {
128         soapRoleList.clear();
129         for (int i = 0; i < soapRoleArray.length; i++) {
130             String JavaDoc soapRole = soapRoleArray[i];
131             soapRoleList.add(soapRole);
132         }
133     }
134
135     public void clearSoapRole() {
136         soapRoleList.clear();
137     }
138
139
140 }
141
Popular Tags