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