001: /**
002: * Licensed to the Apache Software Foundation (ASF) under one or more
003: * contributor license agreements. See the NOTICE file distributed with
004: * this work for additional information regarding copyright ownership.
005: * The ASF licenses this file to You under the Apache License, Version 2.0
006: * (the "License"); you may not use this file except in compliance with
007: * the License. You may obtain a copy of the License at
008: *
009: * http://www.apache.org/licenses/LICENSE-2.0
010: *
011: * Unless required by applicable law or agreed to in writing, software
012: * distributed under the License is distributed on an "AS IS" BASIS,
013: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014: * See the License for the specific language governing permissions and
015: * limitations under the License.
016: */package org.apache.geronimo.webservices;
017:
018: import java.util.ArrayList;
019: import java.util.HashMap;
020:
021: public class WebServiceDescription {
022: private String webServiceDescriptionName;
023: private String wsdlFile;
024: private String jaxrpcMappingFile;
025:
026: /**
027: * List of PortComponent objects
028: *
029: * @see org.apache.geronimo.webservices.PortComponent
030: */
031: private ArrayList portComponentList = new ArrayList();
032: /**
033: * Map of PortComponent objects indexed by portComponentName
034: *
035: * @see org.apache.geronimo.webservices.PortComponent#getPortComponentName
036: */
037: private HashMap portComponentMap = new HashMap();
038:
039: public String getWebServiceDescriptionName() {
040: return webServiceDescriptionName;
041: }
042:
043: public void setWebServiceDescriptionName(
044: String webServiceDescriptionName) {
045: this .webServiceDescriptionName = webServiceDescriptionName;
046: }
047:
048: public String getWsdlFile() {
049: return wsdlFile;
050: }
051:
052: public void setWsdlFile(String wsdlFile) {
053: this .wsdlFile = wsdlFile;
054: }
055:
056: public String getJaxrpcMappingFile() {
057: return jaxrpcMappingFile;
058: }
059:
060: public void setJaxrpcMappingFile(String jaxrpcMappingFile) {
061: this .jaxrpcMappingFile = jaxrpcMappingFile;
062: }
063:
064: public void addPortComponent(PortComponent portComponent)
065: throws IndexOutOfBoundsException {
066: portComponentList.add(portComponent);
067: portComponentMap.put(portComponent.getPortComponentName(),
068: portComponent);
069: }
070:
071: public void addPortComponent(int index, PortComponent portComponent)
072: throws IndexOutOfBoundsException {
073: portComponentList.add(index, portComponent);
074: portComponentMap.put(portComponent.getPortComponentName(),
075: portComponent);
076: }
077:
078: public boolean removePortComponent(PortComponent portComponent) {
079: portComponentMap.remove(portComponent.getPortComponentName());
080: return portComponentList.remove(portComponent);
081: }
082:
083: public PortComponent getPortComponent(int index)
084: throws IndexOutOfBoundsException {
085: if ((index < 0) || (index > portComponentList.size())) {
086: throw new IndexOutOfBoundsException();
087: }
088: return (PortComponent) portComponentList.get(index);
089: }
090:
091: public PortComponent[] getPortComponent() {
092: int size = portComponentList.size();
093: PortComponent[] mArray = new PortComponent[size];
094: for (int index = 0; index < size; index++) {
095: mArray[index] = (PortComponent) portComponentList
096: .get(index);
097: }
098: return mArray;
099: }
100:
101: public PortComponent getPortComponent(String portComponentName) {
102: return (PortComponent) portComponentMap.get(portComponentName);
103: }
104:
105: public void setPortComponent(int index, PortComponent portComponent)
106: throws IndexOutOfBoundsException {
107: if ((index < 0) || (index > portComponentList.size())) {
108: throw new IndexOutOfBoundsException();
109: }
110: PortComponent removed = (PortComponent) portComponentList.set(
111: index, portComponent);
112: portComponentMap.remove(removed.getPortComponentName());
113: portComponentMap.put(portComponent.getPortComponentName(),
114: portComponent);
115: }
116:
117: public void setPortComponent(PortComponent[] portComponentArray) {
118: portComponentList.clear();
119: for (int i = 0; i < portComponentArray.length; i++) {
120: PortComponent portComponent = portComponentArray[i];
121: portComponentList.add(portComponent);
122: portComponentMap.put(portComponent.getPortComponentName(),
123: portComponent);
124: }
125: }
126:
127: public void clearPortComponent() {
128: portComponentList.clear();
129: portComponentMap.clear();
130: }
131:
132: }
|