1
2
3
4
5
6
7
8 package org.astrogrid.registry.beans.v10.resource.sia;
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 org.astrogrid.registry.beans.v10.resource.sia.types.ImageServiceType;
19 import org.exolab.castor.xml.MarshalException;
20 import org.exolab.castor.xml.Marshaller;
21 import org.exolab.castor.xml.Unmarshaller;
22 import org.exolab.castor.xml.ValidationException;
23 import org.xml.sax.ContentHandler;
24
25 /***
26 * The capabilities of an SIA implementation.
27 *
28 * Editor's Notes:
29 * * This is a prototype definition to
30 * illustrate how to extend the schema to a specific
31 * standard interface.
32 * * Staging information is not included yet.
33 *
34 *
35 * @version $Revision: 1.2 $ $Date: 2007/01/04 16:26:30 $
36 */
37 public class SIACapability extends org.astrogrid.registry.beans.v10.resource.sia.SIACapRestriction
38 implements java.io.Serializable
39 {
40
41
42
43
44
45
46 /***
47 * The class of image service: Cutout, Mosaic, Atlas, Pointed
48 *
49 */
50 private org.astrogrid.registry.beans.v10.resource.sia.types.ImageServiceType _imageServiceType;
51
52 /***
53 * The maximum image query region size, expressed in
54 * decimal degrees. A value of 360 degrees indicates that
55 * there is no limit and the entire data collection
56 * (entire sky) can be queried.
57 *
58 */
59 private org.astrogrid.registry.beans.v10.resource.sia.SkySize _maxQueryRegionSize;
60
61 /***
62 * The maximum image query region size, expressed in
63 * decimal degrees. A value of 360 degrees indicates
64 * that there is no limit and the entire data collection
65 * (entire sky) can be requested.
66 *
67 */
68 private org.astrogrid.registry.beans.v10.resource.sia.SkySize _maxImageExtent;
69
70 /***
71 * The largest image (in terms of pixels) that can be
72 * requested.
73 *
74 */
75 private org.astrogrid.registry.beans.v10.resource.sia.ImageSize _maxImageSize;
76
77 /***
78 * The maximum image file size in bytes.
79 *
80 */
81 private int _maxFileSize;
82
83 /***
84 * keeps track of state for field: _maxFileSize
85 */
86 private boolean _has_maxFileSize;
87
88 /***
89 * The largest number of records that the Image Query web
90 * method will return.
91 *
92 */
93 private int _maxRecords;
94
95 /***
96 * keeps track of state for field: _maxRecords
97 */
98 private boolean _has_maxRecords;
99
100
101
102
103
104
105 public SIACapability() {
106 super();
107 }
108
109
110
111
112
113
114 /***
115 * Note: hashCode() has not been overriden
116 *
117 * @param obj
118 */
119 public boolean equals(java.lang.Object obj)
120 {
121 if ( this == obj )
122 return true;
123
124 if (super.equals(obj)==false)
125 return false;
126
127 if (obj instanceof SIACapability) {
128
129 SIACapability temp = (SIACapability)obj;
130 if (this._imageServiceType != null) {
131 if (temp._imageServiceType == null) return false;
132 else if (!(this._imageServiceType.equals(temp._imageServiceType)))
133 return false;
134 }
135 else if (temp._imageServiceType != null)
136 return false;
137 if (this._maxQueryRegionSize != null) {
138 if (temp._maxQueryRegionSize == null) return false;
139 else if (!(this._maxQueryRegionSize.equals(temp._maxQueryRegionSize)))
140 return false;
141 }
142 else if (temp._maxQueryRegionSize != null)
143 return false;
144 if (this._maxImageExtent != null) {
145 if (temp._maxImageExtent == null) return false;
146 else if (!(this._maxImageExtent.equals(temp._maxImageExtent)))
147 return false;
148 }
149 else if (temp._maxImageExtent != null)
150 return false;
151 if (this._maxImageSize != null) {
152 if (temp._maxImageSize == null) return false;
153 else if (!(this._maxImageSize.equals(temp._maxImageSize)))
154 return false;
155 }
156 else if (temp._maxImageSize != null)
157 return false;
158 if (this._maxFileSize != temp._maxFileSize)
159 return false;
160 if (this._has_maxFileSize != temp._has_maxFileSize)
161 return false;
162 if (this._maxRecords != temp._maxRecords)
163 return false;
164 if (this._has_maxRecords != temp._has_maxRecords)
165 return false;
166 return true;
167 }
168 return false;
169 }
170
171 /***
172 * Returns the value of field 'imageServiceType'. The field
173 * 'imageServiceType' has the following description: The class
174 * of image service: Cutout, Mosaic, Atlas, Pointed
175 *
176 *
177 * @return the value of field 'imageServiceType'.
178 */
179 public org.astrogrid.registry.beans.v10.resource.sia.types.ImageServiceType getImageServiceType()
180 {
181 return this._imageServiceType;
182 }
183
184 /***
185 * Returns the value of field 'maxFileSize'. The field
186 * 'maxFileSize' has the following description: The maximum
187 * image file size in bytes.
188 *
189 *
190 * @return the value of field 'maxFileSize'.
191 */
192 public int getMaxFileSize()
193 {
194 return this._maxFileSize;
195 }
196
197 /***
198 * Returns the value of field 'maxImageExtent'. The field
199 * 'maxImageExtent' has the following description: The maximum
200 * image query region size, expressed in
201 * decimal degrees. A value of 360 degrees indicates
202 * that there is no limit and the entire data collection
203 * (entire sky) can be requested.
204 *
205 *
206 * @return the value of field 'maxImageExtent'.
207 */
208 public org.astrogrid.registry.beans.v10.resource.sia.SkySize getMaxImageExtent()
209 {
210 return this._maxImageExtent;
211 }
212
213 /***
214 * Returns the value of field 'maxImageSize'. The field
215 * 'maxImageSize' has the following description: The largest
216 * image (in terms of pixels) that can be
217 * requested.
218 *
219 *
220 * @return the value of field 'maxImageSize'.
221 */
222 public org.astrogrid.registry.beans.v10.resource.sia.ImageSize getMaxImageSize()
223 {
224 return this._maxImageSize;
225 }
226
227 /***
228 * Returns the value of field 'maxQueryRegionSize'. The field
229 * 'maxQueryRegionSize' has the following description: The
230 * maximum image query region size, expressed in
231 * decimal degrees. A value of 360 degrees indicates that
232 * there is no limit and the entire data collection
233 * (entire sky) can be queried.
234 *
235 *
236 * @return the value of field 'maxQueryRegionSize'.
237 */
238 public org.astrogrid.registry.beans.v10.resource.sia.SkySize getMaxQueryRegionSize()
239 {
240 return this._maxQueryRegionSize;
241 }
242
243 /***
244 * Returns the value of field 'maxRecords'. The field
245 * 'maxRecords' has the following description: The largest
246 * number of records that the Image Query web
247 * method will return.
248 *
249 *
250 * @return the value of field 'maxRecords'.
251 */
252 public int getMaxRecords()
253 {
254 return this._maxRecords;
255 }
256
257 /***
258 * Method hasMaxFileSize
259 */
260 public boolean hasMaxFileSize()
261 {
262 return this._has_maxFileSize;
263 }
264
265 /***
266 * Method hasMaxRecords
267 */
268 public boolean hasMaxRecords()
269 {
270 return this._has_maxRecords;
271 }
272
273 /***
274 * Method isValid
275 */
276 public boolean isValid()
277 {
278 try {
279 validate();
280 }
281 catch (org.exolab.castor.xml.ValidationException vex) {
282 return false;
283 }
284 return true;
285 }
286
287 /***
288 * Method marshal
289 *
290 * @param out
291 */
292 public void marshal(java.io.Writer out)
293 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
294 {
295
296 Marshaller.marshal(this, out);
297 }
298
299 /***
300 * Method marshal
301 *
302 * @param handler
303 */
304 public void marshal(org.xml.sax.ContentHandler handler)
305 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
306 {
307
308 Marshaller.marshal(this, handler);
309 }
310
311 /***
312 * Sets the value of field 'imageServiceType'. The field
313 * 'imageServiceType' has the following description: The class
314 * of image service: Cutout, Mosaic, Atlas, Pointed
315 *
316 *
317 * @param imageServiceType the value of field 'imageServiceType'
318 */
319 public void setImageServiceType(org.astrogrid.registry.beans.v10.resource.sia.types.ImageServiceType imageServiceType)
320 {
321 this._imageServiceType = imageServiceType;
322 }
323
324 /***
325 * Sets the value of field 'maxFileSize'. The field
326 * 'maxFileSize' has the following description: The maximum
327 * image file size in bytes.
328 *
329 *
330 * @param maxFileSize the value of field 'maxFileSize'.
331 */
332 public void setMaxFileSize(int maxFileSize)
333 {
334 this._maxFileSize = maxFileSize;
335 this._has_maxFileSize = true;
336 }
337
338 /***
339 * Sets the value of field 'maxImageExtent'. The field
340 * 'maxImageExtent' has the following description: The maximum
341 * image query region size, expressed in
342 * decimal degrees. A value of 360 degrees indicates
343 * that there is no limit and the entire data collection
344 * (entire sky) can be requested.
345 *
346 *
347 * @param maxImageExtent the value of field 'maxImageExtent'.
348 */
349 public void setMaxImageExtent(org.astrogrid.registry.beans.v10.resource.sia.SkySize maxImageExtent)
350 {
351 this._maxImageExtent = maxImageExtent;
352 }
353
354 /***
355 * Sets the value of field 'maxImageSize'. The field
356 * 'maxImageSize' has the following description: The largest
357 * image (in terms of pixels) that can be
358 * requested.
359 *
360 *
361 * @param maxImageSize the value of field 'maxImageSize'.
362 */
363 public void setMaxImageSize(org.astrogrid.registry.beans.v10.resource.sia.ImageSize maxImageSize)
364 {
365 this._maxImageSize = maxImageSize;
366 }
367
368 /***
369 * Sets the value of field 'maxQueryRegionSize'. The field
370 * 'maxQueryRegionSize' has the following description: The
371 * maximum image query region size, expressed in
372 * decimal degrees. A value of 360 degrees indicates that
373 * there is no limit and the entire data collection
374 * (entire sky) can be queried.
375 *
376 *
377 * @param maxQueryRegionSize the value of field
378 * 'maxQueryRegionSize'.
379 */
380 public void setMaxQueryRegionSize(org.astrogrid.registry.beans.v10.resource.sia.SkySize maxQueryRegionSize)
381 {
382 this._maxQueryRegionSize = maxQueryRegionSize;
383 }
384
385 /***
386 * Sets the value of field 'maxRecords'. The field 'maxRecords'
387 * has the following description: The largest number of records
388 * that the Image Query web
389 * method will return.
390 *
391 *
392 * @param maxRecords the value of field 'maxRecords'.
393 */
394 public void setMaxRecords(int maxRecords)
395 {
396 this._maxRecords = maxRecords;
397 this._has_maxRecords = true;
398 }
399
400 /***
401 * Method unmarshalSIACapability
402 *
403 * @param reader
404 */
405 public static org.astrogrid.registry.beans.v10.resource.sia.SIACapability unmarshalSIACapability(java.io.Reader reader)
406 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
407 {
408 return (org.astrogrid.registry.beans.v10.resource.sia.SIACapability) Unmarshaller.unmarshal(org.astrogrid.registry.beans.v10.resource.sia.SIACapability.class, reader);
409 }
410
411 /***
412 * Method validate
413 */
414 public void validate()
415 throws org.exolab.castor.xml.ValidationException
416 {
417 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
418 validator.validate(this);
419 }
420
421 }