01: package org.geotools.data.postgis;
02:
03: import java.io.IOException;
04: import java.util.Set;
05:
06: import org.geotools.data.DataStore;
07: import org.geotools.data.FeatureListener;
08: import org.geotools.data.FeatureSource;
09: import org.geotools.data.Query;
10: import org.geotools.feature.FeatureCollection;
11: import org.geotools.feature.FeatureType;
12: import org.opengis.filter.Filter;
13:
14: import com.vividsolutions.jts.geom.Envelope;
15:
16: /**
17: * Really delegates everything to a wrapped feature source, but allows to
18: * advertise a data store other than the original one
19: *
20: * @author aaime
21: * @since 2.4
22: *
23: */
24: public class WrappingPostgisFeatureSource implements FeatureSource {
25: FeatureSource wrapped;
26:
27: VersionedPostgisDataStore store;
28:
29: public WrappingPostgisFeatureSource(FeatureSource wrapped,
30: VersionedPostgisDataStore store) {
31: this .wrapped = wrapped;
32: this .store = store;
33: }
34:
35: public DataStore getDataStore() {
36: return store;
37: }
38:
39: public void addFeatureListener(FeatureListener listener) {
40: wrapped.addFeatureListener(listener);
41: }
42:
43: public void removeFeatureListener(FeatureListener listener) {
44: wrapped.removeFeatureListener(listener);
45: }
46:
47: public Envelope getBounds() throws IOException {
48: return wrapped.getBounds();
49: }
50:
51: public Envelope getBounds(Query query) throws IOException {
52: return wrapped.getBounds(query);
53: }
54:
55: public int getCount(Query query) throws IOException {
56: return wrapped.getCount(query);
57: }
58:
59: public FeatureCollection getFeatures() throws IOException {
60: return wrapped.getFeatures();
61: }
62:
63: public FeatureCollection getFeatures(Filter filter)
64: throws IOException {
65: return wrapped.getFeatures(filter);
66: }
67:
68: public FeatureCollection getFeatures(Query query)
69: throws IOException {
70: return wrapped.getFeatures(query);
71: }
72:
73: public FeatureType getSchema() {
74: return wrapped.getSchema();
75: }
76:
77: public Set getSupportedHints() {
78: return wrapped.getSupportedHints();
79: }
80:
81: }
|