View Javadoc

1   /*
2    * This class was automatically generated with 
3    * <a href="http://www.castor.org">Castor 1.1.2.1</a>, using an XML
4    * Schema.
5    * $Id$
6    */
7   
8   package org.sourceforge.mbeanmonitoring.report.castor;
9   
10    //---------------------------------/
11   //- Imported classes and packages -/
12  //---------------------------------/
13  
14  import org.exolab.castor.xml.Marshaller;
15  import org.exolab.castor.xml.Unmarshaller;
16  
17  /**
18   * Class ServerParam.
19   * 
20   * @version $Revision$ $Date$
21   */
22  public class ServerParam implements java.io.Serializable {
23  
24  
25        //--------------------------/
26       //- Class/Member Variables -/
27      //--------------------------/
28  
29      /**
30       * Field _host.
31       */
32      private java.lang.String _host = "localhost";
33  
34      /**
35       * Field _port.
36       */
37      private short _port = 1099;
38  
39      /**
40       * keeps track of state for field: _port
41       */
42      private boolean _has_port;
43  
44      /**
45       * Field _genereTo.
46       */
47      private java.lang.String _genereTo;
48  
49      /**
50       * Field _extension.
51       */
52      private java.lang.String _extension = "csv";
53  
54      /**
55       * Field _maxFileSize.
56       */
57      private java.lang.String _maxFileSize = "1024KB";
58  
59      /**
60       * Field _maxBackupIndex.
61       */
62      private int _maxBackupIndex = 10;
63  
64      /**
65       * keeps track of state for field: _maxBackupIndex
66       */
67      private boolean _has_maxBackupIndex;
68  
69      /**
70       * Field _delay.
71       */
72      private int _delay = 30;
73  
74      /**
75       * keeps track of state for field: _delay
76       */
77      private boolean _has_delay;
78  
79      /**
80       * Field _nbThreads.
81       */
82      private int _nbThreads = 10;
83  
84      /**
85       * keeps track of state for field: _nbThreads
86       */
87      private boolean _has_nbThreads;
88  
89      /**
90       * Field _separateur.
91       */
92      private java.lang.String _separateur = ";";
93  
94      /**
95       * Field _mbeanList.
96       */
97      private java.util.Vector _mbeanList;
98  
99  
100       //----------------/
101      //- Constructors -/
102     //----------------/
103 
104     public ServerParam() {
105         super();
106         setHost("localhost");
107         setExtension("csv");
108         setMaxFileSize("1024KB");
109         setSeparateur(";");
110         this._mbeanList = new java.util.Vector();
111     }
112 
113 
114       //-----------/
115      //- Methods -/
116     //-----------/
117 
118     /**
119      * 
120      * 
121      * @param vMbean
122      * @throws java.lang.IndexOutOfBoundsException if the index
123      * given is outside the bounds of the collection
124      */
125     public void addMbean(
126             final org.sourceforge.mbeanmonitoring.report.castor.Mbean vMbean)
127     throws java.lang.IndexOutOfBoundsException {
128         this._mbeanList.addElement(vMbean);
129     }
130 
131     /**
132      * 
133      * 
134      * @param index
135      * @param vMbean
136      * @throws java.lang.IndexOutOfBoundsException if the index
137      * given is outside the bounds of the collection
138      */
139     public void addMbean(
140             final int index,
141             final org.sourceforge.mbeanmonitoring.report.castor.Mbean vMbean)
142     throws java.lang.IndexOutOfBoundsException {
143         this._mbeanList.add(index, vMbean);
144     }
145 
146     /**
147      */
148     public void deleteDelay(
149     ) {
150         this._has_delay= false;
151     }
152 
153     /**
154      */
155     public void deleteMaxBackupIndex(
156     ) {
157         this._has_maxBackupIndex= false;
158     }
159 
160     /**
161      */
162     public void deleteNbThreads(
163     ) {
164         this._has_nbThreads= false;
165     }
166 
167     /**
168      */
169     public void deletePort(
170     ) {
171         this._has_port= false;
172     }
173 
174     /**
175      * Method enumerateMbean.
176      * 
177      * @return an Enumeration over all
178      * org.sourceforge.mbeanmonitoring.report.castor.Mbean elements
179      */
180     public java.util.Enumeration enumerateMbean(
181     ) {
182         return this._mbeanList.elements();
183     }
184 
185     /**
186      * Returns the value of field 'delay'.
187      * 
188      * @return the value of field 'Delay'.
189      */
190     public int getDelay(
191     ) {
192         return this._delay;
193     }
194 
195     /**
196      * Returns the value of field 'extension'.
197      * 
198      * @return the value of field 'Extension'.
199      */
200     public java.lang.String getExtension(
201     ) {
202         return this._extension;
203     }
204 
205     /**
206      * Returns the value of field 'genereTo'.
207      * 
208      * @return the value of field 'GenereTo'.
209      */
210     public java.lang.String getGenereTo(
211     ) {
212         return this._genereTo;
213     }
214 
215     /**
216      * Returns the value of field 'host'.
217      * 
218      * @return the value of field 'Host'.
219      */
220     public java.lang.String getHost(
221     ) {
222         return this._host;
223     }
224 
225     /**
226      * Returns the value of field 'maxBackupIndex'.
227      * 
228      * @return the value of field 'MaxBackupIndex'.
229      */
230     public int getMaxBackupIndex(
231     ) {
232         return this._maxBackupIndex;
233     }
234 
235     /**
236      * Returns the value of field 'maxFileSize'.
237      * 
238      * @return the value of field 'MaxFileSize'.
239      */
240     public java.lang.String getMaxFileSize(
241     ) {
242         return this._maxFileSize;
243     }
244 
245     /**
246      * Method getMbean.
247      * 
248      * @param index
249      * @throws java.lang.IndexOutOfBoundsException if the index
250      * given is outside the bounds of the collection
251      * @return the value of the
252      * org.sourceforge.mbeanmonitoring.report.castor.Mbean at the
253      * given index
254      */
255     public org.sourceforge.mbeanmonitoring.report.castor.Mbean getMbean(
256             final int index)
257     throws java.lang.IndexOutOfBoundsException {
258         // check bounds for index
259         if (index < 0 || index >= this._mbeanList.size()) {
260             throw new IndexOutOfBoundsException("getMbean: Index value '" + index + "' not in range [0.." + (this._mbeanList.size() - 1) + "]");
261         }
262         
263         return (org.sourceforge.mbeanmonitoring.report.castor.Mbean) _mbeanList.get(index);
264     }
265 
266     /**
267      * Method getMbean.Returns the contents of the collection in an
268      * Array.  <p>Note:  Just in case the collection contents are
269      * changing in another thread, we pass a 0-length Array of the
270      * correct type into the API call.  This way we <i>know</i>
271      * that the Array returned is of exactly the correct length.
272      * 
273      * @return this collection as an Array
274      */
275     public org.sourceforge.mbeanmonitoring.report.castor.Mbean[] getMbean(
276     ) {
277         org.sourceforge.mbeanmonitoring.report.castor.Mbean[] array = new org.sourceforge.mbeanmonitoring.report.castor.Mbean[0];
278         return (org.sourceforge.mbeanmonitoring.report.castor.Mbean[]) this._mbeanList.toArray(array);
279     }
280 
281     /**
282      * Method getMbeanCount.
283      * 
284      * @return the size of this collection
285      */
286     public int getMbeanCount(
287     ) {
288         return this._mbeanList.size();
289     }
290 
291     /**
292      * Returns the value of field 'nbThreads'.
293      * 
294      * @return the value of field 'NbThreads'.
295      */
296     public int getNbThreads(
297     ) {
298         return this._nbThreads;
299     }
300 
301     /**
302      * Returns the value of field 'port'.
303      * 
304      * @return the value of field 'Port'.
305      */
306     public short getPort(
307     ) {
308         return this._port;
309     }
310 
311     /**
312      * Returns the value of field 'separateur'.
313      * 
314      * @return the value of field 'Separateur'.
315      */
316     public java.lang.String getSeparateur(
317     ) {
318         return this._separateur;
319     }
320 
321     /**
322      * Method hasDelay.
323      * 
324      * @return true if at least one Delay has been added
325      */
326     public boolean hasDelay(
327     ) {
328         return this._has_delay;
329     }
330 
331     /**
332      * Method hasMaxBackupIndex.
333      * 
334      * @return true if at least one MaxBackupIndex has been added
335      */
336     public boolean hasMaxBackupIndex(
337     ) {
338         return this._has_maxBackupIndex;
339     }
340 
341     /**
342      * Method hasNbThreads.
343      * 
344      * @return true if at least one NbThreads has been added
345      */
346     public boolean hasNbThreads(
347     ) {
348         return this._has_nbThreads;
349     }
350 
351     /**
352      * Method hasPort.
353      * 
354      * @return true if at least one Port has been added
355      */
356     public boolean hasPort(
357     ) {
358         return this._has_port;
359     }
360 
361     /**
362      * Method isValid.
363      * 
364      * @return true if this object is valid according to the schema
365      */
366     public boolean isValid(
367     ) {
368         try {
369             validate();
370         } catch (org.exolab.castor.xml.ValidationException vex) {
371             return false;
372         }
373         return true;
374     }
375 
376     /**
377      * 
378      * 
379      * @param out
380      * @throws org.exolab.castor.xml.MarshalException if object is
381      * null or if any SAXException is thrown during marshaling
382      * @throws org.exolab.castor.xml.ValidationException if this
383      * object is an invalid instance according to the schema
384      */
385     public void marshal(
386             final java.io.Writer out)
387     throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
388         Marshaller.marshal(this, out);
389     }
390 
391     /**
392      * 
393      * 
394      * @param handler
395      * @throws java.io.IOException if an IOException occurs during
396      * marshaling
397      * @throws org.exolab.castor.xml.ValidationException if this
398      * object is an invalid instance according to the schema
399      * @throws org.exolab.castor.xml.MarshalException if object is
400      * null or if any SAXException is thrown during marshaling
401      */
402     public void marshal(
403             final org.xml.sax.ContentHandler handler)
404     throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
405         Marshaller.marshal(this, handler);
406     }
407 
408     /**
409      */
410     public void removeAllMbean(
411     ) {
412         this._mbeanList.clear();
413     }
414 
415     /**
416      * Method removeMbean.
417      * 
418      * @param vMbean
419      * @return true if the object was removed from the collection.
420      */
421     public boolean removeMbean(
422             final org.sourceforge.mbeanmonitoring.report.castor.Mbean vMbean) {
423         boolean removed = _mbeanList.remove(vMbean);
424         return removed;
425     }
426 
427     /**
428      * Method removeMbeanAt.
429      * 
430      * @param index
431      * @return the element removed from the collection
432      */
433     public org.sourceforge.mbeanmonitoring.report.castor.Mbean removeMbeanAt(
434             final int index) {
435         java.lang.Object obj = this._mbeanList.remove(index);
436         return (org.sourceforge.mbeanmonitoring.report.castor.Mbean) obj;
437     }
438 
439     /**
440      * Sets the value of field 'delay'.
441      * 
442      * @param delay the value of field 'delay'.
443      */
444     public void setDelay(
445             final int delay) {
446         this._delay = delay;
447         this._has_delay = true;
448     }
449 
450     /**
451      * Sets the value of field 'extension'.
452      * 
453      * @param extension the value of field 'extension'.
454      */
455     public void setExtension(
456             final java.lang.String extension) {
457         this._extension = extension;
458     }
459 
460     /**
461      * Sets the value of field 'genereTo'.
462      * 
463      * @param genereTo the value of field 'genereTo'.
464      */
465     public void setGenereTo(
466             final java.lang.String genereTo) {
467         this._genereTo = genereTo;
468     }
469 
470     /**
471      * Sets the value of field 'host'.
472      * 
473      * @param host the value of field 'host'.
474      */
475     public void setHost(
476             final java.lang.String host) {
477         this._host = host;
478     }
479 
480     /**
481      * Sets the value of field 'maxBackupIndex'.
482      * 
483      * @param maxBackupIndex the value of field 'maxBackupIndex'.
484      */
485     public void setMaxBackupIndex(
486             final int maxBackupIndex) {
487         this._maxBackupIndex = maxBackupIndex;
488         this._has_maxBackupIndex = true;
489     }
490 
491     /**
492      * Sets the value of field 'maxFileSize'.
493      * 
494      * @param maxFileSize the value of field 'maxFileSize'.
495      */
496     public void setMaxFileSize(
497             final java.lang.String maxFileSize) {
498         this._maxFileSize = maxFileSize;
499     }
500 
501     /**
502      * 
503      * 
504      * @param index
505      * @param vMbean
506      * @throws java.lang.IndexOutOfBoundsException if the index
507      * given is outside the bounds of the collection
508      */
509     public void setMbean(
510             final int index,
511             final org.sourceforge.mbeanmonitoring.report.castor.Mbean vMbean)
512     throws java.lang.IndexOutOfBoundsException {
513         // check bounds for index
514         if (index < 0 || index >= this._mbeanList.size()) {
515             throw new IndexOutOfBoundsException("setMbean: Index value '" + index + "' not in range [0.." + (this._mbeanList.size() - 1) + "]");
516         }
517         
518         this._mbeanList.set(index, vMbean);
519     }
520 
521     /**
522      * 
523      * 
524      * @param vMbeanArray
525      */
526     public void setMbean(
527             final org.sourceforge.mbeanmonitoring.report.castor.Mbean[] vMbeanArray) {
528         //-- copy array
529         _mbeanList.clear();
530         
531         for (int i = 0; i < vMbeanArray.length; i++) {
532                 this._mbeanList.add(vMbeanArray[i]);
533         }
534     }
535 
536     /**
537      * Sets the value of field 'nbThreads'.
538      * 
539      * @param nbThreads the value of field 'nbThreads'.
540      */
541     public void setNbThreads(
542             final int nbThreads) {
543         this._nbThreads = nbThreads;
544         this._has_nbThreads = true;
545     }
546 
547     /**
548      * Sets the value of field 'port'.
549      * 
550      * @param port the value of field 'port'.
551      */
552     public void setPort(
553             final short port) {
554         this._port = port;
555         this._has_port = true;
556     }
557 
558     /**
559      * Sets the value of field 'separateur'.
560      * 
561      * @param separateur the value of field 'separateur'.
562      */
563     public void setSeparateur(
564             final java.lang.String separateur) {
565         this._separateur = separateur;
566     }
567 
568     /**
569      * Method unmarshal.
570      * 
571      * @param reader
572      * @throws org.exolab.castor.xml.MarshalException if object is
573      * null or if any SAXException is thrown during marshaling
574      * @throws org.exolab.castor.xml.ValidationException if this
575      * object is an invalid instance according to the schema
576      * @return the unmarshaled
577      * org.sourceforge.mbeanmonitoring.report.castor.ServerParam
578      */
579     public static org.sourceforge.mbeanmonitoring.report.castor.ServerParam unmarshal(
580             final java.io.Reader reader)
581     throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
582         return (org.sourceforge.mbeanmonitoring.report.castor.ServerParam) Unmarshaller.unmarshal(org.sourceforge.mbeanmonitoring.report.castor.ServerParam.class, reader);
583     }
584 
585     /**
586      * 
587      * 
588      * @throws org.exolab.castor.xml.ValidationException if this
589      * object is an invalid instance according to the schema
590      */
591     public void validate(
592     )
593     throws org.exolab.castor.xml.ValidationException {
594         org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
595         validator.validate(this);
596     }
597 
598 }