Statistics
| Revision:

svn-gvsig-desktop / branches / v05 / libraries / libIverUtiles / src / com / iver / utiles / swing / jcomboServer / ServerData.java @ 4464

History | View | Annotate | Download (7.35 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

    
45
import com.iver.utiles.DateTime;
46

    
47
/**
48
 * This class represents a data server, that can be a WMS, WFS, Catalog or
49
 * any kind of server. It contains the server URL and has a couple of 
50
 * attributes that describe the server type (serverType and serverSubType).
51
 * It contains the date when the server was created and the date when the server
52
 * was accessed last time. * 
53
 * 
54
 * @author Jorge Piera Llodra (piera_jor@gva.es)
55
 */
56
public class ServerData {
57

    
58
        /**
59
         * 
60
         * 
61
         */
62
        public static final String SERVER_TYPE_CATALOG = "CATALOG";
63

    
64
        /**
65
         * 
66
         * 
67
         */
68
        public static final String SERVER_TYPE_GAZETTEER = "GAZETTEER";
69

    
70
        /**
71
         * 
72
         * 
73
         */
74
        public static final String SERVER_TYPE_WMS = "WMS";
75

    
76
        /**
77
         * 
78
         * 
79
         */
80
        public static final String SERVER_TYPE_WCS = "WCS";
81

    
82
        /**
83
         * 
84
         * 
85
         */
86
        public static final String SERVER_SUBTYPE_CATALOG_Z3950 = "Z3950";
87

    
88
        /**
89
         * 
90
         * 
91
         */
92
        public static final String SERVER_SUBTYPE_CATALOG_SRW = "SRW";
93

    
94
        /**
95
         * 
96
         * 
97
         */
98
        public static final String SERVER_SUBTYPE_CATALOG_CSW = "CSW";
99

    
100
        /**
101
         * 
102
         * 
103
         */
104
        public static final String SERVER_SUBTYPE_GAZETTEER_WFSG = "WFS-G";
105

    
106
        /**
107
         * 
108
         * 
109
         */
110
        public static final String SERVER_SUBTYPE_GAZETTEER_ADL = "ADL";
111

    
112
        /**
113
         * 
114
         * 
115
         */
116
        public static final String SERVER_SUBTYPE_GAZETTEER_IDEC = "IDEC";
117

    
118
        /**
119
         * 
120
         * 
121
         */
122
        public static final String SERVER_SUBTYPE_GAZETTEER_WFS = "WFS";
123

    
124
        /**
125
         * 
126
         * 
127
         */
128
        private Date added = null;
129

    
130
        /**
131
         * 
132
         * 
133
         */
134
        private Date lastAccess = null;
135

    
136
        /**
137
         * 
138
         * 
139
         */
140
        private String serviceType = null;
141

    
142
        /**
143
         * 
144
         * 
145
         */
146
        private String serviceSubType = null;
147

    
148
        /**
149
         * 
150
         * 
151
         */
152
        private String serverAddress = null;
153

    
154
        /**
155
         * 
156
         * 
157
         */
158
        private String database = null;
159

    
160
        /**
161
         * 
162
         * 
163
         * 
164
         * @param serverAddress Server address
165
         * @param added When the server was added
166
         * @param lastAccess When the server was used last time
167
         * @param serviceType Service type
168
         * @param serviceSubType Service subtype
169
         */
170
        public  ServerData(String serverAddress, Date added, Date lastAccess, String serviceType, String serviceSubType) {        
171
                this.added = added;
172
                this.lastAccess = lastAccess;
173
                this.serviceType = serviceType;
174
                this.serviceSubType = serviceSubType;
175
                this.serverAddress = serverAddress;
176
        } 
177

    
178
        /**
179
         * 
180
         * 
181
         * 
182
         * @param serverAddress Server address
183
         * @param added When the server was added
184
         * @param lastAccess When the server was used last time
185
         * @param serviceType Service type
186
         * @param serviceSubType Service subtype
187
         * @param database Database name
188
         */
189
        public  ServerData(String serverAddress, Date added, Date lastAccess, String serviceType, String serviceSubType,String database) {        
190
                this.added = added;
191
                this.lastAccess = lastAccess;
192
                this.serviceType = serviceType;
193
                this.serviceSubType = serviceSubType;
194
                this.serverAddress = serverAddress;
195
                this.database = database;
196
        } 
197

    
198
        /**
199
         * Constructor for a new Server
200
         * 
201
         * 
202
         * @param serverAddress Server Address
203
         * @param serviceType Server Type
204
         * @param serviceSubType Server Subtype
205
         */
206
        public  ServerData(String serverAddress, String serviceType, String serviceSubType) {        
207

    
208
                this.serverAddress = serverAddress;
209
                this.added = DateTime.getCurrentDate();
210
                this.lastAccess = DateTime.getCurrentDate();
211
                this.serviceType = serviceType;
212
                this.serviceSubType = serviceSubType;
213
        } 
214

    
215
        /**
216
         * Constructor for a new Server
217
         * 
218
         * 
219
         * @param serverAddress Server Address
220
         * @param serviceType Server Type
221
         * @param serviceSubType Server Subtype
222
         */
223
        public  ServerData(String serverAddress, String serviceType, String serviceSubType,String database) {        
224

    
225
                this.serverAddress = serverAddress;
226
                this.added = DateTime.getCurrentDate();
227
                this.lastAccess = DateTime.getCurrentDate();
228
                this.serviceType = serviceType;
229
                this.serviceSubType = serviceSubType;
230
                this.database = database;
231
        } 
232
        
233
        /**
234
         * Constructor for a new Server
235
         * 
236
         * 
237
         * @param serverAddress Server Address
238
         * @param serviceType Server Type
239
         */
240
        public  ServerData(String serverAddress, String serviceType) {        
241

    
242
                this.serverAddress = serverAddress;
243
                this.added = DateTime.getCurrentDate();
244
                this.lastAccess = DateTime.getCurrentDate();
245
                this.serviceType = serviceType;
246
                this.serviceSubType = "";
247
                this.database = "";
248
        } 
249

    
250
        /**
251
         * This method updates the last access attribute. New value
252
         * is the current time.
253
         * 
254
         */
255
        public void updateLastAccess() {        
256
                lastAccess = DateTime.getCurrentDate();
257
        } 
258

    
259
        /**
260
         * The server address field have to be showed in the combo
261
         * 
262
         * 
263
         * @return String
264
         */
265
        public String toString() {        
266
                return getServerAddress();
267
        } 
268

    
269
        /**
270
         * 
271
         * 
272
         * 
273
         * @return Returns the added.
274
         */
275
        public Date getAdded() {        
276
                return added;
277
        } 
278

    
279
        /**
280
         * 
281
         * 
282
         * 
283
         * @param added The added to set.
284
         */
285
        public void setAdded(Date added) {        
286
                this.added = added;
287
        } 
288

    
289
        /**
290
         * 
291
         * 
292
         * 
293
         * @return Returns the lastAccess.
294
         */
295
        public Date getLastAccess() {        
296
                return lastAccess;
297
        } 
298

    
299
        /**
300
         * 
301
         * 
302
         * 
303
         * @param lastAccess The lastAccess to set.
304
         */
305
        public void setLastAccess(Date lastAccess) {        
306
                this.lastAccess = lastAccess;
307
        } 
308

    
309
        /**
310
         * 
311
         * 
312
         * 
313
         * @return Returns the serverAddress.
314
         */
315
        public String getServerAddress() {        
316
                return serverAddress;
317
        } 
318

    
319
        /**
320
         * 
321
         * 
322
         * 
323
         * @param serverAddress The serverAddress to set.
324
         */
325
        public void setServerAddress(String serverAddress) {        
326
                this.serverAddress = serverAddress;
327
        } 
328

    
329
        /**
330
         * 
331
         * 
332
         * 
333
         * @return Returns the serviceSubType.
334
         */
335
        public String getServiceSubType() {        
336
                return serviceSubType;
337
        } 
338

    
339
        /**
340
         * 
341
         * 
342
         * 
343
         * @param serviceSubType The serviceSubType to set.
344
         */
345
        public void setServiceSubType(String serviceSubType) {        
346
                this.serviceSubType = serviceSubType;
347
        } 
348

    
349
        /**
350
         * 
351
         * 
352
         * 
353
         * @return Returns the serviceType.
354
         */
355
        public String getServiceType() {        
356
                return serviceType;
357
        } 
358

    
359
        /**
360
         * 
361
         * 
362
         * 
363
         * @param serviceType The serviceType to set.
364
         */
365
        public void setServiceType(String serviceType) {        
366
                this.serviceType = serviceType;
367
        }
368

    
369
        public String getDatabase() {
370
                return database;
371
        }
372

    
373
        public void setDatabase(String database) {
374
                this.database = database;
375
        } 
376
}