View Javadoc

1   /*
2    * Copyright 2001-2004 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.geronimo.ews.ws4j2ee.context.webservices.server;
17  
18  import org.apache.geronimo.ews.ws4j2ee.context.webservices.server.interfaces.WSCFPortComponent;
19  import org.apache.geronimo.ews.ws4j2ee.context.webservices.server.interfaces.WSCFWebserviceDescription;
20  
21  import java.util.HashMap;
22  
23  /***
24   * This represents a level 1 element in the Element tree :webservice-description. This is the concrete implementation of the
25   * WSCFWebServiceDescription interface
26   */
27  public class AbstractWSCFWebserviceDescription extends WSCFElement implements WSCFWebserviceDescription {
28  
29      /***
30       * This will refer to the multiple port components that can be there in the webservice-description Element.
31       */
32      protected HashMap portComponent = new HashMap();
33  
34      /***
35       * Webservice-description - description
36       */
37      protected String description;
38  
39      /***
40       * Webservice-description - display name
41       */
42      protected String displayName;
43  
44      /***
45       * Webservice-description - small icon
46       */
47      protected String smallIcon;
48  
49      /***
50       * Webservice-description - large icon
51       */
52      protected String largeIcon;
53  
54      /***
55       * Webservice-description - name
56       */
57      protected String webserviceDescriptionName;
58  
59      /***
60       * Webservice-description - wsdl file
61       */
62      protected String wsdlFile;
63  
64      /***
65       * Webservice-description - jaxrpc mapping file
66       */
67      protected String jaxrpcMappingFile;
68  	
69  	
70  //	////////////////////////////////////jaxb interfacing block /////////////////////////////////////////////
71  //	
72  //	protected WebserviceDescriptionType jaxbWebserviesDescription;
73  //	
74  //	
75  //	public WSCFWebserviceDescriptionImpl(WebserviceDescriptionType jaxbWebserviesDescription) throws WSCFException{
76  //		this.jaxbWebserviesDescription = jaxbWebserviesDescription;
77  //		
78  //		///////////////assigning the values //////////////
79  //		if(null != jaxbWebserviesDescription.getDescription())
80  //  			this.description =jaxbWebserviesDescription.getDescription().getValue();
81  //		
82  //		if(null != jaxbWebserviesDescription.getDisplayName())			
83  //  			this.displayName =jaxbWebserviesDescription.getDisplayName().getValue();
84  //  		
85  //  		if(null != jaxbWebserviesDescription.getIcon()){
86  //  			if(null != (PathType)(jaxbWebserviesDescription.getIcon()).getSmallIcon())
87  //  				this.smallIcon =((PathType)(jaxbWebserviesDescription.getIcon()).getSmallIcon()).getValue();
88  //  				
89  //  			if(null != (PathType)(jaxbWebserviesDescription.getIcon()).getLargeIcon())
90  //  				this.largeIcon =((PathType)(jaxbWebserviesDescription.getIcon()).getLargeIcon()).getValue();
91  //  		}
92  //  		
93  //  		if(null != jaxbWebserviesDescription.getWebserviceDescriptionName())
94  //  			this.webserviceDescriptionName = jaxbWebserviesDescription.getWebserviceDescriptionName().getValue();
95  //  		
96  //  		if(null != jaxbWebserviesDescription.getWsdlFile())
97  //  			this.wsdlFile = ((PathType)jaxbWebserviesDescription.getWsdlFile()).getValue();
98  //  		
99  //  		if(null != jaxbWebserviesDescription.getJaxrpcMappingFile())
100 //  			this.jaxrpcMappingFile = ((PathType)jaxbWebserviesDescription.getJaxrpcMappingFile()).getValue();
101 //  		
102 //  		java.util.List list = this.jaxbWebserviesDescription.getPortComponent();
103 //  		if (0 == list.size()){throw new WSCFException("At least one port-component element should exist in the "+this.description+" webservices element.");}
104 //  		for(int i=0; i < list.size(); i++){
105 //	  		WSCFPortComponent portComponent = new AbstractWSCFPortComponentImpl(((PortComponentType)list.get(i)));
106 //	  		this.portComponent.put(portComponent.getPortComponentName(), portComponent);
107 //		}
108 //	}
109 //	
110 //	
111 //	/////////////////////////////////////////////////////////////////////////////////////////////////
112 //	
113 //	
114 //	/***
115 //	 * The constructor. Here the child elements will be created recursively in a depth first manner.
116 //	 * This is the concrete implementation of the WSCFWebserviceDescrption.
117 //	 * @param e Webservice-description Element
118 //	 * @throws WSCFException
119 //	 */
120 //	public WSCFWebserviceDescriptionImpl(Element e)throws WSCFException{
121 //		super(e);
122 //		//extract the description
123 //		Element element = this.getChildElement(e,WSCFConstants.ELEM_WSCF_DESCRIPTION);
124 //		if(null != element){this.description = element.getChildNodes().item(0).toString();}
125 //		
126 //		//extract the display name
127 //		element = this.getChildElement(e, WSCFConstants.ELEM_WSCF_DISPLAY_NAME);
128 //		if(null != element){this.displayName = element.getChildNodes().item(0).toString();}
129 //		
130 //		//extract the small icon.
131 //		element = this.getChildElement(e, WSCFConstants.ELEM_WSCF_SMALL_ICON);
132 //		if(null != element){this.smallIcon = element.getChildNodes().item(0).toString();}
133 //		
134 //		//extract the large icon
135 //		element = this.getChildElement(e, WSCFConstants.ELEM_WSCF_LARGE_ICON);
136 //		if (null != element){this.largeIcon = element.getChildNodes().item(0).toString();}
137 //		
138 //		//extract the webservice description name.
139 //		element = this.getChildElement(e, WSCFConstants.ELEM_WSCF_WEBSERVICES_DESCRIPTION_NAME);
140 //		if(null != element){this.webserviceDescriptionName = element.getChildNodes().item(0).toString();}
141 //		
142 //		//extract the wsdl file
143 //		element = this.getChildElement(e, WSCFConstants.ELEM_WSCF_WSDLFILE);
144 //		if(null != element){this.wsdlFile = element.getChildNodes().item(0).toString();}
145 //		
146 //		//extract the jax rpc mapping file
147 //		element = this.getChildElement(e, WSCFConstants.ELEM_WSCF_JAXRPC_MAPPING_FILE);
148 //		if(null != element){this.jaxrpcMappingFile = element.getChildNodes().item(0).toString();}
149 //		
150 //		//extract the port component
151 //		Element[] elements = this.getChildElements(e, WSCFConstants.ELEM_WSCF_PORT_COMPONENT);
152 //		for(int i=0; i < elements.length; i++){
153 //			WSCFPortComponent portComponent = new AbstractWSCFPortComponentImpl(elements[i]);
154 //			this.portComponent.put(portComponent.getPortComponentName(), portComponent);
155 //		}
156 //		
157 //	}
158 		
159 		
160     /***
161      * Gets the description of the webservices-description Element
162      *
163      * @return description
164      */
165     public String getDescription() {
166         return description;
167     }
168 
169     /***
170      * Gets the display name of the webservices-description Element
171      *
172      * @return display-name
173      */
174     public String getDisplayName() {
175         return displayName;
176     }
177 
178     /***
179      * Gets the JAXRPC mapping file of the webservices-description Element
180      *
181      * @return JAXRPC-mapping-file
182      */
183     public String getJaxrpcMappingFile() {
184         return jaxrpcMappingFile;
185     }
186 
187     /***
188      * Gets the large icon of the webservices-description Element
189      *
190      * @return large-icon
191      */
192     public String getLargeIcon() {
193         return largeIcon;
194     }
195 
196     /***
197      * Gets the port compoments of the webservices-description Element as an array
198      *
199      * @return port components
200      */
201     public WSCFPortComponent[] getPortComponent() {
202         WSCFPortComponent[] portComponents = new WSCFPortComponent[this.portComponent.size()];
203         this.portComponent.values().toArray(portComponents);
204         return portComponents;
205     }
206 
207     /***
208      * Gets the small icon of the webservices-description Element
209      *
210      * @return small-icon
211      */
212     public String getSmallIcon() {
213         return smallIcon;
214     }
215 
216     /***
217      * Gets the name of the webservices-description Element
218      *
219      * @return webservice-description-name
220      */
221     public String getWebserviceDescriptionName() {
222         return webserviceDescriptionName;
223     }
224 
225     /***
226      * Gets the wsdl file of the webservices-description Element
227      *
228      * @return wsdl-file
229      */
230     public String getWsdlFile() {
231         return wsdlFile;
232     }
233 
234 //	/***
235 //	 * @return
236 //	 */
237 //	public WebserviceDescriptionType getJaxbWebserviesDescription() {
238 //		return jaxbWebserviesDescription;
239 //	}
240 
241 }