KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > enterprise > config > serverbeans > HttpService


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 HttpService matches the DTD element http-service
26  *
27  */

28
29 package com.sun.enterprise.config.serverbeans;
30
31 import org.w3c.dom.*;
32 import org.netbeans.modules.schema2beans.*;
33 import java.beans.*;
34 import java.util.*;
35 import java.io.Serializable JavaDoc;
36 import com.sun.enterprise.config.ConfigBean;
37 import com.sun.enterprise.config.ConfigException;
38 import com.sun.enterprise.config.StaleWriteConfigException;
39 import com.sun.enterprise.util.i18n.StringManager;
40
41 // BEGIN_NOI18N
42

43 public class HttpService extends ConfigBean implements Serializable JavaDoc
44 {
45
46     static Vector comparators = new Vector();
47     private static final org.netbeans.modules.schema2beans.Version runtimeVersion = new org.netbeans.modules.schema2beans.Version(4, 2, 0);
48
49     static public final String JavaDoc ACCESS_LOG = "AccessLog";
50     static public final String JavaDoc HTTP_LISTENER = "HttpListener";
51     static public final String JavaDoc VIRTUAL_SERVER = "VirtualServer";
52     static public final String JavaDoc REQUEST_PROCESSING = "RequestProcessing";
53     static public final String JavaDoc KEEP_ALIVE = "KeepAlive";
54     static public final String JavaDoc CONNECTION_POOL = "ConnectionPool";
55     static public final String JavaDoc HTTP_PROTOCOL = "HttpProtocol";
56     static public final String JavaDoc HTTP_FILE_CACHE = "HttpFileCache";
57     static public final String JavaDoc ELEMENT_PROPERTY = "ElementProperty";
58
59     public HttpService() {
60         this(Common.USE_DEFAULT_VALUES);
61     }
62
63     public HttpService(int options)
64     {
65         super(comparators, runtimeVersion);
66         // Properties (see root bean comments for the bean graph)
67
initPropertyTables(9);
68         this.createProperty("access-log", ACCESS_LOG,
69             Common.TYPE_0_1 | Common.TYPE_BEAN | Common.TYPE_KEY,
70             AccessLog.class);
71         this.createAttribute(ACCESS_LOG, "format", "Format",
72                         AttrProp.CDATA,
73                         null, "%client.name% %auth-user-name% %datetime% %request% %status% %response.length%");
74         this.createAttribute(ACCESS_LOG, "rotation-policy", "RotationPolicy",
75                         AttrProp.CDATA,
76                         null, "time");
77         this.createAttribute(ACCESS_LOG, "rotation-interval-in-minutes", "RotationIntervalInMinutes",
78                         AttrProp.CDATA,
79                         null, "1440");
80         this.createAttribute(ACCESS_LOG, "rotation-suffix", "RotationSuffix",
81                         AttrProp.CDATA,
82                         null, "yyyyMMdd-HH'h'mm'm'ss's'");
83         this.createAttribute(ACCESS_LOG, "rotation-enabled", "RotationEnabled",
84                         AttrProp.CDATA,
85                         null, "true");
86         this.createProperty("http-listener", HTTP_LISTENER,
87             Common.TYPE_1_N | Common.TYPE_BEAN | Common.TYPE_KEY,
88             HttpListener.class);
89         this.createAttribute(HTTP_LISTENER, "id", "Id",
90                         AttrProp.CDATA | AttrProp.REQUIRED,
91                         null, null);
92         this.createAttribute(HTTP_LISTENER, "address", "Address",
93                         AttrProp.CDATA | AttrProp.REQUIRED,
94                         null, null);
95         this.createAttribute(HTTP_LISTENER, "port", "Port",
96                         AttrProp.CDATA | AttrProp.REQUIRED,
97                         null, null);
98         this.createAttribute(HTTP_LISTENER, "external-port", "ExternalPort",
99                         AttrProp.CDATA | AttrProp.IMPLIED,
100                         null, null);
101         this.createAttribute(HTTP_LISTENER, "family", "Family",
102                         AttrProp.CDATA,
103                         null, "inet");
104         this.createAttribute(HTTP_LISTENER, "blocking-enabled", "BlockingEnabled",
105                         AttrProp.CDATA,
106                         null, "false");
107         this.createAttribute(HTTP_LISTENER, "acceptor-threads", "AcceptorThreads",
108                         AttrProp.CDATA,
109                         null, "1");
110         this.createAttribute(HTTP_LISTENER, "security-enabled", "SecurityEnabled",
111                         AttrProp.CDATA,
112                         null, "false");
113         this.createAttribute(HTTP_LISTENER, "default-virtual-server", "DefaultVirtualServer",
114                         AttrProp.CDATA | AttrProp.REQUIRED,
115                         null, null);
116         this.createAttribute(HTTP_LISTENER, "server-name", "ServerName",
117                         AttrProp.CDATA | AttrProp.REQUIRED,
118                         null, null);
119         this.createAttribute(HTTP_LISTENER, "redirect-port", "RedirectPort",
120                         AttrProp.CDATA | AttrProp.IMPLIED,
121                         null, null);
122         this.createAttribute(HTTP_LISTENER, "xpowered-by", "XpoweredBy",
123                         AttrProp.CDATA,
124                         null, "true");
125         this.createAttribute(HTTP_LISTENER, "enabled", "Enabled",
126                         AttrProp.CDATA,
127                         null, "true");
128         this.createProperty("virtual-server", VIRTUAL_SERVER,
129             Common.TYPE_1_N | Common.TYPE_BEAN | Common.TYPE_KEY,
130             VirtualServer.class);
131         this.createAttribute(VIRTUAL_SERVER, "id", "Id",
132                         AttrProp.CDATA | AttrProp.REQUIRED,
133                         null, null);
134         this.createAttribute(VIRTUAL_SERVER, "http-listeners", "HttpListeners",
135                         AttrProp.CDATA | AttrProp.IMPLIED,
136                         null, null);
137         this.createAttribute(VIRTUAL_SERVER, "default-web-module", "DefaultWebModule",
138                         AttrProp.CDATA | AttrProp.IMPLIED,
139                         null, null);
140         this.createAttribute(VIRTUAL_SERVER, "hosts", "Hosts",
141                         AttrProp.CDATA | AttrProp.REQUIRED,
142                         null, null);
143         this.createAttribute(VIRTUAL_SERVER, "state", "State",
144                         AttrProp.CDATA,
145                         null, "on");
146         this.createAttribute(VIRTUAL_SERVER, "docroot", "Docroot",
147                         AttrProp.CDATA | AttrProp.IMPLIED,
148                         null, null);
149         this.createAttribute(VIRTUAL_SERVER, "log-file", "LogFile",
150                         AttrProp.CDATA,
151                         null, "${com.sun.aas.instanceRoot}/logs/server.log");
152         this.createProperty("request-processing", REQUEST_PROCESSING,
153             Common.TYPE_0_1 | Common.TYPE_BEAN | Common.TYPE_KEY,
154             RequestProcessing.class);
155         this.createAttribute(REQUEST_PROCESSING, "thread-count", "ThreadCount",
156                         AttrProp.CDATA,
157                         null, "128");
158         this.createAttribute(REQUEST_PROCESSING, "initial-thread-count", "InitialThreadCount",
159                         AttrProp.CDATA,
160                         null, "48");
161         this.createAttribute(REQUEST_PROCESSING, "thread-increment", "ThreadIncrement",
162                         AttrProp.CDATA,
163                         null, "10");
164         this.createAttribute(REQUEST_PROCESSING, "request-timeout-in-seconds", "RequestTimeoutInSeconds",
165                         AttrProp.CDATA,
166                         null, "30");
167         this.createAttribute(REQUEST_PROCESSING, "header-buffer-length-in-bytes", "HeaderBufferLengthInBytes",
168                         AttrProp.CDATA,
169                         null, "4096");
170         this.createProperty("keep-alive", KEEP_ALIVE,
171             Common.TYPE_0_1 | Common.TYPE_BEAN | Common.TYPE_KEY,
172             KeepAlive.class);
173         this.createAttribute(KEEP_ALIVE, "thread-count", "ThreadCount",
174                         AttrProp.CDATA,
175                         null, "1");
176         this.createAttribute(KEEP_ALIVE, "max-connections", "MaxConnections",
177                         AttrProp.CDATA,
178                         null, "256");
179         this.createAttribute(KEEP_ALIVE, "timeout-in-seconds", "TimeoutInSeconds",
180                         AttrProp.CDATA,
181                         null, "30");
182         this.createProperty("connection-pool", CONNECTION_POOL,
183             Common.TYPE_0_1 | Common.TYPE_BEAN | Common.TYPE_KEY,
184             ConnectionPool.class);
185         this.createAttribute(CONNECTION_POOL, "queue-size-in-bytes", "QueueSizeInBytes",
186                         AttrProp.CDATA,
187                         null, "4096");
188         this.createAttribute(CONNECTION_POOL, "max-pending-count", "MaxPendingCount",
189                         AttrProp.CDATA,
190                         null, "4096");
191         this.createAttribute(CONNECTION_POOL, "receive-buffer-size-in-bytes", "ReceiveBufferSizeInBytes",
192                         AttrProp.CDATA,
193                         null, "4096");
194         this.createAttribute(CONNECTION_POOL, "send-buffer-size-in-bytes", "SendBufferSizeInBytes",
195                         AttrProp.CDATA,
196                         null, "8192");
197         this.createProperty("http-protocol", HTTP_PROTOCOL,
198             Common.TYPE_0_1 | Common.TYPE_BEAN | Common.TYPE_KEY,
199             HttpProtocol.class);
200         this.createAttribute(HTTP_PROTOCOL, "version", "Version",
201                         AttrProp.CDATA,
202                         null, "HTTP/1.1");
203         this.createAttribute(HTTP_PROTOCOL, "dns-lookup-enabled", "DnsLookupEnabled",
204                         AttrProp.CDATA,
205                         null, "false");
206         this.createAttribute(HTTP_PROTOCOL, "forced-response-type", "ForcedResponseType",
207                         AttrProp.CDATA,
208                         null, "text/html; charset=iso-8859-1");
209         this.createAttribute(HTTP_PROTOCOL, "default-response-type", "DefaultResponseType",
210                         AttrProp.CDATA,
211                         null, "text/html; charset=iso-8859-1");
212         this.createAttribute(HTTP_PROTOCOL, "ssl-enabled", "SslEnabled",
213                         AttrProp.CDATA,
214                         null, "true");
215         this.createProperty("http-file-cache", HTTP_FILE_CACHE,
216             Common.TYPE_0_1 | Common.TYPE_BEAN | Common.TYPE_KEY,
217             HttpFileCache.class);
218         this.createAttribute(HTTP_FILE_CACHE, "globally-enabled", "GloballyEnabled",
219                         AttrProp.CDATA,
220                         null, "true");
221         this.createAttribute(HTTP_FILE_CACHE, "file-caching-enabled", "FileCachingEnabled",
222                         AttrProp.CDATA,
223                         null, "on");
224         this.createAttribute(HTTP_FILE_CACHE, "max-age-in-seconds", "MaxAgeInSeconds",
225                         AttrProp.CDATA,
226                         null, "30");
227         this.createAttribute(HTTP_FILE_CACHE, "medium-file-size-limit-in-bytes", "MediumFileSizeLimitInBytes",
228                         AttrProp.CDATA,
229                         null, "537600");
230         this.createAttribute(HTTP_FILE_CACHE, "medium-file-space-in-bytes", "MediumFileSpaceInBytes",
231                         AttrProp.CDATA,
232                         null, "10485760");
233         this.createAttribute(HTTP_FILE_CACHE, "small-file-size-limit-in-bytes", "SmallFileSizeLimitInBytes",
234                         AttrProp.CDATA,
235                         null, "2048");
236         this.createAttribute(HTTP_FILE_CACHE, "small-file-space-in-bytes", "SmallFileSpaceInBytes",
237                         AttrProp.CDATA,
238                         null, "1048576");
239         this.createAttribute(HTTP_FILE_CACHE, "file-transmission-enabled", "FileTransmissionEnabled",
240                         AttrProp.CDATA,
241                         null, "false");
242         this.createAttribute(HTTP_FILE_CACHE, "max-files-count", "MaxFilesCount",
243                         AttrProp.CDATA,
244                         null, "1024");
245         this.createAttribute(HTTP_FILE_CACHE, "hash-init-size", "HashInitSize",
246                         AttrProp.CDATA,
247                         null, "0");
248         this.createProperty("property", ELEMENT_PROPERTY,
249             Common.TYPE_0_N | Common.TYPE_BEAN | Common.TYPE_KEY,
250             ElementProperty.class);
251         this.createAttribute(ELEMENT_PROPERTY, "name", "Name",
252                         AttrProp.CDATA | AttrProp.REQUIRED,
253                         null, null);
254         this.createAttribute(ELEMENT_PROPERTY, "value", "Value",
255                         AttrProp.CDATA | AttrProp.REQUIRED,
256                         null, null);
257         this.initialize(options);
258     }
259
260     // Setting the default values of the properties
261
void initialize(int options) {
262
263     }
264
265     // This attribute is optional
266
public void setAccessLog(AccessLog value) {
267         this.setValue(ACCESS_LOG, value);
268     }
269
270     // Get Method
271
public AccessLog getAccessLog() {
272         return (AccessLog)this.getValue(ACCESS_LOG);
273     }
274
275     // This attribute is an array containing at least one element
276
public void setHttpListener(int index, HttpListener value) {
277         this.setValue(HTTP_LISTENER, index, value);
278     }
279
280     // Get Method
281
public HttpListener getHttpListener(int index) {
282         return (HttpListener)this.getValue(HTTP_LISTENER, index);
283     }
284
285     // This attribute is an array containing at least one element
286
public void setHttpListener(HttpListener[] value) {
287         this.setValue(HTTP_LISTENER, value);
288     }
289
290     // Getter Method
291
public HttpListener[] getHttpListener() {
292         return (HttpListener[])this.getValues(HTTP_LISTENER);
293     }
294
295     // Return the number of properties
296
public int sizeHttpListener() {
297         return this.size(HTTP_LISTENER);
298     }
299
300     // Add a new element returning its index in the list
301
public int addHttpListener(HttpListener value)
302             throws ConfigException{
303         return addHttpListener(value, true);
304     }
305
306     // Add a new element returning its index in the list with a boolean flag
307
public int addHttpListener(HttpListener value, boolean overwrite)
308             throws ConfigException{
309         HttpListener old = getHttpListenerById(value.getId());
310         if(old != null) {
311             throw new ConfigException(StringManager.getManager(HttpService.class).getString("cannotAddDuplicate", "HttpListener"));
312         }
313         return this.addValue(HTTP_LISTENER, value, overwrite);
314     }
315
316     //
317
// Remove an element using its reference
318
// Returns the index the element had in the list
319
//
320
public int removeHttpListener(HttpListener value){
321         return this.removeValue(HTTP_LISTENER, value);
322     }
323
324     //
325
// Remove an element using its reference
326
// Returns the index the element had in the list
327
// with boolean overwrite
328
//
329
public int removeHttpListener(HttpListener value, boolean overwrite)
330             throws StaleWriteConfigException{
331         return this.removeValue(HTTP_LISTENER, value, overwrite);
332     }
333
334     public HttpListener getHttpListenerById(String JavaDoc id) {
335      if (null != id) { id = id.trim(); }
336     HttpListener[] o = getHttpListener();
337      if (o == null) return null;
338
339      for (int i=0; i < o.length; i++) {
340          if(o[i].getAttributeValue(Common.convertName(ServerTags.ID)).equals(id)) {
341              return o[i];
342          }
343      }
344
345         return null;
346         
347     }
348     // This attribute is an array containing at least one element
349
public void setVirtualServer(int index, VirtualServer value) {
350         this.setValue(VIRTUAL_SERVER, index, value);
351     }
352
353     // Get Method
354
public VirtualServer getVirtualServer(int index) {
355         return (VirtualServer)this.getValue(VIRTUAL_SERVER, index);
356     }
357
358     // This attribute is an array containing at least one element
359
public void setVirtualServer(VirtualServer[] value) {
360         this.setValue(VIRTUAL_SERVER, value);
361     }
362
363     // Getter Method
364
public VirtualServer[] getVirtualServer() {
365         return (VirtualServer[])this.getValues(VIRTUAL_SERVER);
366     }
367
368     // Return the number of properties
369
public int sizeVirtualServer() {
370         return this.size(VIRTUAL_SERVER);
371     }
372
373     // Add a new element returning its index in the list
374
public int addVirtualServer(VirtualServer value)
375             throws ConfigException{
376         return addVirtualServer(value, true);
377     }
378
379     // Add a new element returning its index in the list with a boolean flag
380
public int addVirtualServer(VirtualServer value, boolean overwrite)
381             throws ConfigException{
382         VirtualServer old = getVirtualServerById(value.getId());
383         if(old != null) {
384             throw new ConfigException(StringManager.getManager(HttpService.class).getString("cannotAddDuplicate", "VirtualServer"));
385         }
386         return this.addValue(VIRTUAL_SERVER, value, overwrite);
387     }
388
389     //
390
// Remove an element using its reference
391
// Returns the index the element had in the list
392
//
393
public int removeVirtualServer(VirtualServer value){
394         return this.removeValue(VIRTUAL_SERVER, value);
395     }
396
397     //
398
// Remove an element using its reference
399
// Returns the index the element had in the list
400
// with boolean overwrite
401
//
402
public int removeVirtualServer(VirtualServer value, boolean overwrite)
403             throws StaleWriteConfigException{
404         return this.removeValue(VIRTUAL_SERVER, value, overwrite);
405     }
406
407     public VirtualServer getVirtualServerById(String JavaDoc id) {
408      if (null != id) { id = id.trim(); }
409     VirtualServer[] o = getVirtualServer();
410      if (o == null) return null;
411
412      for (int i=0; i < o.length; i++) {
413          if(o[i].getAttributeValue(Common.convertName(ServerTags.ID)).equals(id)) {
414              return o[i];
415          }
416      }
417
418         return null;
419         
420     }
421     // This attribute is optional
422
public void setRequestProcessing(RequestProcessing value) {
423         this.setValue(REQUEST_PROCESSING, value);
424     }
425
426     // Get Method
427
public RequestProcessing getRequestProcessing() {
428         return (RequestProcessing)this.getValue(REQUEST_PROCESSING);
429     }
430
431     // This attribute is optional
432
public void setKeepAlive(KeepAlive value) {
433         this.setValue(KEEP_ALIVE, value);
434     }
435
436     // Get Method
437
public KeepAlive getKeepAlive() {
438         return (KeepAlive)this.getValue(KEEP_ALIVE);
439     }
440
441     // This attribute is optional
442
public void setConnectionPool(ConnectionPool value) {
443         this.setValue(CONNECTION_POOL, value);
444     }
445
446     // Get Method
447
public ConnectionPool getConnectionPool() {
448         return (ConnectionPool)this.getValue(CONNECTION_POOL);
449     }
450
451     // This attribute is optional
452
public void setHttpProtocol(HttpProtocol value) {
453         this.setValue(HTTP_PROTOCOL, value);
454     }
455
456     // Get Method
457
public HttpProtocol getHttpProtocol() {
458         return (HttpProtocol)this.getValue(HTTP_PROTOCOL);
459     }
460
461     // This attribute is optional
462
public void setHttpFileCache(HttpFileCache value) {
463         this.setValue(HTTP_FILE_CACHE, value);
464     }
465
466     // Get Method
467
public HttpFileCache getHttpFileCache() {
468         return (HttpFileCache)this.getValue(HTTP_FILE_CACHE);
469     }
470
471     // This attribute is an array, possibly empty
472
public void setElementProperty(int index, ElementProperty value) {
473         this.setValue(ELEMENT_PROPERTY, index, value);
474     }
475
476     // Get Method
477
public ElementProperty getElementProperty(int index) {
478         return (ElementProperty)this.getValue(ELEMENT_PROPERTY, index);
479     }
480
481     // This attribute is an array, possibly empty
482
public void setElementProperty(ElementProperty[] value) {
483         this.setValue(ELEMENT_PROPERTY, value);
484     }
485
486     // Getter Method
487
public ElementProperty[] getElementProperty() {
488         return (ElementProperty[])this.getValues(ELEMENT_PROPERTY);
489     }
490
491     // Return the number of properties
492
public int sizeElementProperty() {
493         return this.size(ELEMENT_PROPERTY);
494     }
495
496     // Add a new element returning its index in the list
497
public int addElementProperty(ElementProperty value)
498             throws ConfigException{
499         return addElementProperty(value, true);
500     }
501
502     // Add a new element returning its index in the list with a boolean flag
503
public int addElementProperty(ElementProperty value, boolean overwrite)
504             throws ConfigException{
505         ElementProperty old = getElementPropertyByName(value.getName());
506         if(old != null) {
507             throw new ConfigException(StringManager.getManager(HttpService.class).getString("cannotAddDuplicate", "ElementProperty"));
508         }
509         return this.addValue(ELEMENT_PROPERTY, value, overwrite);
510     }
511
512     //
513
// Remove an element using its reference
514
// Returns the index the element had in the list
515
//
516
public int removeElementProperty(ElementProperty value){
517         return this.removeValue(ELEMENT_PROPERTY, value);
518     }
519
520     //
521
// Remove an element using its reference
522
// Returns the index the element had in the list
523
// with boolean overwrite
524
//
525
public int removeElementProperty(ElementProperty value, boolean overwrite)
526             throws StaleWriteConfigException{
527         return this.removeValue(ELEMENT_PROPERTY, value, overwrite);
528     }
529
530     public ElementProperty getElementPropertyByName(String JavaDoc id) {
531      if (null != id) { id = id.trim(); }
532     ElementProperty[] o = getElementProperty();
533      if (o == null) return null;
534
535      for (int i=0; i < o.length; i++) {
536          if(o[i].getAttributeValue(Common.convertName(ServerTags.NAME)).equals(id)) {
537              return o[i];
538          }
539      }
540
541         return null;
542         
543     }
544     /**
545      * Create a new bean using it's default constructor.
546      * This does not add it to any bean graph.
547      */

548     public AccessLog newAccessLog() {
549         return new AccessLog();
550     }
551
552     /**
553      * Create a new bean using it's default constructor.
554      * This does not add it to any bean graph.
555      */

556     public HttpListener newHttpListener() {
557         return new HttpListener();
558     }
559
560     /**
561      * Create a new bean using it's default constructor.
562      * This does not add it to any bean graph.
563      */

564     public VirtualServer newVirtualServer() {
565         return new VirtualServer();
566     }
567
568     /**
569      * Create a new bean using it's default constructor.
570      * This does not add it to any bean graph.
571      */

572     public RequestProcessing newRequestProcessing() {
573         return new RequestProcessing();
574     }
575
576     /**
577      * Create a new bean using it's default constructor.
578      * This does not add it to any bean graph.
579      */

580     public KeepAlive newKeepAlive() {
581         return new KeepAlive();
582     }
583
584     /**
585      * Create a new bean using it's default constructor.
586      * This does not add it to any bean graph.
587      */

588     public ConnectionPool newConnectionPool() {
589         return new ConnectionPool();
590     }
591
592     /**
593      * Create a new bean using it's default constructor.
594      * This does not add it to any bean graph.
595      */

596     public HttpProtocol newHttpProtocol() {
597         return new HttpProtocol();
598     }
599
600     /**
601      * Create a new bean using it's default constructor.
602      * This does not add it to any bean graph.
603      */

604     public HttpFileCache newHttpFileCache() {
605         return new HttpFileCache();
606     }
607
608     /**
609      * Create a new bean using it's default constructor.
610      * This does not add it to any bean graph.
611      */

612     public ElementProperty newElementProperty() {
613         return new ElementProperty();
614     }
615
616     /**
617     * get the xpath representation for this element
618     * returns something like abc[@name='value'] or abc
619     * depending on the type of the bean
620     */

621     protected String JavaDoc getRelativeXPath() {
622         String JavaDoc ret = null;
623         ret = "http-service";
624         return (null != ret ? ret.trim() : null);
625     }
626
627     /*
628     * generic method to get default value from dtd
629     */

630     public static String JavaDoc getDefaultAttributeValue(String JavaDoc attr) {
631         if(attr == null) return null;
632         attr = attr.trim();
633     return null;
634     }
635     //
636
public static void addComparator(org.netbeans.modules.schema2beans.BeanComparator c) {
637         comparators.add(c);
638     }
639
640     //
641
public static void removeComparator(org.netbeans.modules.schema2beans.BeanComparator c) {
642         comparators.remove(c);
643     }
644     public void validate() throws org.netbeans.modules.schema2beans.ValidateException {
645     }
646
647     // Dump the content of this bean returning it as a String
648
public void dump(StringBuffer JavaDoc str, String JavaDoc indent){
649         String JavaDoc s;
650         Object JavaDoc o;
651         org.netbeans.modules.schema2beans.BaseBean n;
652         str.append(indent);
653         str.append("AccessLog"); // NOI18N
654
n = (org.netbeans.modules.schema2beans.BaseBean) this.getAccessLog();
655         if (n != null)
656             n.dump(str, indent + "\t"); // NOI18N
657
else
658             str.append(indent+"\tnull"); // NOI18N
659
this.dumpAttributes(ACCESS_LOG, 0, str, indent);
660
661         str.append(indent);
662         str.append("HttpListener["+this.sizeHttpListener()+"]"); // NOI18N
663
for(int i=0; i<this.sizeHttpListener(); i++)
664         {
665             str.append(indent+"\t");
666             str.append("#"+i+":");
667             n = (org.netbeans.modules.schema2beans.BaseBean) this.getHttpListener(i);
668             if (n != null)
669                 n.dump(str, indent + "\t"); // NOI18N
670
else
671                 str.append(indent+"\tnull"); // NOI18N
672
this.dumpAttributes(HTTP_LISTENER, i, str, indent);
673         }
674
675         str.append(indent);
676         str.append("VirtualServer["+this.sizeVirtualServer()+"]"); // NOI18N
677
for(int i=0; i<this.sizeVirtualServer(); i++)
678         {
679             str.append(indent+"\t");
680             str.append("#"+i+":");
681             n = (org.netbeans.modules.schema2beans.BaseBean) this.getVirtualServer(i);
682             if (n != null)
683                 n.dump(str, indent + "\t"); // NOI18N
684
else
685                 str.append(indent+"\tnull"); // NOI18N
686
this.dumpAttributes(VIRTUAL_SERVER, i, str, indent);
687         }
688
689         str.append(indent);
690         str.append("RequestProcessing"); // NOI18N
691
n = (org.netbeans.modules.schema2beans.BaseBean) this.getRequestProcessing();
692         if (n != null)
693             n.dump(str, indent + "\t"); // NOI18N
694
else
695             str.append(indent+"\tnull"); // NOI18N
696
this.dumpAttributes(REQUEST_PROCESSING, 0, str, indent);
697
698         str.append(indent);
699         str.append("KeepAlive"); // NOI18N
700
n = (org.netbeans.modules.schema2beans.BaseBean) this.getKeepAlive();
701         if (n != null)
702             n.dump(str, indent + "\t"); // NOI18N
703
else
704             str.append(indent+"\tnull"); // NOI18N
705
this.dumpAttributes(KEEP_ALIVE, 0, str, indent);
706
707         str.append(indent);
708         str.append("ConnectionPool"); // NOI18N
709
n = (org.netbeans.modules.schema2beans.BaseBean) this.getConnectionPool();
710         if (n != null)
711             n.dump(str, indent + "\t"); // NOI18N
712
else
713             str.append(indent+"\tnull"); // NOI18N
714
this.dumpAttributes(CONNECTION_POOL, 0, str, indent);
715
716         str.append(indent);
717         str.append("HttpProtocol"); // NOI18N
718
n = (org.netbeans.modules.schema2beans.BaseBean) this.getHttpProtocol();
719         if (n != null)
720             n.dump(str, indent + "\t"); // NOI18N
721
else
722             str.append(indent+"\tnull"); // NOI18N
723
this.dumpAttributes(HTTP_PROTOCOL, 0, str, indent);
724
725         str.append(indent);
726         str.append("HttpFileCache"); // NOI18N
727
n = (org.netbeans.modules.schema2beans.BaseBean) this.getHttpFileCache();
728         if (n != null)
729             n.dump(str, indent + "\t"); // NOI18N
730
else
731             str.append(indent+"\tnull"); // NOI18N
732
this.dumpAttributes(HTTP_FILE_CACHE, 0, str, indent);
733
734         str.append(indent);
735         str.append("ElementProperty["+this.sizeElementProperty()+"]"); // NOI18N
736
for(int i=0; i<this.sizeElementProperty(); i++)
737         {
738             str.append(indent+"\t");
739             str.append("#"+i+":");
740             n = (org.netbeans.modules.schema2beans.BaseBean) this.getElementProperty(i);
741             if (n != null)
742                 n.dump(str, indent + "\t"); // NOI18N
743
else
744                 str.append(indent+"\tnull"); // NOI18N
745
this.dumpAttributes(ELEMENT_PROPERTY, i, str, indent);
746         }
747
748     }
749     public String JavaDoc dumpBeanNode(){
750         StringBuffer JavaDoc str = new StringBuffer JavaDoc();
751         str.append("HttpService\n"); // NOI18N
752
this.dump(str, "\n "); // NOI18N
753
return str.toString();
754     }}
755
756 // END_NOI18N
757

758
Popular Tags