Statistics
| Revision:

root / trunk / applications / appCatalogAndGazetteerClient / src / es / gva / cit / gazetteer / GazetteerClient.java @ 15558

History | View | Annotate | Download (3.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.gazetteer;
43
import es.gva.cit.catalog.DiscoveryServiceClient;
44
import es.gva.cit.gazetteer.drivers.GazetteerCapabilities;
45
import es.gva.cit.gazetteer.drivers.IGazetteerServiceDriver;
46
import es.gva.cit.gazetteer.querys.Feature;
47
import es.gva.cit.gazetteer.querys.FeatureType;
48
import es.gva.cit.gazetteer.querys.FeatureTypeAttribute;
49
import es.gva.cit.gazetteer.querys.GazetteerQuery;
50

    
51
/**
52
 * This class represents a gazetteer client. It must be created to
53
 * use the gazetteer service 
54
 * @author Jorge Piera Llodra (piera_jor@gva.es)
55
 */
56
public class GazetteerClient extends DiscoveryServiceClient{
57
        
58
        public GazetteerClient(String uri, IGazetteerServiceDriver driver) {
59
                super(uri, driver);                
60
        }
61

    
62
        /**
63
         * @return the feature types
64
         * @throws Exception 
65
         */
66
        public FeatureType[] getFeatureTypes() throws Exception {
67
                return ((GazetteerCapabilities)getCapabilities()).getFeatureTypes();
68
        }
69

    
70
        /**
71
         * This method makes the describeFeatureType
72
         * operation
73
         * @param featureName
74
         * Feature name
75
         * @return
76
         * @throws Exception 
77
         */
78
        public FeatureTypeAttribute[] describeFeatureType(String featureName) throws Exception{
79
                return ((IGazetteerServiceDriver)getDriver()).describeFeatureType(getUri(), featureName);
80
        }
81
        
82
        /**
83
         * @return if the describeFeatureType operation is
84
         * supported by the driver
85
         */
86
        public boolean isDescribeFeatureTypeNeeded(){
87
                return ((IGazetteerServiceDriver)getDriver()).isDescribeFeatureTypeNeeded();
88
        }
89

    
90
        /**
91
         * This method implements the getFeature operation
92
         * @return 
93
         * A result collection
94
         * @param query 
95
         * The results query
96
         * @throws Exception 
97
         */
98
        public Feature[] getFeature(GazetteerQuery query) throws Exception {        
99
                return ((IGazetteerServiceDriver)getDriver()).getFeature(getUri(), query);
100
        }         
101

    
102
        /**
103
         * This method is used to create a new Query
104
         * @return 
105
         */
106
        public GazetteerQuery createNewQuery() {        
107
                return new GazetteerQuery();   
108
        }         
109
        
110
        /**
111
         * @return the projection
112
         */
113
        public String getProjection() {
114
                return ((IGazetteerServiceDriver)getDriver()).getProjection();
115
        }
116

    
117
        /**
118
         * @param projection the projection to set
119
         */
120
        public void setProjection(String projection) {
121
                ((IGazetteerServiceDriver)getDriver()).setProjection(projection);
122
        } 
123
}