root / branches / dal_time_support / libraries / libFMap_dal / src / org / gvsig / fmap / dal / feature / spi / FeatureStoreProvider.java @ 35779
History | View | Annotate | Download (6.87 KB)
1 | 29391 | jmvivo | /* gvSIG. Geographic Information System of the Valencian Government
|
---|---|---|---|
2 | *
|
||
3 | * Copyright (C) 2007-2008 Infrastructures and Transports Department
|
||
4 | * of the Valencian Government (CIT)
|
||
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., 51 Franklin Street, Fifth Floor, Boston,
|
||
19 | * MA 02110-1301, USA.
|
||
20 | *
|
||
21 | */
|
||
22 | |||
23 | /*
|
||
24 | * AUTHORS (In addition to CIT):
|
||
25 | * 2008 {{Company}} {{Task}}
|
||
26 | */
|
||
27 | |||
28 | |||
29 | 24496 | jmvivo | package org.gvsig.fmap.dal.feature.spi; |
30 | 23772 | jjdelcerro | |
31 | 24144 | vcaballero | import java.util.Iterator; |
32 | |||
33 | 29391 | jmvivo | import org.gvsig.fmap.dal.DataStoreParameters; |
34 | 29289 | jmvivo | import org.gvsig.fmap.dal.DataTypes; |
35 | 24505 | jmvivo | import org.gvsig.fmap.dal.exception.DataException; |
36 | 25569 | jjdelcerro | import org.gvsig.fmap.dal.feature.FeatureLocks; |
37 | 24496 | jmvivo | import org.gvsig.fmap.dal.feature.FeatureQuery; |
38 | import org.gvsig.fmap.dal.feature.FeatureSelection; |
||
39 | 29289 | jmvivo | import org.gvsig.fmap.dal.feature.FeatureStore; |
40 | 24496 | jmvivo | import org.gvsig.fmap.dal.feature.FeatureType; |
41 | import org.gvsig.fmap.dal.spi.DataStoreProvider; |
||
42 | 23772 | jjdelcerro | import org.gvsig.fmap.geom.primitive.Envelope; |
43 | |||
44 | 29391 | jmvivo | /**
|
45 | *
|
||
46 | * Interface for all feature based data providers.<br>
|
||
47 | * <br>
|
||
48 | *
|
||
49 | *
|
||
50 | * A FeatureStoreProvier must have a contructor like this:<br>
|
||
51 | * <br>
|
||
52 | * <code>
|
||
53 | * FeatureStoreProvider({@link DataStoreParameters}, {@link FeatureStoreProviderServices})
|
||
54 | * </code>
|
||
55 | *
|
||
56 | */
|
||
57 | 29289 | jmvivo | public interface FeatureStoreProvider extends DataStoreProvider { |
58 | 23772 | jjdelcerro | |
59 | 29289 | jmvivo | /**
|
60 | * Return a new OID valid for a new feature.
|
||
61 | 24248 | jjdelcerro | *
|
62 | 29289 | jmvivo | * @return a new OID
|
63 | * @see {@link FeatureStoreProvider#getOIDType()}
|
||
64 | 24248 | jjdelcerro | */
|
65 | public Object createNewOID(); |
||
66 | 23772 | jjdelcerro | |
67 | 24248 | jjdelcerro | /**
|
68 | 29289 | jmvivo | * Return OID data type (from {@link DataTypes}) of this store.
|
69 | 24248 | jjdelcerro | *
|
70 | 29289 | jmvivo | * @return OID data type
|
71 | * @see {@link FeatureStoreProvider#createNewOID()} {@link DataTypes}
|
||
72 | */
|
||
73 | public int getOIDType(); |
||
74 | |||
75 | /**
|
||
76 | * Factory of {@link FeatureProvider}. Create a new {@link FeatureProvider} instance
|
||
77 | * valid for this Store.
|
||
78 | *
|
||
79 | * @param {@link FeatureType} of the {@link FeatureProvider}
|
||
80 | 24248 | jjdelcerro | * @return
|
81 | * @throws DataException
|
||
82 | */
|
||
83 | 29292 | jmvivo | public FeatureProvider createFeatureProvider(FeatureType type) throws DataException; |
84 | 24141 | vcaballero | |
85 | 24248 | jjdelcerro | /**
|
86 | 29289 | jmvivo | * Factory of {@link FeatureSelection}. Create a new
|
87 | * {@link FeatureSelection} instance valid for this Store.
|
||
88 | 24248 | jjdelcerro | *
|
89 | * @return
|
||
90 | * @throws DataException
|
||
91 | */
|
||
92 | 23772 | jjdelcerro | public FeatureSelection createFeatureSelection() throws DataException; |
93 | |||
94 | 29289 | jmvivo | /**
|
95 | * Factory of {@link FeatureLocks}. Create a new {@link FeatureLocks}
|
||
96 | * instance valid for this Store.
|
||
97 | *
|
||
98 | *
|
||
99 | * @return {@link FeatureLocks} or <code>null</code> if not
|
||
100 | * {@link FeatureStoreProvider#isLocksSupported()}
|
||
101 | * @throws DataException
|
||
102 | */
|
||
103 | 23772 | jjdelcerro | public FeatureLocks createFeatureLocks() throws DataException; |
104 | |||
105 | 29289 | jmvivo | /**
|
106 | * Factory of {@link FeatureSetProvider}. Create a new
|
||
107 | * {@link FeatureSetProvider} that represents result of {@link FeatureQuery}
|
||
108 | * .
|
||
109 | *
|
||
110 | * @param query
|
||
111 | * (never will be null)
|
||
112 | * @param featureType
|
||
113 | * (never will be null)
|
||
114 | * @return
|
||
115 | * @throws DataException
|
||
116 | */
|
||
117 | public FeatureSetProvider createSet(FeatureQuery query,
|
||
118 | FeatureType featureType) throws DataException;
|
||
119 | |||
120 | /**
|
||
121 | * Return {@link FeatureProvider} from a
|
||
122 | * {@link FeatureReferenceProviderServices} using
|
||
123 | * {@link FeatureStore#getDefaultFeatureType()} as {@link FeatureType}
|
||
124 | *
|
||
125 | * @param reference
|
||
126 | * @return
|
||
127 | * @throws DataException
|
||
128 | */
|
||
129 | 29292 | jmvivo | public FeatureProvider getFeatureProviderByReference(FeatureReferenceProviderServices reference)
|
130 | 29289 | jmvivo | throws DataException;
|
131 | |||
132 | /**
|
||
133 | * Return {@link FeatureProvider} from a
|
||
134 | * {@link FeatureReferenceProviderServices} using <code>featureType</code>
|
||
135 | * as {@link FeatureType}
|
||
136 | *
|
||
137 | * @param reference
|
||
138 | * @return
|
||
139 | * @throws DataException
|
||
140 | */
|
||
141 | 29292 | jmvivo | public FeatureProvider getFeatureProviderByReference(
|
142 | 24248 | jjdelcerro | FeatureReferenceProviderServices reference, FeatureType featureType) |
143 | 23820 | jjdelcerro | throws DataException;
|
144 | 29289 | jmvivo | /**
|
145 | * Informs that store supports write.
|
||
146 | *
|
||
147 | * @return <true> if write is supported
|
||
148 | */
|
||
149 | 23772 | jjdelcerro | public boolean allowWrite(); |
150 | |||
151 | 29289 | jmvivo | /**
|
152 | *Informs that store supports write a geometry.
|
||
153 | *
|
||
154 | * @param geometryType
|
||
155 | * @param geometrySubType
|
||
156 | * @return
|
||
157 | * @throws DataException
|
||
158 | */
|
||
159 | public boolean canWriteGeometry(int geometryType, int geometrySubType) throws DataException; |
||
160 | 23772 | jjdelcerro | |
161 | 29289 | jmvivo | |
162 | public interface FeatureTypeChanged { |
||
163 | FeatureType getSource(); |
||
164 | |||
165 | FeatureType getTarget(); |
||
166 | } |
||
167 | |||
168 | 28660 | jmvivo | /**
|
169 | 29289 | jmvivo | * Perform changes on store.
|
170 | 28660 | jmvivo | *
|
171 | * @param deleteds
|
||
172 | * iterator of {@link FeatureReferenceProviderServices}
|
||
173 | * @param inserteds
|
||
174 | 29289 | jmvivo | * iterator of {@link FeatureProvider}
|
175 | 28660 | jmvivo | * @param updateds
|
176 | 29289 | jmvivo | * iterator of {@link FeatureProvider}
|
177 | * @param featureTypesChanged
|
||
178 | * iterator of {@link FeatureTypeChanged}
|
||
179 | *
|
||
180 | 28660 | jmvivo | * @throws DataException
|
181 | */
|
||
182 | 29289 | jmvivo | public void performChanges(Iterator deleteds, Iterator inserteds, Iterator updateds, Iterator featureTypesChanged) throws DataException; |
183 | 23772 | jjdelcerro | |
184 | 29289 | jmvivo | /**
|
185 | * Returns this store's total envelope (extent).
|
||
186 | *
|
||
187 | * @return this store's total envelope (extent) or <code>null</code> if
|
||
188 | * store not have geometry information
|
||
189 | */
|
||
190 | 25176 | jmvivo | public Envelope getEnvelope() throws DataException; |
191 | 23772 | jjdelcerro | |
192 | 29289 | jmvivo | /**
|
193 | * Informs if store supports locks
|
||
194 | *
|
||
195 | * @return
|
||
196 | */
|
||
197 | 23842 | jjdelcerro | public boolean isLocksSupported(); |
198 | |||
199 | 29289 | jmvivo | /**
|
200 | * Return {@link FeatureStoreProviderServices} for this store
|
||
201 | *
|
||
202 | * @return
|
||
203 | */
|
||
204 | 23874 | jjdelcerro | public FeatureStoreProviderServices getStoreServices();
|
205 | 23995 | jmvivo | |
206 | 29289 | jmvivo | /**
|
207 | * Inform if the store provider supports automatic values for attributues
|
||
208 | * (autonumeric)
|
||
209 | *
|
||
210 | * @return <code>true</code> if supported
|
||
211 | */
|
||
212 | public boolean allowAutomaticValues(); |
||
213 | 23874 | jjdelcerro | |
214 | 29289 | jmvivo | /**
|
215 | * Returns total feature count of this store.
|
||
216 | *
|
||
217 | * @return
|
||
218 | * @throws DataException
|
||
219 | */
|
||
220 | public long getFeatureCount() throws DataException; |
||
221 | 24162 | jjdelcerro | |
222 | 29289 | jmvivo | |
223 | 24185 | jjdelcerro | public boolean supportsAppendMode(); |
224 | 24176 | jmvivo | |
225 | 25956 | jmvivo | public void beginAppend() throws DataException; |
226 | 24162 | jjdelcerro | |
227 | 25956 | jmvivo | public void endAppend() throws DataException; |
228 | 24162 | jjdelcerro | |
229 | 29292 | jmvivo | public void append(FeatureProvider featureProvider) throws DataException; |
230 | 24162 | jjdelcerro | |
231 | 34026 | jpiera | /**
|
232 | * Return if the provider knows the real envelope of a layer. If not,
|
||
233 | * the {@link FeatureStoreProvider#getEnvelope()} method doesn't return
|
||
234 | * the full envelope.
|
||
235 | *
|
||
236 | * @return
|
||
237 | * <true> if it knows the real envelope.
|
||
238 | */
|
||
239 | public boolean isKnownEnvelope(); |
||
240 | |||
241 | /**
|
||
242 | * Return if the maximum number of features provided by the
|
||
243 | * provider are limited.
|
||
244 | *
|
||
245 | * @return
|
||
246 | * <true> if there is a limit of features.
|
||
247 | */
|
||
248 | public boolean hasRetrievedFeaturesLimit(); |
||
249 | |||
250 | /**
|
||
251 | * If the {@link FeatureStoreProvider#hasRetrievedFeaturesLimit()} returns true,
|
||
252 | * it returns the limit of features retrieved from the provider.
|
||
253 | * @return
|
||
254 | * The limit of the retrieved features.
|
||
255 | */
|
||
256 | public int getRetrievedFeaturesLimit(); |
||
257 | 23772 | jjdelcerro | } |