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

History | View | Annotate | Download (27.8 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.SpatialIndex;
43
import org.gvsig.fmap.geom.primitive.Envelope;
44
import org.gvsig.tools.dispose.DisposableIterator;
45
import org.gvsig.tools.dynobject.DynObject;
46
import org.gvsig.tools.lang.Cloneable;
47
import org.gvsig.tools.observer.Observer;
48
import org.gvsig.tools.undo.UndoRedoStack;
49

    
50
/**
51
 * <p>
52
 * A FeatureStore is a type of store whose data consists on sets of
53
 * {@link Feature}(s). {@link Feature}(s) from the same FeatureStore can be of
54
 * different {@link FeatureType}(s) (as in GML format for instance).
55
 * </p>
56
 *
57
 * <p>
58
 * FeatureStore allows:
59
 * </p>
60
 * <ul>
61
 * <li>Obtaining the default {@link FeatureType}. A FeatureStore always has one
62
 * and only one default FeatureType.
63
 * <li>Obtaining the list of {@link FeatureType}(s) defined in the FeatureStore.
64
 * <li>Obtaining, filtering and sorting subsets of data ({@link FeatureSet})
65
 * through {@link FeatureQuery}, as well as background loading.
66
 * <li>Obtaining the total {@link Envelope} (AKA bounding box or extent) of the
67
 * store.
68
 * <li>Support for editing {@link FeatureType}(s).
69
 * <li>Obtaining information about contained {@link Geometry} types.
70
 * <li>Exporting to another store.
71
 * <li>Indexing.
72
 * <li>Selection.
73
 * <li>Locks management.
74
 * </ul>
75
 *
76
 */
77
public interface FeatureStore extends DataStore, UndoRedoStack, Cloneable {
78

    
79
    public static final String METADATA_DEFINITION_NAME = "FeatureStore";
80

    
81
    /** Indicates that this store is in query mode */
82
    final static int MODE_QUERY = 0;
83

    
84
    /** Indicates that this store is in full edit mode */
85
    final static int MODE_FULLEDIT = 1;
86

    
87
    /** Indicates that this store is in append mode */
88
    final static int MODE_APPEND = 2;
89

    
90
    /*
91
     * =============================================================
92
     *
93
     * information related services
94
     */
95

    
96
    /**
97
     * Indicates whether this store allows writing.
98
     *
99
     * @return
100
     *         true if this store can be written, false if not.
101
     */
102
    public boolean allowWrite();
103

    
104
    /**
105
     * Returns this store's default {@link FeatureType}.
106
     *
107
     * @return
108
     *         this store's default {@link FeatureType}.
109
     *
110
     * @throws DataException
111
     */
112
    public FeatureType getDefaultFeatureType() throws DataException;
113

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

    
127
    /**
128
     * Returns this store's {@link FeatureType}(s).
129
     *
130
     * @return a list with this store's {@link FeatureType}(s).
131
     *
132
     * @throws DataException
133
     */
134
    public List getFeatureTypes() throws DataException;
135

    
136
    /**
137
     * Returns this store's parameters.
138
     *
139
     * @return
140
     *         {@link DataStoreParameters} containing this store's parameters
141
     */
142
    public DataStoreParameters getParameters();
143

    
144
    /**
145
     *@throws DataException
146
     * @deprecated Mirar de cambiarlo a metadatos
147
     */
148
    public boolean canWriteGeometry(int gvSIGgeometryType) throws DataException;
149

    
150
    /**
151
     * Returns this store's total envelope (extent).
152
     *
153
     * @return this store's total envelope (extent) or <code>null</code> if
154
     *         store not have geometry information
155
     */
156
    public Envelope getEnvelope() throws DataException;
157

    
158
    /**
159
     *
160
     * @deprecated use getDefaultFeatureType().getDefaultSRS()
161
     * @return
162
     * @throws DataException
163
     */
164
    public IProjection getSRSDefaultGeometry() throws DataException;
165

    
166
    /**
167
     * Exports this store to another store.
168
     *
169
     * @param explorer
170
     *            {@link DataServerExplorer} target
171
     * @param params
172
     *            New parameters of this store that will be used on the target
173
     *            explorer
174
     *
175
     * @throws DataException
176
     *
177
     * @Deprecated this method is unstable
178
     */
179
    public void export(DataServerExplorer explorer, String provider,
180
        NewFeatureStoreParameters params) throws DataException;
181

    
182
    /*
183
     * =============================================================
184
     *
185
     * Query related services
186
     */
187

    
188
    /**
189
     * Returns all available features in the store.
190
     * <p>
191
     * <em>
192
     * <strong>NOTE:</strong> if you use this method to get a
193
     * {@link FeatureSet}, you  must get sure it is disposed
194
     * (@see {@link DisposableIterator#dispose()}) in any case, even if an
195
     * error occurs while getting the data. It is recommended to use the
196
     * <code>accept</code> methods instead, which handle everything for you.
197
     * Take into account the accept methods may use a fast iterator to
198
     * get the features.
199
     * </em>
200
     * </p>
201
     *
202
     * @see #accept(org.gvsig.tools.visitor.Visitor)
203
     *
204
     * @return a collection of features
205
     * @throws ReadException
206
     *             if there is any error while reading the features
207
     */
208
    FeatureSet getFeatureSet() throws DataException;
209

    
210
    /**
211
     * Returns a subset of features taking into account the properties and
212
     * restrictions of the FeatureQuery.
213
     * <p>
214
     * <em>
215
     * <strong>NOTE:</strong> if you use this method to get a
216
     * {@link FeatureSet}, you  must get sure it is disposed
217
     * (@see {@link DisposableIterator#dispose()}) in any case, even if an
218
     * error occurs while getting the data. It is recommended to use the
219
     * <code>accept</code> methods instead, which handle everything for you.
220
     * Take into account the accept methods may use a fast iterator to
221
     * get the features.
222
     * </em>
223
     * </p>
224
     *
225
     * @see #accept(org.gvsig.tools.visitor.Visitor,
226
     *      org.gvsig.fmap.dal.DataQuery)
227
     *
228
     * @param featureQuery
229
     *            defines the characteristics of the features to return
230
     * @return a collection of features
231
     * @throws ReadException
232
     *             if there is any error while reading the features
233
     */
234
    FeatureSet getFeatureSet(FeatureQuery featureQuery) throws DataException;
235

    
236
    /**
237
     * Loads a subset of features taking into account the properties and
238
     * restrictions of the FeatureQuery. Feature loading is performed by calling
239
     * the Observer, once each loaded Feature.
240
     *
241
     * @param featureQuery
242
     *            defines the characteristics of the features to return
243
     * @param observer
244
     *            to be notified of each loaded Feature
245
     * @throws DataException
246
     *             if there is any error while loading the features
247
     */
248
    void getFeatureSet(FeatureQuery featureQuery, Observer observer)
249
        throws DataException;
250

    
251
    /**
252
     * Loads all available feature in the store. The loading of Features is
253
     * performed by calling the Observer, once each loaded Feature.
254
     *
255
     * @param observer
256
     *            to be notified of each loaded Feature
257
     * @throws DataException
258
     *             if there is any error while loading the features
259
     */
260
    void getFeatureSet(Observer observer) throws DataException;
261

    
262
    /**
263
     * Return a paginated list of Features filtered by the query.
264
     *
265
     * The returned List of Features is paginated, and the page size
266
     * used is "pageSize".
267
     *
268
     * @param query to filter the returned feature list
269
     * @param pageSize the page size of the list
270
     * @return the list of features
271
     */
272
    public List<Feature> getFeatures(FeatureQuery query, int pageSize);
273

    
274
    public List<Feature> getFeatures();
275

    
276
    /**
277
     * Returns the feature given its reference.
278
     *
279
     * @param reference
280
     *            a unique FeatureReference
281
     * @return
282
     *         The Feature
283
     *
284
     * @throws DataException
285
     *
286
     */
287
    public Feature getFeatureByReference(FeatureReference reference)
288
        throws DataException;
289

    
290
    /**
291
     * Returns the feature given its reference and feature type.
292
     *
293
     * @param reference
294
     *            a unique FeatureReference
295
     *
296
     * @param featureType
297
     *            FeatureType to which the requested Feature belongs
298
     *
299
     * @return
300
     *         The Feature
301
     *
302
     * @throws DataException
303
     *
304
     */
305
    public Feature getFeatureByReference(FeatureReference reference,
306
        FeatureType featureType) throws DataException;
307

    
308
    /*
309
     * =============================================================
310
     *
311
     * Editing related services
312
     */
313

    
314
    /**
315
     * Enters editing state.
316
     */
317
    public void edit() throws DataException;
318

    
319
    /**
320
     * Enters editing state specifying the editing mode.
321
     *
322
     * @param mode
323
     *
324
     * @throws DataException
325
     */
326
    public void edit(int mode) throws DataException;
327

    
328
    /**
329
     * Cancels all editing since the last edit().
330
     *
331
     * @throws DataException
332
     */
333
    public void cancelEditing() throws DataException;
334

    
335
    /**
336
     * Exits editing state.
337
     *
338
     * @throws DataException
339
     */
340
    public void finishEditing() throws DataException;
341

    
342
    /**
343
     * Save changes in the provider without leaving the edit mode.
344
     * Do not call observers to communicate a change of ediding mode.
345
     * The operation's history is eliminated to prevent inconsistencies
346
     * in the data.
347
     *
348
     * @throws DataException
349
     */
350
    public void commitChanges() throws DataException ;
351

    
352
    /**
353
     *
354
     * Returns true if you can call CommitChanges method.
355
     * If not in editing or changes have been made in the structure
356
     * return false.
357
     *
358
     * @return true if can call commitChanges
359
     * @throws DataException
360
     */
361
    public boolean canCommitChanges() throws DataException;
362

    
363

    
364
    /**
365
     * Indicates whether this store is in editing state.
366
     *
367
     * @return
368
     *         true if this store is in editing state, false if not.
369
     */
370
    public boolean isEditing();
371

    
372
    /**
373
     * Indicates whether this store is in appending state. In this state the new
374
     * features are automatically inserted at the end of the {@link FeatureSet}.
375
     *
376
     * @return true if this store is in appending state.
377
     */
378
    public boolean isAppending();
379

    
380
    /**
381
     * Updates a {@link FeatureType} in the store with the changes in the
382
     * {@link EditableFeatureType}.<br>
383
     *
384
     * Any {@link FeatureSet} from this store that are used will be invalidated.
385
     *
386
     * @param featureType
387
     *            an {@link EditableFeatureType} with the changes.
388
     *
389
     * @throws DataException
390
     */
391
    public void update(EditableFeatureType featureType) throws DataException;
392

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

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

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

    
436
    /**
437
     * Creates a new feature using the default feature type and returns it as an
438
     * {@link EditableFeature}
439
     *
440
     * @return a new feature in editable state
441
     *
442
     * @throws DataException
443
     */
444
    public EditableFeature createNewFeature() throws DataException;
445

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

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

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

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

    
515
    /**
516
     * Applies the validation rules associated to the given mode to the active
517
     * {@link FeatureSet}.
518
     *
519
     * @param mode
520
     *            can be one of {MODE_QUERY, MODE_FULLEDIT, MODE_APPEND}
521
     *
522
     * @throws DataException
523
     */
524
    public void validateFeatures(int mode) throws DataException;
525

    
526
    /**
527
     * Indicates whether this store supports append mode.
528
     *
529
     * @return
530
     *         true if this store supports append mode.
531
     */
532
    public boolean isAppendModeSupported();
533

    
534
    /**
535
     * Initiates an editing group. This is typically used to group series of
536
     * store editing operations.
537
     *
538
     * @param description
539
     *            Description of the editing group.
540
     *
541
     * @throws NeedEditingModeException
542
     */
543
    public void beginEditingGroup(String description)
544
        throws NeedEditingModeException;
545

    
546
    /**
547
     * Finishes an editing group.
548
     *
549
     * @throws NeedEditingModeException
550
     */
551
    public void endEditingGroup() throws NeedEditingModeException;
552

    
553
    /*
554
     * =============================================================
555
     *
556
     * Index related services
557
     */
558

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

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

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

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

    
696
    /**
697
     * Returns a FeatureIndexes structure containing all available indexes in
698
     * the store.
699
     *
700
     * @return
701
     */
702
    public FeatureIndexes getIndexes();
703

    
704
    /*
705
     * =============================================================
706
     *
707
     * Selection related services
708
     */
709

    
710
    /**
711
     * Sets the selection to the passed {@link FeatureSet}
712
     *
713
     * @param selection
714
     *            A {@link FeatureSet} with the requested selection
715
     */
716
    public void setSelection(FeatureSet selection) throws DataException;
717

    
718
    /**
719
     * Creates a {@link FeatureSelection}
720
     *
721
     * @return
722
     *         a {@link FeatureSelection}
723
     *
724
     * @throws DataException
725
     */
726
    public FeatureSelection createFeatureSelection() throws DataException;
727

    
728
    /**
729
     * Returns the current {@link FeatureSelection}.
730
     * Create a empty selection if not exits.
731
     * 
732
     * Manage of the selection can be slow on some data sources. 
733
     * Use with care.
734
     * In data sources that do not support position access to records, 
735
     * it may be slow to retrieve items from the selection. In some data 
736
     * sources it may be necessary to access to this to retrieve each 
737
     * item in the selection.
738
     *
739
     * @return
740
     *         current {@link FeatureSelection}.
741
     *
742
     * @throws DataException
743
     */
744
    public FeatureSelection getFeatureSelection() throws DataException;
745

    
746
    /*
747
     * =============================================================
748
     *
749
     * Lock related services
750
     */
751

    
752
    /**
753
     * Indicates whether this store supports locks.
754
     *
755
     * @return
756
     *         true if this store supports locks, false if not.
757
     */
758
    public boolean isLocksSupported();
759

    
760
    /**
761
     * Returns the set of locked features
762
     *
763
     * @return
764
     *         set of locked features
765
     *
766
     * @throws DataException
767
     */
768
    public FeatureLocks getLocks() throws DataException;
769

    
770
    /*
771
     * =============================================================
772
     * Transforms related services
773
     * =============================================================
774
     */
775

    
776
    /**
777
     * Returns this store transforms
778
     *
779
     * @return
780
     *         this store transforms
781
     */
782
    public FeatureStoreTransforms getTransforms();
783

    
784
    /**
785
     * Returns a new {@link FeatureQuery} associated to this store.
786
     *
787
     * @return
788
     *         a new {@link FeatureQuery} associated to this store.
789
     */
790
    public FeatureQuery createFeatureQuery();
791

    
792
    /**
793
     * Returns featue count of this store.
794
     *
795
     * @return
796
     * @throws DataException
797
     */
798
    public long getFeatureCount() throws DataException;
799

    
800
//    /**
801
//     * Creates a vectorial cache that is used to save and retrieve data.
802
//     *
803
//     * @param name
804
//     *            the cache name.
805
//     * @param parameters
806
//     *            parameters to create the stores used to save data.
807
//     * @throws DataException
808
//     */
809
//    public void createCache(String name, DynObject parameters)
810
//        throws DataException;
811
//
812
//    /**
813
//     * @return the vectorial cache
814
//     */
815
//    public FeatureCache getCache();
816

    
817
    /**
818
     * Return if the provider knows the real envelope of a layer. If not,
819
     * the {@link FeatureStoreProvider#getEnvelope()} method doesn't return
820
     * the full envelope.
821
     *
822
     * @return
823
     *         <true> if it knows the real envelope.
824
     */
825
    public boolean isKnownEnvelope();
826

    
827
    /**
828
     * Return if the maximum number of features provided by the
829
     * provider are limited.
830
     *
831
     * @return
832
     *         <true> if there is a limit of features.
833
     */
834
    public boolean hasRetrievedFeaturesLimit();
835

    
836
    /**
837
     * If the {@link FeatureStoreProvider#hasRetrievedFeaturesLimit()} returns
838
     * true,
839
     * it returns the limit of features retrieved from the provider.
840
     *
841
     * @return
842
     *         The limit of the retrieved features.
843
     */
844
    public int getRetrievedFeaturesLimit();
845

    
846
    /**
847
     * Return the associated feature to the dynobject.
848
     * If the dynobject isn't associated to a feature of this store, return null.
849
     *
850
     * @param dynobject
851
     * @return
852
     */
853
    public Feature getFeature(DynObject dynobject);
854

    
855
    public Iterator iterator();
856

    
857
    public ExpressionEvaluator createExpression();
858

    
859
    public void createCache(String name, DynObject parameters)
860
        throws DataException;
861

    
862
    public FeatureCache getCache();
863

    
864
    public boolean isBroken();
865

    
866
        public Throwable getBreakingsCause();
867

    
868
    /**
869
     * @param index
870
     * @return
871
     */
872
    SpatialIndex wrapSpatialIndex(SpatialIndex index);
873
}