View Javadoc

1   /*
2    * This class was automatically generated with 
3    * <a href="http://www.castor.org">Castor 0.9.7</a>, using an XML
4    * Schema.
5    * $Id$
6    */
7   
8   package fr.in2p3.jsaga.adaptor.schema.job.emulator.config;
9   
10    //---------------------------------/
11   //- Imported classes and packages -/
12  //---------------------------------/
13  
14  import java.io.IOException;
15  import java.io.Reader;
16  import java.io.Serializable;
17  import java.io.Writer;
18  import java.util.ArrayList;
19  import java.util.Enumeration;
20  import org.exolab.castor.xml.MarshalException;
21  import org.exolab.castor.xml.Marshaller;
22  import org.exolab.castor.xml.Unmarshaller;
23  import org.exolab.castor.xml.ValidationException;
24  import org.xml.sax.ContentHandler;
25  
26  /**
27   * Class Server.
28   * 
29   * @version $Revision$ $Date$
30   */
31  public class Server implements java.io.Serializable {
32  
33  
34        //--------------------------/
35       //- Class/Member Variables -/
36      //--------------------------/
37  
38      /**
39       * Field _host
40       */
41      private java.lang.String _host;
42  
43      /**
44       * Field _port
45       */
46      private int _port;
47  
48      /**
49       * keeps track of state for field: _port
50       */
51      private boolean _has_port;
52  
53      /**
54       * Field _cancelledJobs
55       */
56      private float _cancelledJobs;
57  
58      /**
59       * keeps track of state for field: _cancelledJobs
60       */
61      private boolean _has_cancelledJobs;
62  
63      /**
64       * Field _failedJobs
65       */
66      private float _failedJobs;
67  
68      /**
69       * keeps track of state for field: _failedJobs
70       */
71      private boolean _has_failedJobs;
72  
73      /**
74       * Field _completedJobs
75       */
76      private float _completedJobs;
77  
78      /**
79       * keeps track of state for field: _completedJobs
80       */
81      private boolean _has_completedJobs;
82  
83      /**
84       * Field _lostJobs
85       */
86      private float _lostJobs;
87  
88      /**
89       * keeps track of state for field: _lostJobs
90       */
91      private boolean _has_lostJobs;
92  
93      /**
94       * Field _queuingList
95       */
96      private java.util.ArrayList _queuingList;
97  
98      /**
99       * Field _runningList
100      */
101     private java.util.ArrayList _runningList;
102 
103 
104       //----------------/
105      //- Constructors -/
106     //----------------/
107 
108     public Server() 
109      {
110         super();
111         _queuingList = new ArrayList();
112         _runningList = new ArrayList();
113     } //-- fr.in2p3.jsaga.adaptor.schema.job.emulator.config.Server()
114 
115 
116       //-----------/
117      //- Methods -/
118     //-----------/
119 
120     /**
121      * Method addQueuing
122      * 
123      * 
124      * 
125      * @param vQueuing
126      */
127     public void addQueuing(fr.in2p3.jsaga.adaptor.schema.job.emulator.config.Queuing vQueuing)
128         throws java.lang.IndexOutOfBoundsException
129     {
130         _queuingList.add(vQueuing);
131     } //-- void addQueuing(fr.in2p3.jsaga.adaptor.schema.job.emulator.config.Queuing) 
132 
133     /**
134      * Method addQueuing
135      * 
136      * 
137      * 
138      * @param index
139      * @param vQueuing
140      */
141     public void addQueuing(int index, fr.in2p3.jsaga.adaptor.schema.job.emulator.config.Queuing vQueuing)
142         throws java.lang.IndexOutOfBoundsException
143     {
144         _queuingList.add(index, vQueuing);
145     } //-- void addQueuing(int, fr.in2p3.jsaga.adaptor.schema.job.emulator.config.Queuing) 
146 
147     /**
148      * Method addRunning
149      * 
150      * 
151      * 
152      * @param vRunning
153      */
154     public void addRunning(fr.in2p3.jsaga.adaptor.schema.job.emulator.config.Running vRunning)
155         throws java.lang.IndexOutOfBoundsException
156     {
157         _runningList.add(vRunning);
158     } //-- void addRunning(fr.in2p3.jsaga.adaptor.schema.job.emulator.config.Running) 
159 
160     /**
161      * Method addRunning
162      * 
163      * 
164      * 
165      * @param index
166      * @param vRunning
167      */
168     public void addRunning(int index, fr.in2p3.jsaga.adaptor.schema.job.emulator.config.Running vRunning)
169         throws java.lang.IndexOutOfBoundsException
170     {
171         _runningList.add(index, vRunning);
172     } //-- void addRunning(int, fr.in2p3.jsaga.adaptor.schema.job.emulator.config.Running) 
173 
174     /**
175      * Method clearQueuing
176      * 
177      */
178     public void clearQueuing()
179     {
180         _queuingList.clear();
181     } //-- void clearQueuing() 
182 
183     /**
184      * Method clearRunning
185      * 
186      */
187     public void clearRunning()
188     {
189         _runningList.clear();
190     } //-- void clearRunning() 
191 
192     /**
193      * Method deleteCancelledJobs
194      * 
195      */
196     public void deleteCancelledJobs()
197     {
198         this._has_cancelledJobs= false;
199     } //-- void deleteCancelledJobs() 
200 
201     /**
202      * Method deleteCompletedJobs
203      * 
204      */
205     public void deleteCompletedJobs()
206     {
207         this._has_completedJobs= false;
208     } //-- void deleteCompletedJobs() 
209 
210     /**
211      * Method deleteFailedJobs
212      * 
213      */
214     public void deleteFailedJobs()
215     {
216         this._has_failedJobs= false;
217     } //-- void deleteFailedJobs() 
218 
219     /**
220      * Method deleteLostJobs
221      * 
222      */
223     public void deleteLostJobs()
224     {
225         this._has_lostJobs= false;
226     } //-- void deleteLostJobs() 
227 
228     /**
229      * Method deletePort
230      * 
231      */
232     public void deletePort()
233     {
234         this._has_port= false;
235     } //-- void deletePort() 
236 
237     /**
238      * Method enumerateQueuing
239      * 
240      * 
241      * 
242      * @return Enumeration
243      */
244     public java.util.Enumeration enumerateQueuing()
245     {
246         return new org.exolab.castor.util.IteratorEnumeration(_queuingList.iterator());
247     } //-- java.util.Enumeration enumerateQueuing() 
248 
249     /**
250      * Method enumerateRunning
251      * 
252      * 
253      * 
254      * @return Enumeration
255      */
256     public java.util.Enumeration enumerateRunning()
257     {
258         return new org.exolab.castor.util.IteratorEnumeration(_runningList.iterator());
259     } //-- java.util.Enumeration enumerateRunning() 
260 
261     /**
262      * Returns the value of field 'cancelledJobs'.
263      * 
264      * @return float
265      * @return the value of field 'cancelledJobs'.
266      */
267     public float getCancelledJobs()
268     {
269         return this._cancelledJobs;
270     } //-- float getCancelledJobs() 
271 
272     /**
273      * Returns the value of field 'completedJobs'.
274      * 
275      * @return float
276      * @return the value of field 'completedJobs'.
277      */
278     public float getCompletedJobs()
279     {
280         return this._completedJobs;
281     } //-- float getCompletedJobs() 
282 
283     /**
284      * Returns the value of field 'failedJobs'.
285      * 
286      * @return float
287      * @return the value of field 'failedJobs'.
288      */
289     public float getFailedJobs()
290     {
291         return this._failedJobs;
292     } //-- float getFailedJobs() 
293 
294     /**
295      * Returns the value of field 'host'.
296      * 
297      * @return String
298      * @return the value of field 'host'.
299      */
300     public java.lang.String getHost()
301     {
302         return this._host;
303     } //-- java.lang.String getHost() 
304 
305     /**
306      * Returns the value of field 'lostJobs'.
307      * 
308      * @return float
309      * @return the value of field 'lostJobs'.
310      */
311     public float getLostJobs()
312     {
313         return this._lostJobs;
314     } //-- float getLostJobs() 
315 
316     /**
317      * Returns the value of field 'port'.
318      * 
319      * @return int
320      * @return the value of field 'port'.
321      */
322     public int getPort()
323     {
324         return this._port;
325     } //-- int getPort() 
326 
327     /**
328      * Method getQueuing
329      * 
330      * 
331      * 
332      * @param index
333      * @return Queuing
334      */
335     public fr.in2p3.jsaga.adaptor.schema.job.emulator.config.Queuing getQueuing(int index)
336         throws java.lang.IndexOutOfBoundsException
337     {
338         //-- check bounds for index
339         if ((index < 0) || (index > _queuingList.size())) {
340             throw new IndexOutOfBoundsException();
341         }
342         
343         return (fr.in2p3.jsaga.adaptor.schema.job.emulator.config.Queuing) _queuingList.get(index);
344     } //-- fr.in2p3.jsaga.adaptor.schema.job.emulator.config.Queuing getQueuing(int) 
345 
346     /**
347      * Method getQueuing
348      * 
349      * 
350      * 
351      * @return Queuing
352      */
353     public fr.in2p3.jsaga.adaptor.schema.job.emulator.config.Queuing[] getQueuing()
354     {
355         int size = _queuingList.size();
356         fr.in2p3.jsaga.adaptor.schema.job.emulator.config.Queuing[] mArray = new fr.in2p3.jsaga.adaptor.schema.job.emulator.config.Queuing[size];
357         for (int index = 0; index < size; index++) {
358             mArray[index] = (fr.in2p3.jsaga.adaptor.schema.job.emulator.config.Queuing) _queuingList.get(index);
359         }
360         return mArray;
361     } //-- fr.in2p3.jsaga.adaptor.schema.job.emulator.config.Queuing[] getQueuing() 
362 
363     /**
364      * Method getQueuingCount
365      * 
366      * 
367      * 
368      * @return int
369      */
370     public int getQueuingCount()
371     {
372         return _queuingList.size();
373     } //-- int getQueuingCount() 
374 
375     /**
376      * Method getRunning
377      * 
378      * 
379      * 
380      * @param index
381      * @return Running
382      */
383     public fr.in2p3.jsaga.adaptor.schema.job.emulator.config.Running getRunning(int index)
384         throws java.lang.IndexOutOfBoundsException
385     {
386         //-- check bounds for index
387         if ((index < 0) || (index > _runningList.size())) {
388             throw new IndexOutOfBoundsException();
389         }
390         
391         return (fr.in2p3.jsaga.adaptor.schema.job.emulator.config.Running) _runningList.get(index);
392     } //-- fr.in2p3.jsaga.adaptor.schema.job.emulator.config.Running getRunning(int) 
393 
394     /**
395      * Method getRunning
396      * 
397      * 
398      * 
399      * @return Running
400      */
401     public fr.in2p3.jsaga.adaptor.schema.job.emulator.config.Running[] getRunning()
402     {
403         int size = _runningList.size();
404         fr.in2p3.jsaga.adaptor.schema.job.emulator.config.Running[] mArray = new fr.in2p3.jsaga.adaptor.schema.job.emulator.config.Running[size];
405         for (int index = 0; index < size; index++) {
406             mArray[index] = (fr.in2p3.jsaga.adaptor.schema.job.emulator.config.Running) _runningList.get(index);
407         }
408         return mArray;
409     } //-- fr.in2p3.jsaga.adaptor.schema.job.emulator.config.Running[] getRunning() 
410 
411     /**
412      * Method getRunningCount
413      * 
414      * 
415      * 
416      * @return int
417      */
418     public int getRunningCount()
419     {
420         return _runningList.size();
421     } //-- int getRunningCount() 
422 
423     /**
424      * Method hasCancelledJobs
425      * 
426      * 
427      * 
428      * @return boolean
429      */
430     public boolean hasCancelledJobs()
431     {
432         return this._has_cancelledJobs;
433     } //-- boolean hasCancelledJobs() 
434 
435     /**
436      * Method hasCompletedJobs
437      * 
438      * 
439      * 
440      * @return boolean
441      */
442     public boolean hasCompletedJobs()
443     {
444         return this._has_completedJobs;
445     } //-- boolean hasCompletedJobs() 
446 
447     /**
448      * Method hasFailedJobs
449      * 
450      * 
451      * 
452      * @return boolean
453      */
454     public boolean hasFailedJobs()
455     {
456         return this._has_failedJobs;
457     } //-- boolean hasFailedJobs() 
458 
459     /**
460      * Method hasLostJobs
461      * 
462      * 
463      * 
464      * @return boolean
465      */
466     public boolean hasLostJobs()
467     {
468         return this._has_lostJobs;
469     } //-- boolean hasLostJobs() 
470 
471     /**
472      * Method hasPort
473      * 
474      * 
475      * 
476      * @return boolean
477      */
478     public boolean hasPort()
479     {
480         return this._has_port;
481     } //-- boolean hasPort() 
482 
483     /**
484      * Method isValid
485      * 
486      * 
487      * 
488      * @return boolean
489      */
490     public boolean isValid()
491     {
492         try {
493             validate();
494         }
495         catch (org.exolab.castor.xml.ValidationException vex) {
496             return false;
497         }
498         return true;
499     } //-- boolean isValid() 
500 
501     /**
502      * Method marshal
503      * 
504      * 
505      * 
506      * @param out
507      */
508     public void marshal(java.io.Writer out)
509         throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
510     {
511         
512         Marshaller.marshal(this, out);
513     } //-- void marshal(java.io.Writer) 
514 
515     /**
516      * Method marshal
517      * 
518      * 
519      * 
520      * @param handler
521      */
522     public void marshal(org.xml.sax.ContentHandler handler)
523         throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
524     {
525         
526         Marshaller.marshal(this, handler);
527     } //-- void marshal(org.xml.sax.ContentHandler) 
528 
529     /**
530      * Method removeQueuing
531      * 
532      * 
533      * 
534      * @param vQueuing
535      * @return boolean
536      */
537     public boolean removeQueuing(fr.in2p3.jsaga.adaptor.schema.job.emulator.config.Queuing vQueuing)
538     {
539         boolean removed = _queuingList.remove(vQueuing);
540         return removed;
541     } //-- boolean removeQueuing(fr.in2p3.jsaga.adaptor.schema.job.emulator.config.Queuing) 
542 
543     /**
544      * Method removeRunning
545      * 
546      * 
547      * 
548      * @param vRunning
549      * @return boolean
550      */
551     public boolean removeRunning(fr.in2p3.jsaga.adaptor.schema.job.emulator.config.Running vRunning)
552     {
553         boolean removed = _runningList.remove(vRunning);
554         return removed;
555     } //-- boolean removeRunning(fr.in2p3.jsaga.adaptor.schema.job.emulator.config.Running) 
556 
557     /**
558      * Sets the value of field 'cancelledJobs'.
559      * 
560      * @param cancelledJobs the value of field 'cancelledJobs'.
561      */
562     public void setCancelledJobs(float cancelledJobs)
563     {
564         this._cancelledJobs = cancelledJobs;
565         this._has_cancelledJobs = true;
566     } //-- void setCancelledJobs(float) 
567 
568     /**
569      * Sets the value of field 'completedJobs'.
570      * 
571      * @param completedJobs the value of field 'completedJobs'.
572      */
573     public void setCompletedJobs(float completedJobs)
574     {
575         this._completedJobs = completedJobs;
576         this._has_completedJobs = true;
577     } //-- void setCompletedJobs(float) 
578 
579     /**
580      * Sets the value of field 'failedJobs'.
581      * 
582      * @param failedJobs the value of field 'failedJobs'.
583      */
584     public void setFailedJobs(float failedJobs)
585     {
586         this._failedJobs = failedJobs;
587         this._has_failedJobs = true;
588     } //-- void setFailedJobs(float) 
589 
590     /**
591      * Sets the value of field 'host'.
592      * 
593      * @param host the value of field 'host'.
594      */
595     public void setHost(java.lang.String host)
596     {
597         this._host = host;
598     } //-- void setHost(java.lang.String) 
599 
600     /**
601      * Sets the value of field 'lostJobs'.
602      * 
603      * @param lostJobs the value of field 'lostJobs'.
604      */
605     public void setLostJobs(float lostJobs)
606     {
607         this._lostJobs = lostJobs;
608         this._has_lostJobs = true;
609     } //-- void setLostJobs(float) 
610 
611     /**
612      * Sets the value of field 'port'.
613      * 
614      * @param port the value of field 'port'.
615      */
616     public void setPort(int port)
617     {
618         this._port = port;
619         this._has_port = true;
620     } //-- void setPort(int) 
621 
622     /**
623      * Method setQueuing
624      * 
625      * 
626      * 
627      * @param index
628      * @param vQueuing
629      */
630     public void setQueuing(int index, fr.in2p3.jsaga.adaptor.schema.job.emulator.config.Queuing vQueuing)
631         throws java.lang.IndexOutOfBoundsException
632     {
633         //-- check bounds for index
634         if ((index < 0) || (index > _queuingList.size())) {
635             throw new IndexOutOfBoundsException();
636         }
637         _queuingList.set(index, vQueuing);
638     } //-- void setQueuing(int, fr.in2p3.jsaga.adaptor.schema.job.emulator.config.Queuing) 
639 
640     /**
641      * Method setQueuing
642      * 
643      * 
644      * 
645      * @param queuingArray
646      */
647     public void setQueuing(fr.in2p3.jsaga.adaptor.schema.job.emulator.config.Queuing[] queuingArray)
648     {
649         //-- copy array
650         _queuingList.clear();
651         for (int i = 0; i < queuingArray.length; i++) {
652             _queuingList.add(queuingArray[i]);
653         }
654     } //-- void setQueuing(fr.in2p3.jsaga.adaptor.schema.job.emulator.config.Queuing) 
655 
656     /**
657      * Method setRunning
658      * 
659      * 
660      * 
661      * @param index
662      * @param vRunning
663      */
664     public void setRunning(int index, fr.in2p3.jsaga.adaptor.schema.job.emulator.config.Running vRunning)
665         throws java.lang.IndexOutOfBoundsException
666     {
667         //-- check bounds for index
668         if ((index < 0) || (index > _runningList.size())) {
669             throw new IndexOutOfBoundsException();
670         }
671         _runningList.set(index, vRunning);
672     } //-- void setRunning(int, fr.in2p3.jsaga.adaptor.schema.job.emulator.config.Running) 
673 
674     /**
675      * Method setRunning
676      * 
677      * 
678      * 
679      * @param runningArray
680      */
681     public void setRunning(fr.in2p3.jsaga.adaptor.schema.job.emulator.config.Running[] runningArray)
682     {
683         //-- copy array
684         _runningList.clear();
685         for (int i = 0; i < runningArray.length; i++) {
686             _runningList.add(runningArray[i]);
687         }
688     } //-- void setRunning(fr.in2p3.jsaga.adaptor.schema.job.emulator.config.Running) 
689 
690     /**
691      * Method unmarshal
692      * 
693      * 
694      * 
695      * @param reader
696      * @return Object
697      */
698     public static java.lang.Object unmarshal(java.io.Reader reader)
699         throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
700     {
701         return (fr.in2p3.jsaga.adaptor.schema.job.emulator.config.Server) Unmarshaller.unmarshal(fr.in2p3.jsaga.adaptor.schema.job.emulator.config.Server.class, reader);
702     } //-- java.lang.Object unmarshal(java.io.Reader) 
703 
704     /**
705      * Method validate
706      * 
707      */
708     public void validate()
709         throws org.exolab.castor.xml.ValidationException
710     {
711         org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
712         validator.validate(this);
713     } //-- void validate() 
714 
715 }