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