1
2
3
4
5
6
7
8 package fr.in2p3.jsaga.engine.schema.config;
9
10
11
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
28
29
30
31 public class Adaptors implements java.io.Serializable {
32
33
34
35
36
37
38
39
40
41 private java.lang.String _localIntermediary;
42
43
44
45
46 private java.util.ArrayList _contextList;
47
48
49
50
51 private java.util.ArrayList _protocolList;
52
53
54
55
56 private java.util.ArrayList _executionList;
57
58
59
60
61 private java.util.ArrayList _resourceList;
62
63
64
65
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 }
76
77
78
79
80
81
82
83
84
85
86
87
88
89 public void addContext(fr.in2p3.jsaga.engine.schema.config.Context vContext)
90 throws java.lang.IndexOutOfBoundsException
91 {
92 _contextList.add(vContext);
93 }
94
95
96
97
98
99
100
101
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 }
108
109
110
111
112
113
114
115
116 public void addExecution(fr.in2p3.jsaga.engine.schema.config.Execution vExecution)
117 throws java.lang.IndexOutOfBoundsException
118 {
119 _executionList.add(vExecution);
120 }
121
122
123
124
125
126
127
128
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 }
135
136
137
138
139
140
141
142
143 public void addProtocol(fr.in2p3.jsaga.engine.schema.config.Protocol vProtocol)
144 throws java.lang.IndexOutOfBoundsException
145 {
146 _protocolList.add(vProtocol);
147 }
148
149
150
151
152
153
154
155
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 }
162
163
164
165
166
167
168
169
170 public void addResource(fr.in2p3.jsaga.engine.schema.config.Resource vResource)
171 throws java.lang.IndexOutOfBoundsException
172 {
173 _resourceList.add(vResource);
174 }
175
176
177
178
179
180
181
182
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 }
189
190
191
192
193
194 public void clearContext()
195 {
196 _contextList.clear();
197 }
198
199
200
201
202
203 public void clearExecution()
204 {
205 _executionList.clear();
206 }
207
208
209
210
211
212 public void clearProtocol()
213 {
214 _protocolList.clear();
215 }
216
217
218
219
220
221 public void clearResource()
222 {
223 _resourceList.clear();
224 }
225
226
227
228
229
230
231
232
233 public java.util.Enumeration enumerateContext()
234 {
235 return new org.exolab.castor.util.IteratorEnumeration(_contextList.iterator());
236 }
237
238
239
240
241
242
243
244
245 public java.util.Enumeration enumerateExecution()
246 {
247 return new org.exolab.castor.util.IteratorEnumeration(_executionList.iterator());
248 }
249
250
251
252
253
254
255
256
257 public java.util.Enumeration enumerateProtocol()
258 {
259 return new org.exolab.castor.util.IteratorEnumeration(_protocolList.iterator());
260 }
261
262
263
264
265
266
267
268
269 public java.util.Enumeration enumerateResource()
270 {
271 return new org.exolab.castor.util.IteratorEnumeration(_resourceList.iterator());
272 }
273
274
275
276
277
278
279
280
281
282 public fr.in2p3.jsaga.engine.schema.config.Context getContext(int index)
283 throws java.lang.IndexOutOfBoundsException
284 {
285
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 }
292
293
294
295
296
297
298
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 }
309
310
311
312
313
314
315
316
317 public int getContextCount()
318 {
319 return _contextList.size();
320 }
321
322
323
324
325
326
327
328
329
330 public fr.in2p3.jsaga.engine.schema.config.Execution getExecution(int index)
331 throws java.lang.IndexOutOfBoundsException
332 {
333
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 }
340
341
342
343
344
345
346
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 }
357
358
359
360
361
362
363
364
365 public int getExecutionCount()
366 {
367 return _executionList.size();
368 }
369
370
371
372
373
374
375
376 public java.lang.String getLocalIntermediary()
377 {
378 return this._localIntermediary;
379 }
380
381
382
383
384
385
386
387
388
389 public fr.in2p3.jsaga.engine.schema.config.Protocol getProtocol(int index)
390 throws java.lang.IndexOutOfBoundsException
391 {
392
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 }
399
400
401
402
403
404
405
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 }
416
417
418
419
420
421
422
423
424 public int getProtocolCount()
425 {
426 return _protocolList.size();
427 }
428
429
430
431
432
433
434
435
436
437 public fr.in2p3.jsaga.engine.schema.config.Resource getResource(int index)
438 throws java.lang.IndexOutOfBoundsException
439 {
440
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 }
447
448
449
450
451
452
453
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 }
464
465
466
467
468
469
470
471
472 public int getResourceCount()
473 {
474 return _resourceList.size();
475 }
476
477
478
479
480
481
482
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 }
494
495
496
497
498
499
500
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 }
508
509
510
511
512
513
514
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 }
522
523
524
525
526
527
528
529
530
531 public boolean removeContext(fr.in2p3.jsaga.engine.schema.config.Context vContext)
532 {
533 boolean removed = _contextList.remove(vContext);
534 return removed;
535 }
536
537
538
539
540
541
542
543
544
545 public boolean removeExecution(fr.in2p3.jsaga.engine.schema.config.Execution vExecution)
546 {
547 boolean removed = _executionList.remove(vExecution);
548 return removed;
549 }
550
551
552
553
554
555
556
557
558
559 public boolean removeProtocol(fr.in2p3.jsaga.engine.schema.config.Protocol vProtocol)
560 {
561 boolean removed = _protocolList.remove(vProtocol);
562 return removed;
563 }
564
565
566
567
568
569
570
571
572
573 public boolean removeResource(fr.in2p3.jsaga.engine.schema.config.Resource vResource)
574 {
575 boolean removed = _resourceList.remove(vResource);
576 return removed;
577 }
578
579
580
581
582
583
584
585
586
587 public void setContext(int index, fr.in2p3.jsaga.engine.schema.config.Context vContext)
588 throws java.lang.IndexOutOfBoundsException
589 {
590
591 if ((index < 0) || (index > _contextList.size())) {
592 throw new IndexOutOfBoundsException();
593 }
594 _contextList.set(index, vContext);
595 }
596
597
598
599
600
601
602
603
604 public void setContext(fr.in2p3.jsaga.engine.schema.config.Context[] contextArray)
605 {
606
607 _contextList.clear();
608 for (int i = 0; i < contextArray.length; i++) {
609 _contextList.add(contextArray[i]);
610 }
611 }
612
613
614
615
616
617
618
619
620
621 public void setExecution(int index, fr.in2p3.jsaga.engine.schema.config.Execution vExecution)
622 throws java.lang.IndexOutOfBoundsException
623 {
624
625 if ((index < 0) || (index > _executionList.size())) {
626 throw new IndexOutOfBoundsException();
627 }
628 _executionList.set(index, vExecution);
629 }
630
631
632
633
634
635
636
637
638 public void setExecution(fr.in2p3.jsaga.engine.schema.config.Execution[] executionArray)
639 {
640
641 _executionList.clear();
642 for (int i = 0; i < executionArray.length; i++) {
643 _executionList.add(executionArray[i]);
644 }
645 }
646
647
648
649
650
651
652
653 public void setLocalIntermediary(java.lang.String localIntermediary)
654 {
655 this._localIntermediary = localIntermediary;
656 }
657
658
659
660
661
662
663
664
665
666 public void setProtocol(int index, fr.in2p3.jsaga.engine.schema.config.Protocol vProtocol)
667 throws java.lang.IndexOutOfBoundsException
668 {
669
670 if ((index < 0) || (index > _protocolList.size())) {
671 throw new IndexOutOfBoundsException();
672 }
673 _protocolList.set(index, vProtocol);
674 }
675
676
677
678
679
680
681
682
683 public void setProtocol(fr.in2p3.jsaga.engine.schema.config.Protocol[] protocolArray)
684 {
685
686 _protocolList.clear();
687 for (int i = 0; i < protocolArray.length; i++) {
688 _protocolList.add(protocolArray[i]);
689 }
690 }
691
692
693
694
695
696
697
698
699
700 public void setResource(int index, fr.in2p3.jsaga.engine.schema.config.Resource vResource)
701 throws java.lang.IndexOutOfBoundsException
702 {
703
704 if ((index < 0) || (index > _resourceList.size())) {
705 throw new IndexOutOfBoundsException();
706 }
707 _resourceList.set(index, vResource);
708 }
709
710
711
712
713
714
715
716
717 public void setResource(fr.in2p3.jsaga.engine.schema.config.Resource[] resourceArray)
718 {
719
720 _resourceList.clear();
721 for (int i = 0; i < resourceArray.length; i++) {
722 _resourceList.add(resourceArray[i]);
723 }
724 }
725
726
727
728
729
730
731
732
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 }
739
740
741
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 }
750
751 }