KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > appserv > management > ext > wsmgmt > WebServiceEndpointInfoImpl


1 /*
2  * The contents of this file are subject to the terms
3  * of the Common Development and Distribution License
4  * (the License). You may not use this file except in
5  * compliance with the License.
6  *
7  * You can obtain a copy of the license at
8  * https://glassfish.dev.java.net/public/CDDLv1.0.html or
9  * glassfish/bootstrap/legal/CDDLv1.0.txt.
10  * See the License for the specific language governing
11  * permissions and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL
14  * Header Notice in each file and include the License file
15  * at glassfish/bootstrap/legal/CDDLv1.0.txt.
16  * If applicable, add the following below the CDDL Header,
17  * with the fields enclosed by brackets [] replaced by
18  * you own identifying information:
19  * "Portions Copyrighted [year] [name of copyright owner]"
20  *
21  * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
22  */

23 package com.sun.appserv.management.ext.wsmgmt;
24
25 import java.util.Map JavaDoc;
26 import java.util.HashMap JavaDoc;
27 import java.io.Serializable JavaDoc;
28
29 import com.sun.appserv.management.base.XTypes;
30 import com.sun.appserv.management.base.MapCapableBase;
31
32 /**
33  * This is the mechanism to provide web service endpoint's information in a
34  * given module.
35  *
36  * @since AppServer 9.0
37  */

38 public final class WebServiceEndpointInfoImpl
39     extends MapCapableBase
40     implements WebServiceEndpointInfo {
41
42     /**
43      * Public constructor
44      *
45      * @param m Map containing keys as in {@link WebServiceEndpointInfo}
46      * and their values
47      * @param className Class name of the interface , must be
48      * WebServiceEndpointInfo.CLASS_NAME
49      */

50     public WebServiceEndpointInfoImpl(
51         final Map JavaDoc<String JavaDoc,Serializable JavaDoc> m,
52         final String JavaDoc className) {
53         super(m, className);
54     }
55
56     /**
57      * Public constructor
58      *
59      * @param name Name of the web service end point
60      * @param uri URI of the web service end point
61      * @param appid Application Id of this web service end point
62      * @param bundleName Bundle name (module name) of this web service end
63      * point
64      * @param isStandalone true, if the module (ejb or web) of this web
65      * service end point is standalone
66      * @param wsdl WSDL file location for this web service end point
67      * @param mapfile Mapping file location for this web service end
68      * point
69      * @param webservicesFile webservices.xml file location for this web
70      * service end point
71      * @param implType Implementation type of this web service end point
72      * @param implName Implemenation Ejb or Servlet name
73      * @param implClass Implementation Ejb or Servlet class name
74      * @param isSecure Secure service or not
75      */

76     public WebServiceEndpointInfoImpl( String JavaDoc name, String JavaDoc uri, String JavaDoc appid,
77         String JavaDoc bundleName, boolean isStandalone, String JavaDoc wsdl, String JavaDoc mapfile,
78
79         String JavaDoc webservicesFile, String JavaDoc implType, String JavaDoc implName,
80         String JavaDoc implClass, boolean isSecure) {
81
82         super (null, WebServiceEndpointInfo.CLASS_NAME);
83         setName(name);
84         setEndpointURI(uri);
85         setAppID(appid);
86         setIsAppStandaloneModule(isStandalone);
87         setBundleName(bundleName);
88         setWSDLFile(wsdl);
89         setWebservicesFile(webservicesFile);
90         setMappingFile(mapfile);
91         setServiceImplType(implType);
92         setServiceImplName(implName);
93         setServiceImplClass(implClass);
94         setIsSecure(isSecure);
95     }
96
97     protected boolean validate() {
98         return (true);
99     }
100
101     /**
102      * Returns the name of the WebService.
103      *
104      * @return fully qualified name of this WebService
105      */

106     public String JavaDoc getName() {
107         return (getString(WebServiceEndpointInfo.NAME_KEY));
108     }
109
110     /**
111      * Sets the name of the WebService.
112      */

113     public void setName(String JavaDoc name) {
114         putField(WebServiceEndpointInfo.NAME_KEY, name);
115     }
116
117     /**
118      * Returns the relative URI of this endpoint.
119      *
120      * @return the uri string
121      */

122     public String JavaDoc getEndpointURI() {
123         return (getString(WebServiceEndpointInfo.END_POINT_URI_KEY));
124     }
125
126     /**
127      * Sets the relative URI of this endpoint.
128      */

129     public void setEndpointURI(String JavaDoc uri) {
130         putField(WebServiceEndpointInfo.END_POINT_URI_KEY, uri);
131     }
132
133     /**
134      * Returns the name of the application or stand alone module that has
135      * this web service.
136      *
137      * @return the Application Id
138      */

139     public String JavaDoc getAppID() {
140         return (getString(WebServiceEndpointInfo.APP_ID_KEY));
141     }
142
143     /**
144      * Sets the name of the application or stand alone module that has
145      * this web service.
146      */

147     public void setAppID(String JavaDoc name) {
148         putField(WebServiceEndpointInfo.APP_ID_KEY, name);
149     }
150
151     /**
152      * Returns true if this web service belongs to a stand alone module.
153      *
154      * @return true if this web service belongs to a stand alone module
155      */

156     public boolean isAppStandaloneModule() {
157         return getBoolean(WebServiceEndpointInfo.IS_STAND_ALONE_MODULE_KEY).booleanValue();
158     }
159
160     /**
161      * Sets the boolean indicating web service belongs to a stand alone module.
162      *
163      * @param isAppStandAloneModule true if this web service belongs to a
164      * stand alone module
165      */

166     public void setIsAppStandaloneModule(boolean isAppStandAloneModule) {
167         putField(WebServiceEndpointInfo.IS_STAND_ALONE_MODULE_KEY, new
168         Boolean JavaDoc(isAppStandAloneModule) );
169     }
170
171    
172     /**
173      * Returns the module name within a EAR or null if it is a stand alone
174      * module.
175      *
176      * @return the bundle name
177      */

178     public String JavaDoc getBundleName() {
179         return (getString(WebServiceEndpointInfo.BUNDLE_NAME_KEY));
180     }
181
182     /**
183      * Sets the module name within a EAR or null if it is a stand alone
184      * module.
185      *
186      * @param name the bundle name
187      */

188     public void setBundleName(String JavaDoc name) {
189         putField(WebServiceEndpointInfo.BUNDLE_NAME_KEY, name);
190     }
191
192     /**
193      * Returns the implementation type of this web service.
194      *
195      * @return either "EJB" or "SERVLET"
196      */

197     public String JavaDoc getServiceImplType() {
198         return (getString(WebServiceEndpointInfo.SERVICE_IMPL_TYPE_KEY));
199     }
200
201     /**
202      * Sets the implementation type of this web service.
203      *
204      * @param type either "EJB" or "SERVLET"
205      */

206     public void setServiceImplType(String JavaDoc type) {
207         putField(WebServiceEndpointInfo.SERVICE_IMPL_TYPE_KEY, type);
208     }
209
210     /**
211      * Returns the implementation Ejb or Servlet name of this web service.
212      *
213      * @return the Ejb or Servlet name
214      */

215     public String JavaDoc getServiceImplName() {
216         return (getString(WebServiceEndpointInfo.SERVICE_IMPL_NAME_KEY));
217     }
218
219     /**
220      * Sets the implementation Ejb or Servlet name of this web service.
221      *
222      * @param name the Ejb or Servlet name
223      */

224     public void setServiceImplName(String JavaDoc name) {
225         putField(WebServiceEndpointInfo.SERVICE_IMPL_NAME_KEY, name);
226     }
227
228     /**
229      * Returns the implementation Ejb or Servlet class name of this web service.
230      *
231      * @return the Ejb or Servlet class name
232      */

233     public String JavaDoc getServiceImplClass() {
234         return (getString(WebServiceEndpointInfo.SERVICE_IMPL_CLASS_KEY));
235     }
236
237     /**
238      * Sets the implementation Ejb or Servlet class name of this web service.
239      *
240      * @param implClassName the Ejb or Servlet class name
241      */

242     public void setServiceImplClass(String JavaDoc implClassName) {
243         putField(WebServiceEndpointInfo.SERVICE_IMPL_CLASS_KEY, implClassName);
244     }
245
246     /**
247      * Returns the WSDL file.
248      *
249      * @return the WSDL file
250      */

251     public String JavaDoc getWSDLFile() {
252         return (getString(WebServiceEndpointInfo.WSDL_FILE_KEY));
253     }
254      
255     /**
256      * Sets the WSDL file .
257      *
258      * @param wsdl the WSDL file
259      */

260     public void setWSDLFile(String JavaDoc wsdl) {
261         putField(WebServiceEndpointInfo.WSDL_FILE_KEY, wsdl);
262     }
263
264     /**
265      * Returns the webservices.xml file .
266      *
267      * @return the Web services file
268      */

269     public String JavaDoc getWebservicesFile() {
270         return (getString(WebServiceEndpointInfo.WEB_SERVICES_FILE_KEY));
271     }
272  
273     /**
274      * Sets the webservices.xml file .
275      *
276      * @param webservicesFile the Web services file
277      */

278     public void setWebservicesFile(String JavaDoc webservicesFile) {
279         putField(WebServiceEndpointInfo.WEB_SERVICES_FILE_KEY,
280                         webservicesFile);
281     }
282
283     /**
284      * Returns the mapping file .
285      *
286      * @return the mapping file
287      */

288     public String JavaDoc getMappingFile() {
289         return (getString(WebServiceEndpointInfo.MAPPING_FILE_KEY));
290     }
291
292     /**
293      * Sets the mapping file .
294      *
295      * @param mapFile the mapping file
296      */

297     public void setMappingFile(String JavaDoc mapFile) {
298         putField(WebServiceEndpointInfo.MAPPING_FILE_KEY, mapFile);
299     }
300
301     /**
302      * Gets the web.xml file .
303      *
304      * @return webXML the web.xml file
305      */

306     public String JavaDoc getWebXML() {
307         return getString(WebServiceEndpointInfo.WEB_XML_KEY);
308     }
309
310     /**
311      * Sets the web.xml file .
312      *
313      * @param webXML the web.xml file
314      */

315     public void setWebXML(String JavaDoc webXML) {
316         putField(WebServiceEndpointInfo.WEB_XML_KEY, webXML);
317     }
318
319     /**
320      * Sets the sun-web.xml file .
321      *
322      * @param sunWebXML the sun-web.xml file
323      */

324     public void setSunWebXML(String JavaDoc sunWebXML) {
325         putField(WebServiceEndpointInfo.SUN_WEB_XML_KEY,
326             sunWebXML);
327     }
328
329     /**
330      * Gets the sun-web.xml file .
331      *
332      * @return sunWebXML the sun-web.xml file
333      */

334     public String JavaDoc getSunWebXML() {
335         return getString(WebServiceEndpointInfo.SUN_WEB_XML_KEY);
336     }
337
338     /**
339      * Sets the ejb.xml file .
340      *
341      * @param EJBXML the ejb.xml file
342      */

343     public void setEJBXML(String JavaDoc EJBXML) {
344         putField(WebServiceEndpointInfo.EJB_XML_KEY, EJBXML);
345     }
346
347     /**
348      * Gets the ejb.xml file .
349      *
350      * @return EJBXML the ejb.xml file
351      */

352     public String JavaDoc getEJBXML() {
353         return getString(WebServiceEndpointInfo.EJB_XML_KEY);
354     }
355
356     /**
357      * Sets the sun-ejb.xml file .
358      *
359      * @param sunEJBXML the sun-ejb.xml file
360      */

361     public void setSunEJBXML(String JavaDoc sunEJBXML) {
362         putField(WebServiceEndpointInfo.SUN_EJB_XML_KEY,
363                             sunEJBXML);
364     }
365
366     /**
367      * Gets the sun-ejb.xml file .
368      *
369      * @return sunEJBXML the sun-ejb.xml file
370      */

371     public String JavaDoc getSunEJBXML() {
372         return getString(WebServiceEndpointInfo.SUN_EJB_XML_KEY);
373     }
374
375     /**
376      * Sets the application.xml file .
377      *
378      * @param applicationXML the application.xml file
379      */

380     public void setApplicationXML(String JavaDoc applicationXML) {
381         putField(WebServiceEndpointInfo.APPLICATION_XML_KEY,
382                             applicationXML);
383     }
384
385     /**
386      * Gets the application.xml file .
387      *
388      * @return applicationXML the application.xml file
389      */

390     public String JavaDoc getApplicationXML() {
391         return getString(WebServiceEndpointInfo.APPLICATION_XML_KEY);
392     }
393
394     /**
395      * Returns true if this web service is secured or not.
396      * Corresponds to the {@link #IS_SECURE_KEY} key.
397      *
398      * @return true, if this web service is secured, false otherwise
399      */

400     public boolean isSecure() {
401         return getBoolean(WebServiceEndpointInfo.IS_SECURE_KEY).booleanValue();
402     }
403
404     /**
405      * Returns true if this web service is secured or not.
406      * Corresponds to the {@link #IS_SECURE_KEY} key.
407      *
408      * @return true, if this web service is secured, false otherwise
409      */

410     public void setIsSecure(boolean isSec) {
411         putField(WebServiceEndpointInfo.IS_SECURE_KEY, new
412         Boolean JavaDoc(isSec) );
413     }
414
415     /**
416      * Returns the descriptor . The descriptors include WSDL,
417      * webservices.xml and mapping file. If the alt WSDL is specified
418      * in the archive, the overridden (correct) WSDL file is returned.
419      *
420      * @return the descriptors
421      */

422     public String JavaDoc[] getDescriptors() {
423         String JavaDoc [] list = new String JavaDoc[3];
424         list[0] = getString(WebServiceEndpointInfo.WSDL_FILE_KEY);
425         list[1] = getString(WebServiceEndpointInfo.WEB_SERVICES_FILE_KEY);
426         list[2] = getString(WebServiceEndpointInfo.MAPPING_FILE_KEY);
427         return list;
428     }
429 }
430
Popular Tags