gvsig-gazetteer / org.gvsig.gazetteer / trunk / org.gvsig.gazetteer / org.gvsig.gazetteer.lib / src / main / java / org / gvsig / gazetteer / drivers / AbstractGazetteerServiceDriver.java @ 102
History | View | Annotate | Download (3.71 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 org.gvsig.gazetteer.drivers; |
43 |
import java.net.URI; |
44 |
|
45 |
import org.gvsig.catalog.drivers.AbstractDiscoveryServiceDriver; |
46 |
import org.gvsig.catalog.querys.DiscoveryServiceQuery; |
47 |
import org.gvsig.gazetteer.GazetteerLocator; |
48 |
import org.gvsig.gazetteer.querys.FeatureType; |
49 |
import org.gvsig.gazetteer.querys.FeatureTypeAttribute; |
50 |
import org.gvsig.gazetteer.querys.GazetteerQuery; |
51 |
|
52 |
|
53 |
/**
|
54 |
* This class must be inherited by all the gazetteer drivers. It contains
|
55 |
* the common attributes.
|
56 |
* @author Jorge Piera Llodra (piera_jor@gva.es)
|
57 |
*/
|
58 |
public abstract class AbstractGazetteerServiceDriver extends AbstractDiscoveryServiceDriver implements IGazetteerServiceDriver { |
59 |
private FeatureType[] featureTypes; |
60 |
private GazetteerQuery query;
|
61 |
private String projection = null; |
62 |
|
63 |
/**
|
64 |
* @return Returns the feature.
|
65 |
*/
|
66 |
public FeatureType[] getFeatureTypes() { |
67 |
return featureTypes;
|
68 |
} |
69 |
|
70 |
/**
|
71 |
* @param feature The feature to set.
|
72 |
*/
|
73 |
public void setFeatureTypes(FeatureType[] featureTypes) { |
74 |
this.featureTypes = featureTypes;
|
75 |
} |
76 |
|
77 |
/*
|
78 |
* (non-Javadoc)
|
79 |
* @see es.gva.cit.catalogClient.drivers.IDiscoveryServiceDriver#createQuery()
|
80 |
*/
|
81 |
public DiscoveryServiceQuery createQuery(){
|
82 |
return new GazetteerQuery(); |
83 |
} |
84 |
|
85 |
/**
|
86 |
* @return Returns the query.
|
87 |
*/
|
88 |
public GazetteerQuery getQuery() {
|
89 |
return query;
|
90 |
} |
91 |
|
92 |
/**
|
93 |
* @param query The query to set.
|
94 |
*/
|
95 |
public void setQuery(GazetteerQuery query) { |
96 |
this.query = query;
|
97 |
} |
98 |
|
99 |
/*
|
100 |
* (non-Javadoc)
|
101 |
* @see es.gva.cit.gazetteer.drivers.IGazetteerServiceDriver#describeFeatureType(java.net.URI, java.lang.String)
|
102 |
*/
|
103 |
public FeatureTypeAttribute[] describeFeatureType(URI uri, String feature) { |
104 |
return null; |
105 |
} |
106 |
|
107 |
/*
|
108 |
* (non-Javadoc)
|
109 |
* @see es.gva.cit.gazetteer.drivers.IGazetteerServiceDriver#isDescribeFeatureTypeNeeded()
|
110 |
*/
|
111 |
public boolean isDescribeFeatureTypeNeeded() { |
112 |
return false; |
113 |
} |
114 |
|
115 |
/*
|
116 |
* (non-Javadoc)
|
117 |
* @see es.gva.cit.gazetteer.drivers.IGazetteerServiceDriver#getProjection()
|
118 |
*/
|
119 |
public String getProjection(){ |
120 |
return projection;
|
121 |
} |
122 |
|
123 |
/*
|
124 |
* (non-Javadoc)
|
125 |
* @see es.gva.cit.gazetteer.drivers.IGazetteerServiceDriver#setProjection(java.lang.String)
|
126 |
*/
|
127 |
public void setProjection(String projection){ |
128 |
this.projection = projection;
|
129 |
} |
130 |
|
131 |
public boolean needsUsername(String protocol) { |
132 |
return false; |
133 |
} |
134 |
|
135 |
public String getUsername() { |
136 |
return GazetteerLocator.getGazetteerManager().getUsername(this.getServiceName()); |
137 |
} |
138 |
|
139 |
public void setUsername(String username) { |
140 |
GazetteerLocator.getGazetteerManager().setUsername(this.getServiceName(),username);
|
141 |
|
142 |
} |
143 |
} |