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 @ 42293

History | View | Annotate | Download (26.5 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
     * Returns the feature given its reference.
260
     *
261
     * @param reference
262
     *            a unique FeatureReference
263
     * @return
264
     *         The Feature
265
     *
266
     * @throws DataException
267
     *
268
     */
269
    public Feature getFeatureByReference(FeatureReference reference)
270
        throws DataException;
271

    
272
    /**
273
     * Returns the feature given its reference and feature type.
274
     *
275
     * @param reference
276
     *            a unique FeatureReference
277
     *
278
     * @param featureType
279
     *            FeatureType to which the requested Feature belongs
280
     *
281
     * @return
282
     *         The Feature
283
     *
284
     * @throws DataException
285
     *
286
     */
287
    public Feature getFeatureByReference(FeatureReference reference,
288
        FeatureType featureType) throws DataException;
289

    
290
    /*
291
     * =============================================================
292
     *
293
     * 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
     *
304
     * @param mode
305
     *
306
     * @throws DataException
307
     */
308
    public void edit(int mode) throws DataException;
309

    
310
    /**
311
     * Cancels all editing since the last edit().
312
     *
313
     * @throws DataException
314
     */
315
    public void cancelEditing() throws DataException;
316

    
317
    /**
318
     * Exits editing state.
319
     *
320
     * @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
     *
340
     * @return true if can call commitChanges
341
     * @throws DataException
342
     */
343
    public boolean canCommitChanges() throws DataException;
344

    
345

    
346
    /**
347
     * Indicates whether this store is in editing state.
348
     *
349
     * @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
     *
358
     * @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
     *
366
     * Any {@link FeatureSet} from this store that are used will be invalidated.
367
     *
368
     * @param featureType
369
     *            an {@link EditableFeatureType} with the changes.
370
     *
371
     * @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
     *
379
     * 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
     *
383
     * @param feature
384
     *            the feature to be updated
385
     *
386
     * @throws DataException
387
     */
388
    public void update(EditableFeature feature) throws DataException;
389

    
390
    /**
391
     * Deletes a {@link Feature} from the store.<br>
392
     *
393
     * 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
     *
397
     * @param feature
398
     *            The feature to be deleted.
399
     *
400
     * @throws DataException
401
     */
402
    public void delete(Feature feature) throws DataException;
403

    
404
    /**
405
     * Inserts a {@link Feature} in the store.<br>
406
     *
407
     * 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
     *
411
     * @param feature
412
     *            The feature to be inserted
413
     *
414
     * @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
     *
422
     * @return a new feature in editable state
423
     *
424
     * @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
     *
432
     * @param type
433
     *            the new feature's feature type
434
     *
435
     * @param defaultValues
436
     *            a feature whose values are used as default values for the new
437
     *            feature.
438
     *
439
     * @return the new feature.
440
     *
441
     * @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
     *
451
     * @param type
452
     *            the new feature's feature type
453
     *
454
     * @param defaultValues
455
     *            if true the new feature is initialized with each attribute's
456
     *            default value.
457
     *
458
     * @return
459
     *         the new feature
460
     *
461
     * @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
     *
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(boolean defaultValues)
481
        throws DataException;
482

    
483
    /**
484
     * 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
     * Applies the validation rules associated to the given mode to the active
499
     * {@link FeatureSet}.
500
     *
501
     * @param mode
502
     *            can be one of {MODE_QUERY, MODE_FULLEDIT, MODE_APPEND}
503
     *
504
     * @throws DataException
505
     */
506
    public void validateFeatures(int mode) throws DataException;
507

    
508
    /**
509
     * Indicates whether this store supports append mode.
510
     *
511
     * @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
     *
520
     * @param description
521
     *            Description of the editing group.
522
     *
523
     * @throws NeedEditingModeException
524
     */
525
    public void beginEditingGroup(String description)
526
        throws NeedEditingModeException;
527

    
528
    /**
529
     * Finishes an editing group.
530
     *
531
     * @throws NeedEditingModeException
532
     */
533
    public void endEditingGroup() throws NeedEditingModeException;
534

    
535
    /*
536
     * =============================================================
537
     *
538
     * 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
     *
545
     * @param featureType
546
     *            The FeatureType to which the indexed attribute belongs.
547
     *
548
     * @param attributeName
549
     *            The name of the attributed to be indexed
550
     *
551
     * @param indexName
552
     *            The index name
553
     *
554
     * @return the resulting {@link FeatureIndex}
555
     *
556
     *
557
     * @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
     *
567
     * @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
     *
573
     * @param attributeName
574
     *            The name of the attributed to be indexed
575
     *
576
     * @param indexName
577
     *            The index name
578
     *
579
     * @return the resulting {@link FeatureIndex}
580
     *
581
     *
582
     * @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
     *
598
     * @param featureType
599
     *            The FeatureType to which the indexed attribute belongs.
600
     *
601
     * @param attributeName
602
     *            The name of the attributed to be indexed
603
     *
604
     * @param indexName
605
     *            The index name
606
     *
607
     * @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
     *
618
     * @return the resulting {@link FeatureIndex}
619
     *
620
     * @see FeatureStoreNotification#INDEX_FILLING_STARTED
621
     * @see FeatureStoreNotification#INDEX_FILLING_SUCCESS
622
     * @see FeatureStoreNotification#INDEX_FILLING_CANCELLED
623
     * @see FeatureStoreNotification#INDEX_FILLING_ERROR
624
     *
625
     * @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
     *
641
     * @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
     *
647
     * @param attributeName
648
     *            The name of the attributed to be indexed
649
     *
650
     * @param indexName
651
     *            The index name
652
     *
653
     * @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
     *
664
     * @return the resulting {@link FeatureIndex}
665
     *
666
     * @see FeatureStoreNotification#INDEX_FILLING_STARTED
667
     * @see FeatureStoreNotification#INDEX_FILLING_SUCCESS
668
     * @see FeatureStoreNotification#INDEX_FILLING_CANCELLED
669
     * @see FeatureStoreNotification#INDEX_FILLING_ERROR
670
     *
671
     * @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
     *
682
     * @return
683
     */
684
    public FeatureIndexes getIndexes();
685

    
686
    /*
687
     * =============================================================
688
     *
689
     * Selection related services
690
     */
691

    
692
    /**
693
     * Sets the selection to the passed {@link FeatureSet}
694
     *
695
     * @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
     *
703
     * @return
704
     *         a {@link FeatureSelection}
705
     *
706
     * @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
     *
714
     * @return
715
     *         current {@link FeatureSelection}.
716
     *
717
     * @throws DataException
718
     */
719
    public FeatureSelection getFeatureSelection() throws DataException;
720

    
721
    /*
722
     * =============================================================
723
     *
724
     * Lock related services
725
     */
726

    
727
    /**
728
     * Indicates whether this store supports locks.
729
     *
730
     * @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
     *
738
     * @return
739
     *         set of locked features
740
     *
741
     * @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
     *
754
     * @return
755
     *         this store transforms
756
     */
757
    public FeatureStoreTransforms getTransforms();
758

    
759
    /**
760
     * Returns a new {@link FeatureQuery} associated to this store.
761
     *
762
     * @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
     *
770
     * @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
     *
778
     * @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
     *
797
     * @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
     *
806
     * @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
     *
816
     * @return
817
     *         The limit of the retrieved features.
818
     */
819
    public int getRetrievedFeaturesLimit();
820

    
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
    
830
    public Iterator iterator();
831
}