root / tags / v1_0_2_Build_916 / applications / appCatalogYNomenclatorClient / src / es / gva / cit / catalogClient / schemas / discoverer / Resource.java @ 12327
History | View | Annotate | Download (6.09 KB)
1 | 3566 | jorpiell | |
---|---|---|---|
2 | 3593 | jorpiell | /* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
|
3 | 4238 | jorpiell | *
|
4 | * Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
|
||
5 | *
|
||
6 | * This program is free software; you can redistribute it and/or
|
||
7 | * modify it under the terms of the GNU General Public License
|
||
8 | * as published by the Free Software Foundation; either version 2
|
||
9 | * of the License, or (at your option) any later version.
|
||
10 | *
|
||
11 | * This program is distributed in the hope that it will be useful,
|
||
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||
14 | * GNU General Public License for more details.
|
||
15 | *
|
||
16 | * You should have received a copy of the GNU General Public License
|
||
17 | * along with this program; if not, write to the Free Software
|
||
18 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA.
|
||
19 | *
|
||
20 | * For more information, contact:
|
||
21 | *
|
||
22 | * Generalitat Valenciana
|
||
23 | * Conselleria d'Infraestructures i Transport
|
||
24 | * Av. Blasco Ib??ez, 50
|
||
25 | * 46010 VALENCIA
|
||
26 | * SPAIN
|
||
27 | *
|
||
28 | * +34 963862235
|
||
29 | * gvsig@gva.es
|
||
30 | * www.gvsig.gva.es
|
||
31 | *
|
||
32 | * or
|
||
33 | *
|
||
34 | * IVER T.I. S.A
|
||
35 | * Salamanca 50
|
||
36 | * 46005 Valencia
|
||
37 | * Spain
|
||
38 | *
|
||
39 | * +34 963163400
|
||
40 | * dac@iver.es
|
||
41 | */
|
||
42 | 3509 | jorpiell | package es.gva.cit.catalogClient.schemas.discoverer; |
43 | import es.gva.cit.catalogClient.querys.Coordinates; |
||
44 | |||
45 | /**
|
||
46 | * This class implements a geodata linked by a metadata
|
||
47 | *
|
||
48 | 3566 | jorpiell | *
|
49 | 3509 | jorpiell | * @author Jorge Piera Llodra (piera_jor@gva.es)
|
50 | */
|
||
51 | public class Resource { |
||
52 | 4238 | jorpiell | |
53 | /**
|
||
54 | *
|
||
55 | *
|
||
56 | */
|
||
57 | public static final String WMS = "OGC:WMS"; |
||
58 | |||
59 | /**
|
||
60 | *
|
||
61 | *
|
||
62 | */
|
||
63 | public static final String WFS = "OGC:WFS"; |
||
64 | |||
65 | /**
|
||
66 | *
|
||
67 | *
|
||
68 | */
|
||
69 | public static final String WCS = "OGC:WCS"; |
||
70 | |||
71 | /**
|
||
72 | *
|
||
73 | *
|
||
74 | */
|
||
75 | public static final String POSTGIS = "POSTGIS"; |
||
76 | |||
77 | /**
|
||
78 | *
|
||
79 | *
|
||
80 | */
|
||
81 | 7400 | jorpiell | public static final String ARCIMS_IMAGE = "ESRI:AIMS--HTTP-GET-IMAGE"; |
82 | |||
83 | /**
|
||
84 | *
|
||
85 | *
|
||
86 | */
|
||
87 | public static final String ARCIMS_VECTORIAL = "ESRI:AIMS--HTTP-GET-FEATURE"; |
||
88 | |||
89 | /**
|
||
90 | *
|
||
91 | *
|
||
92 | */
|
||
93 | 4238 | jorpiell | public static final String WEBSITE = "WWW:LINK"; |
94 | |||
95 | /**
|
||
96 | *
|
||
97 | *
|
||
98 | */
|
||
99 | public static final String DOWNLOAD = "WWW:DOWNLOAD"; |
||
100 | /**
|
||
101 | *
|
||
102 | *
|
||
103 | */
|
||
104 | public static final String UNKNOWN = "UNKNOWN"; |
||
105 | |||
106 | /**
|
||
107 | *
|
||
108 | *
|
||
109 | */
|
||
110 | private String linkage = null; |
||
111 | |||
112 | /**
|
||
113 | *
|
||
114 | *
|
||
115 | */
|
||
116 | private String protocol = null; |
||
117 | |||
118 | /**
|
||
119 | *
|
||
120 | *
|
||
121 | */
|
||
122 | private String name = null; |
||
123 | |||
124 | /**
|
||
125 | *
|
||
126 | *
|
||
127 | */
|
||
128 | private String description = null; |
||
129 | |||
130 | /**
|
||
131 | *
|
||
132 | *
|
||
133 | */
|
||
134 | private String function = null; |
||
135 | |||
136 | /**
|
||
137 | *
|
||
138 | *
|
||
139 | */
|
||
140 | private String srs = null; |
||
141 | /**
|
||
142 | *
|
||
143 | *
|
||
144 | */
|
||
145 | private Coordinates coordinates = null; |
||
146 | /**
|
||
147 | *
|
||
148 | *
|
||
149 | */
|
||
150 | private String Type = null; |
||
151 | |||
152 | /**
|
||
153 | *
|
||
154 | *
|
||
155 | *
|
||
156 | * @param linkage
|
||
157 | * @param protocol
|
||
158 | * @param name
|
||
159 | * @param description
|
||
160 | * @param function
|
||
161 | * @param srs
|
||
162 | * @param coordinates
|
||
163 | */
|
||
164 | public Resource(String linkage, String protocol, String name, String description, String function, String srs, Coordinates coordinates) { |
||
165 | super();
|
||
166 | this.linkage = linkage;
|
||
167 | this.protocol = protocol;
|
||
168 | this.name = name;
|
||
169 | this.description = description;
|
||
170 | this.function = function;
|
||
171 | this.srs = srs;
|
||
172 | this.coordinates = coordinates;
|
||
173 | setResourceType(); |
||
174 | } |
||
175 | |||
176 | /**
|
||
177 | *
|
||
178 | *
|
||
179 | *
|
||
180 | * @return Returns the description.
|
||
181 | */
|
||
182 | public String getDescription() { |
||
183 | return description;
|
||
184 | } |
||
185 | |||
186 | /**
|
||
187 | *
|
||
188 | *
|
||
189 | *
|
||
190 | * @param description The description to set.
|
||
191 | */
|
||
192 | public void setDescription(String description) { |
||
193 | this.description = description;
|
||
194 | } |
||
195 | |||
196 | /**
|
||
197 | *
|
||
198 | *
|
||
199 | *
|
||
200 | * @return Returns the function.
|
||
201 | */
|
||
202 | public String getFunction() { |
||
203 | return function;
|
||
204 | } |
||
205 | |||
206 | /**
|
||
207 | *
|
||
208 | *
|
||
209 | *
|
||
210 | * @param function The function to set.
|
||
211 | */
|
||
212 | public void setFunction(String function) { |
||
213 | this.function = function;
|
||
214 | } |
||
215 | |||
216 | /**
|
||
217 | *
|
||
218 | *
|
||
219 | *
|
||
220 | * @return Returns the linkage.
|
||
221 | */
|
||
222 | public String getLinkage() { |
||
223 | return linkage;
|
||
224 | } |
||
225 | |||
226 | /**
|
||
227 | *
|
||
228 | *
|
||
229 | *
|
||
230 | * @param linkage The linkage to set.
|
||
231 | */
|
||
232 | public void setLinkage(String linkage) { |
||
233 | this.linkage = linkage;
|
||
234 | } |
||
235 | |||
236 | /**
|
||
237 | *
|
||
238 | *
|
||
239 | *
|
||
240 | * @return Returns the name.
|
||
241 | */
|
||
242 | public String getName() { |
||
243 | return name;
|
||
244 | } |
||
245 | |||
246 | /**
|
||
247 | *
|
||
248 | *
|
||
249 | *
|
||
250 | * @param name The name to set.
|
||
251 | */
|
||
252 | public void setName(String name) { |
||
253 | this.name = name;
|
||
254 | } |
||
255 | |||
256 | /**
|
||
257 | *
|
||
258 | *
|
||
259 | *
|
||
260 | * @return Returns the protocol.
|
||
261 | */
|
||
262 | public String getProtocol() { |
||
263 | return protocol;
|
||
264 | } |
||
265 | |||
266 | /**
|
||
267 | *
|
||
268 | *
|
||
269 | *
|
||
270 | * @param protocol The protocol to set.
|
||
271 | */
|
||
272 | public void setProtocol(String protocol) { |
||
273 | this.protocol = protocol;
|
||
274 | } |
||
275 | |||
276 | /**
|
||
277 | *
|
||
278 | *
|
||
279 | *
|
||
280 | * @return Returns the srs.
|
||
281 | */
|
||
282 | public String getSrs() { |
||
283 | 3509 | jorpiell | return srs;
|
284 | 4238 | jorpiell | } |
285 | |||
286 | /**
|
||
287 | *
|
||
288 | *
|
||
289 | *
|
||
290 | * @param srs The srs to set.
|
||
291 | */
|
||
292 | public void setSrs(String srs) { |
||
293 | 3509 | jorpiell | this.srs = srs;
|
294 | 4238 | jorpiell | } |
295 | |||
296 | /**
|
||
297 | *
|
||
298 | *
|
||
299 | *
|
||
300 | * @return Returns the coordinates.
|
||
301 | */
|
||
302 | public Coordinates getCoordinates() {
|
||
303 | 3509 | jorpiell | return coordinates;
|
304 | 4238 | jorpiell | } |
305 | |||
306 | /**
|
||
307 | *
|
||
308 | *
|
||
309 | *
|
||
310 | * @param coordinates The coordinates to set.
|
||
311 | */
|
||
312 | public void setCoordinates(Coordinates coordinates) { |
||
313 | 3509 | jorpiell | this.coordinates = coordinates;
|
314 | 4238 | jorpiell | } |
315 | /**
|
||
316 | *
|
||
317 | *
|
||
318 | *
|
||
319 | * @return Returns the typr.
|
||
320 | */
|
||
321 | public String getType() { |
||
322 | return Type; |
||
323 | } |
||
324 | /**
|
||
325 | *
|
||
326 | *
|
||
327 | *
|
||
328 | * @return Returns the type
|
||
329 | */
|
||
330 | public void setType(String type) { |
||
331 | Type = type;
|
||
332 | } |
||
333 | |||
334 | 3817 | jorpiell | public void setResourceType(){ |
335 | 4238 | jorpiell | try{
|
336 | if (getProtocol().toUpperCase().indexOf(Resource.WCS) >= 0){ |
||
337 | setType(Resource.WCS); |
||
338 | }else if (getProtocol().toUpperCase().indexOf(Resource.WMS) >= 0){ |
||
339 | setType(Resource.WMS); |
||
340 | }else if (getProtocol().toUpperCase().indexOf(Resource.WFS) >= 0){ |
||
341 | setType(Resource.WFS); |
||
342 | }else if (getProtocol().toUpperCase().indexOf(Resource.POSTGIS) >= 0){ |
||
343 | setType(Resource.POSTGIS); |
||
344 | }else if (getProtocol().toUpperCase().indexOf(Resource.WEBSITE) >= 0){ |
||
345 | setType(Resource.WEBSITE); |
||
346 | }else if (getProtocol().toUpperCase().indexOf(Resource.DOWNLOAD) >= 0){ |
||
347 | setType(Resource.DOWNLOAD); |
||
348 | 7400 | jorpiell | }else if (getProtocol().toUpperCase().indexOf(Resource.ARCIMS_IMAGE) >= 0){ |
349 | setType(Resource.ARCIMS_IMAGE); |
||
350 | }else if (getProtocol().toUpperCase().indexOf(Resource.ARCIMS_VECTORIAL) >= 0){ |
||
351 | setType(Resource.ARCIMS_VECTORIAL); |
||
352 | 4238 | jorpiell | }else{
|
353 | setType(Resource.UNKNOWN); |
||
354 | } |
||
355 | }catch(NullPointerException e){ |
||
356 | 3817 | jorpiell | setType(Resource.UNKNOWN); |
357 | } |
||
358 | } |
||
359 | 4238 | jorpiell | } |