KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > enterprise > tools > common > dd > webapp > CookieProperties


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 CookieProperties matches the schema element cookie-properties
26  *
27  * Generated on Tue Sep 02 18:08:42 PDT 2003
28  */

29
30 package com.sun.enterprise.tools.common.dd.webapp;
31
32 import org.w3c.dom.*;
33 import org.netbeans.modules.schema2beans.*;
34 import java.beans.*;
35 import java.util.*;
36
37 // BEGIN_NOI18N
38

39 public class CookieProperties extends com.sun.enterprise.tools.common.dd.SunBaseBean
40 {
41
42     static Vector comparators = new Vector();
43
44     static public final String JavaDoc PROPERTY = "WebProperty"; // NOI18N
45

46     public CookieProperties() {
47         this(Common.USE_DEFAULT_VALUES);
48     }
49
50     public CookieProperties(int options)
51     {
52         super(comparators, new org.netbeans.modules.schema2beans.Version(1, 2, 0));
53         // Properties (see root bean comments for the bean graph)
54
this.createProperty("property", // NOI18N
55
PROPERTY,
56             Common.TYPE_0_N | Common.TYPE_BEAN | Common.TYPE_KEY,
57             WebProperty.class);
58         this.createAttribute(PROPERTY, "name", "Name",
59                         AttrProp.CDATA | AttrProp.REQUIRED,
60                         null, null);
61         this.createAttribute(PROPERTY, "value", "Value",
62                         AttrProp.CDATA | AttrProp.REQUIRED,
63                         null, null);
64         this.initialize(options);
65     }
66
67     // Setting the default values of the properties
68
void initialize(int options)
69     {
70
71     }
72
73     // This attribute is an array, possibly empty
74
public void setWebProperty(int index, WebProperty value) {
75         this.setValue(PROPERTY, index, value);
76     }
77
78     //
79
public WebProperty getWebProperty(int index) {
80         return (WebProperty)this.getValue(PROPERTY, index);
81     }
82
83     // This attribute is an array, possibly empty
84
public void setWebProperty(WebProperty[] value) {
85         this.setValue(PROPERTY, value);
86     }
87
88     //
89
public WebProperty[] getWebProperty() {
90         return (WebProperty[])this.getValues(PROPERTY);
91     }
92
93     // Return the number of properties
94
public int sizeWebProperty() {
95         return this.size(PROPERTY);
96     }
97
98     // Add a new element returning its index in the list
99
public int addWebProperty(com.sun.enterprise.tools.common.dd.webapp.WebProperty value) {
100         return this.addValue(PROPERTY, value);
101     }
102
103     //
104
// Remove an element using its reference
105
// Returns the index the element had in the list
106
//
107
public int removeWebProperty(com.sun.enterprise.tools.common.dd.webapp.WebProperty value) {
108         return this.removeValue(PROPERTY, value);
109     }
110
111     //
112
public static void addComparator(org.netbeans.modules.schema2beans.BeanComparator c) {
113         comparators.add(c);
114     }
115
116     //
117
public static void removeComparator(org.netbeans.modules.schema2beans.BeanComparator c) {
118         comparators.remove(c);
119     }
120     public void validate() throws org.netbeans.modules.schema2beans.ValidateException {
121         boolean restrictionFailure = false;
122         // Validating property webProperty
123
for (int _index = 0; _index < sizeWebProperty(); ++_index) {
124             com.sun.enterprise.tools.common.dd.webapp.WebProperty element = getWebProperty(_index);
125             if (element != null) {
126                 element.validate();
127             }
128         }
129     }
130
131     // Dump the content of this bean returning it as a String
132
public void dump(StringBuffer JavaDoc str, String JavaDoc indent){
133         String JavaDoc s;
134         Object JavaDoc o;
135         org.netbeans.modules.schema2beans.BaseBean n;
136         str.append(indent);
137         str.append("WebProperty["+this.sizeWebProperty()+"]"); // NOI18N
138
for(int i=0; i<this.sizeWebProperty(); i++)
139         {
140             str.append(indent+"\t");
141             str.append("#"+i+":");
142             n = (org.netbeans.modules.schema2beans.BaseBean) this.getWebProperty(i);
143             if (n != null)
144                 n.dump(str, indent + "\t"); // NOI18N
145
else
146                 str.append(indent+"\tnull"); // NOI18N
147
this.dumpAttributes(PROPERTY, i, str, indent);
148         }
149
150     }
151     public String JavaDoc dumpBeanNode(){
152         StringBuffer JavaDoc str = new StringBuffer JavaDoc();
153         str.append("CookieProperties\n"); // NOI18N
154
this.dump(str, "\n "); // NOI18N
155
return str.toString();
156     }}
157
158 // END_NOI18N
159

160
161 /*
162         The following schema file has been used for generation:
163
164 <!--
165   XML DTD for Sun ONE Application Server specific Web Application
166   deployment descriptor. This is a companion DTD for web-app_2_4.xsd
167
168   $Revision: 1.3 $
169 -->
170
171 <!-- root element for vendor specific web application (module) configuration -->
172 <!ELEMENT sun-web-app (context-root?, security-role-mapping*, servlet*, session-config?,
173                        ejb-ref*, resource-ref*, resource-env-ref*, service-ref*,
174                        cache?, class-loader?,
175                        jsp-config?, locale-charset-info?, property*,
176                    message-destination*, webservice-description*)>
177
178 <!--
179  Context Root for the web application when the war file is a standalone module.
180  When the war module is part of the J2EE Application, use the application.xml
181 -->
182 <!ELEMENT context-root (#PCDATA)>
183
184 <!ELEMENT security-role-mapping (role-name, (principal-name | group-name)+)>
185 <!ELEMENT role-name (#PCDATA)>
186
187 <!ELEMENT principal-name (#PCDATA)>
188 <!ELEMENT group-name (#PCDATA)>
189
190 <!ELEMENT servlet (servlet-name, principal-name?, webservice-endpoint*)>
191
192 <!ELEMENT session-config (session-manager?, session-properties?, cookie-properties?)>
193
194 <!ELEMENT session-manager (manager-properties?, store-properties?)>
195 <!ATTLIST session-manager persistence-type CDATA "memory">
196
197 <!ELEMENT manager-properties (property*)>
198 <!ELEMENT store-properties (property*)>
199 <!ELEMENT session-properties (property*)>
200 <!ELEMENT cookie-properties (property*)>
201
202 <!ELEMENT jndi-name (#PCDATA)>
203
204 <!ELEMENT resource-env-ref (resource-env-ref-name, jndi-name)>
205 <!ELEMENT resource-env-ref-name (#PCDATA)>
206            
207 <!ELEMENT resource-ref (res-ref-name, jndi-name, default-resource-principal?)>
208 <!ELEMENT res-ref-name (#PCDATA)>
209
210 <!ELEMENT default-resource-principal ( name, password)>
211
212 <!--
213 This node holds information about a logical message destination
214 -->
215 <!ELEMENT message-destination (message-destination-name, jndi-name)>
216
217 <!--
218 This node holds the name of a logical message destination
219 -->
220 <!ELEMENT message-destination-name (#PCDATA)>
221
222 <!--
223 This text nodes holds a name string.
224 -->
225 <!ELEMENT name (#PCDATA)>
226
227 <!--
228 This element holds password text.
229 -->
230 <!ELEMENT password (#PCDATA)>
231
232
233 <!ELEMENT ejb-ref (ejb-ref-name, jndi-name)>
234 <!ELEMENT ejb-ref-name (#PCDATA)>
235
236 <!-- cache element configures the cache for web application. iAS 7.0 web container
237      supports one such cache object per application: i.e. <cache> is a sub element
238      of <ias-web-app>. A cache can have zero or more cache-mapping elements and
239      zero or more customizable cache-helper classes.
240                                                                                    
241         max-entries Maximum number of entries this cache may hold. [4096]
242         timeout-in-seconds Default timeout for the cache entries in seconds. [30]
243         enabled Is this cache enabled? [false]
244 -->
245 <!ELEMENT cache (cache-helper*, default-helper?, property*, cache-mapping*)>
246 <!ATTLIST cache max-entries CDATA "4096"
247                  timeout-in-seconds CDATA "30"
248                  enabled CDATA "false">
249
250 <!-- cache-helper specifies customizable class which implements CacheHelper interface.
251
252      name Unique name for the helper class; this is referenced in
253                               the cache-mapping elements (see below).
254                               "default" is reserved for the built-in default helper.
255      class-name Fully qualified class name of the cache-helper; this class
256                               must extend the com.sun.appserv.web.CacheHelper class.
257 -->
258 <!ELEMENT cache-helper (property*)>
259 <!ATTLIST cache-helper name CDATA #REQUIRED
260                        class-name CDATA #REQUIRED>
261
262 <!--
263 Default, built-in cache-helper properties
264 -->
265 <!ELEMENT default-helper (property*)>
266
267 <!--
268 cache-mapping element defines what to be cached, the key to be used, any other
269 constraints to be applied and a customizable cache-helper to programmatically
270 hook this information.
271 -->
272 <!ELEMENT cache-mapping ((servlet-name | url-pattern),
273                         (cache-helper-ref |
274                         (timeout?, refresh-field?, http-method*, key-field*, constraint-field*)))>
275
276 <!--
277 servlet-name element defines a named servlet to which this caching is enabled.
278 the specified name must be present in the web application deployment descriptor
279 (web.xml)
280 -->
281 <!ELEMENT servlet-name (#PCDATA)>
282
283 <!--
284 url-pattern element specifies the url pattern to which caching is to be enabled.
285 See Servlet 2.3 specification section SRV. 11.2 for the applicable patterns.
286 -->
287 <!ELEMENT url-pattern (#PCDATA)>
288
289 <!--
290 cache-helper-ref s a reference to the cache-helper used by this cache-mapping
291 -->
292 <!ELEMENT cache-helper-ref (#PCDATA)>
293
294 <!--
295 timeout element defines the cache timeout in seconds applicable for this mapping.
296 default is to use cache object's timeout. The timeout value is specified statically
297 ere (e.g. <timeout> 60 </timeout> or dynamically via fields in the relevant scope.
298
299    name Name of the field where this timeout could be found
300    scope Scope of the field. default scope is request attribute.
301 -->
302 <!ELEMENT timeout (#PCDATA)>
303 <!ATTLIST timeout name CDATA #REQUIRED
304                    scope CDATA 'request.attribute'>
305
306 <!--
307 http-method specifies HTTP method eligible for caching default is GET.
308 -->
309 <!ELEMENT http-method (#PCDATA)>
310
311 <!--
312 specifies the request parameter name that triggers refresh. the cached entry
313 is refreshed when there such a request parameter is set to "true"
314 example:
315 <cache-mapping>
316     <url-pattern> /quote </url-pattern>
317     <refresh-field name="refresh" scope="request.parameter"/>
318 </cache-mapping>
319 -->
320 <!ELEMENT refresh-field EMPTY>
321 <!ATTLIST refresh-field name CDATA #REQUIRED
322                         scope CDATA 'request.parameter'>
323 <!--
324 key-field specifies a component of the key; container looks for the named
325 field in the given scope to access the cached entry. Default is to use
326 the Servlet Path (the path section that corresponds to the servlet mapping
327 which activated this request). See Servlet 2.3 specification section SRV 4.4
328 on Servlet Path.
329
330   name Name of the field to look for in the given scope
331   scope Scope of the field. default scope is request parameter.
332 -->
333 <!ELEMENT key-field EMPTY>
334 <!ATTLIST key-field name CDATA #REQUIRED
335                     scope CDATA 'request.parameter'>
336
337 <!--
338 constraint-field specifies a field whose value is used as a cacheability constraint.
339   
340   name Name of the field to look for in the given scope
341   scope Scope of the field. Default scope is request parameter.
342   cache-on-match Should this constraint check pass, is the response cacheable?
343                            Default is true (i.e. cache the response on success match).
344                            Useful to turn off caching when there is an attribute in the
345                            scope (e.g. don't cache when there is an attribute called UID
346                            in the session.attribute scope).
347   cache-on-match-failure Should the constraint check fail, is response not cacheable?
348                            Default is false (i.e. a failure in enforcing the constraint
349                            would negate caching). Useful to turn on caching when the
350                            an an attribute is not present (e.g. turn on caching
351                            when there is no session or session attribute called UID).
352
353   Example 1: don't cache when there is a session attribute
354   <constraint-field name="UID" scope="session.attribute" cache-on-match="false">
355
356   Example 2: do cache only when there is no session attribute
357   <constraint-field name="UID" scope="session.attribute"
358                     cache-on-match-failure="false">
359 -->
360 <!ELEMENT constraint-field (constraint-field-value*)>
361 <!ATTLIST constraint-field name CDATA #REQUIRED
362                             scope CDATA 'request.parameter'
363                             cache-on-match CDATA 'true'
364                             cache-on-match-failure CDATA 'false'>
365
366 <!--
367 value element specifies the applicable value and a matching expression for a constraint-field
368   match-expr Expression used to match the value. Default is 'equals'.
369
370   Example 1: cache when the category matches with any value other than a specific value
371   <constraint-field name="category" scope="request.parameter>
372     <value match-expr="equals" cache-on-match-failure="true">
373          bogus
374     </value>
375   </constraint-field>
376 -->
377 <!ELEMENT constraint-field-value (#PCDATA)>
378 <!ATTLIST constraint-field-value match-expr CDATA 'equals'
379                             cache-on-match CDATA 'true'
380                             cache-on-match-failure CDATA 'false'>
381
382 <!ELEMENT class-loader EMPTY>
383 <!ATTLIST class-loader extra-class-path CDATA #IMPLIED
384                        delegate CDATA 'true'>
385
386 <!ELEMENT jsp-config (property*)>
387
388 <!ELEMENT locale-charset-info (locale-charset-map+, parameter-encoding?)>
389 <!ATTLIST locale-charset-info default-locale CDATA #REQUIRED>
390
391 <!ELEMENT locale-charset-map (description?)>
392 <!ATTLIST locale-charset-map locale CDATA #REQUIRED
393                              agent CDATA #IMPLIED
394                              charset CDATA #REQUIRED>
395
396 <!ELEMENT parameter-encoding EMPTY>
397 <!ATTLIST parameter-encoding form-hint-field CDATA #IMPLIED
398                  default-charset CDATA #IMPLIED>
399
400 <!--
401 Syntax for supplying properties as name value pairs
402 -->
403 <!ELEMENT property (description?)>
404 <!ATTLIST property name CDATA #REQUIRED
405                    value CDATA #REQUIRED>
406
407 <!ELEMENT description (#PCDATA)>
408
409 <!--
410 This text nodes holds a value string.
411 -->
412 <!ELEMENT value (#PCDATA)>
413
414
415 <!--
416                     W E B S E R V I C E S
417 -->
418 <!--
419 Runtime settings for a web service reference. In the simplest case,
420 there is no runtime information required for a service ref. Runtime info
421 is only needed in the following cases :
422  * to define the port that should be used to resolve a container-managed port
423  * to define default Stub/Call property settings for Stub objects
424  * to define the URL of a final WSDL document to be used instead of
425 the one packaged with a service-ref
426 -->
427 <!ELEMENT service-ref ( service-ref-name, port-info*, call-property*, wsdl-override?, service-impl-class?, service-qname? )>
428
429 <!--
430 Coded name (relative to java:comp/env) for a service-reference
431 -->
432 <!ELEMENT service-ref-name ( #PCDATA )>
433
434 <!--
435 Information for a port within a service-reference.
436
437 Either service-endpoint-interface or wsdl-port or both
438 (service-endpoint-interface and wsdl-port) should be specified.
439
440 If both are specified, wsdl-port represents the
441 port the container should choose for container-managed port selection.
442
443 The same wsdl-port value must not appear in
444 more than one port-info entry within the same service-ref.
445
446 If a particular service-endpoint-interface is using container-managed port
447 selection, it must not appear in more than one port-info entry
448 within the same service-ref.
449
450 -->
451 <!ELEMENT port-info ( service-endpoint-interface?, wsdl-port?, stub-property*, call-property* )>
452
453 <!--
454 Fully qualified name of service endpoint interface
455 -->
456 <!ELEMENT service-endpoint-interface ( #PCDATA )>
457 <!--
458 Port used in port-info.
459 -->
460 <!ELEMENT wsdl-port ( namespaceURI, localpart )>
461
462 <!--
463 JAXRPC property values that should be set on a stub before it's returned to
464 to the web service client. The property names can be any properties supported
465 by the JAXRPC Stub implementation. See javadoc for javax.xml.rpc.Stub
466 -->
467 <!ELEMENT stub-property ( name, value )>
468
469 <!--
470 JAXRPC property values that should be set on a Call object before it's
471 returned to the web service client. The property names can be any
472 properties supported by the JAXRPC Call implementation. See javadoc
473 for javax.xml.rpc.Call
474 -->
475 <!ELEMENT call-property ( name, value )>
476
477 <!--
478 This is a valid URL pointing to a final WSDL document. It is optional.
479 If specified, the WSDL document at this URL will be used during
480 deployment instead of the WSDL document associated with the
481 service-ref in the standard deployment descriptor.
482
483 Examples :
484
485   // available via HTTP
486   <wsdl-override>http://localhost:8000/myservice/myport?WSDL</wsdl-override>
487
488   // in a file
489   <wsdl-override>file:/home/user1/myfinalwsdl.wsdl</wsdl-override>
490
491 -->
492 <!ELEMENT wsdl-override ( #PCDATA )>
493
494 <!--
495 Name of generated service implementation class. This is not set by the
496 deployer. It is derived during deployment.
497 -->
498 <!ELEMENT service-impl-class ( #PCDATA )>
499
500 <!--
501 The service-qname element declares the specific WSDL service
502 element that is being refered to. It is not set by the deployer.
503 It is derived during deployment.
504 -->
505 <!ELEMENT service-qname (namespaceURI, localpart)>
506
507 <!--
508 Runtime information about a web service.
509
510 wsdl-publish-location is optionally used to specify
511 where the final wsdl and any dependent files should be stored. This location
512 resides on the file system from which deployment is initiated.
513
514 -->
515 <!ELEMENT webservice-description ( webservice-description-name, wsdl-publish-location? )>
516
517 <!--
518 Unique name of a webservice within a module
519 -->
520 <!ELEMENT webservice-description-name ( #PCDATA )>
521
522 <!--
523 file: URL of a directory to which a web-service-description's wsdl should be
524 published during deployment. Any required files will be published to this
525 directory, preserving their location relative to the module-specific
526 wsdl directory(META-INF/wsdl or WEB-INF/wsdl).
527
528 Example :
529
530   For an ejb.jar whose webservices.xml wsdl-file element contains
531     META-INF/wsdl/a/Foo.wsdl
532
533   <wsdl-publish-location>file:/home/user1/publish
534   </wsdl-publish-location>
535
536   The final wsdl will be stored in /home/user1/publish/a/Foo.wsdl
537
538 -->
539 <!ELEMENT wsdl-publish-location ( #PCDATA )>
540
541 <!--
542 Information about a web service endpoint.
543 -->
544 <!ELEMENT webservice-endpoint ( port-component-name, endpoint-address-uri?, login-config?, transport-guarantee?, service-qname?, tie-class?, servlet-impl-class? )>
545
546 <!--
547 Unique name of a port component within a module
548 -->
549 <!ELEMENT port-component-name ( #PCDATA )>
550
551 <!--
552 Relative path combined with web server root to form fully qualified
553 endpoint address for a web service endpoint. For servlet endpoints, this
554 value is relative to the servlet's web application context root. In
555 all cases, this value must be a fixed pattern(i.e. no "*" allowed).
556 If the web service endpoint is a servlet that only implements a single
557 endpoint has only one url-pattern, it is not necessary to set
558 this value since the container can derive it from web.xml.
559 -->
560 <!ELEMENT endpoint-address-uri ( #PCDATA )>
561
562 <!--
563 The name of tie implementation class for a port-component. This is
564 not specified by the deployer. It is derived during deployment.
565 -->
566 <!ELEMENT tie-class (#PCDATA)>
567
568 <!--
569 Optional authentication configuration for an EJB web service endpoint.
570 Not needed for servet web service endpoints. Their security configuration
571 is contained in the standard web application descriptor.
572 -->
573 <!ELEMENT login-config ( auth-method )>
574
575 <!--
576 The auth-method element is used to configure the authentication
577 mechanism for the web application. As a prerequisite to gaining access
578 to any web resources which are protected by an authorization
579 constraint, a user must have authenticated using the configured
580 mechanism.
581 -->
582
583 <!ELEMENT auth-method (#PCDATA)>
584
585 <!--
586 Name of application-written servlet impl class contained in deployed war.
587 This is not set by the deployer. It is derived by the container
588 during deployment.
589 -->
590 <!ELEMENT servlet-impl-class (#PCDATA)>
591
592 <!--
593 The transport-guarantee element specifies that the communication
594 between client and server should be NONE, INTEGRAL, or
595 CONFIDENTIAL. NONE means that the application does not require any
596 transport guarantees. A value of INTEGRAL means that the application
597 requires that the data sent between the client and server be sent in
598 such a way that it can't be changed in transit. CONFIDENTIAL means
599 that the application requires that the data be transmitted in a
600 fashion that prevents other entities from observing the contents of
601 the transmission. In most cases, the presence of the INTEGRAL or
602 CONFIDENTIAL flag will indicate that the use of SSL is required.
603 -->
604
605 <!ELEMENT transport-guarantee (#PCDATA)>
606
607 <!--
608 Runtime settings for a web service reference. In the simplest case,
609 there is no runtime information required for a service ref. Runtime info
610 is only needed in the following cases :
611  * to define the port that should be used to resolve a container-managed port
612  * to define default Stub/Call property settings for Stub objects
613  * to define the URL of a final WSDL document to be used instead of
614 the one packaged with a service-ref
615 -->
616
617 <!--
618 The localpart element indicates the local part of a QNAME.
619 -->
620 <!ELEMENT localpart (#PCDATA)>
621
622 <!--
623 The namespaceURI element indicates a URI.
624 -->
625 <!ELEMENT namespaceURI (#PCDATA)>
626
627 */

628
Popular Tags