root / tags / v1_1_Build_1000 / libraries / libIverUtiles / src / com / iver / utiles / swing / jcomboServer / ServerData.java @ 11885
History | View | Annotate | Download (7.98 KB)
1 |
|
---|---|
2 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
|
3 |
*
|
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 |
package com.iver.utiles.swing.jcomboServer; |
43 |
import java.util.Date; |
44 |
import java.util.Properties; |
45 |
|
46 |
import com.iver.utiles.DateTime; |
47 |
|
48 |
/**
|
49 |
* This class represents a data server, that can be a WMS, WFS, Catalog or
|
50 |
* any kind of server. It contains the server URL and has a couple of
|
51 |
* attributes that describe the server type (serverType and serverSubType).
|
52 |
* It contains the date when the server was created and the date when the server
|
53 |
* was accessed last time. *
|
54 |
*
|
55 |
* @author Jorge Piera Llodra (piera_jor@gva.es)
|
56 |
*/
|
57 |
public class ServerData { |
58 |
|
59 |
/**
|
60 |
*
|
61 |
*
|
62 |
*/
|
63 |
public static final String SERVER_TYPE_CATALOG = "CATALOG"; |
64 |
|
65 |
/**
|
66 |
*
|
67 |
*
|
68 |
*/
|
69 |
public static final String SERVER_TYPE_GAZETTEER = "GAZETTEER"; |
70 |
|
71 |
/**
|
72 |
*
|
73 |
*
|
74 |
*/
|
75 |
public static final String SERVER_TYPE_MULTIPLE = "MULTIPLE"; |
76 |
/**
|
77 |
*
|
78 |
*
|
79 |
*/
|
80 |
public static final String SERVER_TYPE_WMS = "WMS"; |
81 |
|
82 |
/**
|
83 |
*
|
84 |
*
|
85 |
*/
|
86 |
public static final String SERVER_TYPE_WCS = "WCS"; |
87 |
|
88 |
/**
|
89 |
*
|
90 |
*
|
91 |
*/
|
92 |
public static final String SERVER_TYPE_WFS = "WFS"; |
93 |
|
94 |
/**
|
95 |
*
|
96 |
*
|
97 |
*/
|
98 |
public static final String SERVER_SUBTYPE_CATALOG_Z3950 = "Z3950"; |
99 |
|
100 |
/**
|
101 |
*
|
102 |
*
|
103 |
*/
|
104 |
public static final String SERVER_SUBTYPE_CATALOG_SRW = "SRW"; |
105 |
|
106 |
/**
|
107 |
*
|
108 |
*
|
109 |
*/
|
110 |
public static final String SERVER_SUBTYPE_CATALOG_CSW = "CSW"; |
111 |
|
112 |
/**
|
113 |
*
|
114 |
*
|
115 |
*/
|
116 |
public static final String SERVER_SUBTYPE_GAZETTEER_WFSG = "WFS-G"; |
117 |
|
118 |
/**
|
119 |
*
|
120 |
*
|
121 |
*/
|
122 |
public static final String SERVER_SUBTYPE_GAZETTEER_ADL = "ADL"; |
123 |
|
124 |
/**
|
125 |
*
|
126 |
*
|
127 |
*/
|
128 |
public static final String SERVER_SUBTYPE_GAZETTEER_IDEC = "IDEC"; |
129 |
|
130 |
/**
|
131 |
*
|
132 |
*
|
133 |
*/
|
134 |
public static final String SERVER_SUBTYPE_GAZETTEER_WFS = "WFS"; |
135 |
|
136 |
/**
|
137 |
*
|
138 |
*
|
139 |
*/
|
140 |
private Date added = null; |
141 |
|
142 |
/**
|
143 |
*
|
144 |
*
|
145 |
*/
|
146 |
private Date lastAccess = null; |
147 |
|
148 |
/**
|
149 |
*
|
150 |
*
|
151 |
*/
|
152 |
private String serviceType = null; |
153 |
|
154 |
/**
|
155 |
*
|
156 |
*
|
157 |
*/
|
158 |
private String serviceSubType = null; |
159 |
|
160 |
/**
|
161 |
*
|
162 |
*
|
163 |
*/
|
164 |
private String serverAddress = null; |
165 |
|
166 |
/**
|
167 |
*
|
168 |
*
|
169 |
*/
|
170 |
private String database = null; |
171 |
|
172 |
private Properties properies = new Properties(); |
173 |
|
174 |
/**
|
175 |
*
|
176 |
*
|
177 |
*
|
178 |
* @param serverAddress Server address
|
179 |
* @param added When the server was added
|
180 |
* @param lastAccess When the server was used last time
|
181 |
* @param serviceType Service type
|
182 |
* @param serviceSubType Service subtype
|
183 |
*/
|
184 |
public ServerData(String serverAddress, Date added, Date lastAccess, String serviceType, String serviceSubType) { |
185 |
this.added = added;
|
186 |
this.lastAccess = lastAccess;
|
187 |
this.serviceType = serviceType;
|
188 |
this.serviceSubType = serviceSubType;
|
189 |
this.serverAddress = serverAddress;
|
190 |
} |
191 |
|
192 |
/**
|
193 |
*
|
194 |
*
|
195 |
*
|
196 |
* @param serverAddress Server address
|
197 |
* @param added When the server was added
|
198 |
* @param lastAccess When the server was used last time
|
199 |
* @param serviceType Service type
|
200 |
* @param serviceSubType Service subtype
|
201 |
* @param database Database name
|
202 |
*/
|
203 |
public ServerData(String serverAddress, Date added, Date lastAccess, String serviceType, String serviceSubType,String database) { |
204 |
this.added = added;
|
205 |
this.lastAccess = lastAccess;
|
206 |
this.serviceType = serviceType;
|
207 |
this.serviceSubType = serviceSubType;
|
208 |
this.serverAddress = serverAddress;
|
209 |
this.database = database;
|
210 |
} |
211 |
|
212 |
/**
|
213 |
* Constructor for a new Server
|
214 |
*
|
215 |
*
|
216 |
* @param serverAddress Server Address
|
217 |
* @param serviceType Server Type
|
218 |
* @param serviceSubType Server Subtype
|
219 |
*/
|
220 |
public ServerData(String serverAddress, String serviceType, String serviceSubType) { |
221 |
|
222 |
this.serverAddress = serverAddress;
|
223 |
this.added = DateTime.getCurrentDate();
|
224 |
this.lastAccess = DateTime.getCurrentDate();
|
225 |
this.serviceType = serviceType;
|
226 |
this.serviceSubType = serviceSubType;
|
227 |
} |
228 |
|
229 |
/**
|
230 |
* Constructor for a new Server
|
231 |
*
|
232 |
*
|
233 |
* @param serverAddress Server Address
|
234 |
* @param serviceType Server Type
|
235 |
* @param serviceSubType Server Subtype
|
236 |
*/
|
237 |
public ServerData(String serverAddress, String serviceType, String serviceSubType,String database) { |
238 |
|
239 |
this.serverAddress = serverAddress;
|
240 |
this.added = DateTime.getCurrentDate();
|
241 |
this.lastAccess = DateTime.getCurrentDate();
|
242 |
this.serviceType = serviceType;
|
243 |
this.serviceSubType = serviceSubType;
|
244 |
this.database = database;
|
245 |
} |
246 |
|
247 |
/**
|
248 |
* Constructor for a new Server
|
249 |
*
|
250 |
*
|
251 |
* @param serverAddress Server Address
|
252 |
* @param serviceType Server Type
|
253 |
*/
|
254 |
public ServerData(String serverAddress, String serviceType) { |
255 |
|
256 |
this.serverAddress = serverAddress;
|
257 |
this.added = DateTime.getCurrentDate();
|
258 |
this.lastAccess = DateTime.getCurrentDate();
|
259 |
this.serviceType = serviceType;
|
260 |
this.serviceSubType = ""; |
261 |
this.database = ""; |
262 |
} |
263 |
|
264 |
/**
|
265 |
* This method updates the last access attribute. New value
|
266 |
* is the current time.
|
267 |
*
|
268 |
*/
|
269 |
public void updateLastAccess() { |
270 |
lastAccess = DateTime.getCurrentDate(); |
271 |
} |
272 |
|
273 |
/**
|
274 |
* The server address field have to be showed in the combo
|
275 |
*
|
276 |
*
|
277 |
* @return String
|
278 |
*/
|
279 |
public String toString() { |
280 |
return getServerAddress();
|
281 |
} |
282 |
|
283 |
/**
|
284 |
*
|
285 |
*
|
286 |
*
|
287 |
* @return Returns the added.
|
288 |
*/
|
289 |
public Date getAdded() { |
290 |
return added;
|
291 |
} |
292 |
|
293 |
/**
|
294 |
*
|
295 |
*
|
296 |
*
|
297 |
* @param added The added to set.
|
298 |
*/
|
299 |
public void setAdded(Date added) { |
300 |
this.added = added;
|
301 |
} |
302 |
|
303 |
/**
|
304 |
*
|
305 |
*
|
306 |
*
|
307 |
* @return Returns the lastAccess.
|
308 |
*/
|
309 |
public Date getLastAccess() { |
310 |
return lastAccess;
|
311 |
} |
312 |
|
313 |
/**
|
314 |
*
|
315 |
*
|
316 |
*
|
317 |
* @param lastAccess The lastAccess to set.
|
318 |
*/
|
319 |
public void setLastAccess(Date lastAccess) { |
320 |
this.lastAccess = lastAccess;
|
321 |
} |
322 |
|
323 |
/**
|
324 |
*
|
325 |
*
|
326 |
*
|
327 |
* @return Returns the serverAddress.
|
328 |
*/
|
329 |
public String getServerAddress() { |
330 |
return serverAddress;
|
331 |
} |
332 |
|
333 |
/**
|
334 |
*
|
335 |
*
|
336 |
*
|
337 |
* @param serverAddress The serverAddress to set.
|
338 |
*/
|
339 |
public void setServerAddress(String serverAddress) { |
340 |
this.serverAddress = serverAddress;
|
341 |
} |
342 |
|
343 |
/**
|
344 |
*
|
345 |
*
|
346 |
*
|
347 |
* @return Returns the serviceSubType.
|
348 |
*/
|
349 |
public String getServiceSubType() { |
350 |
return serviceSubType;
|
351 |
} |
352 |
|
353 |
/**
|
354 |
*
|
355 |
*
|
356 |
*
|
357 |
* @param serviceSubType The serviceSubType to set.
|
358 |
*/
|
359 |
public void setServiceSubType(String serviceSubType) { |
360 |
this.serviceSubType = serviceSubType;
|
361 |
} |
362 |
|
363 |
/**
|
364 |
*
|
365 |
*
|
366 |
*
|
367 |
* @return Returns the serviceType.
|
368 |
*/
|
369 |
public String getServiceType() { |
370 |
return serviceType;
|
371 |
} |
372 |
|
373 |
/**
|
374 |
*
|
375 |
*
|
376 |
*
|
377 |
* @param serviceType The serviceType to set.
|
378 |
*/
|
379 |
public void setServiceType(String serviceType) { |
380 |
this.serviceType = serviceType;
|
381 |
} |
382 |
|
383 |
public String getDatabase() { |
384 |
return database;
|
385 |
} |
386 |
|
387 |
public void setDatabase(String database) { |
388 |
this.database = database;
|
389 |
} |
390 |
|
391 |
/**
|
392 |
* @return Returns the properies.
|
393 |
*/
|
394 |
public Properties getProperies() { |
395 |
return properies;
|
396 |
} |
397 |
|
398 |
/**
|
399 |
* @param properies The properies to set.
|
400 |
*/
|
401 |
public void setProperies(Properties properies) { |
402 |
this.properies = properies;
|
403 |
} |
404 |
|
405 |
/**
|
406 |
*
|
407 |
* @param propertyName
|
408 |
* @return
|
409 |
*/
|
410 |
public String getProperty(String propertyName){ |
411 |
return (String)getProperies().getProperty(propertyName); |
412 |
} |
413 |
} |