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.data.emulator;
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 DataEmulator.
28   * 
29   * @version $Revision$ $Date$
30   */
31  public class DataEmulator implements java.io.Serializable {
32  
33  
34        //--------------------------/
35       //- Class/Member Variables -/
36      //--------------------------/
37  
38      /**
39       * Field _serverList
40       */
41      private java.util.ArrayList _serverList;
42  
43      /**
44       * Field _secureServerList
45       */
46      private java.util.ArrayList _secureServerList;
47  
48  
49        //----------------/
50       //- Constructors -/
51      //----------------/
52  
53      public DataEmulator() 
54       {
55          super();
56          _serverList = new ArrayList();
57          _secureServerList = new ArrayList();
58      } //-- fr.in2p3.jsaga.adaptor.schema.data.emulator.DataEmulator()
59  
60  
61        //-----------/
62       //- Methods -/
63      //-----------/
64  
65      /**
66       * Method addSecureServer
67       * 
68       * 
69       * 
70       * @param vSecureServer
71       */
72      public void addSecureServer(fr.in2p3.jsaga.adaptor.schema.data.emulator.SecureServer vSecureServer)
73          throws java.lang.IndexOutOfBoundsException
74      {
75          _secureServerList.add(vSecureServer);
76      } //-- void addSecureServer(fr.in2p3.jsaga.adaptor.schema.data.emulator.SecureServer) 
77  
78      /**
79       * Method addSecureServer
80       * 
81       * 
82       * 
83       * @param index
84       * @param vSecureServer
85       */
86      public void addSecureServer(int index, fr.in2p3.jsaga.adaptor.schema.data.emulator.SecureServer vSecureServer)
87          throws java.lang.IndexOutOfBoundsException
88      {
89          _secureServerList.add(index, vSecureServer);
90      } //-- void addSecureServer(int, fr.in2p3.jsaga.adaptor.schema.data.emulator.SecureServer) 
91  
92      /**
93       * Method addServer
94       * 
95       * 
96       * 
97       * @param vServer
98       */
99      public void addServer(fr.in2p3.jsaga.adaptor.schema.data.emulator.Server vServer)
100         throws java.lang.IndexOutOfBoundsException
101     {
102         _serverList.add(vServer);
103     } //-- void addServer(fr.in2p3.jsaga.adaptor.schema.data.emulator.Server) 
104 
105     /**
106      * Method addServer
107      * 
108      * 
109      * 
110      * @param index
111      * @param vServer
112      */
113     public void addServer(int index, fr.in2p3.jsaga.adaptor.schema.data.emulator.Server vServer)
114         throws java.lang.IndexOutOfBoundsException
115     {
116         _serverList.add(index, vServer);
117     } //-- void addServer(int, fr.in2p3.jsaga.adaptor.schema.data.emulator.Server) 
118 
119     /**
120      * Method clearSecureServer
121      * 
122      */
123     public void clearSecureServer()
124     {
125         _secureServerList.clear();
126     } //-- void clearSecureServer() 
127 
128     /**
129      * Method clearServer
130      * 
131      */
132     public void clearServer()
133     {
134         _serverList.clear();
135     } //-- void clearServer() 
136 
137     /**
138      * Method enumerateSecureServer
139      * 
140      * 
141      * 
142      * @return Enumeration
143      */
144     public java.util.Enumeration enumerateSecureServer()
145     {
146         return new org.exolab.castor.util.IteratorEnumeration(_secureServerList.iterator());
147     } //-- java.util.Enumeration enumerateSecureServer() 
148 
149     /**
150      * Method enumerateServer
151      * 
152      * 
153      * 
154      * @return Enumeration
155      */
156     public java.util.Enumeration enumerateServer()
157     {
158         return new org.exolab.castor.util.IteratorEnumeration(_serverList.iterator());
159     } //-- java.util.Enumeration enumerateServer() 
160 
161     /**
162      * Method getSecureServer
163      * 
164      * 
165      * 
166      * @param index
167      * @return SecureServer
168      */
169     public fr.in2p3.jsaga.adaptor.schema.data.emulator.SecureServer getSecureServer(int index)
170         throws java.lang.IndexOutOfBoundsException
171     {
172         //-- check bounds for index
173         if ((index < 0) || (index > _secureServerList.size())) {
174             throw new IndexOutOfBoundsException();
175         }
176         
177         return (fr.in2p3.jsaga.adaptor.schema.data.emulator.SecureServer) _secureServerList.get(index);
178     } //-- fr.in2p3.jsaga.adaptor.schema.data.emulator.SecureServer getSecureServer(int) 
179 
180     /**
181      * Method getSecureServer
182      * 
183      * 
184      * 
185      * @return SecureServer
186      */
187     public fr.in2p3.jsaga.adaptor.schema.data.emulator.SecureServer[] getSecureServer()
188     {
189         int size = _secureServerList.size();
190         fr.in2p3.jsaga.adaptor.schema.data.emulator.SecureServer[] mArray = new fr.in2p3.jsaga.adaptor.schema.data.emulator.SecureServer[size];
191         for (int index = 0; index < size; index++) {
192             mArray[index] = (fr.in2p3.jsaga.adaptor.schema.data.emulator.SecureServer) _secureServerList.get(index);
193         }
194         return mArray;
195     } //-- fr.in2p3.jsaga.adaptor.schema.data.emulator.SecureServer[] getSecureServer() 
196 
197     /**
198      * Method getSecureServerCount
199      * 
200      * 
201      * 
202      * @return int
203      */
204     public int getSecureServerCount()
205     {
206         return _secureServerList.size();
207     } //-- int getSecureServerCount() 
208 
209     /**
210      * Method getServer
211      * 
212      * 
213      * 
214      * @param index
215      * @return Server
216      */
217     public fr.in2p3.jsaga.adaptor.schema.data.emulator.Server getServer(int index)
218         throws java.lang.IndexOutOfBoundsException
219     {
220         //-- check bounds for index
221         if ((index < 0) || (index > _serverList.size())) {
222             throw new IndexOutOfBoundsException();
223         }
224         
225         return (fr.in2p3.jsaga.adaptor.schema.data.emulator.Server) _serverList.get(index);
226     } //-- fr.in2p3.jsaga.adaptor.schema.data.emulator.Server getServer(int) 
227 
228     /**
229      * Method getServer
230      * 
231      * 
232      * 
233      * @return Server
234      */
235     public fr.in2p3.jsaga.adaptor.schema.data.emulator.Server[] getServer()
236     {
237         int size = _serverList.size();
238         fr.in2p3.jsaga.adaptor.schema.data.emulator.Server[] mArray = new fr.in2p3.jsaga.adaptor.schema.data.emulator.Server[size];
239         for (int index = 0; index < size; index++) {
240             mArray[index] = (fr.in2p3.jsaga.adaptor.schema.data.emulator.Server) _serverList.get(index);
241         }
242         return mArray;
243     } //-- fr.in2p3.jsaga.adaptor.schema.data.emulator.Server[] getServer() 
244 
245     /**
246      * Method getServerCount
247      * 
248      * 
249      * 
250      * @return int
251      */
252     public int getServerCount()
253     {
254         return _serverList.size();
255     } //-- int getServerCount() 
256 
257     /**
258      * Method isValid
259      * 
260      * 
261      * 
262      * @return boolean
263      */
264     public boolean isValid()
265     {
266         try {
267             validate();
268         }
269         catch (org.exolab.castor.xml.ValidationException vex) {
270             return false;
271         }
272         return true;
273     } //-- boolean isValid() 
274 
275     /**
276      * Method marshal
277      * 
278      * 
279      * 
280      * @param out
281      */
282     public void marshal(java.io.Writer out)
283         throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
284     {
285         
286         Marshaller.marshal(this, out);
287     } //-- void marshal(java.io.Writer) 
288 
289     /**
290      * Method marshal
291      * 
292      * 
293      * 
294      * @param handler
295      */
296     public void marshal(org.xml.sax.ContentHandler handler)
297         throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
298     {
299         
300         Marshaller.marshal(this, handler);
301     } //-- void marshal(org.xml.sax.ContentHandler) 
302 
303     /**
304      * Method removeSecureServer
305      * 
306      * 
307      * 
308      * @param vSecureServer
309      * @return boolean
310      */
311     public boolean removeSecureServer(fr.in2p3.jsaga.adaptor.schema.data.emulator.SecureServer vSecureServer)
312     {
313         boolean removed = _secureServerList.remove(vSecureServer);
314         return removed;
315     } //-- boolean removeSecureServer(fr.in2p3.jsaga.adaptor.schema.data.emulator.SecureServer) 
316 
317     /**
318      * Method removeServer
319      * 
320      * 
321      * 
322      * @param vServer
323      * @return boolean
324      */
325     public boolean removeServer(fr.in2p3.jsaga.adaptor.schema.data.emulator.Server vServer)
326     {
327         boolean removed = _serverList.remove(vServer);
328         return removed;
329     } //-- boolean removeServer(fr.in2p3.jsaga.adaptor.schema.data.emulator.Server) 
330 
331     /**
332      * Method setSecureServer
333      * 
334      * 
335      * 
336      * @param index
337      * @param vSecureServer
338      */
339     public void setSecureServer(int index, fr.in2p3.jsaga.adaptor.schema.data.emulator.SecureServer vSecureServer)
340         throws java.lang.IndexOutOfBoundsException
341     {
342         //-- check bounds for index
343         if ((index < 0) || (index > _secureServerList.size())) {
344             throw new IndexOutOfBoundsException();
345         }
346         _secureServerList.set(index, vSecureServer);
347     } //-- void setSecureServer(int, fr.in2p3.jsaga.adaptor.schema.data.emulator.SecureServer) 
348 
349     /**
350      * Method setSecureServer
351      * 
352      * 
353      * 
354      * @param secureServerArray
355      */
356     public void setSecureServer(fr.in2p3.jsaga.adaptor.schema.data.emulator.SecureServer[] secureServerArray)
357     {
358         //-- copy array
359         _secureServerList.clear();
360         for (int i = 0; i < secureServerArray.length; i++) {
361             _secureServerList.add(secureServerArray[i]);
362         }
363     } //-- void setSecureServer(fr.in2p3.jsaga.adaptor.schema.data.emulator.SecureServer) 
364 
365     /**
366      * Method setServer
367      * 
368      * 
369      * 
370      * @param index
371      * @param vServer
372      */
373     public void setServer(int index, fr.in2p3.jsaga.adaptor.schema.data.emulator.Server vServer)
374         throws java.lang.IndexOutOfBoundsException
375     {
376         //-- check bounds for index
377         if ((index < 0) || (index > _serverList.size())) {
378             throw new IndexOutOfBoundsException();
379         }
380         _serverList.set(index, vServer);
381     } //-- void setServer(int, fr.in2p3.jsaga.adaptor.schema.data.emulator.Server) 
382 
383     /**
384      * Method setServer
385      * 
386      * 
387      * 
388      * @param serverArray
389      */
390     public void setServer(fr.in2p3.jsaga.adaptor.schema.data.emulator.Server[] serverArray)
391     {
392         //-- copy array
393         _serverList.clear();
394         for (int i = 0; i < serverArray.length; i++) {
395             _serverList.add(serverArray[i]);
396         }
397     } //-- void setServer(fr.in2p3.jsaga.adaptor.schema.data.emulator.Server) 
398 
399     /**
400      * Method unmarshal
401      * 
402      * 
403      * 
404      * @param reader
405      * @return Object
406      */
407     public static java.lang.Object unmarshal(java.io.Reader reader)
408         throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
409     {
410         return (fr.in2p3.jsaga.adaptor.schema.data.emulator.DataEmulator) Unmarshaller.unmarshal(fr.in2p3.jsaga.adaptor.schema.data.emulator.DataEmulator.class, reader);
411     } //-- java.lang.Object unmarshal(java.io.Reader) 
412 
413     /**
414      * Method validate
415      * 
416      */
417     public void validate()
418         throws org.exolab.castor.xml.ValidationException
419     {
420         org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
421         validator.validate(this);
422     } //-- void validate() 
423 
424 }