1
2
3
4
5
6
7
8 package org.astrogrid.registry.beans.v10.resource;
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.exolab.castor.xml.MarshalException;
19 import org.exolab.castor.xml.Marshaller;
20 import org.exolab.castor.xml.Unmarshaller;
21 import org.exolab.castor.xml.ValidationException;
22 import org.xml.sax.ContentHandler;
23
24 /***
25 * A description of a service interface.
26 *
27 * Since this type is abstract, one must use an Interface subclass
28 * to describe an actual interface.
29 *
30 * Additional interface subtypes (beyond WebService and
31 * WebBrowser) are
32 * defined in the VODataService schema.
33 *
34 *
35 * @version $Revision: 1.2 $ $Date: 2007/01/04 16:26:24 $
36 */
37 public class Interface extends org.astrogrid.common.bean.BaseBean
38 implements java.io.Serializable
39 {
40
41
42
43
44
45
46 /***
47 * The URL (or base URL) that a client uses to access the
48 * service. How this URL is to be interpreted and used
49 * depends on the specific Interface subclass
50 *
51 */
52 private org.astrogrid.registry.beans.v10.resource.AccessURL _accessURL;
53
54
55
56
57
58
59 public Interface() {
60 super();
61 }
62
63
64
65
66
67
68 /***
69 * Note: hashCode() has not been overriden
70 *
71 * @param obj
72 */
73 public boolean equals(java.lang.Object obj)
74 {
75 if ( this == obj )
76 return true;
77
78 if (super.equals(obj)==false)
79 return false;
80
81 if (obj instanceof Interface) {
82
83 Interface temp = (Interface)obj;
84 if (this._accessURL != null) {
85 if (temp._accessURL == null) return false;
86 else if (!(this._accessURL.equals(temp._accessURL)))
87 return false;
88 }
89 else if (temp._accessURL != null)
90 return false;
91 return true;
92 }
93 return false;
94 }
95
96 /***
97 * Returns the value of field 'accessURL'. The field
98 * 'accessURL' has the following description: The URL (or base
99 * URL) that a client uses to access the
100 * service. How this URL is to be interpreted and used
101 * depends on the specific Interface subclass
102 *
103 *
104 * @return the value of field 'accessURL'.
105 */
106 public org.astrogrid.registry.beans.v10.resource.AccessURL getAccessURL()
107 {
108 return this._accessURL;
109 }
110
111 /***
112 * Method isValid
113 */
114 public boolean isValid()
115 {
116 try {
117 validate();
118 }
119 catch (org.exolab.castor.xml.ValidationException vex) {
120 return false;
121 }
122 return true;
123 }
124
125 /***
126 * Method marshal
127 *
128 * @param out
129 */
130 public void marshal(java.io.Writer out)
131 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
132 {
133
134 Marshaller.marshal(this, out);
135 }
136
137 /***
138 * Method marshal
139 *
140 * @param handler
141 */
142 public void marshal(org.xml.sax.ContentHandler handler)
143 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
144 {
145
146 Marshaller.marshal(this, handler);
147 }
148
149 /***
150 * Sets the value of field 'accessURL'. The field 'accessURL'
151 * has the following description: The URL (or base URL) that a
152 * client uses to access the
153 * service. How this URL is to be interpreted and used
154 * depends on the specific Interface subclass
155 *
156 *
157 * @param accessURL the value of field 'accessURL'.
158 */
159 public void setAccessURL(org.astrogrid.registry.beans.v10.resource.AccessURL accessURL)
160 {
161 this._accessURL = accessURL;
162 }
163
164 /***
165 * Method unmarshalInterface
166 *
167 * @param reader
168 */
169 public static org.astrogrid.registry.beans.v10.resource.Interface unmarshalInterface(java.io.Reader reader)
170 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
171 {
172 return (org.astrogrid.registry.beans.v10.resource.Interface) Unmarshaller.unmarshal(org.astrogrid.registry.beans.v10.resource.Interface.class, reader);
173 }
174
175 /***
176 * Method validate
177 */
178 public void validate()
179 throws org.exolab.castor.xml.ValidationException
180 {
181 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
182 validator.validate(this);
183 }
184
185 }