KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > enterprise > tools > common > dd > WebserviceEndpoint


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
24 /**
25  * This generated bean class WebserviceEndpoint matches the schema element
26  * webservice-endpoint. Hand Modified on August 8, 2006 to support
27  * MessageSecurityBinding - to avoid regenerating all the schema2beans.
28  * The generated files - Message.java, MessageSecurityBinding.java,
29  * JavaMethod.java and MethodParams.java are added to this directory.
30  * These files are required by MessageSecurityBinding.java
31  *
32  * Generated on Wed Aug 13 12:12:27 PDT 2003
33  */

34
35 package com.sun.enterprise.tools.common.dd;
36
37 import org.w3c.dom.*;
38 import org.netbeans.modules.schema2beans.*;
39 import java.beans.*;
40 import java.util.*;
41
42 // BEGIN_NOI18N
43

44 public class WebserviceEndpoint extends com.sun.enterprise.tools.common.dd.SunBaseBean
45 {
46
47     static Vector comparators = new Vector();
48
49     static public final String JavaDoc PORT_COMPONENT_NAME = "PortComponentName"; // NOI18N
50
static public final String JavaDoc ENDPOINT_ADDRESS_URI = "EndpointAddressUri"; // NOI18N
51
static public final String JavaDoc LOGIN_CONFIG = "LoginConfig"; // NOI18N
52
static public final String JavaDoc MESSAGE_SECURITY_BINDING = "MessageSecurityBinding"; // NOI18N
53
static public final String JavaDoc TRANSPORT_GUARANTEE = "TransportGuarantee"; // NOI18N
54
static public final String JavaDoc SERVICE_QNAME = "ServiceQname"; // NOI18N
55
static public final String JavaDoc TIE_CLASS = "TieClass"; // NOI18N
56
static public final String JavaDoc SERVLET_IMPL_CLASS = "ServletImplClass"; // NOI18N
57

58     public WebserviceEndpoint() {
59         this(Common.USE_DEFAULT_VALUES);
60     }
61
62     public WebserviceEndpoint(int options)
63     {
64         super(comparators, new org.netbeans.modules.schema2beans.Version(1, 2, 0));
65         // Properties (see root bean comments for the bean graph)
66
this.createProperty("port-component-name", // NOI18N
67
PORT_COMPONENT_NAME,
68             Common.TYPE_1 | Common.TYPE_STRING | Common.TYPE_KEY,
69             String JavaDoc.class);
70         this.createProperty("endpoint-address-uri", // NOI18N
71
ENDPOINT_ADDRESS_URI,
72             Common.TYPE_0_1 | Common.TYPE_STRING | Common.TYPE_KEY,
73             String JavaDoc.class);
74         this.createProperty("login-config", // NOI18N
75
LOGIN_CONFIG,
76             Common.TYPE_0_1 | Common.TYPE_BEAN | Common.TYPE_KEY,
77             LoginConfig.class);
78                 this.createProperty("message-security-binding", // NOI18N
79
MESSAGE_SECURITY_BINDING, Common.SEQUENCE_OR |
80                         Common.TYPE_1 | Common.TYPE_BEAN | Common.TYPE_KEY,
81                         MessageSecurityBinding.class);
82         this.createProperty("transport-guarantee", // NOI18N
83
TRANSPORT_GUARANTEE,
84             Common.TYPE_0_1 | Common.TYPE_STRING | Common.TYPE_KEY,
85             String JavaDoc.class);
86         this.createProperty("service-qname", // NOI18N
87
SERVICE_QNAME,
88             Common.TYPE_0_1 | Common.TYPE_BEAN | Common.TYPE_KEY,
89             ServiceQname.class);
90         this.createProperty("tie-class", // NOI18N
91
TIE_CLASS,
92             Common.TYPE_0_1 | Common.TYPE_STRING | Common.TYPE_KEY,
93             String JavaDoc.class);
94         this.createProperty("servlet-impl-class", // NOI18N
95
SERVLET_IMPL_CLASS,
96             Common.TYPE_0_1 | Common.TYPE_STRING | Common.TYPE_KEY,
97             String JavaDoc.class);
98         this.initialize(options);
99     }
100
101     // Setting the default values of the properties
102
void initialize(int options)
103     {
104                     
105     }
106
107     // This attribute is mandatory
108
public void setPortComponentName(String JavaDoc value) {
109         this.setValue(PORT_COMPONENT_NAME, value);
110     }
111
112     //
113
public String JavaDoc getPortComponentName() {
114         return (String JavaDoc)this.getValue(PORT_COMPONENT_NAME);
115     }
116
117     // This attribute is optional
118
public void setEndpointAddressUri(String JavaDoc value) {
119         this.setValue(ENDPOINT_ADDRESS_URI, value);
120     }
121
122     //
123
public String JavaDoc getEndpointAddressUri() {
124         return (String JavaDoc)this.getValue(ENDPOINT_ADDRESS_URI);
125     }
126
127     // This attribute is optional
128
public void setLoginConfig(LoginConfig value) {
129         this.setValue(LOGIN_CONFIG, value);
130                 if (value != null) {
131                         // It's a mutually exclusive property.
132
setMessageSecurityBinding(null);
133                 }
134     }
135
136         // This attribute is mandatory
137
public void setMessageSecurityBinding(MessageSecurityBinding value) {
138                 this.setValue(MESSAGE_SECURITY_BINDING, value);
139                 if (value != null) {
140                         // It's a mutually exclusive property.
141
setLoginConfig(null);
142                 }
143         }
144
145     //
146
public LoginConfig getLoginConfig() {
147         return (LoginConfig)this.getValue(LOGIN_CONFIG);
148     }
149
150         //
151
public MessageSecurityBinding getMessageSecurityBinding() {
152                 return (MessageSecurityBinding)this.getValue(MESSAGE_SECURITY_BINDING);
153         }
154
155     // This attribute is optional
156
public void setTransportGuarantee(String JavaDoc value) {
157         this.setValue(TRANSPORT_GUARANTEE, value);
158     }
159
160     //
161
public String JavaDoc getTransportGuarantee() {
162         return (String JavaDoc)this.getValue(TRANSPORT_GUARANTEE);
163     }
164
165     // This attribute is optional
166
public void setServiceQname(ServiceQname value) {
167         this.setValue(SERVICE_QNAME, value);
168     }
169
170     //
171
public ServiceQname getServiceQname() {
172         return (ServiceQname)this.getValue(SERVICE_QNAME);
173     }
174
175     // This attribute is optional
176
public void setTieClass(String JavaDoc value) {
177         this.setValue(TIE_CLASS, value);
178     }
179
180     //
181
public String JavaDoc getTieClass() {
182         return (String JavaDoc)this.getValue(TIE_CLASS);
183     }
184
185     // This attribute is optional
186
public void setServletImplClass(String JavaDoc value) {
187         this.setValue(SERVLET_IMPL_CLASS, value);
188     }
189
190     //
191
public String JavaDoc getServletImplClass() {
192         return (String JavaDoc)this.getValue(SERVLET_IMPL_CLASS);
193     }
194
195     //
196
public static void addComparator(org.netbeans.modules.schema2beans.BeanComparator c) {
197         comparators.add(c);
198     }
199
200     //
201
public static void removeComparator(org.netbeans.modules.schema2beans.BeanComparator c) {
202         comparators.remove(c);
203     }
204     public void validate() throws org.netbeans.modules.schema2beans.ValidateException {
205         boolean restrictionFailure = false;
206         // Validating property portComponentName
207
if (getPortComponentName() == null) {
208             throw new org.netbeans.modules.schema2beans.ValidateException("getPortComponentName() == null", "portComponentName", this); // NOI18N
209
}
210         // Validating property endpointAddressUri
211
if (getEndpointAddressUri() != null) {
212         }
213         // Validating property loginConfig
214
if (getLoginConfig() != null) {
215             getLoginConfig().validate();
216         }
217         // Validating property transportGuarantee
218
if (getTransportGuarantee() != null) {
219         }
220         // Validating property serviceQname
221
if (getServiceQname() != null) {
222             getServiceQname().validate();
223         }
224         // Validating property tieClass
225
if (getTieClass() != null) {
226         }
227         // Validating property servletImplClass
228
if (getServletImplClass() != null) {
229         }
230     }
231
232     // Dump the content of this bean returning it as a String
233
public void dump(StringBuffer JavaDoc str, String JavaDoc indent){
234         String JavaDoc s;
235         Object JavaDoc o;
236         org.netbeans.modules.schema2beans.BaseBean n;
237         str.append(indent);
238         str.append("PortComponentName"); // NOI18N
239
str.append(indent+"\t"); // NOI18N
240
str.append("<"); // NOI18N
241
s = this.getPortComponentName();
242         str.append((s==null?"null":s.trim())); // NOI18N
243
str.append(">\n"); // NOI18N
244
this.dumpAttributes(PORT_COMPONENT_NAME, 0, str, indent);
245
246         str.append(indent);
247         str.append("EndpointAddressUri"); // NOI18N
248
str.append(indent+"\t"); // NOI18N
249
str.append("<"); // NOI18N
250
s = this.getEndpointAddressUri();
251         str.append((s==null?"null":s.trim())); // NOI18N
252
str.append(">\n"); // NOI18N
253
this.dumpAttributes(ENDPOINT_ADDRESS_URI, 0, str, indent);
254
255         str.append(indent);
256         str.append("LoginConfig"); // NOI18N
257
n = (org.netbeans.modules.schema2beans.BaseBean) this.getLoginConfig();
258         if (n != null)
259             n.dump(str, indent + "\t"); // NOI18N
260
else
261             str.append(indent+"\tnull"); // NOI18N
262
this.dumpAttributes(LOGIN_CONFIG, 0, str, indent);
263
264         str.append(indent);
265                 str.append("MessageSecurityBinding"); // NOI18N
266
n = (org.netbeans.modules.schema2beans.BaseBean) this.getMessageSecurityBinding();
267                 if (n != null)
268                         n.dump(str, indent + "\t"); // NOI18N
269
else
270                         str.append(indent+"\tnull"); // NOI18N
271
this.dumpAttributes(MESSAGE_SECURITY_BINDING, 0, str, indent);
272
273                 str.append(indent);
274         str.append("TransportGuarantee"); // NOI18N
275
str.append(indent+"\t"); // NOI18N
276
str.append("<"); // NOI18N
277
s = this.getTransportGuarantee();
278         str.append((s==null?"null":s.trim())); // NOI18N
279
str.append(">\n"); // NOI18N
280
this.dumpAttributes(TRANSPORT_GUARANTEE, 0, str, indent);
281
282         str.append(indent);
283         str.append("ServiceQname"); // NOI18N
284
n = (org.netbeans.modules.schema2beans.BaseBean) this.getServiceQname();
285         if (n != null)
286             n.dump(str, indent + "\t"); // NOI18N
287
else
288             str.append(indent+"\tnull"); // NOI18N
289
this.dumpAttributes(SERVICE_QNAME, 0, str, indent);
290
291         str.append(indent);
292         str.append("TieClass"); // NOI18N
293
str.append(indent+"\t"); // NOI18N
294
str.append("<"); // NOI18N
295
s = this.getTieClass();
296         str.append((s==null?"null":s.trim())); // NOI18N
297
str.append(">\n"); // NOI18N
298
this.dumpAttributes(TIE_CLASS, 0, str, indent);
299
300         str.append(indent);
301         str.append("ServletImplClass"); // NOI18N
302
str.append(indent+"\t"); // NOI18N
303
str.append("<"); // NOI18N
304
s = this.getServletImplClass();
305         str.append((s==null?"null":s.trim())); // NOI18N
306
str.append(">\n"); // NOI18N
307
this.dumpAttributes(SERVLET_IMPL_CLASS, 0, str, indent);
308
309     }
310     public String JavaDoc dumpBeanNode(){
311         StringBuffer JavaDoc str = new StringBuffer JavaDoc();
312         str.append("WebserviceEndpoint\n"); // NOI18N
313
this.dump(str, "\n "); // NOI18N
314
return str.toString();
315     }}
316
317 // END_NOI18N
318

319
320 /*
321         The following schema file has been used for generation:
322
323 <!--
324 This is the root element which binds an ejb reference to a jndi name.
325 -->
326 <!ELEMENT ejb-ref (ejb-ref-name, jndi-name)>
327
328 <!--
329 This node holds all the runtime bindings of a resource env reference.
330 -->
331 <!ELEMENT resource-env-ref ( resource-env-ref-name, jndi-name )>
332
333 <!--
334 This node holds all the runtime bindings of a resource reference.
335 -->
336 <!ELEMENT resource-ref (res-ref-name, jndi-name, default-resource-principal?)>
337
338 <!ELEMENT default-resource-principal (name, password)>
339
340 <!ELEMENT security-role-mapping (role-name, (principal-name | group-name)+)>
341
342 <!--
343 Information about a web service endpoint.
344 -->
345 <!ELEMENT webservice-endpoint ( port-component-name, endpoint-address-uri?, login-config?, transport-guarantee?, service-qname?, tie-class?, servlet-impl-class? )>
346
347 <!--
348 Optional authentication configuration for an EJB web service endpoint.
349 Not needed for servet web service endpoints. Their security configuration
350 is contained in the standard web application descriptor.
351 -->
352 <!ELEMENT login-config ( auth-method )>
353
354 <!--
355 The service-qname element declares the specific WSDL service
356 element that is being refered to. It is not set by the deployer.
357 It is derived during deployment.
358 -->
359 <!ELEMENT service-qname (namespaceURI, localpart)>
360
361 <!--
362 Runtime information about a web service.
363 wsdl-publish-location is optionally used to specify
364 where the final wsdl and any dependent files should be stored. This location
365 resides on the file system from which deployment is initiated.
366 -->
367 <!ELEMENT webservice-description ( webservice-description-name, wsdl-publish-location? )>
368
369 <!--
370 Runtime settings for a web service reference. In the simplest case,
371 there is no runtime information required for a service ref. Runtime info
372 is only needed in the following cases :
373  * to define the port that should be used to resolve a container-managed port
374  * to define default Stub/Call property settings for Stub objects
375  * to define the URL of a final WSDL document to be used instead of
376 the one packaged with a service-ref
377 -->
378 <!ELEMENT service-ref ( service-ref-name, port-info*, call-property*, wsdl-override?, service-impl-class?, service-qname? )>
379
380 <!--
381 Information for a port within a service-reference.
382
383 Either service-endpoint-interface or wsdl-port or both
384 (service-endpoint-interface and wsdl-port) should be specified.
385
386 If both are specified, wsdl-port represents the
387 port the container should choose for container-managed port selection.
388
389 The same wsdl-port value must not appear in
390 more than one port-info entry within the same service-ref.
391
392 If a particular service-endpoint-interface is using container-managed port
393 selection, it must not appear in more than one port-info entry
394 within the same service-ref.
395 -->
396 <!ELEMENT port-info ( service-endpoint-interface?, wsdl-port?, stub-property*, call-property* )>
397
398 <!--
399 Port used in port-info.
400 -->
401 <!ELEMENT wsdl-port ( namespaceURI, localpart )>
402
403 <!--
404 JAXRPC property values that should be set on a stub before it's returned to
405 to the web service client. The property names can be any properties supported
406 by the JAXRPC Stub implementation. See javadoc for javax.xml.rpc.Stub
407 -->
408 <!ELEMENT stub-property ( name, value )>
409
410 <!--
411 JAXRPC property values that should be set on a Call object before it's
412 returned to the web service client. The property names can be any
413 properties supported by the JAXRPC Call implementation. See javadoc
414 for javax.xml.rpc.Call
415 -->
416 <!ELEMENT call-property ( name, value )>
417
418 <!--
419 This info is used only by studio plug-in;it is NOT the part of the orgianl DTD.
420 Used by plugin to store parameters needed to execute an Application client.
421 -->
422 <!ELEMENT plugin-data ( auto-generate-sql?, client-jar-path?, client-args? )>
423 <!ELEMENT auto-generate-sql (#PCDATA)>
424 <!ELEMENT client-jar-path (#PCDATA)>
425 <!ELEMENT client-args (#PCDATA)>
426
427 <!--
428 The ejb ref name locates the name of the ejb reference in the application.
429 -->
430 <!ELEMENT ejb-ref-name (#PCDATA)>
431
432 <!--
433 The text in this node is a jndi name.
434 -->
435 <!ELEMENT jndi-name (#PCDATA)>
436
437 <!--
438 The name of a resource env reference.
439 -->
440 <!ELEMENT resource-env-ref-name (#PCDATA)>
441
442 <!--
443 The name of a resource reference.
444 -->
445 <!ELEMENT res-ref-name (#PCDATA)>
446
447 <!--
448 This text nodes holds a name string.
449 -->
450 <!ELEMENT name (#PCDATA)>
451
452 <!--
453 This element holds password text.
454 -->
455 <!ELEMENT password (#PCDATA)>
456
457 <!ELEMENT role-name (#PCDATA)>
458
459 <!ELEMENT principal-name (#PCDATA)>
460
461 <!ELEMENT group-name (#PCDATA)>
462
463 <!--
464 Unique name of a port component within a module
465 -->
466 <!ELEMENT port-component-name ( #PCDATA )>
467
468 <!--
469 Relative path combined with web server root to form fully qualified
470 endpoint address for a web service endpoint. For servlet endpoints, this
471 value is relative to the servlet's web application context root. In
472 all cases, this value must be a fixed pattern(i.e. no "*" allowed).
473 If the web service endpoint is a servlet that only implements a single
474 endpoint has only one url-pattern, it is not necessary to set
475 this value since the container can derive it from web.xml.
476 -->
477 <!ELEMENT endpoint-address-uri ( #PCDATA )>
478
479 <!--
480 The namespaceURI element indicates a URI.
481 -->
482 <!ELEMENT namespaceURI (#PCDATA)>
483
484 <!--
485 The localpart element indicates the local part of a QNAME.
486 -->
487 <!ELEMENT localpart (#PCDATA)>
488
489 <!--
490 auth-method element describes the authentication method. The only supported value
491 is USERNAME_PASSWORD
492 -->
493 <!ELEMENT auth-method ( #PCDATA )>
494
495 <!--
496 Specifies that the communication between client and server should
497 be NONE, INTEGRAL, or CONFIDENTIAL. NONE means that the application
498 does not require any transport guarantees. A value of INTEGRAL means
499 that the application requires that the data sent between the client
500 and server be sent in such a way that it can't be changed in transit.
501 CONFIDENTIAL means that the application requires that the data be
502 transmitted in a fashion that prevents other entities from observing
503 the contents of the transmission. In most cases, the presence of the
504 INTEGRAL or CONFIDENTIAL flag will indicate that the use of SSL is
505 required.
506 -->
507 <!ELEMENT transport-guarantee ( #PCDATA )>
508
509 <!--
510 The name of tie implementation class for a port-component. This is
511 not specified by the deployer. It is derived during deployment.
512 -->
513 <!ELEMENT tie-class (#PCDATA)>
514
515 <!--
516 Name of application-written servlet impl class contained in deployed war.
517 This is not set by the deployer. It is derived by the container
518 during deployment.
519 -->
520 <!ELEMENT servlet-impl-class (#PCDATA)>
521
522 <!--
523 Unique name of a webservice within a module
524 -->
525 <!ELEMENT webservice-description-name ( #PCDATA )>
526
527 <!--
528 file: URL of a directory to which a web-service-description's wsdl should be
529 published during deployment. Any required files will be published to this
530 directory, preserving their location relative to the module-specific
531 wsdl directory(META-INF/wsdl or WEB-INF/wsdl).
532
533 Example :
534
535   For an ejb.jar whose webservices.xml wsdl-file element contains
536     META-INF/wsdl/a/Foo.wsdl
537
538   <wsdl-publish-location>file:/home/user1/publish
539   </wsdl-publish-location>
540
541   The final wsdl will be stored in /home/user1/publish/a/Foo.wsdl
542 -->
543 <!ELEMENT wsdl-publish-location ( #PCDATA )>
544
545 <!--
546 Coded name (relative to java:comp/env) for a service-reference
547 -->
548 <!ELEMENT service-ref-name ( #PCDATA )>
549
550 <!--
551 Fully qualified name of service endpoint interface
552 -->
553 <!ELEMENT service-endpoint-interface ( #PCDATA )>
554
555 <!--
556 This text nodes holds a value string.
557 -->
558 <!ELEMENT value (#PCDATA)>
559
560 <!--
561 This is a valid URL pointing to a final WSDL document. It is optional.
562 If specified, the WSDL document at this URL will be used during
563 deployment instead of the WSDL document associated with the
564 service-ref in the standard deployment descriptor.
565
566 Examples :
567
568   // available via HTTP
569   <wsdl-override>http://localhost:8000/myservice/myport?WSDL</wsdl-override>
570
571   // in a file
572   <wsdl-override>file:/home/user1/myfinalwsdl.wsdl</wsdl-override>
573 -->
574 <!ELEMENT wsdl-override ( #PCDATA )>
575
576 <!--
577 Name of generated service implementation class. This is not set by the
578 deployer. It is derived during deployment.
579 -->
580 <!ELEMENT service-impl-class ( #PCDATA )>
581
582 <!--
583 This node holds information about a logical message destination
584 -->
585 <!ELEMENT message-destination (message-destination-name, jndi-name)>
586
587 <!--
588 This node holds the name of a logical message destination
589 -->
590 <!ELEMENT message-destination-name (#PCDATA)>
591
592 */

593
Popular Tags