KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > enterprise > admin > wsmgmt > repository > impl > WebServiceInfoImpl


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.enterprise.admin.wsmgmt.repository.impl;
24
25 import com.sun.enterprise.admin.wsmgmt.repository.spi.WebServiceInfo;
26
27 /**
28  * This is the mechanism to provide web service information for a given module.
29  * A WebServiceInfoProvider implementation is a class that extends the
30  * WebServiceInfoProvider abstract class. Some WebServiceInfoProvider can deal
31  * with ejb and web module. Some only deal with web modules.
32  * <br>
33  */

34 public class WebServiceInfoImpl implements WebServiceInfo {
35
36     /**
37      * Public constructor
38      *
39      * @param name Name of the web service end point
40      * @param uri URI of the web service end point
41      * @param appid Application Id of this web service end point
42      * @param bundleName Bundle name (module name) of this web service end
43      * point
44      * @param isStandAlone true, if the module (ejb or web) of this web
45      * service end point is standalone
46      * @param wsdl WSDL file location for this web service end point
47      * @param mapFile Mapping file location for this web service end
48      * point
49      * @param webservicesFile webservices.xml file location for this web
50      * service end point
51      * @param implType Implementation type of this web service end point
52      * @param implName Implemenation Ejb or Servlet name
53      * @param implClass Implementation Ejb or Servlet class name
54      */

55
56     public WebServiceInfoImpl( String JavaDoc name, String JavaDoc uri, String JavaDoc appid,
57         String JavaDoc bundleName, boolean isStandAlone, String JavaDoc wsdl, String JavaDoc mapfile,
58         String JavaDoc webservicesFile, String JavaDoc implType, String JavaDoc implName,
59         String JavaDoc implClass) {
60             wsName = name;
61             wsUri = uri;
62             wsAppId = appid;
63             wsAppStandAloneModule = isStandAlone;
64             wsBundleName = bundleName;
65             wsWSDL = wsdl;
66             wsWebServices = webservicesFile;
67             wsMapping = mapfile;
68             wsImplType = implType;
69             wsImplName = implName;
70             wsImplClass = implClass;
71         }
72
73     /**
74      * Returns the name of the WebService.
75      *
76      * @return fully qualified name of this WebService
77      */

78     public String JavaDoc getName() {
79         return wsName;
80     }
81
82     /**
83      * Returns the relative URI of this endpoint.
84      *
85      * @return the uri string
86      */

87     public String JavaDoc getEndpointUri() {
88         return wsUri;
89     }
90
91     /**
92      * Returns the name of the application or stand alone module that has
93      * this web service.
94      *
95      * @return the Application Id
96      */

97     public String JavaDoc getAppId() {
98         return wsAppId;
99     }
100
101     /**
102      * Returns true if this web service belongs to a stand alone module.
103      *
104      * @return true if this web service belongs to a stand alone module
105      */

106     public boolean isAppStandAloneModule() {
107         return wsAppStandAloneModule;
108     }
109    
110     /**
111      * Returns the module name within a EAR or null if it is a stand alone
112      * module.
113      *
114      * @return the bundle name
115      */

116     public String JavaDoc getBundleName() {
117         return wsBundleName;
118     }
119
120     /**
121      * Returns the implementation type of this web service.
122      *
123      * @return either "EJB" or "SERVLET"
124      */

125     public String JavaDoc getServiceImplType() {
126         return wsImplType;
127     }
128
129     /**
130      * Returns the implementation Ejb or Servlet name of this web service.
131      *
132      * @return the Ejb or Servlet name
133      */

134     public String JavaDoc getServiceImplName() {
135         return wsImplName;
136     }
137
138     /**
139      * Returns the implementation Ejb or Servlet class name of this web service.
140      *
141      * @return the Ejb or Servlet class name
142      */

143     public String JavaDoc getServiceImplClass() {
144         return wsImplClass;
145     }
146
147     /**
148      * Returns the WSDL file location.
149      *
150      * @return the WSDL file location
151      */

152     public String JavaDoc getWSDLFileLocation() {
153         return wsWSDL;
154     }
155      
156     /**
157      * Returns the webservices.xml file location.
158      *
159      * @return the Web services file location
160      */

161     public String JavaDoc getWebservicesFileLocation() {
162         return wsWebServices;
163     }
164  
165     /**
166      * Returns the mapping file location.
167      *
168      * @return the mapping file location
169      */

170     public String JavaDoc getMappingFileLocation() {
171         return wsMapping;
172     }
173
174     /**
175      * Returns the descriptor locations. The descriptors include WSDL,
176      * webservices.xml and mapping file. If the alt WSDL location is specified
177      * in the archive, the overridden (correct) WSDL file location is returned.
178      *
179      * @return the descriptor locations
180      */

181     public String JavaDoc[] getDescriptorLocations() {
182         String JavaDoc [] list = new String JavaDoc[3];
183         list[0] = wsWSDL;
184         list[1] = wsWebServices;
185         list[2] = wsMapping;
186         return list;
187     }
188
189     /**
190      * Provides the string representation for this web sevice end point.
191      *
192      * @return string representation.
193      */

194     public String JavaDoc toString() {
195         return "Web Service Name: " + wsName + " URI: " + wsUri +
196         " Application Id " + wsAppId + " isStandAlone?: " +
197         wsAppStandAloneModule + " Bundle Name: " + wsBundleName +
198         " WSDL location " + wsWSDL + " Mapping file location: " +
199         wsMapping + " webservices.xml location: " + wsWebServices +
200         " impl Type " + wsImplType + " impl Name " + wsImplName +
201         " impl Class " + wsImplClass;
202     }
203
204     private String JavaDoc wsName;
205     private String JavaDoc wsUri;
206     private String JavaDoc wsAppId;
207     private boolean wsAppStandAloneModule;
208     private String JavaDoc wsBundleName;
209     private String JavaDoc wsWSDL;
210     private String JavaDoc wsWebServices;
211     private String JavaDoc wsMapping;
212     private String JavaDoc wsImplName;
213     private String JavaDoc wsImplType;
214     private String JavaDoc wsImplClass;
215
216 }
217
Popular Tags