1 17 package org.apache.geronimo.webservices; 18 19 import java.util.ArrayList ; 20 import java.util.HashMap ; 21 22 public class WebServiceDescription { 23 private String webServiceDescriptionName; 24 private String wsdlFile; 25 private String jaxrpcMappingFile; 26 27 32 private ArrayList portComponentList = new ArrayList (); 33 38 private HashMap portComponentMap = new HashMap (); 39 40 public String getWebServiceDescriptionName() { 41 return webServiceDescriptionName; 42 } 43 44 public void setWebServiceDescriptionName(String webServiceDescriptionName) { 45 this.webServiceDescriptionName = webServiceDescriptionName; 46 } 47 48 public String getWsdlFile() { 49 return wsdlFile; 50 } 51 52 public void setWsdlFile(String wsdlFile) { 53 this.wsdlFile = wsdlFile; 54 } 55 56 public String getJaxrpcMappingFile() { 57 return jaxrpcMappingFile; 58 } 59 60 public void setJaxrpcMappingFile(String jaxrpcMappingFile) { 61 this.jaxrpcMappingFile = jaxrpcMappingFile; 62 } 63 64 public void addPortComponent(PortComponent portComponent) throws IndexOutOfBoundsException { 65 portComponentList.add(portComponent); 66 portComponentMap.put(portComponent.getPortComponentName(), portComponent); 67 } 68 69 public void addPortComponent(int index, PortComponent portComponent) throws IndexOutOfBoundsException { 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 { 80 if ((index < 0) || (index > portComponentList.size())) { 81 throw new IndexOutOfBoundsException (); 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 portComponentName) { 96 return (PortComponent) portComponentMap.get(portComponentName); 97 } 98 99 public void setPortComponent(int index, PortComponent portComponent) throws IndexOutOfBoundsException { 100 if ((index < 0) || (index > portComponentList.size())) { 101 throw new IndexOutOfBoundsException (); 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 |