svn-gvsig-desktop / tags / gvSIGv0_6_1RELEASE / applications / appCatalogYNomenclatorClient / src / es / gva / cit / catalogClient / schemas / discoverer / Resource.java @ 5222
History | View | Annotate | Download (5.67 KB)
1 | 3566 | jorpiell | |
---|---|---|---|
2 | 3593 | jorpiell | /* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
|
3 | 3893 | 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 | 3893 | 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 | public static final String WEBSITE = "WWW:LINK"; |
||
82 | |||
83 | /**
|
||
84 | *
|
||
85 | *
|
||
86 | */
|
||
87 | public static final String DOWNLOAD = "WWW:DOWNLOAD"; |
||
88 | /**
|
||
89 | *
|
||
90 | *
|
||
91 | */
|
||
92 | public static final String UNKNOWN = "UNKNOWN"; |
||
93 | |||
94 | /**
|
||
95 | *
|
||
96 | *
|
||
97 | */
|
||
98 | private String linkage = null; |
||
99 | |||
100 | /**
|
||
101 | *
|
||
102 | *
|
||
103 | */
|
||
104 | private String protocol = null; |
||
105 | |||
106 | /**
|
||
107 | *
|
||
108 | *
|
||
109 | */
|
||
110 | private String name = null; |
||
111 | |||
112 | /**
|
||
113 | *
|
||
114 | *
|
||
115 | */
|
||
116 | private String description = null; |
||
117 | |||
118 | /**
|
||
119 | *
|
||
120 | *
|
||
121 | */
|
||
122 | private String function = null; |
||
123 | |||
124 | /**
|
||
125 | *
|
||
126 | *
|
||
127 | */
|
||
128 | private String srs = null; |
||
129 | /**
|
||
130 | *
|
||
131 | *
|
||
132 | */
|
||
133 | private Coordinates coordinates = null; |
||
134 | /**
|
||
135 | *
|
||
136 | *
|
||
137 | */
|
||
138 | private String Type = null; |
||
139 | |||
140 | /**
|
||
141 | *
|
||
142 | *
|
||
143 | *
|
||
144 | * @param linkage
|
||
145 | * @param protocol
|
||
146 | * @param name
|
||
147 | * @param description
|
||
148 | * @param function
|
||
149 | * @param srs
|
||
150 | * @param coordinates
|
||
151 | */
|
||
152 | public Resource(String linkage, String protocol, String name, String description, String function, String srs, Coordinates coordinates) { |
||
153 | super();
|
||
154 | this.linkage = linkage;
|
||
155 | this.protocol = protocol;
|
||
156 | this.name = name;
|
||
157 | this.description = description;
|
||
158 | this.function = function;
|
||
159 | this.srs = srs;
|
||
160 | this.coordinates = coordinates;
|
||
161 | setResourceType(); |
||
162 | } |
||
163 | |||
164 | /**
|
||
165 | *
|
||
166 | *
|
||
167 | *
|
||
168 | * @return Returns the description.
|
||
169 | */
|
||
170 | public String getDescription() { |
||
171 | return description;
|
||
172 | } |
||
173 | |||
174 | /**
|
||
175 | *
|
||
176 | *
|
||
177 | *
|
||
178 | * @param description The description to set.
|
||
179 | */
|
||
180 | public void setDescription(String description) { |
||
181 | this.description = description;
|
||
182 | } |
||
183 | |||
184 | /**
|
||
185 | *
|
||
186 | *
|
||
187 | *
|
||
188 | * @return Returns the function.
|
||
189 | */
|
||
190 | public String getFunction() { |
||
191 | return function;
|
||
192 | } |
||
193 | |||
194 | /**
|
||
195 | *
|
||
196 | *
|
||
197 | *
|
||
198 | * @param function The function to set.
|
||
199 | */
|
||
200 | public void setFunction(String function) { |
||
201 | this.function = function;
|
||
202 | } |
||
203 | |||
204 | /**
|
||
205 | *
|
||
206 | *
|
||
207 | *
|
||
208 | * @return Returns the linkage.
|
||
209 | */
|
||
210 | public String getLinkage() { |
||
211 | return linkage;
|
||
212 | } |
||
213 | |||
214 | /**
|
||
215 | *
|
||
216 | *
|
||
217 | *
|
||
218 | * @param linkage The linkage to set.
|
||
219 | */
|
||
220 | public void setLinkage(String linkage) { |
||
221 | this.linkage = linkage;
|
||
222 | } |
||
223 | |||
224 | /**
|
||
225 | *
|
||
226 | *
|
||
227 | *
|
||
228 | * @return Returns the name.
|
||
229 | */
|
||
230 | public String getName() { |
||
231 | return name;
|
||
232 | } |
||
233 | |||
234 | /**
|
||
235 | *
|
||
236 | *
|
||
237 | *
|
||
238 | * @param name The name to set.
|
||
239 | */
|
||
240 | public void setName(String name) { |
||
241 | this.name = name;
|
||
242 | } |
||
243 | |||
244 | /**
|
||
245 | *
|
||
246 | *
|
||
247 | *
|
||
248 | * @return Returns the protocol.
|
||
249 | */
|
||
250 | public String getProtocol() { |
||
251 | return protocol;
|
||
252 | } |
||
253 | |||
254 | /**
|
||
255 | *
|
||
256 | *
|
||
257 | *
|
||
258 | * @param protocol The protocol to set.
|
||
259 | */
|
||
260 | public void setProtocol(String protocol) { |
||
261 | this.protocol = protocol;
|
||
262 | } |
||
263 | |||
264 | /**
|
||
265 | *
|
||
266 | *
|
||
267 | *
|
||
268 | * @return Returns the srs.
|
||
269 | */
|
||
270 | public String getSrs() { |
||
271 | 3509 | jorpiell | return srs;
|
272 | 3893 | jorpiell | } |
273 | |||
274 | /**
|
||
275 | *
|
||
276 | *
|
||
277 | *
|
||
278 | * @param srs The srs to set.
|
||
279 | */
|
||
280 | public void setSrs(String srs) { |
||
281 | 3509 | jorpiell | this.srs = srs;
|
282 | 3893 | jorpiell | } |
283 | |||
284 | /**
|
||
285 | *
|
||
286 | *
|
||
287 | *
|
||
288 | * @return Returns the coordinates.
|
||
289 | */
|
||
290 | public Coordinates getCoordinates() {
|
||
291 | 3509 | jorpiell | return coordinates;
|
292 | 3893 | jorpiell | } |
293 | |||
294 | /**
|
||
295 | *
|
||
296 | *
|
||
297 | *
|
||
298 | * @param coordinates The coordinates to set.
|
||
299 | */
|
||
300 | public void setCoordinates(Coordinates coordinates) { |
||
301 | 3509 | jorpiell | this.coordinates = coordinates;
|
302 | 3893 | jorpiell | } |
303 | /**
|
||
304 | *
|
||
305 | *
|
||
306 | *
|
||
307 | * @return Returns the typr.
|
||
308 | */
|
||
309 | public String getType() { |
||
310 | return Type; |
||
311 | } |
||
312 | /**
|
||
313 | *
|
||
314 | *
|
||
315 | *
|
||
316 | * @return Returns the type
|
||
317 | */
|
||
318 | public void setType(String type) { |
||
319 | Type = type;
|
||
320 | } |
||
321 | |||
322 | 3817 | jorpiell | public void setResourceType(){ |
323 | 3893 | jorpiell | try{
|
324 | if (getProtocol().toUpperCase().indexOf(Resource.WCS) >= 0){ |
||
325 | setType(Resource.WCS); |
||
326 | }else if (getProtocol().toUpperCase().indexOf(Resource.WMS) >= 0){ |
||
327 | setType(Resource.WMS); |
||
328 | }else if (getProtocol().toUpperCase().indexOf(Resource.WFS) >= 0){ |
||
329 | setType(Resource.WFS); |
||
330 | }else if (getProtocol().toUpperCase().indexOf(Resource.POSTGIS) >= 0){ |
||
331 | setType(Resource.POSTGIS); |
||
332 | }else if (getProtocol().toUpperCase().indexOf(Resource.WEBSITE) >= 0){ |
||
333 | setType(Resource.WEBSITE); |
||
334 | }else if (getProtocol().toUpperCase().indexOf(Resource.DOWNLOAD) >= 0){ |
||
335 | setType(Resource.DOWNLOAD); |
||
336 | }else{
|
||
337 | setType(Resource.UNKNOWN); |
||
338 | } |
||
339 | }catch(NullPointerException e){ |
||
340 | 3817 | jorpiell | setType(Resource.UNKNOWN); |
341 | } |
||
342 | } |
||
343 | 3893 | jorpiell | } |