1
2
3
4
5
6
7
8 package org.astrogrid.registry.beans.resource.dataservice;
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.resource.AccessURLType;
19 import org.astrogrid.registry.beans.resource.types.InvocationType;
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 * This is used as a base type for extended Interface types.
28 * It simply restricts the value of Invocation to be "Extended".
29 *
30 *
31 * @version $Revision: 1.14 $ $Date: 2007/01/04 16:26:08 $
32 */
33 public class ExtendedInterfaceType extends org.astrogrid.registry.beans.resource.InterfaceType
34 implements java.io.Serializable
35 {
36
37
38
39
40
41
42 /***
43 * The type of interface used by the current Service,
44 * expressed as a controlled name.
45 *
46 */
47 private org.astrogrid.registry.beans.resource.types.InvocationType _invocation;
48
49 /***
50 * An account of the nature of the resource
51 *
52 */
53 private java.lang.String _description;
54
55 /***
56 * A full or base URL that can be used to access data or a
57 * service.
58 *
59 */
60 private org.astrogrid.registry.beans.resource.AccessURLType _accessURL;
61
62
63
64
65
66
67 public ExtendedInterfaceType() {
68 super();
69 }
70
71
72
73
74
75
76 /***
77 * Note: hashCode() has not been overriden
78 *
79 * @param obj
80 */
81 public boolean equals(java.lang.Object obj)
82 {
83 if ( this == obj )
84 return true;
85
86 if (super.equals(obj)==false)
87 return false;
88
89 if (obj instanceof ExtendedInterfaceType) {
90
91 ExtendedInterfaceType temp = (ExtendedInterfaceType)obj;
92 if (this._invocation != null) {
93 if (temp._invocation == null) return false;
94 else if (!(this._invocation.equals(temp._invocation)))
95 return false;
96 }
97 else if (temp._invocation != null)
98 return false;
99 if (this._description != null) {
100 if (temp._description == null) return false;
101 else if (!(this._description.equals(temp._description)))
102 return false;
103 }
104 else if (temp._description != null)
105 return false;
106 if (this._accessURL != null) {
107 if (temp._accessURL == null) return false;
108 else if (!(this._accessURL.equals(temp._accessURL)))
109 return false;
110 }
111 else if (temp._accessURL != null)
112 return false;
113 return true;
114 }
115 return false;
116 }
117
118 /***
119 * Returns the value of field 'accessURL'. The field
120 * 'accessURL' has the following description: A full or base
121 * URL that can be used to access data or a service.
122 *
123 *
124 * @return the value of field 'accessURL'.
125 */
126 public org.astrogrid.registry.beans.resource.AccessURLType getAccessURL()
127 {
128 return this._accessURL;
129 }
130
131 /***
132 * Returns the value of field 'description'. The field
133 * 'description' has the following description: An account of
134 * the nature of the resource
135 *
136 *
137 * @return the value of field 'description'.
138 */
139 public java.lang.String getDescription()
140 {
141 return this._description;
142 }
143
144 /***
145 * Returns the value of field 'invocation'. The field
146 * 'invocation' has the following description: The type of
147 * interface used by the current Service,
148 * expressed as a controlled name.
149 *
150 *
151 * @return the value of field 'invocation'.
152 */
153 public org.astrogrid.registry.beans.resource.types.InvocationType getInvocation()
154 {
155 return this._invocation;
156 }
157
158 /***
159 * Method isValid
160 */
161 public boolean isValid()
162 {
163 try {
164 validate();
165 }
166 catch (org.exolab.castor.xml.ValidationException vex) {
167 return false;
168 }
169 return true;
170 }
171
172 /***
173 * Method marshal
174 *
175 * @param out
176 */
177 public void marshal(java.io.Writer out)
178 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
179 {
180
181 Marshaller.marshal(this, out);
182 }
183
184 /***
185 * Method marshal
186 *
187 * @param handler
188 */
189 public void marshal(org.xml.sax.ContentHandler handler)
190 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
191 {
192
193 Marshaller.marshal(this, handler);
194 }
195
196 /***
197 * Sets the value of field 'accessURL'. The field 'accessURL'
198 * has the following description: A full or base URL that can
199 * be used to access data or a service.
200 *
201 *
202 * @param accessURL the value of field 'accessURL'.
203 */
204 public void setAccessURL(org.astrogrid.registry.beans.resource.AccessURLType accessURL)
205 {
206 this._accessURL = accessURL;
207 }
208
209 /***
210 * Sets the value of field 'description'. The field
211 * 'description' has the following description: An account of
212 * the nature of the resource
213 *
214 *
215 * @param description the value of field 'description'.
216 */
217 public void setDescription(java.lang.String description)
218 {
219 this._description = description;
220 }
221
222 /***
223 * Sets the value of field 'invocation'. The field 'invocation'
224 * has the following description: The type of interface used by
225 * the current Service,
226 * expressed as a controlled name.
227 *
228 *
229 * @param invocation the value of field 'invocation'.
230 */
231 public void setInvocation(org.astrogrid.registry.beans.resource.types.InvocationType invocation)
232 {
233 this._invocation = invocation;
234 }
235
236 /***
237 * Method unmarshalExtendedInterfaceType
238 *
239 * @param reader
240 */
241 public static org.astrogrid.registry.beans.resource.dataservice.ExtendedInterfaceType unmarshalExtendedInterfaceType(java.io.Reader reader)
242 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
243 {
244 return (org.astrogrid.registry.beans.resource.dataservice.ExtendedInterfaceType) Unmarshaller.unmarshal(org.astrogrid.registry.beans.resource.dataservice.ExtendedInterfaceType.class, reader);
245 }
246
247 /***
248 * Method validate
249 */
250 public void validate()
251 throws org.exolab.castor.xml.ValidationException
252 {
253 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
254 validator.validate(this);
255 }
256
257 }