svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.compat.cdc / org.gvsig.fmap.dal / org.gvsig.fmap.dal.api / src / main / java / org / gvsig / fmap / dal / feature / FeatureStore.java @ 42925
History | View | Annotate | Download (26.9 KB)
1 | 40559 | jjdelcerro | /**
|
---|---|---|---|
2 | * gvSIG. Desktop Geographic Information System.
|
||
3 | *
|
||
4 | * Copyright (C) 2007-2013 gvSIG Association.
|
||
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 3
|
||
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 | * For any additional information, do not hesitate to contact us
|
||
22 | * at info AT gvsig.com, or visit our website www.gvsig.com.
|
||
23 | */
|
||
24 | 40435 | jjdelcerro | package org.gvsig.fmap.dal.feature; |
25 | |||
26 | import java.util.Iterator; |
||
27 | import java.util.List; |
||
28 | |||
29 | import org.cresques.cts.IProjection; |
||
30 | |||
31 | import org.gvsig.fmap.dal.DataServerExplorer; |
||
32 | import org.gvsig.fmap.dal.DataStore; |
||
33 | import org.gvsig.fmap.dal.DataStoreParameters; |
||
34 | import org.gvsig.fmap.dal.exception.DataException; |
||
35 | import org.gvsig.fmap.dal.exception.ReadException; |
||
36 | import org.gvsig.fmap.dal.feature.exception.FeatureIndexException; |
||
37 | import org.gvsig.fmap.dal.feature.exception.NeedEditingModeException; |
||
38 | import org.gvsig.fmap.geom.Geometry; |
||
39 | import org.gvsig.fmap.geom.primitive.Envelope; |
||
40 | import org.gvsig.tools.dispose.DisposableIterator; |
||
41 | import org.gvsig.tools.dynobject.DynObject; |
||
42 | import org.gvsig.tools.lang.Cloneable; |
||
43 | import org.gvsig.tools.observer.Observer; |
||
44 | import org.gvsig.tools.undo.UndoRedoStack; |
||
45 | |||
46 | /**
|
||
47 | * <p>
|
||
48 | * A FeatureStore is a type of store whose data consists on sets of
|
||
49 | * {@link Feature}(s). {@link Feature}(s) from the same FeatureStore can be of
|
||
50 | * different {@link FeatureType}(s) (as in GML format for instance).
|
||
51 | * </p>
|
||
52 | 41818 | fdiaz | *
|
53 | 40435 | jjdelcerro | * <p>
|
54 | * FeatureStore allows:
|
||
55 | * </p>
|
||
56 | * <ul>
|
||
57 | * <li>Obtaining the default {@link FeatureType}. A FeatureStore always has one
|
||
58 | * and only one default FeatureType.
|
||
59 | * <li>Obtaining the list of {@link FeatureType}(s) defined in the FeatureStore.
|
||
60 | * <li>Obtaining, filtering and sorting subsets of data ({@link FeatureSet})
|
||
61 | * through {@link FeatureQuery}, as well as background loading.
|
||
62 | * <li>Obtaining the total {@link Envelope} (AKA bounding box or extent) of the
|
||
63 | * store.
|
||
64 | * <li>Support for editing {@link FeatureType}(s).
|
||
65 | * <li>Obtaining information about contained {@link Geometry} types.
|
||
66 | * <li>Exporting to another store.
|
||
67 | * <li>Indexing.
|
||
68 | * <li>Selection.
|
||
69 | * <li>Locks management.
|
||
70 | * </ul>
|
||
71 | 41818 | fdiaz | *
|
72 | 40435 | jjdelcerro | */
|
73 | public interface FeatureStore extends DataStore, UndoRedoStack, Cloneable { |
||
74 | |||
75 | public static final String METADATA_DEFINITION_NAME = "FeatureStore"; |
||
76 | |||
77 | /** Indicates that this store is in query mode */
|
||
78 | final static int MODE_QUERY = 0; |
||
79 | |||
80 | /** Indicates that this store is in full edit mode */
|
||
81 | final static int MODE_FULLEDIT = 1; |
||
82 | |||
83 | /** Indicates that this store is in append mode */
|
||
84 | final static int MODE_APPEND = 2; |
||
85 | |||
86 | /*
|
||
87 | * =============================================================
|
||
88 | 41818 | fdiaz | *
|
89 | 40435 | jjdelcerro | * information related services
|
90 | */
|
||
91 | |||
92 | /**
|
||
93 | * Indicates whether this store allows writing.
|
||
94 | 41818 | fdiaz | *
|
95 | 40435 | jjdelcerro | * @return
|
96 | * true if this store can be written, false if not.
|
||
97 | */
|
||
98 | public boolean allowWrite(); |
||
99 | |||
100 | /**
|
||
101 | * Returns this store's default {@link FeatureType}.
|
||
102 | 41818 | fdiaz | *
|
103 | 40435 | jjdelcerro | * @return
|
104 | * this store's default {@link FeatureType}.
|
||
105 | 41818 | fdiaz | *
|
106 | 40435 | jjdelcerro | * @throws DataException
|
107 | */
|
||
108 | public FeatureType getDefaultFeatureType() throws DataException; |
||
109 | |||
110 | /**
|
||
111 | * Returns this store's featureType {@link FeatureType} matches with
|
||
112 | * featureTypeId.
|
||
113 | 41818 | fdiaz | *
|
114 | 40435 | jjdelcerro | * @param featureTypeId
|
115 | 41818 | fdiaz | *
|
116 | 40435 | jjdelcerro | * @return this store's default {@link FeatureType}.
|
117 | 41818 | fdiaz | *
|
118 | 40435 | jjdelcerro | * @throws DataException
|
119 | */
|
||
120 | public FeatureType getFeatureType(String featureTypeId) |
||
121 | throws DataException;
|
||
122 | |||
123 | /**
|
||
124 | * Returns this store's {@link FeatureType}(s).
|
||
125 | 41818 | fdiaz | *
|
126 | 40435 | jjdelcerro | * @return a list with this store's {@link FeatureType}(s).
|
127 | 41818 | fdiaz | *
|
128 | 40435 | jjdelcerro | * @throws DataException
|
129 | */
|
||
130 | public List getFeatureTypes() throws DataException; |
||
131 | |||
132 | /**
|
||
133 | * Returns this store's parameters.
|
||
134 | 41818 | fdiaz | *
|
135 | 40435 | jjdelcerro | * @return
|
136 | * {@link DataStoreParameters} containing this store's parameters
|
||
137 | */
|
||
138 | public DataStoreParameters getParameters();
|
||
139 | |||
140 | /**
|
||
141 | *@throws DataException
|
||
142 | * @deprecated Mirar de cambiarlo a metadatos
|
||
143 | */
|
||
144 | public boolean canWriteGeometry(int gvSIGgeometryType) throws DataException; |
||
145 | |||
146 | /**
|
||
147 | * Returns this store's total envelope (extent).
|
||
148 | 41818 | fdiaz | *
|
149 | 40435 | jjdelcerro | * @return this store's total envelope (extent) or <code>null</code> if
|
150 | * store not have geometry information
|
||
151 | */
|
||
152 | public Envelope getEnvelope() throws DataException; |
||
153 | |||
154 | /**
|
||
155 | 41818 | fdiaz | *
|
156 | 40435 | jjdelcerro | * @deprecated use getDefaultFeatureType().getDefaultSRS()
|
157 | * @return
|
||
158 | * @throws DataException
|
||
159 | */
|
||
160 | public IProjection getSRSDefaultGeometry() throws DataException; |
||
161 | |||
162 | /**
|
||
163 | * Exports this store to another store.
|
||
164 | 41818 | fdiaz | *
|
165 | 40435 | jjdelcerro | * @param explorer
|
166 | * {@link DataServerExplorer} target
|
||
167 | * @param params
|
||
168 | * New parameters of this store that will be used on the target
|
||
169 | * explorer
|
||
170 | 41818 | fdiaz | *
|
171 | 40435 | jjdelcerro | * @throws DataException
|
172 | 41818 | fdiaz | *
|
173 | 40435 | jjdelcerro | * @Deprecated this method is unstable
|
174 | */
|
||
175 | public void export(DataServerExplorer explorer, String provider, |
||
176 | NewFeatureStoreParameters params) throws DataException;
|
||
177 | |||
178 | /*
|
||
179 | * =============================================================
|
||
180 | 41818 | fdiaz | *
|
181 | 40435 | jjdelcerro | * Query related services
|
182 | */
|
||
183 | |||
184 | /**
|
||
185 | * Returns all available features in the store.
|
||
186 | * <p>
|
||
187 | * <em>
|
||
188 | 41818 | fdiaz | * <strong>NOTE:</strong> if you use this method to get a
|
189 | * {@link FeatureSet}, you must get sure it is disposed
|
||
190 | * (@see {@link DisposableIterator#dispose()}) in any case, even if an
|
||
191 | * error occurs while getting the data. It is recommended to use the
|
||
192 | * <code>accept</code> methods instead, which handle everything for you.
|
||
193 | * Take into account the accept methods may use a fast iterator to
|
||
194 | 40435 | jjdelcerro | * get the features.
|
195 | * </em>
|
||
196 | * </p>
|
||
197 | 41818 | fdiaz | *
|
198 | 40435 | jjdelcerro | * @see #accept(org.gvsig.tools.visitor.Visitor)
|
199 | 41818 | fdiaz | *
|
200 | 40435 | jjdelcerro | * @return a collection of features
|
201 | * @throws ReadException
|
||
202 | * if there is any error while reading the features
|
||
203 | */
|
||
204 | FeatureSet getFeatureSet() throws DataException;
|
||
205 | |||
206 | /**
|
||
207 | * Returns a subset of features taking into account the properties and
|
||
208 | * restrictions of the FeatureQuery.
|
||
209 | * <p>
|
||
210 | * <em>
|
||
211 | 41818 | fdiaz | * <strong>NOTE:</strong> if you use this method to get a
|
212 | * {@link FeatureSet}, you must get sure it is disposed
|
||
213 | * (@see {@link DisposableIterator#dispose()}) in any case, even if an
|
||
214 | * error occurs while getting the data. It is recommended to use the
|
||
215 | * <code>accept</code> methods instead, which handle everything for you.
|
||
216 | * Take into account the accept methods may use a fast iterator to
|
||
217 | 40435 | jjdelcerro | * get the features.
|
218 | * </em>
|
||
219 | * </p>
|
||
220 | 41818 | fdiaz | *
|
221 | 40435 | jjdelcerro | * @see #accept(org.gvsig.tools.visitor.Visitor,
|
222 | * org.gvsig.fmap.dal.DataQuery)
|
||
223 | 41818 | fdiaz | *
|
224 | 40435 | jjdelcerro | * @param featureQuery
|
225 | * defines the characteristics of the features to return
|
||
226 | * @return a collection of features
|
||
227 | * @throws ReadException
|
||
228 | * if there is any error while reading the features
|
||
229 | */
|
||
230 | FeatureSet getFeatureSet(FeatureQuery featureQuery) throws DataException;
|
||
231 | |||
232 | /**
|
||
233 | * Loads a subset of features taking into account the properties and
|
||
234 | * restrictions of the FeatureQuery. Feature loading is performed by calling
|
||
235 | * the Observer, once each loaded Feature.
|
||
236 | 41818 | fdiaz | *
|
237 | 40435 | jjdelcerro | * @param featureQuery
|
238 | * defines the characteristics of the features to return
|
||
239 | * @param observer
|
||
240 | * to be notified of each loaded Feature
|
||
241 | * @throws DataException
|
||
242 | * if there is any error while loading the features
|
||
243 | */
|
||
244 | void getFeatureSet(FeatureQuery featureQuery, Observer observer) |
||
245 | throws DataException;
|
||
246 | |||
247 | /**
|
||
248 | * Loads all available feature in the store. The loading of Features is
|
||
249 | * performed by calling the Observer, once each loaded Feature.
|
||
250 | 41818 | fdiaz | *
|
251 | 40435 | jjdelcerro | * @param observer
|
252 | * to be notified of each loaded Feature
|
||
253 | * @throws DataException
|
||
254 | * if there is any error while loading the features
|
||
255 | */
|
||
256 | void getFeatureSet(Observer observer) throws DataException; |
||
257 | |||
258 | /**
|
||
259 | 42925 | jjdelcerro | * Return a paginated list of Features filtered by the query.
|
260 | *
|
||
261 | * The returned List of Features is paginated, and the page size
|
||
262 | * used is "pageSize".
|
||
263 | *
|
||
264 | * @param query to filter the returned feature list
|
||
265 | * @param pageSize the page size of the list
|
||
266 | * @return the list of features
|
||
267 | */
|
||
268 | public List<Feature> getFeatures(FeatureQuery query, int pageSize); |
||
269 | |||
270 | /**
|
||
271 | 40435 | jjdelcerro | * Returns the feature given its reference.
|
272 | 41818 | fdiaz | *
|
273 | 40435 | jjdelcerro | * @param reference
|
274 | * a unique FeatureReference
|
||
275 | * @return
|
||
276 | * The Feature
|
||
277 | 41818 | fdiaz | *
|
278 | 40435 | jjdelcerro | * @throws DataException
|
279 | 41818 | fdiaz | *
|
280 | 40435 | jjdelcerro | */
|
281 | public Feature getFeatureByReference(FeatureReference reference)
|
||
282 | throws DataException;
|
||
283 | |||
284 | /**
|
||
285 | * Returns the feature given its reference and feature type.
|
||
286 | 41818 | fdiaz | *
|
287 | 40435 | jjdelcerro | * @param reference
|
288 | * a unique FeatureReference
|
||
289 | 41818 | fdiaz | *
|
290 | 40435 | jjdelcerro | * @param featureType
|
291 | * FeatureType to which the requested Feature belongs
|
||
292 | 41818 | fdiaz | *
|
293 | 40435 | jjdelcerro | * @return
|
294 | * The Feature
|
||
295 | 41818 | fdiaz | *
|
296 | 40435 | jjdelcerro | * @throws DataException
|
297 | 41818 | fdiaz | *
|
298 | 40435 | jjdelcerro | */
|
299 | public Feature getFeatureByReference(FeatureReference reference,
|
||
300 | FeatureType featureType) throws DataException;
|
||
301 | |||
302 | /*
|
||
303 | * =============================================================
|
||
304 | 41818 | fdiaz | *
|
305 | 40435 | jjdelcerro | * Editing related services
|
306 | */
|
||
307 | |||
308 | /**
|
||
309 | * Enters editing state.
|
||
310 | */
|
||
311 | public void edit() throws DataException; |
||
312 | |||
313 | /**
|
||
314 | * Enters editing state specifying the editing mode.
|
||
315 | 41818 | fdiaz | *
|
316 | 40435 | jjdelcerro | * @param mode
|
317 | 41818 | fdiaz | *
|
318 | 40435 | jjdelcerro | * @throws DataException
|
319 | */
|
||
320 | public void edit(int mode) throws DataException; |
||
321 | |||
322 | /**
|
||
323 | * Cancels all editing since the last edit().
|
||
324 | 41818 | fdiaz | *
|
325 | 40435 | jjdelcerro | * @throws DataException
|
326 | */
|
||
327 | public void cancelEditing() throws DataException; |
||
328 | |||
329 | /**
|
||
330 | * Exits editing state.
|
||
331 | 41818 | fdiaz | *
|
332 | 40435 | jjdelcerro | * @throws DataException
|
333 | */
|
||
334 | public void finishEditing() throws DataException; |
||
335 | |||
336 | /**
|
||
337 | * Save changes in the provider without leaving the edit mode.
|
||
338 | * Do not call observers to communicate a change of ediding mode.
|
||
339 | * The operation's history is eliminated to prevent inconsistencies
|
||
340 | * in the data.
|
||
341 | *
|
||
342 | * @throws DataException
|
||
343 | */
|
||
344 | public void commitChanges() throws DataException ; |
||
345 | |||
346 | /**
|
||
347 | *
|
||
348 | * Returns true if you can call CommitChanges method.
|
||
349 | * If not in editing or changes have been made in the structure
|
||
350 | * return false.
|
||
351 | 41818 | fdiaz | *
|
352 | 40435 | jjdelcerro | * @return true if can call commitChanges
|
353 | 41818 | fdiaz | * @throws DataException
|
354 | 40435 | jjdelcerro | */
|
355 | public boolean canCommitChanges() throws DataException; |
||
356 | |||
357 | 41818 | fdiaz | |
358 | 40435 | jjdelcerro | /**
|
359 | * Indicates whether this store is in editing state.
|
||
360 | 41818 | fdiaz | *
|
361 | 40435 | jjdelcerro | * @return
|
362 | * true if this store is in editing state, false if not.
|
||
363 | */
|
||
364 | public boolean isEditing(); |
||
365 | |||
366 | /**
|
||
367 | * Indicates whether this store is in appending state. In this state the new
|
||
368 | * features are automatically inserted at the end of the {@link FeatureSet}.
|
||
369 | 41818 | fdiaz | *
|
370 | 40435 | jjdelcerro | * @return true if this store is in appending state.
|
371 | */
|
||
372 | public boolean isAppending(); |
||
373 | |||
374 | /**
|
||
375 | * Updates a {@link FeatureType} in the store with the changes in the
|
||
376 | * {@link EditableFeatureType}.<br>
|
||
377 | 41818 | fdiaz | *
|
378 | 40435 | jjdelcerro | * Any {@link FeatureSet} from this store that are used will be invalidated.
|
379 | 41818 | fdiaz | *
|
380 | 40435 | jjdelcerro | * @param featureType
|
381 | * an {@link EditableFeatureType} with the changes.
|
||
382 | 41818 | fdiaz | *
|
383 | 40435 | jjdelcerro | * @throws DataException
|
384 | */
|
||
385 | public void update(EditableFeatureType featureType) throws DataException; |
||
386 | |||
387 | /**
|
||
388 | * Updates a {@link Feature} in the store with the changes in the
|
||
389 | * {@link EditableFeature}.<br>
|
||
390 | 41818 | fdiaz | *
|
391 | 40435 | jjdelcerro | * Any {@link FeatureSet} from this store that was still in use will be
|
392 | * invalidated. You can override this using
|
||
393 | * {@link FeatureSet#update(EditableFeature)}.
|
||
394 | 41818 | fdiaz | *
|
395 | 40435 | jjdelcerro | * @param feature
|
396 | * the feature to be updated
|
||
397 | 41818 | fdiaz | *
|
398 | 40435 | jjdelcerro | * @throws DataException
|
399 | */
|
||
400 | public void update(EditableFeature feature) throws DataException; |
||
401 | |||
402 | /**
|
||
403 | * Deletes a {@link Feature} from the store.<br>
|
||
404 | 41818 | fdiaz | *
|
405 | 40435 | jjdelcerro | * Any {@link FeatureSet} from this store that was still in use will be
|
406 | * invalidated. You can override this using {@link Iterator#remove()} from
|
||
407 | * {@link FeatureSet}.
|
||
408 | 41818 | fdiaz | *
|
409 | 40435 | jjdelcerro | * @param feature
|
410 | * The feature to be deleted.
|
||
411 | 41818 | fdiaz | *
|
412 | 40435 | jjdelcerro | * @throws DataException
|
413 | */
|
||
414 | public void delete(Feature feature) throws DataException; |
||
415 | |||
416 | /**
|
||
417 | * Inserts a {@link Feature} in the store.<br>
|
||
418 | 41818 | fdiaz | *
|
419 | 40435 | jjdelcerro | * Any {@link FeatureSet} from this store that was still in use will be
|
420 | * invalidated. You can override this using
|
||
421 | * {@link FeatureSet#insert(EditableFeature)}.
|
||
422 | 41818 | fdiaz | *
|
423 | 40435 | jjdelcerro | * @param feature
|
424 | * The feature to be inserted
|
||
425 | 41818 | fdiaz | *
|
426 | 40435 | jjdelcerro | * @throws DataException
|
427 | */
|
||
428 | public void insert(EditableFeature feature) throws DataException; |
||
429 | |||
430 | /**
|
||
431 | * Creates a new feature using the default feature type and returns it as an
|
||
432 | * {@link EditableFeature}
|
||
433 | 41818 | fdiaz | *
|
434 | 40435 | jjdelcerro | * @return a new feature in editable state
|
435 | 41818 | fdiaz | *
|
436 | 40435 | jjdelcerro | * @throws DataException
|
437 | */
|
||
438 | public EditableFeature createNewFeature() throws DataException; |
||
439 | |||
440 | /**
|
||
441 | * Creates a new feature of the given {@link FeatureType} and uses the given
|
||
442 | * {@link Feature} as default values to initialize it.
|
||
443 | 41818 | fdiaz | *
|
444 | 40435 | jjdelcerro | * @param type
|
445 | * the new feature's feature type
|
||
446 | 41818 | fdiaz | *
|
447 | 40435 | jjdelcerro | * @param defaultValues
|
448 | * a feature whose values are used as default values for the new
|
||
449 | * feature.
|
||
450 | 41818 | fdiaz | *
|
451 | 40435 | jjdelcerro | * @return the new feature.
|
452 | 41818 | fdiaz | *
|
453 | 40435 | jjdelcerro | * @throws DataException
|
454 | */
|
||
455 | public EditableFeature createNewFeature(FeatureType type,
|
||
456 | Feature defaultValues) throws DataException;
|
||
457 | |||
458 | /**
|
||
459 | * Creates a new feature of the given {@link FeatureType}. The flag
|
||
460 | * defaultValues is used to indicate whether the new feature should be
|
||
461 | * initialized with default values or not.
|
||
462 | 41818 | fdiaz | *
|
463 | 40435 | jjdelcerro | * @param type
|
464 | * the new feature's feature type
|
||
465 | 41818 | fdiaz | *
|
466 | 40435 | jjdelcerro | * @param defaultValues
|
467 | * if true the new feature is initialized with each attribute's
|
||
468 | * default value.
|
||
469 | 41818 | fdiaz | *
|
470 | 40435 | jjdelcerro | * @return
|
471 | * the new feature
|
||
472 | 41818 | fdiaz | *
|
473 | 40435 | jjdelcerro | * @throws DataException
|
474 | */
|
||
475 | public EditableFeature createNewFeature(FeatureType type,
|
||
476 | boolean defaultValues) throws DataException; |
||
477 | |||
478 | /**
|
||
479 | * Creates a new feature of default {@link FeatureType}. The flag
|
||
480 | * defaultValues is used to indicate whether the new feature should be
|
||
481 | * initialized with default values or not.
|
||
482 | 41818 | fdiaz | *
|
483 | 40435 | jjdelcerro | * @param defaultValues
|
484 | * if true the new feature is initialized with each attribute's
|
||
485 | * default value.
|
||
486 | 41818 | fdiaz | *
|
487 | 40435 | jjdelcerro | * @return
|
488 | * the new feature
|
||
489 | 41818 | fdiaz | *
|
490 | 40435 | jjdelcerro | * @throws DataException
|
491 | */
|
||
492 | public EditableFeature createNewFeature(boolean defaultValues) |
||
493 | throws DataException;
|
||
494 | |||
495 | /**
|
||
496 | 42293 | jjdelcerro | * Creates a new feature of default {@link FeatureType}.
|
497 | * The new feature should be initialized with the values of the feature
|
||
498 | * passed as parameter.
|
||
499 | * Values are inicialiced by name from the feature specified. Error in
|
||
500 | * value assignement are ignoreds.
|
||
501 | *
|
||
502 | * @param defaultValues the values to initialize the new feature.
|
||
503 | * @return the new feature
|
||
504 | * @throws DataException
|
||
505 | */
|
||
506 | public EditableFeature createNewFeature(Feature defaultValues)
|
||
507 | throws DataException;
|
||
508 | |||
509 | /**
|
||
510 | 40435 | jjdelcerro | * Applies the validation rules associated to the given mode to the active
|
511 | * {@link FeatureSet}.
|
||
512 | 41818 | fdiaz | *
|
513 | 40435 | jjdelcerro | * @param mode
|
514 | * can be one of {MODE_QUERY, MODE_FULLEDIT, MODE_APPEND}
|
||
515 | 41818 | fdiaz | *
|
516 | 40435 | jjdelcerro | * @throws DataException
|
517 | */
|
||
518 | public void validateFeatures(int mode) throws DataException; |
||
519 | |||
520 | /**
|
||
521 | * Indicates whether this store supports append mode.
|
||
522 | 41818 | fdiaz | *
|
523 | 40435 | jjdelcerro | * @return
|
524 | * true if this store supports append mode.
|
||
525 | */
|
||
526 | public boolean isAppendModeSupported(); |
||
527 | |||
528 | /**
|
||
529 | * Initiates an editing group. This is typically used to group series of
|
||
530 | * store editing operations.
|
||
531 | 41818 | fdiaz | *
|
532 | 40435 | jjdelcerro | * @param description
|
533 | * Description of the editing group.
|
||
534 | 41818 | fdiaz | *
|
535 | 40435 | jjdelcerro | * @throws NeedEditingModeException
|
536 | */
|
||
537 | public void beginEditingGroup(String description) |
||
538 | throws NeedEditingModeException;
|
||
539 | |||
540 | /**
|
||
541 | * Finishes an editing group.
|
||
542 | 41818 | fdiaz | *
|
543 | 40435 | jjdelcerro | * @throws NeedEditingModeException
|
544 | */
|
||
545 | public void endEditingGroup() throws NeedEditingModeException; |
||
546 | |||
547 | /*
|
||
548 | * =============================================================
|
||
549 | 41818 | fdiaz | *
|
550 | 40435 | jjdelcerro | * Index related services
|
551 | */
|
||
552 | |||
553 | /**
|
||
554 | * Creates an index which will be applied to the features of the given type,
|
||
555 | * by using the data of the given attribute.
|
||
556 | 41818 | fdiaz | *
|
557 | 40435 | jjdelcerro | * @param featureType
|
558 | * The FeatureType to which the indexed attribute belongs.
|
||
559 | 41818 | fdiaz | *
|
560 | 40435 | jjdelcerro | * @param attributeName
|
561 | * The name of the attributed to be indexed
|
||
562 | 41818 | fdiaz | *
|
563 | 40435 | jjdelcerro | * @param indexName
|
564 | * The index name
|
||
565 | 41818 | fdiaz | *
|
566 | 40435 | jjdelcerro | * @return the resulting {@link FeatureIndex}
|
567 | 41818 | fdiaz | *
|
568 | *
|
||
569 | 40435 | jjdelcerro | * @throws FeatureIndexException
|
570 | * if there is an error creating the index
|
||
571 | */
|
||
572 | public FeatureIndex createIndex(FeatureType featureType,
|
||
573 | String attributeName, String indexName) throws DataException; |
||
574 | |||
575 | /**
|
||
576 | * Creates an index which will be applied to the features of the given type,
|
||
577 | * by using the data of the given attribute.
|
||
578 | 41818 | fdiaz | *
|
579 | 40435 | jjdelcerro | * @param indexTypeName
|
580 | * the type of the index to be created. That name is
|
||
581 | * related to one of the registered index providers
|
||
582 | * @param featureType
|
||
583 | * The FeatureType to which the indexed attribute belongs.
|
||
584 | 41818 | fdiaz | *
|
585 | 40435 | jjdelcerro | * @param attributeName
|
586 | * The name of the attributed to be indexed
|
||
587 | 41818 | fdiaz | *
|
588 | 40435 | jjdelcerro | * @param indexName
|
589 | * The index name
|
||
590 | 41818 | fdiaz | *
|
591 | 40435 | jjdelcerro | * @return the resulting {@link FeatureIndex}
|
592 | 41818 | fdiaz | *
|
593 | *
|
||
594 | 40435 | jjdelcerro | * @throws FeatureIndexException
|
595 | * if there is an error creating the index
|
||
596 | */
|
||
597 | public FeatureIndex createIndex(String indexTypeName, |
||
598 | FeatureType featureType, String attributeName, String indexName) |
||
599 | throws DataException;
|
||
600 | |||
601 | /**
|
||
602 | * Creates an index which will be applied to the features of the given type,
|
||
603 | * by using the data of the given attribute. This method will return without
|
||
604 | * waiting for the index to be filled, as that will be performed in
|
||
605 | * background. An optional {@link Observer} parameter is provided to be
|
||
606 | * notified ( {@link FeatureStoreNotification#INDEX_FILLING_SUCCESS} )
|
||
607 | * when the index has finished filling with data and is available to be
|
||
608 | * used.
|
||
609 | 41818 | fdiaz | *
|
610 | 40435 | jjdelcerro | * @param featureType
|
611 | * The FeatureType to which the indexed attribute belongs.
|
||
612 | 41818 | fdiaz | *
|
613 | 40435 | jjdelcerro | * @param attributeName
|
614 | * The name of the attributed to be indexed
|
||
615 | 41818 | fdiaz | *
|
616 | 40435 | jjdelcerro | * @param indexName
|
617 | * The index name
|
||
618 | 41818 | fdiaz | *
|
619 | 40435 | jjdelcerro | * @param observer
|
620 | * to notify to when the created index has finished filling
|
||
621 | * with data and is available to be used. The observer will
|
||
622 | * receive then a
|
||
623 | * {@link FeatureStoreNotification#INDEX_FILLING_SUCCESS}
|
||
624 | * notification, with the index object if it has finished
|
||
625 | * successfully, or a
|
||
626 | * {@link FeatureStoreNotification#INDEX_FILLING_ERROR}
|
||
627 | * notification with the exception object if there has been
|
||
628 | * any error in the process. Optional.
|
||
629 | 41818 | fdiaz | *
|
630 | 40435 | jjdelcerro | * @return the resulting {@link FeatureIndex}
|
631 | 41818 | fdiaz | *
|
632 | 40435 | jjdelcerro | * @see FeatureStoreNotification#INDEX_FILLING_STARTED
|
633 | * @see FeatureStoreNotification#INDEX_FILLING_SUCCESS
|
||
634 | * @see FeatureStoreNotification#INDEX_FILLING_CANCELLED
|
||
635 | * @see FeatureStoreNotification#INDEX_FILLING_ERROR
|
||
636 | 41818 | fdiaz | *
|
637 | 40435 | jjdelcerro | * @throws FeatureIndexException
|
638 | * if there is an error creating the index
|
||
639 | */
|
||
640 | public FeatureIndex createIndex(FeatureType featureType,
|
||
641 | String attributeName, String indexName, Observer observer) |
||
642 | throws DataException;
|
||
643 | |||
644 | /**
|
||
645 | * Creates an index which will be applied to the features of the given type,
|
||
646 | * by using the data of the given attribute. This method will return without
|
||
647 | * waiting for the index to be filled, as that will be performed in
|
||
648 | * background. An optional {@link Observer} parameter is provided to be
|
||
649 | * notified ( {@link FeatureStoreNotification#INDEX_FILLING_SUCCESS} )
|
||
650 | * when the index has finished filling with data and is available to be
|
||
651 | * used.
|
||
652 | 41818 | fdiaz | *
|
653 | 40435 | jjdelcerro | * @param indexTypeName
|
654 | * the type of the index to be created. That name is
|
||
655 | * related to one of the registered index providers
|
||
656 | * @param featureType
|
||
657 | * The FeatureType to which the indexed attribute belongs.
|
||
658 | 41818 | fdiaz | *
|
659 | 40435 | jjdelcerro | * @param attributeName
|
660 | * The name of the attributed to be indexed
|
||
661 | 41818 | fdiaz | *
|
662 | 40435 | jjdelcerro | * @param indexName
|
663 | * The index name
|
||
664 | 41818 | fdiaz | *
|
665 | 40435 | jjdelcerro | * @param observer
|
666 | * to notify to when the created index has finished filling
|
||
667 | * with data and is available to be used. The observer will
|
||
668 | * receive then a
|
||
669 | * {@link FeatureStoreNotification#INDEX_FILLING_SUCCESS}
|
||
670 | * notification, with the index object if it has finished
|
||
671 | * successfully, or a
|
||
672 | * {@link FeatureStoreNotification#INDEX_FILLING_ERROR}
|
||
673 | * notification with the exception object if there has been
|
||
674 | * any error in the process. Optional.
|
||
675 | 41818 | fdiaz | *
|
676 | 40435 | jjdelcerro | * @return the resulting {@link FeatureIndex}
|
677 | 41818 | fdiaz | *
|
678 | 40435 | jjdelcerro | * @see FeatureStoreNotification#INDEX_FILLING_STARTED
|
679 | * @see FeatureStoreNotification#INDEX_FILLING_SUCCESS
|
||
680 | * @see FeatureStoreNotification#INDEX_FILLING_CANCELLED
|
||
681 | * @see FeatureStoreNotification#INDEX_FILLING_ERROR
|
||
682 | 41818 | fdiaz | *
|
683 | 40435 | jjdelcerro | * @throws FeatureIndexException
|
684 | * if there is an error creating the index
|
||
685 | */
|
||
686 | public FeatureIndex createIndex(String indexTypeName, |
||
687 | FeatureType featureType, String attributeName, String indexName, |
||
688 | Observer observer) throws DataException; |
||
689 | |||
690 | /**
|
||
691 | * Returns a FeatureIndexes structure containing all available indexes in
|
||
692 | * the store.
|
||
693 | 41818 | fdiaz | *
|
694 | 40435 | jjdelcerro | * @return
|
695 | */
|
||
696 | public FeatureIndexes getIndexes();
|
||
697 | |||
698 | /*
|
||
699 | * =============================================================
|
||
700 | 41818 | fdiaz | *
|
701 | 40435 | jjdelcerro | * Selection related services
|
702 | */
|
||
703 | |||
704 | /**
|
||
705 | * Sets the selection to the passed {@link FeatureSet}
|
||
706 | 41818 | fdiaz | *
|
707 | 40435 | jjdelcerro | * @param selection
|
708 | * A {@link FeatureSet} with the requested selection
|
||
709 | */
|
||
710 | public void setSelection(FeatureSet selection) throws DataException; |
||
711 | |||
712 | /**
|
||
713 | * Creates a {@link FeatureSelection}
|
||
714 | 41818 | fdiaz | *
|
715 | 40435 | jjdelcerro | * @return
|
716 | * a {@link FeatureSelection}
|
||
717 | 41818 | fdiaz | *
|
718 | 40435 | jjdelcerro | * @throws DataException
|
719 | */
|
||
720 | public FeatureSelection createFeatureSelection() throws DataException; |
||
721 | |||
722 | /**
|
||
723 | * Returns the current {@link FeatureSelection}.
|
||
724 | * Create a empty selection if not exits.
|
||
725 | 41818 | fdiaz | *
|
726 | 40435 | jjdelcerro | * @return
|
727 | * current {@link FeatureSelection}.
|
||
728 | 41818 | fdiaz | *
|
729 | 40435 | jjdelcerro | * @throws DataException
|
730 | */
|
||
731 | public FeatureSelection getFeatureSelection() throws DataException; |
||
732 | |||
733 | /*
|
||
734 | * =============================================================
|
||
735 | 41818 | fdiaz | *
|
736 | 40435 | jjdelcerro | * Lock related services
|
737 | */
|
||
738 | |||
739 | /**
|
||
740 | * Indicates whether this store supports locks.
|
||
741 | 41818 | fdiaz | *
|
742 | 40435 | jjdelcerro | * @return
|
743 | * true if this store supports locks, false if not.
|
||
744 | */
|
||
745 | public boolean isLocksSupported(); |
||
746 | |||
747 | /**
|
||
748 | * Returns the set of locked features
|
||
749 | 41818 | fdiaz | *
|
750 | 40435 | jjdelcerro | * @return
|
751 | * set of locked features
|
||
752 | 41818 | fdiaz | *
|
753 | 40435 | jjdelcerro | * @throws DataException
|
754 | */
|
||
755 | public FeatureLocks getLocks() throws DataException; |
||
756 | |||
757 | /*
|
||
758 | * =============================================================
|
||
759 | * Transforms related services
|
||
760 | * =============================================================
|
||
761 | */
|
||
762 | |||
763 | /**
|
||
764 | * Returns this store transforms
|
||
765 | 41818 | fdiaz | *
|
766 | 40435 | jjdelcerro | * @return
|
767 | * this store transforms
|
||
768 | */
|
||
769 | public FeatureStoreTransforms getTransforms();
|
||
770 | |||
771 | /**
|
||
772 | * Returns a new {@link FeatureQuery} associated to this store.
|
||
773 | 41818 | fdiaz | *
|
774 | 40435 | jjdelcerro | * @return
|
775 | * a new {@link FeatureQuery} associated to this store.
|
||
776 | */
|
||
777 | public FeatureQuery createFeatureQuery();
|
||
778 | |||
779 | /**
|
||
780 | * Returns featue count of this store.
|
||
781 | 41818 | fdiaz | *
|
782 | 40435 | jjdelcerro | * @return
|
783 | * @throws DataException
|
||
784 | */
|
||
785 | public long getFeatureCount() throws DataException; |
||
786 | |||
787 | /**
|
||
788 | * Creates a vectorial cache that is used to save and retrieve data.
|
||
789 | 41818 | fdiaz | *
|
790 | 40435 | jjdelcerro | * @param name
|
791 | * the cache name.
|
||
792 | * @param parameters
|
||
793 | * parameters to create the stores used to save data.
|
||
794 | * @throws DataException
|
||
795 | */
|
||
796 | public void createCache(String name, DynObject parameters) |
||
797 | throws DataException;
|
||
798 | |||
799 | /**
|
||
800 | * @return the vectorial cache
|
||
801 | */
|
||
802 | public FeatureCache getCache();
|
||
803 | |||
804 | /**
|
||
805 | * Return if the provider knows the real envelope of a layer. If not,
|
||
806 | * the {@link FeatureStoreProvider#getEnvelope()} method doesn't return
|
||
807 | * the full envelope.
|
||
808 | 41818 | fdiaz | *
|
809 | 40435 | jjdelcerro | * @return
|
810 | * <true> if it knows the real envelope.
|
||
811 | */
|
||
812 | public boolean isKnownEnvelope(); |
||
813 | |||
814 | /**
|
||
815 | * Return if the maximum number of features provided by the
|
||
816 | * provider are limited.
|
||
817 | 41818 | fdiaz | *
|
818 | 40435 | jjdelcerro | * @return
|
819 | * <true> if there is a limit of features.
|
||
820 | */
|
||
821 | public boolean hasRetrievedFeaturesLimit(); |
||
822 | |||
823 | /**
|
||
824 | * If the {@link FeatureStoreProvider#hasRetrievedFeaturesLimit()} returns
|
||
825 | * true,
|
||
826 | * it returns the limit of features retrieved from the provider.
|
||
827 | 41818 | fdiaz | *
|
828 | 40435 | jjdelcerro | * @return
|
829 | * The limit of the retrieved features.
|
||
830 | */
|
||
831 | public int getRetrievedFeaturesLimit(); |
||
832 | 41818 | fdiaz | |
833 | /**
|
||
834 | * Return the associated feature to the dynobject.
|
||
835 | * If the dynobject isn't associated to a feature of this store, return null.
|
||
836 | *
|
||
837 | * @param dynobject
|
||
838 | * @return
|
||
839 | */
|
||
840 | public Feature getFeature(DynObject dynobject);
|
||
841 | 42293 | jjdelcerro | |
842 | public Iterator iterator(); |
||
843 | 40435 | jjdelcerro | } |