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.engine.schema.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 Adaptors.
28   * 
29   * @version $Revision$ $Date$
30   */
31  public class Adaptors implements java.io.Serializable {
32  
33  
34        //--------------------------/
35       //- Class/Member Variables -/
36      //--------------------------/
37  
38      /**
39       * Field _localIntermediary
40       */
41      private java.lang.String _localIntermediary;
42  
43      /**
44       * Field _contextList
45       */
46      private java.util.ArrayList _contextList;
47  
48      /**
49       * Field _protocolList
50       */
51      private java.util.ArrayList _protocolList;
52  
53      /**
54       * Field _executionList
55       */
56      private java.util.ArrayList _executionList;
57  
58      /**
59       * Field _resourceList
60       */
61      private java.util.ArrayList _resourceList;
62  
63  
64        //----------------/
65       //- Constructors -/
66      //----------------/
67  
68      public Adaptors() 
69       {
70          super();
71          _contextList = new ArrayList();
72          _protocolList = new ArrayList();
73          _executionList = new ArrayList();
74          _resourceList = new ArrayList();
75      } //-- fr.in2p3.jsaga.engine.schema.config.Adaptors()
76  
77  
78        //-----------/
79       //- Methods -/
80      //-----------/
81  
82      /**
83       * Method addContext
84       * 
85       * 
86       * 
87       * @param vContext
88       */
89      public void addContext(fr.in2p3.jsaga.engine.schema.config.Context vContext)
90          throws java.lang.IndexOutOfBoundsException
91      {
92          _contextList.add(vContext);
93      } //-- void addContext(fr.in2p3.jsaga.engine.schema.config.Context) 
94  
95      /**
96       * Method addContext
97       * 
98       * 
99       * 
100      * @param index
101      * @param vContext
102      */
103     public void addContext(int index, fr.in2p3.jsaga.engine.schema.config.Context vContext)
104         throws java.lang.IndexOutOfBoundsException
105     {
106         _contextList.add(index, vContext);
107     } //-- void addContext(int, fr.in2p3.jsaga.engine.schema.config.Context) 
108 
109     /**
110      * Method addExecution
111      * 
112      * 
113      * 
114      * @param vExecution
115      */
116     public void addExecution(fr.in2p3.jsaga.engine.schema.config.Execution vExecution)
117         throws java.lang.IndexOutOfBoundsException
118     {
119         _executionList.add(vExecution);
120     } //-- void addExecution(fr.in2p3.jsaga.engine.schema.config.Execution) 
121 
122     /**
123      * Method addExecution
124      * 
125      * 
126      * 
127      * @param index
128      * @param vExecution
129      */
130     public void addExecution(int index, fr.in2p3.jsaga.engine.schema.config.Execution vExecution)
131         throws java.lang.IndexOutOfBoundsException
132     {
133         _executionList.add(index, vExecution);
134     } //-- void addExecution(int, fr.in2p3.jsaga.engine.schema.config.Execution) 
135 
136     /**
137      * Method addProtocol
138      * 
139      * 
140      * 
141      * @param vProtocol
142      */
143     public void addProtocol(fr.in2p3.jsaga.engine.schema.config.Protocol vProtocol)
144         throws java.lang.IndexOutOfBoundsException
145     {
146         _protocolList.add(vProtocol);
147     } //-- void addProtocol(fr.in2p3.jsaga.engine.schema.config.Protocol) 
148 
149     /**
150      * Method addProtocol
151      * 
152      * 
153      * 
154      * @param index
155      * @param vProtocol
156      */
157     public void addProtocol(int index, fr.in2p3.jsaga.engine.schema.config.Protocol vProtocol)
158         throws java.lang.IndexOutOfBoundsException
159     {
160         _protocolList.add(index, vProtocol);
161     } //-- void addProtocol(int, fr.in2p3.jsaga.engine.schema.config.Protocol) 
162 
163     /**
164      * Method addResource
165      * 
166      * 
167      * 
168      * @param vResource
169      */
170     public void addResource(fr.in2p3.jsaga.engine.schema.config.Resource vResource)
171         throws java.lang.IndexOutOfBoundsException
172     {
173         _resourceList.add(vResource);
174     } //-- void addResource(fr.in2p3.jsaga.engine.schema.config.Resource) 
175 
176     /**
177      * Method addResource
178      * 
179      * 
180      * 
181      * @param index
182      * @param vResource
183      */
184     public void addResource(int index, fr.in2p3.jsaga.engine.schema.config.Resource vResource)
185         throws java.lang.IndexOutOfBoundsException
186     {
187         _resourceList.add(index, vResource);
188     } //-- void addResource(int, fr.in2p3.jsaga.engine.schema.config.Resource) 
189 
190     /**
191      * Method clearContext
192      * 
193      */
194     public void clearContext()
195     {
196         _contextList.clear();
197     } //-- void clearContext() 
198 
199     /**
200      * Method clearExecution
201      * 
202      */
203     public void clearExecution()
204     {
205         _executionList.clear();
206     } //-- void clearExecution() 
207 
208     /**
209      * Method clearProtocol
210      * 
211      */
212     public void clearProtocol()
213     {
214         _protocolList.clear();
215     } //-- void clearProtocol() 
216 
217     /**
218      * Method clearResource
219      * 
220      */
221     public void clearResource()
222     {
223         _resourceList.clear();
224     } //-- void clearResource() 
225 
226     /**
227      * Method enumerateContext
228      * 
229      * 
230      * 
231      * @return Enumeration
232      */
233     public java.util.Enumeration enumerateContext()
234     {
235         return new org.exolab.castor.util.IteratorEnumeration(_contextList.iterator());
236     } //-- java.util.Enumeration enumerateContext() 
237 
238     /**
239      * Method enumerateExecution
240      * 
241      * 
242      * 
243      * @return Enumeration
244      */
245     public java.util.Enumeration enumerateExecution()
246     {
247         return new org.exolab.castor.util.IteratorEnumeration(_executionList.iterator());
248     } //-- java.util.Enumeration enumerateExecution() 
249 
250     /**
251      * Method enumerateProtocol
252      * 
253      * 
254      * 
255      * @return Enumeration
256      */
257     public java.util.Enumeration enumerateProtocol()
258     {
259         return new org.exolab.castor.util.IteratorEnumeration(_protocolList.iterator());
260     } //-- java.util.Enumeration enumerateProtocol() 
261 
262     /**
263      * Method enumerateResource
264      * 
265      * 
266      * 
267      * @return Enumeration
268      */
269     public java.util.Enumeration enumerateResource()
270     {
271         return new org.exolab.castor.util.IteratorEnumeration(_resourceList.iterator());
272     } //-- java.util.Enumeration enumerateResource() 
273 
274     /**
275      * Method getContext
276      * 
277      * 
278      * 
279      * @param index
280      * @return Context
281      */
282     public fr.in2p3.jsaga.engine.schema.config.Context getContext(int index)
283         throws java.lang.IndexOutOfBoundsException
284     {
285         //-- check bounds for index
286         if ((index < 0) || (index > _contextList.size())) {
287             throw new IndexOutOfBoundsException();
288         }
289         
290         return (fr.in2p3.jsaga.engine.schema.config.Context) _contextList.get(index);
291     } //-- fr.in2p3.jsaga.engine.schema.config.Context getContext(int) 
292 
293     /**
294      * Method getContext
295      * 
296      * 
297      * 
298      * @return Context
299      */
300     public fr.in2p3.jsaga.engine.schema.config.Context[] getContext()
301     {
302         int size = _contextList.size();
303         fr.in2p3.jsaga.engine.schema.config.Context[] mArray = new fr.in2p3.jsaga.engine.schema.config.Context[size];
304         for (int index = 0; index < size; index++) {
305             mArray[index] = (fr.in2p3.jsaga.engine.schema.config.Context) _contextList.get(index);
306         }
307         return mArray;
308     } //-- fr.in2p3.jsaga.engine.schema.config.Context[] getContext() 
309 
310     /**
311      * Method getContextCount
312      * 
313      * 
314      * 
315      * @return int
316      */
317     public int getContextCount()
318     {
319         return _contextList.size();
320     } //-- int getContextCount() 
321 
322     /**
323      * Method getExecution
324      * 
325      * 
326      * 
327      * @param index
328      * @return Execution
329      */
330     public fr.in2p3.jsaga.engine.schema.config.Execution getExecution(int index)
331         throws java.lang.IndexOutOfBoundsException
332     {
333         //-- check bounds for index
334         if ((index < 0) || (index > _executionList.size())) {
335             throw new IndexOutOfBoundsException();
336         }
337         
338         return (fr.in2p3.jsaga.engine.schema.config.Execution) _executionList.get(index);
339     } //-- fr.in2p3.jsaga.engine.schema.config.Execution getExecution(int) 
340 
341     /**
342      * Method getExecution
343      * 
344      * 
345      * 
346      * @return Execution
347      */
348     public fr.in2p3.jsaga.engine.schema.config.Execution[] getExecution()
349     {
350         int size = _executionList.size();
351         fr.in2p3.jsaga.engine.schema.config.Execution[] mArray = new fr.in2p3.jsaga.engine.schema.config.Execution[size];
352         for (int index = 0; index < size; index++) {
353             mArray[index] = (fr.in2p3.jsaga.engine.schema.config.Execution) _executionList.get(index);
354         }
355         return mArray;
356     } //-- fr.in2p3.jsaga.engine.schema.config.Execution[] getExecution() 
357 
358     /**
359      * Method getExecutionCount
360      * 
361      * 
362      * 
363      * @return int
364      */
365     public int getExecutionCount()
366     {
367         return _executionList.size();
368     } //-- int getExecutionCount() 
369 
370     /**
371      * Returns the value of field 'localIntermediary'.
372      * 
373      * @return String
374      * @return the value of field 'localIntermediary'.
375      */
376     public java.lang.String getLocalIntermediary()
377     {
378         return this._localIntermediary;
379     } //-- java.lang.String getLocalIntermediary() 
380 
381     /**
382      * Method getProtocol
383      * 
384      * 
385      * 
386      * @param index
387      * @return Protocol
388      */
389     public fr.in2p3.jsaga.engine.schema.config.Protocol getProtocol(int index)
390         throws java.lang.IndexOutOfBoundsException
391     {
392         //-- check bounds for index
393         if ((index < 0) || (index > _protocolList.size())) {
394             throw new IndexOutOfBoundsException();
395         }
396         
397         return (fr.in2p3.jsaga.engine.schema.config.Protocol) _protocolList.get(index);
398     } //-- fr.in2p3.jsaga.engine.schema.config.Protocol getProtocol(int) 
399 
400     /**
401      * Method getProtocol
402      * 
403      * 
404      * 
405      * @return Protocol
406      */
407     public fr.in2p3.jsaga.engine.schema.config.Protocol[] getProtocol()
408     {
409         int size = _protocolList.size();
410         fr.in2p3.jsaga.engine.schema.config.Protocol[] mArray = new fr.in2p3.jsaga.engine.schema.config.Protocol[size];
411         for (int index = 0; index < size; index++) {
412             mArray[index] = (fr.in2p3.jsaga.engine.schema.config.Protocol) _protocolList.get(index);
413         }
414         return mArray;
415     } //-- fr.in2p3.jsaga.engine.schema.config.Protocol[] getProtocol() 
416 
417     /**
418      * Method getProtocolCount
419      * 
420      * 
421      * 
422      * @return int
423      */
424     public int getProtocolCount()
425     {
426         return _protocolList.size();
427     } //-- int getProtocolCount() 
428 
429     /**
430      * Method getResource
431      * 
432      * 
433      * 
434      * @param index
435      * @return Resource
436      */
437     public fr.in2p3.jsaga.engine.schema.config.Resource getResource(int index)
438         throws java.lang.IndexOutOfBoundsException
439     {
440         //-- check bounds for index
441         if ((index < 0) || (index > _resourceList.size())) {
442             throw new IndexOutOfBoundsException();
443         }
444         
445         return (fr.in2p3.jsaga.engine.schema.config.Resource) _resourceList.get(index);
446     } //-- fr.in2p3.jsaga.engine.schema.config.Resource getResource(int) 
447 
448     /**
449      * Method getResource
450      * 
451      * 
452      * 
453      * @return Resource
454      */
455     public fr.in2p3.jsaga.engine.schema.config.Resource[] getResource()
456     {
457         int size = _resourceList.size();
458         fr.in2p3.jsaga.engine.schema.config.Resource[] mArray = new fr.in2p3.jsaga.engine.schema.config.Resource[size];
459         for (int index = 0; index < size; index++) {
460             mArray[index] = (fr.in2p3.jsaga.engine.schema.config.Resource) _resourceList.get(index);
461         }
462         return mArray;
463     } //-- fr.in2p3.jsaga.engine.schema.config.Resource[] getResource() 
464 
465     /**
466      * Method getResourceCount
467      * 
468      * 
469      * 
470      * @return int
471      */
472     public int getResourceCount()
473     {
474         return _resourceList.size();
475     } //-- int getResourceCount() 
476 
477     /**
478      * Method isValid
479      * 
480      * 
481      * 
482      * @return boolean
483      */
484     public boolean isValid()
485     {
486         try {
487             validate();
488         }
489         catch (org.exolab.castor.xml.ValidationException vex) {
490             return false;
491         }
492         return true;
493     } //-- boolean isValid() 
494 
495     /**
496      * Method marshal
497      * 
498      * 
499      * 
500      * @param out
501      */
502     public void marshal(java.io.Writer out)
503         throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
504     {
505         
506         Marshaller.marshal(this, out);
507     } //-- void marshal(java.io.Writer) 
508 
509     /**
510      * Method marshal
511      * 
512      * 
513      * 
514      * @param handler
515      */
516     public void marshal(org.xml.sax.ContentHandler handler)
517         throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
518     {
519         
520         Marshaller.marshal(this, handler);
521     } //-- void marshal(org.xml.sax.ContentHandler) 
522 
523     /**
524      * Method removeContext
525      * 
526      * 
527      * 
528      * @param vContext
529      * @return boolean
530      */
531     public boolean removeContext(fr.in2p3.jsaga.engine.schema.config.Context vContext)
532     {
533         boolean removed = _contextList.remove(vContext);
534         return removed;
535     } //-- boolean removeContext(fr.in2p3.jsaga.engine.schema.config.Context) 
536 
537     /**
538      * Method removeExecution
539      * 
540      * 
541      * 
542      * @param vExecution
543      * @return boolean
544      */
545     public boolean removeExecution(fr.in2p3.jsaga.engine.schema.config.Execution vExecution)
546     {
547         boolean removed = _executionList.remove(vExecution);
548         return removed;
549     } //-- boolean removeExecution(fr.in2p3.jsaga.engine.schema.config.Execution) 
550 
551     /**
552      * Method removeProtocol
553      * 
554      * 
555      * 
556      * @param vProtocol
557      * @return boolean
558      */
559     public boolean removeProtocol(fr.in2p3.jsaga.engine.schema.config.Protocol vProtocol)
560     {
561         boolean removed = _protocolList.remove(vProtocol);
562         return removed;
563     } //-- boolean removeProtocol(fr.in2p3.jsaga.engine.schema.config.Protocol) 
564 
565     /**
566      * Method removeResource
567      * 
568      * 
569      * 
570      * @param vResource
571      * @return boolean
572      */
573     public boolean removeResource(fr.in2p3.jsaga.engine.schema.config.Resource vResource)
574     {
575         boolean removed = _resourceList.remove(vResource);
576         return removed;
577     } //-- boolean removeResource(fr.in2p3.jsaga.engine.schema.config.Resource) 
578 
579     /**
580      * Method setContext
581      * 
582      * 
583      * 
584      * @param index
585      * @param vContext
586      */
587     public void setContext(int index, fr.in2p3.jsaga.engine.schema.config.Context vContext)
588         throws java.lang.IndexOutOfBoundsException
589     {
590         //-- check bounds for index
591         if ((index < 0) || (index > _contextList.size())) {
592             throw new IndexOutOfBoundsException();
593         }
594         _contextList.set(index, vContext);
595     } //-- void setContext(int, fr.in2p3.jsaga.engine.schema.config.Context) 
596 
597     /**
598      * Method setContext
599      * 
600      * 
601      * 
602      * @param contextArray
603      */
604     public void setContext(fr.in2p3.jsaga.engine.schema.config.Context[] contextArray)
605     {
606         //-- copy array
607         _contextList.clear();
608         for (int i = 0; i < contextArray.length; i++) {
609             _contextList.add(contextArray[i]);
610         }
611     } //-- void setContext(fr.in2p3.jsaga.engine.schema.config.Context) 
612 
613     /**
614      * Method setExecution
615      * 
616      * 
617      * 
618      * @param index
619      * @param vExecution
620      */
621     public void setExecution(int index, fr.in2p3.jsaga.engine.schema.config.Execution vExecution)
622         throws java.lang.IndexOutOfBoundsException
623     {
624         //-- check bounds for index
625         if ((index < 0) || (index > _executionList.size())) {
626             throw new IndexOutOfBoundsException();
627         }
628         _executionList.set(index, vExecution);
629     } //-- void setExecution(int, fr.in2p3.jsaga.engine.schema.config.Execution) 
630 
631     /**
632      * Method setExecution
633      * 
634      * 
635      * 
636      * @param executionArray
637      */
638     public void setExecution(fr.in2p3.jsaga.engine.schema.config.Execution[] executionArray)
639     {
640         //-- copy array
641         _executionList.clear();
642         for (int i = 0; i < executionArray.length; i++) {
643             _executionList.add(executionArray[i]);
644         }
645     } //-- void setExecution(fr.in2p3.jsaga.engine.schema.config.Execution) 
646 
647     /**
648      * Sets the value of field 'localIntermediary'.
649      * 
650      * @param localIntermediary the value of field
651      * 'localIntermediary'.
652      */
653     public void setLocalIntermediary(java.lang.String localIntermediary)
654     {
655         this._localIntermediary = localIntermediary;
656     } //-- void setLocalIntermediary(java.lang.String) 
657 
658     /**
659      * Method setProtocol
660      * 
661      * 
662      * 
663      * @param index
664      * @param vProtocol
665      */
666     public void setProtocol(int index, fr.in2p3.jsaga.engine.schema.config.Protocol vProtocol)
667         throws java.lang.IndexOutOfBoundsException
668     {
669         //-- check bounds for index
670         if ((index < 0) || (index > _protocolList.size())) {
671             throw new IndexOutOfBoundsException();
672         }
673         _protocolList.set(index, vProtocol);
674     } //-- void setProtocol(int, fr.in2p3.jsaga.engine.schema.config.Protocol) 
675 
676     /**
677      * Method setProtocol
678      * 
679      * 
680      * 
681      * @param protocolArray
682      */
683     public void setProtocol(fr.in2p3.jsaga.engine.schema.config.Protocol[] protocolArray)
684     {
685         //-- copy array
686         _protocolList.clear();
687         for (int i = 0; i < protocolArray.length; i++) {
688             _protocolList.add(protocolArray[i]);
689         }
690     } //-- void setProtocol(fr.in2p3.jsaga.engine.schema.config.Protocol) 
691 
692     /**
693      * Method setResource
694      * 
695      * 
696      * 
697      * @param index
698      * @param vResource
699      */
700     public void setResource(int index, fr.in2p3.jsaga.engine.schema.config.Resource vResource)
701         throws java.lang.IndexOutOfBoundsException
702     {
703         //-- check bounds for index
704         if ((index < 0) || (index > _resourceList.size())) {
705             throw new IndexOutOfBoundsException();
706         }
707         _resourceList.set(index, vResource);
708     } //-- void setResource(int, fr.in2p3.jsaga.engine.schema.config.Resource) 
709 
710     /**
711      * Method setResource
712      * 
713      * 
714      * 
715      * @param resourceArray
716      */
717     public void setResource(fr.in2p3.jsaga.engine.schema.config.Resource[] resourceArray)
718     {
719         //-- copy array
720         _resourceList.clear();
721         for (int i = 0; i < resourceArray.length; i++) {
722             _resourceList.add(resourceArray[i]);
723         }
724     } //-- void setResource(fr.in2p3.jsaga.engine.schema.config.Resource) 
725 
726     /**
727      * Method unmarshal
728      * 
729      * 
730      * 
731      * @param reader
732      * @return Object
733      */
734     public static java.lang.Object unmarshal(java.io.Reader reader)
735         throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
736     {
737         return (fr.in2p3.jsaga.engine.schema.config.Adaptors) Unmarshaller.unmarshal(fr.in2p3.jsaga.engine.schema.config.Adaptors.class, reader);
738     } //-- java.lang.Object unmarshal(java.io.Reader) 
739 
740     /**
741      * Method validate
742      * 
743      */
744     public void validate()
745         throws org.exolab.castor.xml.ValidationException
746     {
747         org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
748         validator.validate(this);
749     } //-- void validate() 
750 
751 }