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 @ 42293
History | View | Annotate | Download (26.5 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 | * Returns the feature given its reference.
|
||
260 | 41818 | fdiaz | *
|
261 | 40435 | jjdelcerro | * @param reference
|
262 | * a unique FeatureReference
|
||
263 | * @return
|
||
264 | * The Feature
|
||
265 | 41818 | fdiaz | *
|
266 | 40435 | jjdelcerro | * @throws DataException
|
267 | 41818 | fdiaz | *
|
268 | 40435 | jjdelcerro | */
|
269 | public Feature getFeatureByReference(FeatureReference reference)
|
||
270 | throws DataException;
|
||
271 | |||
272 | /**
|
||
273 | * Returns the feature given its reference and feature type.
|
||
274 | 41818 | fdiaz | *
|
275 | 40435 | jjdelcerro | * @param reference
|
276 | * a unique FeatureReference
|
||
277 | 41818 | fdiaz | *
|
278 | 40435 | jjdelcerro | * @param featureType
|
279 | * FeatureType to which the requested Feature belongs
|
||
280 | 41818 | fdiaz | *
|
281 | 40435 | jjdelcerro | * @return
|
282 | * The Feature
|
||
283 | 41818 | fdiaz | *
|
284 | 40435 | jjdelcerro | * @throws DataException
|
285 | 41818 | fdiaz | *
|
286 | 40435 | jjdelcerro | */
|
287 | public Feature getFeatureByReference(FeatureReference reference,
|
||
288 | FeatureType featureType) throws DataException;
|
||
289 | |||
290 | /*
|
||
291 | * =============================================================
|
||
292 | 41818 | fdiaz | *
|
293 | 40435 | jjdelcerro | * Editing related services
|
294 | */
|
||
295 | |||
296 | /**
|
||
297 | * Enters editing state.
|
||
298 | */
|
||
299 | public void edit() throws DataException; |
||
300 | |||
301 | /**
|
||
302 | * Enters editing state specifying the editing mode.
|
||
303 | 41818 | fdiaz | *
|
304 | 40435 | jjdelcerro | * @param mode
|
305 | 41818 | fdiaz | *
|
306 | 40435 | jjdelcerro | * @throws DataException
|
307 | */
|
||
308 | public void edit(int mode) throws DataException; |
||
309 | |||
310 | /**
|
||
311 | * Cancels all editing since the last edit().
|
||
312 | 41818 | fdiaz | *
|
313 | 40435 | jjdelcerro | * @throws DataException
|
314 | */
|
||
315 | public void cancelEditing() throws DataException; |
||
316 | |||
317 | /**
|
||
318 | * Exits editing state.
|
||
319 | 41818 | fdiaz | *
|
320 | 40435 | jjdelcerro | * @throws DataException
|
321 | */
|
||
322 | public void finishEditing() throws DataException; |
||
323 | |||
324 | /**
|
||
325 | * Save changes in the provider without leaving the edit mode.
|
||
326 | * Do not call observers to communicate a change of ediding mode.
|
||
327 | * The operation's history is eliminated to prevent inconsistencies
|
||
328 | * in the data.
|
||
329 | *
|
||
330 | * @throws DataException
|
||
331 | */
|
||
332 | public void commitChanges() throws DataException ; |
||
333 | |||
334 | /**
|
||
335 | *
|
||
336 | * Returns true if you can call CommitChanges method.
|
||
337 | * If not in editing or changes have been made in the structure
|
||
338 | * return false.
|
||
339 | 41818 | fdiaz | *
|
340 | 40435 | jjdelcerro | * @return true if can call commitChanges
|
341 | 41818 | fdiaz | * @throws DataException
|
342 | 40435 | jjdelcerro | */
|
343 | public boolean canCommitChanges() throws DataException; |
||
344 | |||
345 | 41818 | fdiaz | |
346 | 40435 | jjdelcerro | /**
|
347 | * Indicates whether this store is in editing state.
|
||
348 | 41818 | fdiaz | *
|
349 | 40435 | jjdelcerro | * @return
|
350 | * true if this store is in editing state, false if not.
|
||
351 | */
|
||
352 | public boolean isEditing(); |
||
353 | |||
354 | /**
|
||
355 | * Indicates whether this store is in appending state. In this state the new
|
||
356 | * features are automatically inserted at the end of the {@link FeatureSet}.
|
||
357 | 41818 | fdiaz | *
|
358 | 40435 | jjdelcerro | * @return true if this store is in appending state.
|
359 | */
|
||
360 | public boolean isAppending(); |
||
361 | |||
362 | /**
|
||
363 | * Updates a {@link FeatureType} in the store with the changes in the
|
||
364 | * {@link EditableFeatureType}.<br>
|
||
365 | 41818 | fdiaz | *
|
366 | 40435 | jjdelcerro | * Any {@link FeatureSet} from this store that are used will be invalidated.
|
367 | 41818 | fdiaz | *
|
368 | 40435 | jjdelcerro | * @param featureType
|
369 | * an {@link EditableFeatureType} with the changes.
|
||
370 | 41818 | fdiaz | *
|
371 | 40435 | jjdelcerro | * @throws DataException
|
372 | */
|
||
373 | public void update(EditableFeatureType featureType) throws DataException; |
||
374 | |||
375 | /**
|
||
376 | * Updates a {@link Feature} in the store with the changes in the
|
||
377 | * {@link EditableFeature}.<br>
|
||
378 | 41818 | fdiaz | *
|
379 | 40435 | jjdelcerro | * Any {@link FeatureSet} from this store that was still in use will be
|
380 | * invalidated. You can override this using
|
||
381 | * {@link FeatureSet#update(EditableFeature)}.
|
||
382 | 41818 | fdiaz | *
|
383 | 40435 | jjdelcerro | * @param feature
|
384 | * the feature to be updated
|
||
385 | 41818 | fdiaz | *
|
386 | 40435 | jjdelcerro | * @throws DataException
|
387 | */
|
||
388 | public void update(EditableFeature feature) throws DataException; |
||
389 | |||
390 | /**
|
||
391 | * Deletes a {@link Feature} from the store.<br>
|
||
392 | 41818 | fdiaz | *
|
393 | 40435 | jjdelcerro | * Any {@link FeatureSet} from this store that was still in use will be
|
394 | * invalidated. You can override this using {@link Iterator#remove()} from
|
||
395 | * {@link FeatureSet}.
|
||
396 | 41818 | fdiaz | *
|
397 | 40435 | jjdelcerro | * @param feature
|
398 | * The feature to be deleted.
|
||
399 | 41818 | fdiaz | *
|
400 | 40435 | jjdelcerro | * @throws DataException
|
401 | */
|
||
402 | public void delete(Feature feature) throws DataException; |
||
403 | |||
404 | /**
|
||
405 | * Inserts a {@link Feature} in the store.<br>
|
||
406 | 41818 | fdiaz | *
|
407 | 40435 | jjdelcerro | * Any {@link FeatureSet} from this store that was still in use will be
|
408 | * invalidated. You can override this using
|
||
409 | * {@link FeatureSet#insert(EditableFeature)}.
|
||
410 | 41818 | fdiaz | *
|
411 | 40435 | jjdelcerro | * @param feature
|
412 | * The feature to be inserted
|
||
413 | 41818 | fdiaz | *
|
414 | 40435 | jjdelcerro | * @throws DataException
|
415 | */
|
||
416 | public void insert(EditableFeature feature) throws DataException; |
||
417 | |||
418 | /**
|
||
419 | * Creates a new feature using the default feature type and returns it as an
|
||
420 | * {@link EditableFeature}
|
||
421 | 41818 | fdiaz | *
|
422 | 40435 | jjdelcerro | * @return a new feature in editable state
|
423 | 41818 | fdiaz | *
|
424 | 40435 | jjdelcerro | * @throws DataException
|
425 | */
|
||
426 | public EditableFeature createNewFeature() throws DataException; |
||
427 | |||
428 | /**
|
||
429 | * Creates a new feature of the given {@link FeatureType} and uses the given
|
||
430 | * {@link Feature} as default values to initialize it.
|
||
431 | 41818 | fdiaz | *
|
432 | 40435 | jjdelcerro | * @param type
|
433 | * the new feature's feature type
|
||
434 | 41818 | fdiaz | *
|
435 | 40435 | jjdelcerro | * @param defaultValues
|
436 | * a feature whose values are used as default values for the new
|
||
437 | * feature.
|
||
438 | 41818 | fdiaz | *
|
439 | 40435 | jjdelcerro | * @return the new feature.
|
440 | 41818 | fdiaz | *
|
441 | 40435 | jjdelcerro | * @throws DataException
|
442 | */
|
||
443 | public EditableFeature createNewFeature(FeatureType type,
|
||
444 | Feature defaultValues) throws DataException;
|
||
445 | |||
446 | /**
|
||
447 | * Creates a new feature of the given {@link FeatureType}. The flag
|
||
448 | * defaultValues is used to indicate whether the new feature should be
|
||
449 | * initialized with default values or not.
|
||
450 | 41818 | fdiaz | *
|
451 | 40435 | jjdelcerro | * @param type
|
452 | * the new feature's feature type
|
||
453 | 41818 | fdiaz | *
|
454 | 40435 | jjdelcerro | * @param defaultValues
|
455 | * if true the new feature is initialized with each attribute's
|
||
456 | * default value.
|
||
457 | 41818 | fdiaz | *
|
458 | 40435 | jjdelcerro | * @return
|
459 | * the new feature
|
||
460 | 41818 | fdiaz | *
|
461 | 40435 | jjdelcerro | * @throws DataException
|
462 | */
|
||
463 | public EditableFeature createNewFeature(FeatureType type,
|
||
464 | boolean defaultValues) throws DataException; |
||
465 | |||
466 | /**
|
||
467 | * Creates a new feature of default {@link FeatureType}. The flag
|
||
468 | * defaultValues is used to indicate whether the new feature should be
|
||
469 | * initialized with default values or not.
|
||
470 | 41818 | fdiaz | *
|
471 | 40435 | jjdelcerro | * @param defaultValues
|
472 | * if true the new feature is initialized with each attribute's
|
||
473 | * default value.
|
||
474 | 41818 | fdiaz | *
|
475 | 40435 | jjdelcerro | * @return
|
476 | * the new feature
|
||
477 | 41818 | fdiaz | *
|
478 | 40435 | jjdelcerro | * @throws DataException
|
479 | */
|
||
480 | public EditableFeature createNewFeature(boolean defaultValues) |
||
481 | throws DataException;
|
||
482 | |||
483 | /**
|
||
484 | 42293 | jjdelcerro | * Creates a new feature of default {@link FeatureType}.
|
485 | * The new feature should be initialized with the values of the feature
|
||
486 | * passed as parameter.
|
||
487 | * Values are inicialiced by name from the feature specified. Error in
|
||
488 | * value assignement are ignoreds.
|
||
489 | *
|
||
490 | * @param defaultValues the values to initialize the new feature.
|
||
491 | * @return the new feature
|
||
492 | * @throws DataException
|
||
493 | */
|
||
494 | public EditableFeature createNewFeature(Feature defaultValues)
|
||
495 | throws DataException;
|
||
496 | |||
497 | /**
|
||
498 | 40435 | jjdelcerro | * Applies the validation rules associated to the given mode to the active
|
499 | * {@link FeatureSet}.
|
||
500 | 41818 | fdiaz | *
|
501 | 40435 | jjdelcerro | * @param mode
|
502 | * can be one of {MODE_QUERY, MODE_FULLEDIT, MODE_APPEND}
|
||
503 | 41818 | fdiaz | *
|
504 | 40435 | jjdelcerro | * @throws DataException
|
505 | */
|
||
506 | public void validateFeatures(int mode) throws DataException; |
||
507 | |||
508 | /**
|
||
509 | * Indicates whether this store supports append mode.
|
||
510 | 41818 | fdiaz | *
|
511 | 40435 | jjdelcerro | * @return
|
512 | * true if this store supports append mode.
|
||
513 | */
|
||
514 | public boolean isAppendModeSupported(); |
||
515 | |||
516 | /**
|
||
517 | * Initiates an editing group. This is typically used to group series of
|
||
518 | * store editing operations.
|
||
519 | 41818 | fdiaz | *
|
520 | 40435 | jjdelcerro | * @param description
|
521 | * Description of the editing group.
|
||
522 | 41818 | fdiaz | *
|
523 | 40435 | jjdelcerro | * @throws NeedEditingModeException
|
524 | */
|
||
525 | public void beginEditingGroup(String description) |
||
526 | throws NeedEditingModeException;
|
||
527 | |||
528 | /**
|
||
529 | * Finishes an editing group.
|
||
530 | 41818 | fdiaz | *
|
531 | 40435 | jjdelcerro | * @throws NeedEditingModeException
|
532 | */
|
||
533 | public void endEditingGroup() throws NeedEditingModeException; |
||
534 | |||
535 | /*
|
||
536 | * =============================================================
|
||
537 | 41818 | fdiaz | *
|
538 | 40435 | jjdelcerro | * Index related services
|
539 | */
|
||
540 | |||
541 | /**
|
||
542 | * Creates an index which will be applied to the features of the given type,
|
||
543 | * by using the data of the given attribute.
|
||
544 | 41818 | fdiaz | *
|
545 | 40435 | jjdelcerro | * @param featureType
|
546 | * The FeatureType to which the indexed attribute belongs.
|
||
547 | 41818 | fdiaz | *
|
548 | 40435 | jjdelcerro | * @param attributeName
|
549 | * The name of the attributed to be indexed
|
||
550 | 41818 | fdiaz | *
|
551 | 40435 | jjdelcerro | * @param indexName
|
552 | * The index name
|
||
553 | 41818 | fdiaz | *
|
554 | 40435 | jjdelcerro | * @return the resulting {@link FeatureIndex}
|
555 | 41818 | fdiaz | *
|
556 | *
|
||
557 | 40435 | jjdelcerro | * @throws FeatureIndexException
|
558 | * if there is an error creating the index
|
||
559 | */
|
||
560 | public FeatureIndex createIndex(FeatureType featureType,
|
||
561 | String attributeName, String indexName) throws DataException; |
||
562 | |||
563 | /**
|
||
564 | * Creates an index which will be applied to the features of the given type,
|
||
565 | * by using the data of the given attribute.
|
||
566 | 41818 | fdiaz | *
|
567 | 40435 | jjdelcerro | * @param indexTypeName
|
568 | * the type of the index to be created. That name is
|
||
569 | * related to one of the registered index providers
|
||
570 | * @param featureType
|
||
571 | * The FeatureType to which the indexed attribute belongs.
|
||
572 | 41818 | fdiaz | *
|
573 | 40435 | jjdelcerro | * @param attributeName
|
574 | * The name of the attributed to be indexed
|
||
575 | 41818 | fdiaz | *
|
576 | 40435 | jjdelcerro | * @param indexName
|
577 | * The index name
|
||
578 | 41818 | fdiaz | *
|
579 | 40435 | jjdelcerro | * @return the resulting {@link FeatureIndex}
|
580 | 41818 | fdiaz | *
|
581 | *
|
||
582 | 40435 | jjdelcerro | * @throws FeatureIndexException
|
583 | * if there is an error creating the index
|
||
584 | */
|
||
585 | public FeatureIndex createIndex(String indexTypeName, |
||
586 | FeatureType featureType, String attributeName, String indexName) |
||
587 | throws DataException;
|
||
588 | |||
589 | /**
|
||
590 | * Creates an index which will be applied to the features of the given type,
|
||
591 | * by using the data of the given attribute. This method will return without
|
||
592 | * waiting for the index to be filled, as that will be performed in
|
||
593 | * background. An optional {@link Observer} parameter is provided to be
|
||
594 | * notified ( {@link FeatureStoreNotification#INDEX_FILLING_SUCCESS} )
|
||
595 | * when the index has finished filling with data and is available to be
|
||
596 | * used.
|
||
597 | 41818 | fdiaz | *
|
598 | 40435 | jjdelcerro | * @param featureType
|
599 | * The FeatureType to which the indexed attribute belongs.
|
||
600 | 41818 | fdiaz | *
|
601 | 40435 | jjdelcerro | * @param attributeName
|
602 | * The name of the attributed to be indexed
|
||
603 | 41818 | fdiaz | *
|
604 | 40435 | jjdelcerro | * @param indexName
|
605 | * The index name
|
||
606 | 41818 | fdiaz | *
|
607 | 40435 | jjdelcerro | * @param observer
|
608 | * to notify to when the created index has finished filling
|
||
609 | * with data and is available to be used. The observer will
|
||
610 | * receive then a
|
||
611 | * {@link FeatureStoreNotification#INDEX_FILLING_SUCCESS}
|
||
612 | * notification, with the index object if it has finished
|
||
613 | * successfully, or a
|
||
614 | * {@link FeatureStoreNotification#INDEX_FILLING_ERROR}
|
||
615 | * notification with the exception object if there has been
|
||
616 | * any error in the process. Optional.
|
||
617 | 41818 | fdiaz | *
|
618 | 40435 | jjdelcerro | * @return the resulting {@link FeatureIndex}
|
619 | 41818 | fdiaz | *
|
620 | 40435 | jjdelcerro | * @see FeatureStoreNotification#INDEX_FILLING_STARTED
|
621 | * @see FeatureStoreNotification#INDEX_FILLING_SUCCESS
|
||
622 | * @see FeatureStoreNotification#INDEX_FILLING_CANCELLED
|
||
623 | * @see FeatureStoreNotification#INDEX_FILLING_ERROR
|
||
624 | 41818 | fdiaz | *
|
625 | 40435 | jjdelcerro | * @throws FeatureIndexException
|
626 | * if there is an error creating the index
|
||
627 | */
|
||
628 | public FeatureIndex createIndex(FeatureType featureType,
|
||
629 | String attributeName, String indexName, Observer observer) |
||
630 | throws DataException;
|
||
631 | |||
632 | /**
|
||
633 | * Creates an index which will be applied to the features of the given type,
|
||
634 | * by using the data of the given attribute. This method will return without
|
||
635 | * waiting for the index to be filled, as that will be performed in
|
||
636 | * background. An optional {@link Observer} parameter is provided to be
|
||
637 | * notified ( {@link FeatureStoreNotification#INDEX_FILLING_SUCCESS} )
|
||
638 | * when the index has finished filling with data and is available to be
|
||
639 | * used.
|
||
640 | 41818 | fdiaz | *
|
641 | 40435 | jjdelcerro | * @param indexTypeName
|
642 | * the type of the index to be created. That name is
|
||
643 | * related to one of the registered index providers
|
||
644 | * @param featureType
|
||
645 | * The FeatureType to which the indexed attribute belongs.
|
||
646 | 41818 | fdiaz | *
|
647 | 40435 | jjdelcerro | * @param attributeName
|
648 | * The name of the attributed to be indexed
|
||
649 | 41818 | fdiaz | *
|
650 | 40435 | jjdelcerro | * @param indexName
|
651 | * The index name
|
||
652 | 41818 | fdiaz | *
|
653 | 40435 | jjdelcerro | * @param observer
|
654 | * to notify to when the created index has finished filling
|
||
655 | * with data and is available to be used. The observer will
|
||
656 | * receive then a
|
||
657 | * {@link FeatureStoreNotification#INDEX_FILLING_SUCCESS}
|
||
658 | * notification, with the index object if it has finished
|
||
659 | * successfully, or a
|
||
660 | * {@link FeatureStoreNotification#INDEX_FILLING_ERROR}
|
||
661 | * notification with the exception object if there has been
|
||
662 | * any error in the process. Optional.
|
||
663 | 41818 | fdiaz | *
|
664 | 40435 | jjdelcerro | * @return the resulting {@link FeatureIndex}
|
665 | 41818 | fdiaz | *
|
666 | 40435 | jjdelcerro | * @see FeatureStoreNotification#INDEX_FILLING_STARTED
|
667 | * @see FeatureStoreNotification#INDEX_FILLING_SUCCESS
|
||
668 | * @see FeatureStoreNotification#INDEX_FILLING_CANCELLED
|
||
669 | * @see FeatureStoreNotification#INDEX_FILLING_ERROR
|
||
670 | 41818 | fdiaz | *
|
671 | 40435 | jjdelcerro | * @throws FeatureIndexException
|
672 | * if there is an error creating the index
|
||
673 | */
|
||
674 | public FeatureIndex createIndex(String indexTypeName, |
||
675 | FeatureType featureType, String attributeName, String indexName, |
||
676 | Observer observer) throws DataException; |
||
677 | |||
678 | /**
|
||
679 | * Returns a FeatureIndexes structure containing all available indexes in
|
||
680 | * the store.
|
||
681 | 41818 | fdiaz | *
|
682 | 40435 | jjdelcerro | * @return
|
683 | */
|
||
684 | public FeatureIndexes getIndexes();
|
||
685 | |||
686 | /*
|
||
687 | * =============================================================
|
||
688 | 41818 | fdiaz | *
|
689 | 40435 | jjdelcerro | * Selection related services
|
690 | */
|
||
691 | |||
692 | /**
|
||
693 | * Sets the selection to the passed {@link FeatureSet}
|
||
694 | 41818 | fdiaz | *
|
695 | 40435 | jjdelcerro | * @param selection
|
696 | * A {@link FeatureSet} with the requested selection
|
||
697 | */
|
||
698 | public void setSelection(FeatureSet selection) throws DataException; |
||
699 | |||
700 | /**
|
||
701 | * Creates a {@link FeatureSelection}
|
||
702 | 41818 | fdiaz | *
|
703 | 40435 | jjdelcerro | * @return
|
704 | * a {@link FeatureSelection}
|
||
705 | 41818 | fdiaz | *
|
706 | 40435 | jjdelcerro | * @throws DataException
|
707 | */
|
||
708 | public FeatureSelection createFeatureSelection() throws DataException; |
||
709 | |||
710 | /**
|
||
711 | * Returns the current {@link FeatureSelection}.
|
||
712 | * Create a empty selection if not exits.
|
||
713 | 41818 | fdiaz | *
|
714 | 40435 | jjdelcerro | * @return
|
715 | * current {@link FeatureSelection}.
|
||
716 | 41818 | fdiaz | *
|
717 | 40435 | jjdelcerro | * @throws DataException
|
718 | */
|
||
719 | public FeatureSelection getFeatureSelection() throws DataException; |
||
720 | |||
721 | /*
|
||
722 | * =============================================================
|
||
723 | 41818 | fdiaz | *
|
724 | 40435 | jjdelcerro | * Lock related services
|
725 | */
|
||
726 | |||
727 | /**
|
||
728 | * Indicates whether this store supports locks.
|
||
729 | 41818 | fdiaz | *
|
730 | 40435 | jjdelcerro | * @return
|
731 | * true if this store supports locks, false if not.
|
||
732 | */
|
||
733 | public boolean isLocksSupported(); |
||
734 | |||
735 | /**
|
||
736 | * Returns the set of locked features
|
||
737 | 41818 | fdiaz | *
|
738 | 40435 | jjdelcerro | * @return
|
739 | * set of locked features
|
||
740 | 41818 | fdiaz | *
|
741 | 40435 | jjdelcerro | * @throws DataException
|
742 | */
|
||
743 | public FeatureLocks getLocks() throws DataException; |
||
744 | |||
745 | /*
|
||
746 | * =============================================================
|
||
747 | * Transforms related services
|
||
748 | * =============================================================
|
||
749 | */
|
||
750 | |||
751 | /**
|
||
752 | * Returns this store transforms
|
||
753 | 41818 | fdiaz | *
|
754 | 40435 | jjdelcerro | * @return
|
755 | * this store transforms
|
||
756 | */
|
||
757 | public FeatureStoreTransforms getTransforms();
|
||
758 | |||
759 | /**
|
||
760 | * Returns a new {@link FeatureQuery} associated to this store.
|
||
761 | 41818 | fdiaz | *
|
762 | 40435 | jjdelcerro | * @return
|
763 | * a new {@link FeatureQuery} associated to this store.
|
||
764 | */
|
||
765 | public FeatureQuery createFeatureQuery();
|
||
766 | |||
767 | /**
|
||
768 | * Returns featue count of this store.
|
||
769 | 41818 | fdiaz | *
|
770 | 40435 | jjdelcerro | * @return
|
771 | * @throws DataException
|
||
772 | */
|
||
773 | public long getFeatureCount() throws DataException; |
||
774 | |||
775 | /**
|
||
776 | * Creates a vectorial cache that is used to save and retrieve data.
|
||
777 | 41818 | fdiaz | *
|
778 | 40435 | jjdelcerro | * @param name
|
779 | * the cache name.
|
||
780 | * @param parameters
|
||
781 | * parameters to create the stores used to save data.
|
||
782 | * @throws DataException
|
||
783 | */
|
||
784 | public void createCache(String name, DynObject parameters) |
||
785 | throws DataException;
|
||
786 | |||
787 | /**
|
||
788 | * @return the vectorial cache
|
||
789 | */
|
||
790 | public FeatureCache getCache();
|
||
791 | |||
792 | /**
|
||
793 | * Return if the provider knows the real envelope of a layer. If not,
|
||
794 | * the {@link FeatureStoreProvider#getEnvelope()} method doesn't return
|
||
795 | * the full envelope.
|
||
796 | 41818 | fdiaz | *
|
797 | 40435 | jjdelcerro | * @return
|
798 | * <true> if it knows the real envelope.
|
||
799 | */
|
||
800 | public boolean isKnownEnvelope(); |
||
801 | |||
802 | /**
|
||
803 | * Return if the maximum number of features provided by the
|
||
804 | * provider are limited.
|
||
805 | 41818 | fdiaz | *
|
806 | 40435 | jjdelcerro | * @return
|
807 | * <true> if there is a limit of features.
|
||
808 | */
|
||
809 | public boolean hasRetrievedFeaturesLimit(); |
||
810 | |||
811 | /**
|
||
812 | * If the {@link FeatureStoreProvider#hasRetrievedFeaturesLimit()} returns
|
||
813 | * true,
|
||
814 | * it returns the limit of features retrieved from the provider.
|
||
815 | 41818 | fdiaz | *
|
816 | 40435 | jjdelcerro | * @return
|
817 | * The limit of the retrieved features.
|
||
818 | */
|
||
819 | public int getRetrievedFeaturesLimit(); |
||
820 | 41818 | fdiaz | |
821 | /**
|
||
822 | * Return the associated feature to the dynobject.
|
||
823 | * If the dynobject isn't associated to a feature of this store, return null.
|
||
824 | *
|
||
825 | * @param dynobject
|
||
826 | * @return
|
||
827 | */
|
||
828 | public Feature getFeature(DynObject dynobject);
|
||
829 | 42293 | jjdelcerro | |
830 | public Iterator iterator(); |
||
831 | 40435 | jjdelcerro | } |