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 Protocol extends fr.in2p3.jsaga.engine.schema.config.ObjectType
32 implements java.io.Serializable
33 {
34
35
36
37
38
39
40
41
42
43 private java.lang.String _type;
44
45
46
47
48 private java.lang.String _impl;
49
50
51
52
53 private java.lang.String _usage;
54
55
56
57
58 private boolean _read;
59
60
61
62
63 private boolean _has_read;
64
65
66
67
68 private boolean _write;
69
70
71
72
73 private boolean _has_write;
74
75
76
77
78 private boolean _thirdparty;
79
80
81
82
83 private boolean _has_thirdparty;
84
85
86
87
88 private boolean _logical;
89
90
91
92
93 private boolean _has_logical;
94
95
96
97
98 private java.util.ArrayList _supportedContextTypeList;
99
100
101
102
103
104
105 public Protocol()
106 {
107 super();
108 _supportedContextTypeList = new ArrayList();
109 }
110
111
112
113
114
115
116
117
118
119
120
121
122
123 public void addSupportedContextType(java.lang.String vSupportedContextType)
124 throws java.lang.IndexOutOfBoundsException
125 {
126 _supportedContextTypeList.add(vSupportedContextType);
127 }
128
129
130
131
132
133
134
135
136
137 public void addSupportedContextType(int index, java.lang.String vSupportedContextType)
138 throws java.lang.IndexOutOfBoundsException
139 {
140 _supportedContextTypeList.add(index, vSupportedContextType);
141 }
142
143
144
145
146
147 public void clearSupportedContextType()
148 {
149 _supportedContextTypeList.clear();
150 }
151
152
153
154
155
156 public void deleteLogical()
157 {
158 this._has_logical= false;
159 }
160
161
162
163
164
165 public void deleteRead()
166 {
167 this._has_read= false;
168 }
169
170
171
172
173
174 public void deleteThirdparty()
175 {
176 this._has_thirdparty= false;
177 }
178
179
180
181
182
183 public void deleteWrite()
184 {
185 this._has_write= false;
186 }
187
188
189
190
191
192
193
194
195 public java.util.Enumeration enumerateSupportedContextType()
196 {
197 return new org.exolab.castor.util.IteratorEnumeration(_supportedContextTypeList.iterator());
198 }
199
200
201
202
203
204
205
206 public java.lang.String getImpl()
207 {
208 return this._impl;
209 }
210
211
212
213
214
215
216
217 public boolean getLogical()
218 {
219 return this._logical;
220 }
221
222
223
224
225
226
227
228 public boolean getRead()
229 {
230 return this._read;
231 }
232
233
234
235
236
237
238
239
240
241 public java.lang.String getSupportedContextType(int index)
242 throws java.lang.IndexOutOfBoundsException
243 {
244
245 if ((index < 0) || (index > _supportedContextTypeList.size())) {
246 throw new IndexOutOfBoundsException();
247 }
248
249 return (String)_supportedContextTypeList.get(index);
250 }
251
252
253
254
255
256
257
258
259 public java.lang.String[] getSupportedContextType()
260 {
261 int size = _supportedContextTypeList.size();
262 java.lang.String[] mArray = new java.lang.String[size];
263 for (int index = 0; index < size; index++) {
264 mArray[index] = (String)_supportedContextTypeList.get(index);
265 }
266 return mArray;
267 }
268
269
270
271
272
273
274
275
276 public int getSupportedContextTypeCount()
277 {
278 return _supportedContextTypeList.size();
279 }
280
281
282
283
284
285
286
287 public boolean getThirdparty()
288 {
289 return this._thirdparty;
290 }
291
292
293
294
295
296
297
298 public java.lang.String getType()
299 {
300 return this._type;
301 }
302
303
304
305
306
307
308
309 public java.lang.String getUsage()
310 {
311 return this._usage;
312 }
313
314
315
316
317
318
319
320 public boolean getWrite()
321 {
322 return this._write;
323 }
324
325
326
327
328
329
330
331
332 public boolean hasLogical()
333 {
334 return this._has_logical;
335 }
336
337
338
339
340
341
342
343
344 public boolean hasRead()
345 {
346 return this._has_read;
347 }
348
349
350
351
352
353
354
355
356 public boolean hasThirdparty()
357 {
358 return this._has_thirdparty;
359 }
360
361
362
363
364
365
366
367
368 public boolean hasWrite()
369 {
370 return this._has_write;
371 }
372
373
374
375
376
377
378
379
380 public boolean isValid()
381 {
382 try {
383 validate();
384 }
385 catch (org.exolab.castor.xml.ValidationException vex) {
386 return false;
387 }
388 return true;
389 }
390
391
392
393
394
395
396
397
398 public void marshal(java.io.Writer out)
399 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
400 {
401
402 Marshaller.marshal(this, out);
403 }
404
405
406
407
408
409
410
411
412 public void marshal(org.xml.sax.ContentHandler handler)
413 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
414 {
415
416 Marshaller.marshal(this, handler);
417 }
418
419
420
421
422
423
424
425
426
427 public boolean removeSupportedContextType(java.lang.String vSupportedContextType)
428 {
429 boolean removed = _supportedContextTypeList.remove(vSupportedContextType);
430 return removed;
431 }
432
433
434
435
436
437
438 public void setImpl(java.lang.String impl)
439 {
440 this._impl = impl;
441 }
442
443
444
445
446
447
448 public void setLogical(boolean logical)
449 {
450 this._logical = logical;
451 this._has_logical = true;
452 }
453
454
455
456
457
458
459 public void setRead(boolean read)
460 {
461 this._read = read;
462 this._has_read = true;
463 }
464
465
466
467
468
469
470
471
472
473 public void setSupportedContextType(int index, java.lang.String vSupportedContextType)
474 throws java.lang.IndexOutOfBoundsException
475 {
476
477 if ((index < 0) || (index > _supportedContextTypeList.size())) {
478 throw new IndexOutOfBoundsException();
479 }
480 _supportedContextTypeList.set(index, vSupportedContextType);
481 }
482
483
484
485
486
487
488
489
490 public void setSupportedContextType(java.lang.String[] supportedContextTypeArray)
491 {
492
493 _supportedContextTypeList.clear();
494 for (int i = 0; i < supportedContextTypeArray.length; i++) {
495 _supportedContextTypeList.add(supportedContextTypeArray[i]);
496 }
497 }
498
499
500
501
502
503
504 public void setThirdparty(boolean thirdparty)
505 {
506 this._thirdparty = thirdparty;
507 this._has_thirdparty = true;
508 }
509
510
511
512
513
514
515 public void setType(java.lang.String type)
516 {
517 this._type = type;
518 }
519
520
521
522
523
524
525 public void setUsage(java.lang.String usage)
526 {
527 this._usage = usage;
528 }
529
530
531
532
533
534
535 public void setWrite(boolean write)
536 {
537 this._write = write;
538 this._has_write = true;
539 }
540
541
542
543
544
545
546
547
548
549 public static java.lang.Object unmarshal(java.io.Reader reader)
550 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
551 {
552 return (fr.in2p3.jsaga.engine.schema.config.Protocol) Unmarshaller.unmarshal(fr.in2p3.jsaga.engine.schema.config.Protocol.class, reader);
553 }
554
555
556
557
558
559 public void validate()
560 throws org.exolab.castor.xml.ValidationException
561 {
562 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
563 validator.validate(this);
564 }
565
566 }