Statistics
| Revision:

svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.compat.cdc / org.gvsig.fmap.dal / org.gvsig.fmap.dal.api / src / main / java / org / gvsig / fmap / dal / feature / FeatureStore.java @ 42925

History | View | Annotate | Download (26.9 KB)

1
/**
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.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
 *
53
 * <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
 *
72
 */
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
     *
89
     * information related services
90
     */
91

    
92
    /**
93
     * Indicates whether this store allows writing.
94
     *
95
     * @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
     *
103
     * @return
104
     *         this store's default {@link FeatureType}.
105
     *
106
     * @throws DataException
107
     */
108
    public FeatureType getDefaultFeatureType() throws DataException;
109

    
110
    /**
111
     * Returns this store's featureType {@link FeatureType} matches with
112
     * featureTypeId.
113
     *
114
     * @param featureTypeId
115
     *
116
     * @return this store's default {@link FeatureType}.
117
     *
118
     * @throws DataException
119
     */
120
    public FeatureType getFeatureType(String featureTypeId)
121
        throws DataException;
122

    
123
    /**
124
     * Returns this store's {@link FeatureType}(s).
125
     *
126
     * @return a list with this store's {@link FeatureType}(s).
127
     *
128
     * @throws DataException
129
     */
130
    public List getFeatureTypes() throws DataException;
131

    
132
    /**
133
     * Returns this store's parameters.
134
     *
135
     * @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
     *
149
     * @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
     *
156
     * @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
     *
165
     * @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
     *
171
     * @throws DataException
172
     *
173
     * @Deprecated this method is unstable
174
     */
175
    public void export(DataServerExplorer explorer, String provider,
176
        NewFeatureStoreParameters params) throws DataException;
177

    
178
    /*
179
     * =============================================================
180
     *
181
     * Query related services
182
     */
183

    
184
    /**
185
     * Returns all available features in the store.
186
     * <p>
187
     * <em>
188
     * <strong>NOTE:</strong> if you use this method to get a
189
     * {@link FeatureSet}, you  must get sure it is disposed
190
     * (@see {@link DisposableIterator#dispose()}) in any case, even if an
191
     * error occurs while getting the data. It is recommended to use the
192
     * <code>accept</code> methods instead, which handle everything for you.
193
     * Take into account the accept methods may use a fast iterator to
194
     * get the features.
195
     * </em>
196
     * </p>
197
     *
198
     * @see #accept(org.gvsig.tools.visitor.Visitor)
199
     *
200
     * @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
     * <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
     * get the features.
218
     * </em>
219
     * </p>
220
     *
221
     * @see #accept(org.gvsig.tools.visitor.Visitor,
222
     *      org.gvsig.fmap.dal.DataQuery)
223
     *
224
     * @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
     *
237
     * @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
     *
251
     * @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
     * Return a paginated list of Features filtered by the query.
260
     * 
261
     * The returned List of Features is paginated, and the page size
262
     * used is "pageSize".
263
     * 
264
     * @param query to filter the returned feature list
265
     * @param pageSize the page size of the list
266
     * @return the list of features
267
     */
268
    public List<Feature> getFeatures(FeatureQuery query, int pageSize);
269
    
270
    /**
271
     * Returns the feature given its reference.
272
     *
273
     * @param reference
274
     *            a unique FeatureReference
275
     * @return
276
     *         The Feature
277
     *
278
     * @throws DataException
279
     *
280
     */
281
    public Feature getFeatureByReference(FeatureReference reference)
282
        throws DataException;
283

    
284
    /**
285
     * Returns the feature given its reference and feature type.
286
     *
287
     * @param reference
288
     *            a unique FeatureReference
289
     *
290
     * @param featureType
291
     *            FeatureType to which the requested Feature belongs
292
     *
293
     * @return
294
     *         The Feature
295
     *
296
     * @throws DataException
297
     *
298
     */
299
    public Feature getFeatureByReference(FeatureReference reference,
300
        FeatureType featureType) throws DataException;
301

    
302
    /*
303
     * =============================================================
304
     *
305
     * Editing related services
306
     */
307

    
308
    /**
309
     * Enters editing state.
310
     */
311
    public void edit() throws DataException;
312

    
313
    /**
314
     * Enters editing state specifying the editing mode.
315
     *
316
     * @param mode
317
     *
318
     * @throws DataException
319
     */
320
    public void edit(int mode) throws DataException;
321

    
322
    /**
323
     * Cancels all editing since the last edit().
324
     *
325
     * @throws DataException
326
     */
327
    public void cancelEditing() throws DataException;
328

    
329
    /**
330
     * Exits editing state.
331
     *
332
     * @throws DataException
333
     */
334
    public void finishEditing() throws DataException;
335

    
336
    /**
337
     * Save changes in the provider without leaving the edit mode.
338
     * Do not call observers to communicate a change of ediding mode.
339
     * The operation's history is eliminated to prevent inconsistencies
340
     * in the data.
341
     *
342
     * @throws DataException
343
     */
344
    public void commitChanges() throws DataException ;
345

    
346
    /**
347
     *
348
     * Returns true if you can call CommitChanges method.
349
     * If not in editing or changes have been made in the structure
350
     * return false.
351
     *
352
     * @return true if can call commitChanges
353
     * @throws DataException
354
     */
355
    public boolean canCommitChanges() throws DataException;
356

    
357

    
358
    /**
359
     * Indicates whether this store is in editing state.
360
     *
361
     * @return
362
     *         true if this store is in editing state, false if not.
363
     */
364
    public boolean isEditing();
365

    
366
    /**
367
     * Indicates whether this store is in appending state. In this state the new
368
     * features are automatically inserted at the end of the {@link FeatureSet}.
369
     *
370
     * @return true if this store is in appending state.
371
     */
372
    public boolean isAppending();
373

    
374
    /**
375
     * Updates a {@link FeatureType} in the store with the changes in the
376
     * {@link EditableFeatureType}.<br>
377
     *
378
     * Any {@link FeatureSet} from this store that are used will be invalidated.
379
     *
380
     * @param featureType
381
     *            an {@link EditableFeatureType} with the changes.
382
     *
383
     * @throws DataException
384
     */
385
    public void update(EditableFeatureType featureType) throws DataException;
386

    
387
    /**
388
     * Updates a {@link Feature} in the store with the changes in the
389
     * {@link EditableFeature}.<br>
390
     *
391
     * Any {@link FeatureSet} from this store that was still in use will be
392
     * invalidated. You can override this using
393
     * {@link FeatureSet#update(EditableFeature)}.
394
     *
395
     * @param feature
396
     *            the feature to be updated
397
     *
398
     * @throws DataException
399
     */
400
    public void update(EditableFeature feature) throws DataException;
401

    
402
    /**
403
     * Deletes a {@link Feature} from the store.<br>
404
     *
405
     * Any {@link FeatureSet} from this store that was still in use will be
406
     * invalidated. You can override this using {@link Iterator#remove()} from
407
     * {@link FeatureSet}.
408
     *
409
     * @param feature
410
     *            The feature to be deleted.
411
     *
412
     * @throws DataException
413
     */
414
    public void delete(Feature feature) throws DataException;
415

    
416
    /**
417
     * Inserts a {@link Feature} in the store.<br>
418
     *
419
     * Any {@link FeatureSet} from this store that was still in use will be
420
     * invalidated. You can override this using
421
     * {@link FeatureSet#insert(EditableFeature)}.
422
     *
423
     * @param feature
424
     *            The feature to be inserted
425
     *
426
     * @throws DataException
427
     */
428
    public void insert(EditableFeature feature) throws DataException;
429

    
430
    /**
431
     * Creates a new feature using the default feature type and returns it as an
432
     * {@link EditableFeature}
433
     *
434
     * @return a new feature in editable state
435
     *
436
     * @throws DataException
437
     */
438
    public EditableFeature createNewFeature() throws DataException;
439

    
440
    /**
441
     * Creates a new feature of the given {@link FeatureType} and uses the given
442
     * {@link Feature} as default values to initialize it.
443
     *
444
     * @param type
445
     *            the new feature's feature type
446
     *
447
     * @param defaultValues
448
     *            a feature whose values are used as default values for the new
449
     *            feature.
450
     *
451
     * @return the new feature.
452
     *
453
     * @throws DataException
454
     */
455
    public EditableFeature createNewFeature(FeatureType type,
456
        Feature defaultValues) throws DataException;
457

    
458
    /**
459
     * Creates a new feature of the given {@link FeatureType}. The flag
460
     * defaultValues is used to indicate whether the new feature should be
461
     * initialized with default values or not.
462
     *
463
     * @param type
464
     *            the new feature's feature type
465
     *
466
     * @param defaultValues
467
     *            if true the new feature is initialized with each attribute's
468
     *            default value.
469
     *
470
     * @return
471
     *         the new feature
472
     *
473
     * @throws DataException
474
     */
475
    public EditableFeature createNewFeature(FeatureType type,
476
        boolean defaultValues) throws DataException;
477

    
478
    /**
479
     * Creates a new feature of default {@link FeatureType}. The flag
480
     * defaultValues is used to indicate whether the new feature should be
481
     * initialized with default values or not.
482
     *
483
     * @param defaultValues
484
     *            if true the new feature is initialized with each attribute's
485
     *            default value.
486
     *
487
     * @return
488
     *         the new feature
489
     *
490
     * @throws DataException
491
     */
492
    public EditableFeature createNewFeature(boolean defaultValues)
493
        throws DataException;
494

    
495
    /**
496
     * Creates a new feature of default {@link FeatureType}. 
497
     * The new feature should be initialized with the values of the feature 
498
     * passed as parameter.
499
     * Values are inicialiced by name from the feature specified. Error in
500
     * value assignement are ignoreds.
501
     * 
502
     * @param defaultValues the values to initialize the new feature.
503
     * @return the new feature
504
     * @throws DataException 
505
     */
506
    public EditableFeature createNewFeature(Feature defaultValues)
507
        throws DataException;
508

    
509
    /**
510
     * Applies the validation rules associated to the given mode to the active
511
     * {@link FeatureSet}.
512
     *
513
     * @param mode
514
     *            can be one of {MODE_QUERY, MODE_FULLEDIT, MODE_APPEND}
515
     *
516
     * @throws DataException
517
     */
518
    public void validateFeatures(int mode) throws DataException;
519

    
520
    /**
521
     * Indicates whether this store supports append mode.
522
     *
523
     * @return
524
     *         true if this store supports append mode.
525
     */
526
    public boolean isAppendModeSupported();
527

    
528
    /**
529
     * Initiates an editing group. This is typically used to group series of
530
     * store editing operations.
531
     *
532
     * @param description
533
     *            Description of the editing group.
534
     *
535
     * @throws NeedEditingModeException
536
     */
537
    public void beginEditingGroup(String description)
538
        throws NeedEditingModeException;
539

    
540
    /**
541
     * Finishes an editing group.
542
     *
543
     * @throws NeedEditingModeException
544
     */
545
    public void endEditingGroup() throws NeedEditingModeException;
546

    
547
    /*
548
     * =============================================================
549
     *
550
     * Index related services
551
     */
552

    
553
    /**
554
     * Creates an index which will be applied to the features of the given type,
555
     * by using the data of the given attribute.
556
     *
557
     * @param featureType
558
     *            The FeatureType to which the indexed attribute belongs.
559
     *
560
     * @param attributeName
561
     *            The name of the attributed to be indexed
562
     *
563
     * @param indexName
564
     *            The index name
565
     *
566
     * @return the resulting {@link FeatureIndex}
567
     *
568
     *
569
     * @throws FeatureIndexException
570
     *             if there is an error creating the index
571
     */
572
    public FeatureIndex createIndex(FeatureType featureType,
573
        String attributeName, String indexName) throws DataException;
574

    
575
    /**
576
     * Creates an index which will be applied to the features of the given type,
577
     * by using the data of the given attribute.
578
     *
579
     * @param indexTypeName
580
     *            the type of the index to be created. That name is
581
     *            related to one of the registered index providers
582
     * @param featureType
583
     *            The FeatureType to which the indexed attribute belongs.
584
     *
585
     * @param attributeName
586
     *            The name of the attributed to be indexed
587
     *
588
     * @param indexName
589
     *            The index name
590
     *
591
     * @return the resulting {@link FeatureIndex}
592
     *
593
     *
594
     * @throws FeatureIndexException
595
     *             if there is an error creating the index
596
     */
597
    public FeatureIndex createIndex(String indexTypeName,
598
        FeatureType featureType, String attributeName, String indexName)
599
        throws DataException;
600

    
601
    /**
602
     * Creates an index which will be applied to the features of the given type,
603
     * by using the data of the given attribute. This method will return without
604
     * waiting for the index to be filled, as that will be performed in
605
     * background. An optional {@link Observer} parameter is provided to be
606
     * notified ( {@link FeatureStoreNotification#INDEX_FILLING_SUCCESS} )
607
     * when the index has finished filling with data and is available to be
608
     * used.
609
     *
610
     * @param featureType
611
     *            The FeatureType to which the indexed attribute belongs.
612
     *
613
     * @param attributeName
614
     *            The name of the attributed to be indexed
615
     *
616
     * @param indexName
617
     *            The index name
618
     *
619
     * @param observer
620
     *            to notify to when the created index has finished filling
621
     *            with data and is available to be used. The observer will
622
     *            receive then a
623
     *            {@link FeatureStoreNotification#INDEX_FILLING_SUCCESS}
624
     *            notification, with the index object if it has finished
625
     *            successfully, or a
626
     *            {@link FeatureStoreNotification#INDEX_FILLING_ERROR}
627
     *            notification with the exception object if there has been
628
     *            any error in the process. Optional.
629
     *
630
     * @return the resulting {@link FeatureIndex}
631
     *
632
     * @see FeatureStoreNotification#INDEX_FILLING_STARTED
633
     * @see FeatureStoreNotification#INDEX_FILLING_SUCCESS
634
     * @see FeatureStoreNotification#INDEX_FILLING_CANCELLED
635
     * @see FeatureStoreNotification#INDEX_FILLING_ERROR
636
     *
637
     * @throws FeatureIndexException
638
     *             if there is an error creating the index
639
     */
640
    public FeatureIndex createIndex(FeatureType featureType,
641
        String attributeName, String indexName, Observer observer)
642
        throws DataException;
643

    
644
    /**
645
     * Creates an index which will be applied to the features of the given type,
646
     * by using the data of the given attribute. This method will return without
647
     * waiting for the index to be filled, as that will be performed in
648
     * background. An optional {@link Observer} parameter is provided to be
649
     * notified ( {@link FeatureStoreNotification#INDEX_FILLING_SUCCESS} )
650
     * when the index has finished filling with data and is available to be
651
     * used.
652
     *
653
     * @param indexTypeName
654
     *            the type of the index to be created. That name is
655
     *            related to one of the registered index providers
656
     * @param featureType
657
     *            The FeatureType to which the indexed attribute belongs.
658
     *
659
     * @param attributeName
660
     *            The name of the attributed to be indexed
661
     *
662
     * @param indexName
663
     *            The index name
664
     *
665
     * @param observer
666
     *            to notify to when the created index has finished filling
667
     *            with data and is available to be used. The observer will
668
     *            receive then a
669
     *            {@link FeatureStoreNotification#INDEX_FILLING_SUCCESS}
670
     *            notification, with the index object if it has finished
671
     *            successfully, or a
672
     *            {@link FeatureStoreNotification#INDEX_FILLING_ERROR}
673
     *            notification with the exception object if there has been
674
     *            any error in the process. Optional.
675
     *
676
     * @return the resulting {@link FeatureIndex}
677
     *
678
     * @see FeatureStoreNotification#INDEX_FILLING_STARTED
679
     * @see FeatureStoreNotification#INDEX_FILLING_SUCCESS
680
     * @see FeatureStoreNotification#INDEX_FILLING_CANCELLED
681
     * @see FeatureStoreNotification#INDEX_FILLING_ERROR
682
     *
683
     * @throws FeatureIndexException
684
     *             if there is an error creating the index
685
     */
686
    public FeatureIndex createIndex(String indexTypeName,
687
        FeatureType featureType, String attributeName, String indexName,
688
        Observer observer) throws DataException;
689

    
690
    /**
691
     * Returns a FeatureIndexes structure containing all available indexes in
692
     * the store.
693
     *
694
     * @return
695
     */
696
    public FeatureIndexes getIndexes();
697

    
698
    /*
699
     * =============================================================
700
     *
701
     * Selection related services
702
     */
703

    
704
    /**
705
     * Sets the selection to the passed {@link FeatureSet}
706
     *
707
     * @param selection
708
     *            A {@link FeatureSet} with the requested selection
709
     */
710
    public void setSelection(FeatureSet selection) throws DataException;
711

    
712
    /**
713
     * Creates a {@link FeatureSelection}
714
     *
715
     * @return
716
     *         a {@link FeatureSelection}
717
     *
718
     * @throws DataException
719
     */
720
    public FeatureSelection createFeatureSelection() throws DataException;
721

    
722
    /**
723
     * Returns the current {@link FeatureSelection}.
724
     * Create a empty selection if not exits.
725
     *
726
     * @return
727
     *         current {@link FeatureSelection}.
728
     *
729
     * @throws DataException
730
     */
731
    public FeatureSelection getFeatureSelection() throws DataException;
732

    
733
    /*
734
     * =============================================================
735
     *
736
     * Lock related services
737
     */
738

    
739
    /**
740
     * Indicates whether this store supports locks.
741
     *
742
     * @return
743
     *         true if this store supports locks, false if not.
744
     */
745
    public boolean isLocksSupported();
746

    
747
    /**
748
     * Returns the set of locked features
749
     *
750
     * @return
751
     *         set of locked features
752
     *
753
     * @throws DataException
754
     */
755
    public FeatureLocks getLocks() throws DataException;
756

    
757
    /*
758
     * =============================================================
759
     * Transforms related services
760
     * =============================================================
761
     */
762

    
763
    /**
764
     * Returns this store transforms
765
     *
766
     * @return
767
     *         this store transforms
768
     */
769
    public FeatureStoreTransforms getTransforms();
770

    
771
    /**
772
     * Returns a new {@link FeatureQuery} associated to this store.
773
     *
774
     * @return
775
     *         a new {@link FeatureQuery} associated to this store.
776
     */
777
    public FeatureQuery createFeatureQuery();
778

    
779
    /**
780
     * Returns featue count of this store.
781
     *
782
     * @return
783
     * @throws DataException
784
     */
785
    public long getFeatureCount() throws DataException;
786

    
787
    /**
788
     * Creates a vectorial cache that is used to save and retrieve data.
789
     *
790
     * @param name
791
     *            the cache name.
792
     * @param parameters
793
     *            parameters to create the stores used to save data.
794
     * @throws DataException
795
     */
796
    public void createCache(String name, DynObject parameters)
797
        throws DataException;
798

    
799
    /**
800
     * @return the vectorial cache
801
     */
802
    public FeatureCache getCache();
803

    
804
    /**
805
     * Return if the provider knows the real envelope of a layer. If not,
806
     * the {@link FeatureStoreProvider#getEnvelope()} method doesn't return
807
     * the full envelope.
808
     *
809
     * @return
810
     *         <true> if it knows the real envelope.
811
     */
812
    public boolean isKnownEnvelope();
813

    
814
    /**
815
     * Return if the maximum number of features provided by the
816
     * provider are limited.
817
     *
818
     * @return
819
     *         <true> if there is a limit of features.
820
     */
821
    public boolean hasRetrievedFeaturesLimit();
822

    
823
    /**
824
     * If the {@link FeatureStoreProvider#hasRetrievedFeaturesLimit()} returns
825
     * true,
826
     * it returns the limit of features retrieved from the provider.
827
     *
828
     * @return
829
     *         The limit of the retrieved features.
830
     */
831
    public int getRetrievedFeaturesLimit();
832

    
833
    /**
834
     * Return the associated feature to the dynobject.
835
     * If the dynobject isn't associated to a feature of this store, return null.
836
     *
837
     * @param dynobject
838
     * @return
839
     */
840
    public Feature getFeature(DynObject dynobject);
841
    
842
    public Iterator iterator();
843
}