Statistics
| Revision:

svn-gvsig-desktop / trunk / applications / appCatalogYNomenclatorClient / src / es / gva / cit / catalogClient / utils / comboServer / ServerData.java @ 3613

History | View | Annotate | Download (5.4 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 es.gva.cit.catalogClient.utils.comboServer;
43
import es.gva.cit.catalogClient.utils.DateTime;
44
import java.util.Date;
45

    
46
/**
47
 * This class is used to model a server. It contains information
48
 * about the URL, their type, last access ...
49
 * 
50
 * 
51
 * @author Jorge Piera Llodra (piera_jor@gva.es)
52
 */
53
public class ServerData {
54

    
55
/**
56
 * 
57
 * 
58
 */
59
    public static final String SERVER_TYPE_CATALOG = "CATALOG";
60

    
61
/**
62
 * 
63
 * 
64
 */
65
    public static final String SERVER_TYPE_GAZETTEER = "GAZETTEER";
66

    
67
/**
68
 * 
69
 * 
70
 */
71
    public static final String SERVER_SUBTYPE_CATALOG_Z3950 = "Z3950";
72

    
73
/**
74
 * 
75
 * 
76
 */
77
    public static final String SERVER_SUBTYPE_CATALOG_SRW = "SRW";
78

    
79
/**
80
 * 
81
 * 
82
 */
83
    public static final String SERVER_SUBTYPE_CATALOG_CSW = "CSW";
84

    
85
/**
86
 * 
87
 * 
88
 */
89
    public static final String SERVER_SUBTYPE_GAZETTEER_WFSG = "WFS-G";
90

    
91
/**
92
 * 
93
 * 
94
 */
95
    public static final String SERVER_SUBTYPE_GAZETTEER_ADL = "ADL";
96

    
97
/**
98
 * 
99
 * 
100
 */
101
    public static final String SERVER_SUBTYPE_GAZETTEER_IDEC = "IDEC";
102

    
103
/**
104
 * 
105
 * 
106
 */
107
    public static final String SERVER_SUBTYPE_GAZETTEER_WFS = "WFS";
108

    
109
/**
110
 * 
111
 * 
112
 */
113
    private Date added = null;
114

    
115
/**
116
 * 
117
 * 
118
 */
119
    private Date lastAccess = null;
120

    
121
/**
122
 * 
123
 * 
124
 */
125
    private String serviceType = null;
126

    
127
/**
128
 * 
129
 * 
130
 */
131
    private String serviceSubType = null;
132

    
133
/**
134
 * 
135
 * 
136
 */
137
    private String serverAddress = null;
138

    
139
/**
140
 * 
141
 * 
142
 * 
143
 * @param serverAddress Server address
144
 * @param added When the server was added
145
 * @param lastAccess When the server was used last time
146
 * @param serviceType Service type
147
 * @param serviceSubType Service subtype
148
 */
149
    public  ServerData(String serverAddress, Date added, Date lastAccess, String serviceType, String serviceSubType) {        
150
        this.added = added;
151
        this.lastAccess = lastAccess;
152
        this.serviceType = serviceType;
153
        this.serviceSubType = serviceSubType;
154
        this.serverAddress = serverAddress;
155
    } 
156

    
157
/**
158
 * Constructor for a new Server
159
 * 
160
 * 
161
 * @param serverAddress Server Address
162
 * @param serviceType Server Type
163
 * @param serviceSubType Server Subtype
164
 */
165
    public  ServerData(String serverAddress, String serviceType, String serviceSubType) {        
166
        
167
        this.serverAddress = serverAddress;
168
        this.added = DateTime.getCurrentDate();
169
        this.lastAccess = DateTime.getCurrentDate();
170
        this.serviceType = serviceType;
171
        this.serviceSubType = serviceSubType;
172
    } 
173

    
174
/**
175
 * This method updates the last access attribute. New value
176
 * is the current time.
177
 * 
178
 */
179
    public void updateLastAccess() {        
180
        lastAccess = DateTime.getCurrentDate();
181
    } 
182

    
183
/**
184
 * The server address field have to be showed in the combo
185
 * 
186
 * 
187
 * @return String
188
 */
189
    public String toString() {        
190
        return getServerAddress();
191
    } 
192

    
193
/**
194
 * 
195
 * 
196
 * 
197
 * @return Returns the added.
198
 */
199
    public Date getAdded() {        
200
        return added;
201
    } 
202

    
203
/**
204
 * 
205
 * 
206
 * 
207
 * @param added The added to set.
208
 */
209
    public void setAdded(Date added) {        
210
        this.added = added;
211
    } 
212

    
213
/**
214
 * 
215
 * 
216
 * 
217
 * @return Returns the lastAccess.
218
 */
219
    public Date getLastAccess() {        
220
        return lastAccess;
221
    } 
222

    
223
/**
224
 * 
225
 * 
226
 * 
227
 * @param lastAccess The lastAccess to set.
228
 */
229
    public void setLastAccess(Date lastAccess) {        
230
        this.lastAccess = lastAccess;
231
    } 
232

    
233
/**
234
 * 
235
 * 
236
 * 
237
 * @return Returns the serverAddress.
238
 */
239
    public String getServerAddress() {        
240
        return serverAddress;
241
    } 
242

    
243
/**
244
 * 
245
 * 
246
 * 
247
 * @param serverAddress The serverAddress to set.
248
 */
249
    public void setServerAddress(String serverAddress) {        
250
        this.serverAddress = serverAddress;
251
    } 
252

    
253
/**
254
 * 
255
 * 
256
 * 
257
 * @return Returns the serviceSubType.
258
 */
259
    public String getServiceSubType() {        
260
        return serviceSubType;
261
    } 
262

    
263
/**
264
 * 
265
 * 
266
 * 
267
 * @param serviceSubType The serviceSubType to set.
268
 */
269
    public void setServiceSubType(String serviceSubType) {        
270
        this.serviceSubType = serviceSubType;
271
    } 
272

    
273
/**
274
 * 
275
 * 
276
 * 
277
 * @return Returns the serviceType.
278
 */
279
    public String getServiceType() {        
280
        return serviceType;
281
    } 
282

    
283
/**
284
 * 
285
 * 
286
 * 
287
 * @param serviceType The serviceType to set.
288
 */
289
    public void setServiceType(String serviceType) {        
290
        this.serviceType = serviceType;
291
    } 
292
 }