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 org.exolab.castor.mapping.AccessMode;
15  import org.exolab.castor.xml.TypeValidator;
16  import org.exolab.castor.xml.XMLFieldDescriptor;
17  import org.exolab.castor.xml.validators.*;
18  
19  /**
20   * Class ServerDescriptor.
21   * 
22   * @version $Revision$ $Date$
23   */
24  public class ServerDescriptor extends org.exolab.castor.xml.util.XMLClassDescriptorImpl {
25  
26  
27        //--------------------------/
28       //- Class/Member Variables -/
29      //--------------------------/
30  
31      /**
32       * Field nsPrefix
33       */
34      private java.lang.String nsPrefix;
35  
36      /**
37       * Field nsURI
38       */
39      private java.lang.String nsURI;
40  
41      /**
42       * Field xmlName
43       */
44      private java.lang.String xmlName;
45  
46      /**
47       * Field identity
48       */
49      private org.exolab.castor.xml.XMLFieldDescriptor identity;
50  
51  
52        //----------------/
53       //- Constructors -/
54      //----------------/
55  
56      public ServerDescriptor() 
57       {
58          super();
59          nsURI = "http://www.in2p3.fr/jsaga/job-emulator-config";
60          xmlName = "server";
61          
62          //-- set grouping compositor
63          setCompositorAsSequence();
64          org.exolab.castor.xml.util.XMLFieldDescriptorImpl  desc           = null;
65          org.exolab.castor.mapping.FieldHandler             handler        = null;
66          org.exolab.castor.xml.FieldValidator               fieldValidator = null;
67          //-- initialize attribute descriptors
68          
69          //-- _host
70          desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_host", "host", org.exolab.castor.xml.NodeType.Attribute);
71          desc.setImmutable(true);
72          handler = new org.exolab.castor.xml.XMLFieldHandler() {
73              public java.lang.Object getValue( java.lang.Object object ) 
74                  throws IllegalStateException
75              {
76                  Server target = (Server) object;
77                  return target.getHost();
78              }
79              public void setValue( java.lang.Object object, java.lang.Object value) 
80                  throws IllegalStateException, IllegalArgumentException
81              {
82                  try {
83                      Server target = (Server) object;
84                      target.setHost( (java.lang.String) value);
85                  }
86                  catch (java.lang.Exception ex) {
87                      throw new IllegalStateException(ex.toString());
88                  }
89              }
90              public java.lang.Object newInstance( java.lang.Object parent ) {
91                  return null;
92              }
93          };
94          desc.setHandler(handler);
95          desc.setNameSpaceURI("http://www.in2p3.fr/jsaga/job-emulator-config");
96          desc.setMultivalued(false);
97          addFieldDescriptor(desc);
98          
99          //-- validation code for: _host
100         fieldValidator = new org.exolab.castor.xml.FieldValidator();
101         { //-- local scope
102             StringValidator typeValidator = new StringValidator();
103             typeValidator.setWhiteSpace("preserve");
104             fieldValidator.setValidator(typeValidator);
105         }
106         desc.setValidator(fieldValidator);
107         //-- _port
108         desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_port", "port", org.exolab.castor.xml.NodeType.Attribute);
109         handler = new org.exolab.castor.xml.XMLFieldHandler() {
110             public java.lang.Object getValue( java.lang.Object object ) 
111                 throws IllegalStateException
112             {
113                 Server target = (Server) object;
114                 if(!target.hasPort())
115                     return null;
116                 return new java.lang.Integer(target.getPort());
117             }
118             public void setValue( java.lang.Object object, java.lang.Object value) 
119                 throws IllegalStateException, IllegalArgumentException
120             {
121                 try {
122                     Server target = (Server) object;
123                     // if null, use delete method for optional primitives 
124                     if (value == null) {
125                         target.deletePort();
126                         return;
127                     }
128                     target.setPort( ((java.lang.Integer)value).intValue());
129                 }
130                 catch (java.lang.Exception ex) {
131                     throw new IllegalStateException(ex.toString());
132                 }
133             }
134             public java.lang.Object newInstance( java.lang.Object parent ) {
135                 return null;
136             }
137         };
138         desc.setHandler(handler);
139         desc.setNameSpaceURI("http://www.in2p3.fr/jsaga/job-emulator-config");
140         desc.setMultivalued(false);
141         addFieldDescriptor(desc);
142         
143         //-- validation code for: _port
144         fieldValidator = new org.exolab.castor.xml.FieldValidator();
145         { //-- local scope
146             IntegerValidator typeValidator= new IntegerValidator();
147             fieldValidator.setValidator(typeValidator);
148         }
149         desc.setValidator(fieldValidator);
150         //-- _cancelledJobs
151         desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(float.class, "_cancelledJobs", "cancelledJobs", org.exolab.castor.xml.NodeType.Attribute);
152         handler = new org.exolab.castor.xml.XMLFieldHandler() {
153             public java.lang.Object getValue( java.lang.Object object ) 
154                 throws IllegalStateException
155             {
156                 Server target = (Server) object;
157                 if(!target.hasCancelledJobs())
158                     return null;
159                 return new java.lang.Float(target.getCancelledJobs());
160             }
161             public void setValue( java.lang.Object object, java.lang.Object value) 
162                 throws IllegalStateException, IllegalArgumentException
163             {
164                 try {
165                     Server target = (Server) object;
166                     // if null, use delete method for optional primitives 
167                     if (value == null) {
168                         target.deleteCancelledJobs();
169                         return;
170                     }
171                     target.setCancelledJobs( ((java.lang.Float)value).floatValue());
172                 }
173                 catch (java.lang.Exception ex) {
174                     throw new IllegalStateException(ex.toString());
175                 }
176             }
177             public java.lang.Object newInstance( java.lang.Object parent ) {
178                 return null;
179             }
180         };
181         desc.setHandler(handler);
182         desc.setNameSpaceURI("http://www.in2p3.fr/jsaga/job-emulator-config");
183         desc.setMultivalued(false);
184         addFieldDescriptor(desc);
185         
186         //-- validation code for: _cancelledJobs
187         fieldValidator = new org.exolab.castor.xml.FieldValidator();
188         { //-- local scope
189             FloatValidator typeValidator = new FloatValidator();
190             typeValidator.setMinInclusive(0.0f);
191             typeValidator.setMaxInclusive(1.0f);
192             fieldValidator.setValidator(typeValidator);
193         }
194         desc.setValidator(fieldValidator);
195         //-- _failedJobs
196         desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(float.class, "_failedJobs", "failedJobs", org.exolab.castor.xml.NodeType.Attribute);
197         handler = new org.exolab.castor.xml.XMLFieldHandler() {
198             public java.lang.Object getValue( java.lang.Object object ) 
199                 throws IllegalStateException
200             {
201                 Server target = (Server) object;
202                 if(!target.hasFailedJobs())
203                     return null;
204                 return new java.lang.Float(target.getFailedJobs());
205             }
206             public void setValue( java.lang.Object object, java.lang.Object value) 
207                 throws IllegalStateException, IllegalArgumentException
208             {
209                 try {
210                     Server target = (Server) object;
211                     // if null, use delete method for optional primitives 
212                     if (value == null) {
213                         target.deleteFailedJobs();
214                         return;
215                     }
216                     target.setFailedJobs( ((java.lang.Float)value).floatValue());
217                 }
218                 catch (java.lang.Exception ex) {
219                     throw new IllegalStateException(ex.toString());
220                 }
221             }
222             public java.lang.Object newInstance( java.lang.Object parent ) {
223                 return null;
224             }
225         };
226         desc.setHandler(handler);
227         desc.setNameSpaceURI("http://www.in2p3.fr/jsaga/job-emulator-config");
228         desc.setMultivalued(false);
229         addFieldDescriptor(desc);
230         
231         //-- validation code for: _failedJobs
232         fieldValidator = new org.exolab.castor.xml.FieldValidator();
233         { //-- local scope
234             FloatValidator typeValidator = new FloatValidator();
235             typeValidator.setMinInclusive(0.0f);
236             typeValidator.setMaxInclusive(1.0f);
237             fieldValidator.setValidator(typeValidator);
238         }
239         desc.setValidator(fieldValidator);
240         //-- _completedJobs
241         desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(float.class, "_completedJobs", "completedJobs", org.exolab.castor.xml.NodeType.Attribute);
242         handler = new org.exolab.castor.xml.XMLFieldHandler() {
243             public java.lang.Object getValue( java.lang.Object object ) 
244                 throws IllegalStateException
245             {
246                 Server target = (Server) object;
247                 if(!target.hasCompletedJobs())
248                     return null;
249                 return new java.lang.Float(target.getCompletedJobs());
250             }
251             public void setValue( java.lang.Object object, java.lang.Object value) 
252                 throws IllegalStateException, IllegalArgumentException
253             {
254                 try {
255                     Server target = (Server) object;
256                     // if null, use delete method for optional primitives 
257                     if (value == null) {
258                         target.deleteCompletedJobs();
259                         return;
260                     }
261                     target.setCompletedJobs( ((java.lang.Float)value).floatValue());
262                 }
263                 catch (java.lang.Exception ex) {
264                     throw new IllegalStateException(ex.toString());
265                 }
266             }
267             public java.lang.Object newInstance( java.lang.Object parent ) {
268                 return null;
269             }
270         };
271         desc.setHandler(handler);
272         desc.setNameSpaceURI("http://www.in2p3.fr/jsaga/job-emulator-config");
273         desc.setMultivalued(false);
274         addFieldDescriptor(desc);
275         
276         //-- validation code for: _completedJobs
277         fieldValidator = new org.exolab.castor.xml.FieldValidator();
278         { //-- local scope
279             FloatValidator typeValidator = new FloatValidator();
280             typeValidator.setMinInclusive(0.0f);
281             typeValidator.setMaxInclusive(1.0f);
282             fieldValidator.setValidator(typeValidator);
283         }
284         desc.setValidator(fieldValidator);
285         //-- _lostJobs
286         desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(float.class, "_lostJobs", "lostJobs", org.exolab.castor.xml.NodeType.Attribute);
287         handler = new org.exolab.castor.xml.XMLFieldHandler() {
288             public java.lang.Object getValue( java.lang.Object object ) 
289                 throws IllegalStateException
290             {
291                 Server target = (Server) object;
292                 if(!target.hasLostJobs())
293                     return null;
294                 return new java.lang.Float(target.getLostJobs());
295             }
296             public void setValue( java.lang.Object object, java.lang.Object value) 
297                 throws IllegalStateException, IllegalArgumentException
298             {
299                 try {
300                     Server target = (Server) object;
301                     // if null, use delete method for optional primitives 
302                     if (value == null) {
303                         target.deleteLostJobs();
304                         return;
305                     }
306                     target.setLostJobs( ((java.lang.Float)value).floatValue());
307                 }
308                 catch (java.lang.Exception ex) {
309                     throw new IllegalStateException(ex.toString());
310                 }
311             }
312             public java.lang.Object newInstance( java.lang.Object parent ) {
313                 return null;
314             }
315         };
316         desc.setHandler(handler);
317         desc.setNameSpaceURI("http://www.in2p3.fr/jsaga/job-emulator-config");
318         desc.setMultivalued(false);
319         addFieldDescriptor(desc);
320         
321         //-- validation code for: _lostJobs
322         fieldValidator = new org.exolab.castor.xml.FieldValidator();
323         { //-- local scope
324             FloatValidator typeValidator = new FloatValidator();
325             typeValidator.setMinInclusive(0.0f);
326             typeValidator.setMaxInclusive(1.0f);
327             fieldValidator.setValidator(typeValidator);
328         }
329         desc.setValidator(fieldValidator);
330         //-- initialize element descriptors
331         
332         //-- _queuingList
333         desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(fr.in2p3.jsaga.adaptor.schema.job.emulator.config.Queuing.class, "_queuingList", "queuing", org.exolab.castor.xml.NodeType.Element);
334         handler = new org.exolab.castor.xml.XMLFieldHandler() {
335             public java.lang.Object getValue( java.lang.Object object ) 
336                 throws IllegalStateException
337             {
338                 Server target = (Server) object;
339                 return target.getQueuing();
340             }
341             public void setValue( java.lang.Object object, java.lang.Object value) 
342                 throws IllegalStateException, IllegalArgumentException
343             {
344                 try {
345                     Server target = (Server) object;
346                     target.addQueuing( (fr.in2p3.jsaga.adaptor.schema.job.emulator.config.Queuing) value);
347                 }
348                 catch (java.lang.Exception ex) {
349                     throw new IllegalStateException(ex.toString());
350                 }
351             }
352             public java.lang.Object newInstance( java.lang.Object parent ) {
353                 return new fr.in2p3.jsaga.adaptor.schema.job.emulator.config.Queuing();
354             }
355         };
356         desc.setHandler(handler);
357         desc.setNameSpaceURI("http://www.in2p3.fr/jsaga/job-emulator-config");
358         desc.setMultivalued(true);
359         addFieldDescriptor(desc);
360         
361         //-- validation code for: _queuingList
362         fieldValidator = new org.exolab.castor.xml.FieldValidator();
363         fieldValidator.setMinOccurs(0);
364         { //-- local scope
365         }
366         desc.setValidator(fieldValidator);
367         //-- _runningList
368         desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(fr.in2p3.jsaga.adaptor.schema.job.emulator.config.Running.class, "_runningList", "running", org.exolab.castor.xml.NodeType.Element);
369         handler = new org.exolab.castor.xml.XMLFieldHandler() {
370             public java.lang.Object getValue( java.lang.Object object ) 
371                 throws IllegalStateException
372             {
373                 Server target = (Server) object;
374                 return target.getRunning();
375             }
376             public void setValue( java.lang.Object object, java.lang.Object value) 
377                 throws IllegalStateException, IllegalArgumentException
378             {
379                 try {
380                     Server target = (Server) object;
381                     target.addRunning( (fr.in2p3.jsaga.adaptor.schema.job.emulator.config.Running) value);
382                 }
383                 catch (java.lang.Exception ex) {
384                     throw new IllegalStateException(ex.toString());
385                 }
386             }
387             public java.lang.Object newInstance( java.lang.Object parent ) {
388                 return new fr.in2p3.jsaga.adaptor.schema.job.emulator.config.Running();
389             }
390         };
391         desc.setHandler(handler);
392         desc.setNameSpaceURI("http://www.in2p3.fr/jsaga/job-emulator-config");
393         desc.setMultivalued(true);
394         addFieldDescriptor(desc);
395         
396         //-- validation code for: _runningList
397         fieldValidator = new org.exolab.castor.xml.FieldValidator();
398         fieldValidator.setMinOccurs(0);
399         { //-- local scope
400         }
401         desc.setValidator(fieldValidator);
402     } //-- fr.in2p3.jsaga.adaptor.schema.job.emulator.config.ServerDescriptor()
403 
404 
405       //-----------/
406      //- Methods -/
407     //-----------/
408 
409     /**
410      * Method getAccessMode
411      * 
412      * 
413      * 
414      * @return AccessMode
415      */
416     public org.exolab.castor.mapping.AccessMode getAccessMode()
417     {
418         return null;
419     } //-- org.exolab.castor.mapping.AccessMode getAccessMode() 
420 
421     /**
422      * Method getExtends
423      * 
424      * 
425      * 
426      * @return ClassDescriptor
427      */
428     public org.exolab.castor.mapping.ClassDescriptor getExtends()
429     {
430         return null;
431     } //-- org.exolab.castor.mapping.ClassDescriptor getExtends() 
432 
433     /**
434      * Method getIdentity
435      * 
436      * 
437      * 
438      * @return FieldDescriptor
439      */
440     public org.exolab.castor.mapping.FieldDescriptor getIdentity()
441     {
442         return identity;
443     } //-- org.exolab.castor.mapping.FieldDescriptor getIdentity() 
444 
445     /**
446      * Method getJavaClass
447      * 
448      * 
449      * 
450      * @return Class
451      */
452     public java.lang.Class getJavaClass()
453     {
454         return fr.in2p3.jsaga.adaptor.schema.job.emulator.config.Server.class;
455     } //-- java.lang.Class getJavaClass() 
456 
457     /**
458      * Method getNameSpacePrefix
459      * 
460      * 
461      * 
462      * @return String
463      */
464     public java.lang.String getNameSpacePrefix()
465     {
466         return nsPrefix;
467     } //-- java.lang.String getNameSpacePrefix() 
468 
469     /**
470      * Method getNameSpaceURI
471      * 
472      * 
473      * 
474      * @return String
475      */
476     public java.lang.String getNameSpaceURI()
477     {
478         return nsURI;
479     } //-- java.lang.String getNameSpaceURI() 
480 
481     /**
482      * Method getValidator
483      * 
484      * 
485      * 
486      * @return TypeValidator
487      */
488     public org.exolab.castor.xml.TypeValidator getValidator()
489     {
490         return this;
491     } //-- org.exolab.castor.xml.TypeValidator getValidator() 
492 
493     /**
494      * Method getXMLName
495      * 
496      * 
497      * 
498      * @return String
499      */
500     public java.lang.String getXMLName()
501     {
502         return xmlName;
503     } //-- java.lang.String getXMLName() 
504 
505 }