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