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 Execution 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 fr.in2p3.jsaga.engine.schema.config.MonitorService _monitorService;
59
60
61
62
63 private java.util.ArrayList _supportedContextTypeList;
64
65
66
67
68
69
70 public Execution()
71 {
72 super();
73 _supportedContextTypeList = new ArrayList();
74 }
75
76
77
78
79
80
81
82
83
84
85
86
87
88 public void addSupportedContextType(java.lang.String vSupportedContextType)
89 throws java.lang.IndexOutOfBoundsException
90 {
91 _supportedContextTypeList.add(vSupportedContextType);
92 }
93
94
95
96
97
98
99
100
101
102 public void addSupportedContextType(int index, java.lang.String vSupportedContextType)
103 throws java.lang.IndexOutOfBoundsException
104 {
105 _supportedContextTypeList.add(index, vSupportedContextType);
106 }
107
108
109
110
111
112 public void clearSupportedContextType()
113 {
114 _supportedContextTypeList.clear();
115 }
116
117
118
119
120
121
122
123
124 public java.util.Enumeration enumerateSupportedContextType()
125 {
126 return new org.exolab.castor.util.IteratorEnumeration(_supportedContextTypeList.iterator());
127 }
128
129
130
131
132
133
134
135 public java.lang.String getImpl()
136 {
137 return this._impl;
138 }
139
140
141
142
143
144
145
146 public fr.in2p3.jsaga.engine.schema.config.MonitorService getMonitorService()
147 {
148 return this._monitorService;
149 }
150
151
152
153
154
155
156
157
158
159 public java.lang.String getSupportedContextType(int index)
160 throws java.lang.IndexOutOfBoundsException
161 {
162
163 if ((index < 0) || (index > _supportedContextTypeList.size())) {
164 throw new IndexOutOfBoundsException();
165 }
166
167 return (String)_supportedContextTypeList.get(index);
168 }
169
170
171
172
173
174
175
176
177 public java.lang.String[] getSupportedContextType()
178 {
179 int size = _supportedContextTypeList.size();
180 java.lang.String[] mArray = new java.lang.String[size];
181 for (int index = 0; index < size; index++) {
182 mArray[index] = (String)_supportedContextTypeList.get(index);
183 }
184 return mArray;
185 }
186
187
188
189
190
191
192
193
194 public int getSupportedContextTypeCount()
195 {
196 return _supportedContextTypeList.size();
197 }
198
199
200
201
202
203
204
205 public java.lang.String getType()
206 {
207 return this._type;
208 }
209
210
211
212
213
214
215
216 public java.lang.String getUsage()
217 {
218 return this._usage;
219 }
220
221
222
223
224
225
226
227
228 public boolean isValid()
229 {
230 try {
231 validate();
232 }
233 catch (org.exolab.castor.xml.ValidationException vex) {
234 return false;
235 }
236 return true;
237 }
238
239
240
241
242
243
244
245
246 public void marshal(java.io.Writer out)
247 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
248 {
249
250 Marshaller.marshal(this, out);
251 }
252
253
254
255
256
257
258
259
260 public void marshal(org.xml.sax.ContentHandler handler)
261 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
262 {
263
264 Marshaller.marshal(this, handler);
265 }
266
267
268
269
270
271
272
273
274
275 public boolean removeSupportedContextType(java.lang.String vSupportedContextType)
276 {
277 boolean removed = _supportedContextTypeList.remove(vSupportedContextType);
278 return removed;
279 }
280
281
282
283
284
285
286 public void setImpl(java.lang.String impl)
287 {
288 this._impl = impl;
289 }
290
291
292
293
294
295
296 public void setMonitorService(fr.in2p3.jsaga.engine.schema.config.MonitorService monitorService)
297 {
298 this._monitorService = monitorService;
299 }
300
301
302
303
304
305
306
307
308
309 public void setSupportedContextType(int index, java.lang.String vSupportedContextType)
310 throws java.lang.IndexOutOfBoundsException
311 {
312
313 if ((index < 0) || (index > _supportedContextTypeList.size())) {
314 throw new IndexOutOfBoundsException();
315 }
316 _supportedContextTypeList.set(index, vSupportedContextType);
317 }
318
319
320
321
322
323
324
325
326 public void setSupportedContextType(java.lang.String[] supportedContextTypeArray)
327 {
328
329 _supportedContextTypeList.clear();
330 for (int i = 0; i < supportedContextTypeArray.length; i++) {
331 _supportedContextTypeList.add(supportedContextTypeArray[i]);
332 }
333 }
334
335
336
337
338
339
340 public void setType(java.lang.String type)
341 {
342 this._type = type;
343 }
344
345
346
347
348
349
350 public void setUsage(java.lang.String usage)
351 {
352 this._usage = usage;
353 }
354
355
356
357
358
359
360
361
362
363 public static java.lang.Object unmarshal(java.io.Reader reader)
364 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
365 {
366 return (fr.in2p3.jsaga.engine.schema.config.Execution) Unmarshaller.unmarshal(fr.in2p3.jsaga.engine.schema.config.Execution.class, reader);
367 }
368
369
370
371
372
373 public void validate()
374 throws org.exolab.castor.xml.ValidationException
375 {
376 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
377 validator.validate(this);
378 }
379
380 }