KickJava   Java API By Example, From Geeks To Geeks.

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


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 import java.util.HashMap JavaDoc;
21
22 public class WebServiceDescription {
23     private String JavaDoc webServiceDescriptionName;
24     private String JavaDoc wsdlFile;
25     private String JavaDoc jaxrpcMappingFile;
26
27     /**
28      * List of PortComponent objects
29      *
30      * @see org.apache.geronimo.webservices.PortComponent
31      */

32     private ArrayList JavaDoc portComponentList = new ArrayList JavaDoc();
33     /**
34      * Map of PortComponent objects indexed by portComponentName
35      *
36      * @see org.apache.geronimo.webservices.PortComponent#getPortComponentName
37      */

38     private HashMap JavaDoc portComponentMap = new HashMap JavaDoc();
39
40     public String JavaDoc getWebServiceDescriptionName() {
41         return webServiceDescriptionName;
42     }
43
44     public void setWebServiceDescriptionName(String JavaDoc webServiceDescriptionName) {
45         this.webServiceDescriptionName = webServiceDescriptionName;
46     }
47
48     public String JavaDoc getWsdlFile() {
49         return wsdlFile;
50     }
51
52     public void setWsdlFile(String JavaDoc wsdlFile) {
53         this.wsdlFile = wsdlFile;
54     }
55
56     public String JavaDoc getJaxrpcMappingFile() {
57         return jaxrpcMappingFile;
58     }
59
60     public void setJaxrpcMappingFile(String JavaDoc jaxrpcMappingFile) {
61         this.jaxrpcMappingFile = jaxrpcMappingFile;
62     }
63
64     public void addPortComponent(PortComponent portComponent) throws IndexOutOfBoundsException JavaDoc {
65         portComponentList.add(portComponent);
66         portComponentMap.put(portComponent.getPortComponentName(), portComponent);
67     }
68
69     public void addPortComponent(int index, PortComponent portComponent) throws IndexOutOfBoundsException JavaDoc {
70         portComponentList.add(index, portComponent);
71         portComponentMap.put(portComponent.getPortComponentName(), portComponent);
72     }
73
74     public boolean removePortComponent(PortComponent portComponent) {
75         portComponentMap.remove(portComponent.getPortComponentName());
76         return portComponentList.remove(portComponent);
77     }
78
79     public PortComponent getPortComponent(int index) throws IndexOutOfBoundsException JavaDoc {
80         if ((index < 0) || (index > portComponentList.size())) {
81             throw new IndexOutOfBoundsException JavaDoc();
82         }
83         return (PortComponent) portComponentList.get(index);
84     }
85
86     public PortComponent[] getPortComponent() {
87         int size = portComponentList.size();
88         PortComponent[] mArray = new PortComponent[size];
89         for (int index = 0; index < size; index++) {
90             mArray[index] = (PortComponent) portComponentList.get(index);
91         }
92         return mArray;
93     }
94
95     public PortComponent getPortComponent(String JavaDoc portComponentName) {
96         return (PortComponent) portComponentMap.get(portComponentName);
97     }
98
99     public void setPortComponent(int index, PortComponent portComponent) throws IndexOutOfBoundsException JavaDoc {
100         if ((index < 0) || (index > portComponentList.size())) {
101             throw new IndexOutOfBoundsException JavaDoc();
102         }
103         PortComponent removed = (PortComponent) portComponentList.set(index, portComponent);
104         portComponentMap.remove(removed.getPortComponentName());
105         portComponentMap.put(portComponent.getPortComponentName(), portComponent);
106     }
107
108     public void setPortComponent(PortComponent[] portComponentArray) {
109         portComponentList.clear();
110         for (int i = 0; i < portComponentArray.length; i++) {
111             PortComponent portComponent = portComponentArray[i];
112             portComponentList.add(portComponent);
113             portComponentMap.put(portComponent.getPortComponentName(), portComponent);
114         }
115     }
116
117     public void clearPortComponent() {
118         portComponentList.clear();
119         portComponentMap.clear();
120     }
121
122 }
123
Popular Tags