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

History | View | Annotate | Download (28.1 KB)

1
/**
2
 * gvSIG. Desktop Geographic Information System.
3
 *
4
 * Copyright (C) 2007-2013 gvSIG Association.
5
 *
6
 * This program is free software; you can redistribute it and/or
7
 * modify it under the terms of the GNU General Public License
8
 * as published by the Free Software Foundation; either version 3
9
 * of the License, or (at your option) any later version.
10
 *
11
 * This program is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU General Public License
17
 * along with this program; if not, write to the Free Software
18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19
 * MA  02110-1301, USA.
20
 *
21
 * For any additional information, do not hesitate to contact us
22
 * at info AT gvsig.com, or visit our website www.gvsig.com.
23
 */
24
package org.gvsig.fmap.dal.feature;
25

    
26
import java.util.Iterator;
27
import java.util.List;
28

    
29
import org.cresques.cts.IProjection;
30

    
31
import org.gvsig.fmap.dal.DataServerExplorer;
32
import org.gvsig.fmap.dal.DataStore;
33
import org.gvsig.fmap.dal.DataStoreParameters;
34
import org.gvsig.fmap.dal.ExpressionBuilder;
35
import org.gvsig.fmap.dal.exception.DataException;
36
import org.gvsig.fmap.dal.exception.ReadException;
37
import org.gvsig.fmap.dal.feature.exception.FeatureIndexException;
38
import org.gvsig.fmap.dal.feature.exception.NeedEditingModeException;
39
import org.gvsig.fmap.geom.Geometry;
40
import org.gvsig.fmap.geom.SpatialIndex;
41
import org.gvsig.fmap.geom.primitive.Envelope;
42
import org.gvsig.tools.dispose.DisposableIterator;
43
import org.gvsig.tools.dynobject.DynObject;
44
import org.gvsig.tools.lang.Cloneable;
45
import org.gvsig.tools.observer.Observer;
46
import org.gvsig.tools.undo.UndoRedoStack;
47

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

    
77
    public static final String METADATA_DEFINITION_NAME = "FeatureStore";
78

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

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

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

    
88
    /*
89
     * =============================================================
90
     *
91
     * information related services
92
     */
93

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

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

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

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

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

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

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

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

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

    
180
    /*
181
     * =============================================================
182
     *
183
     * Query related services
184
     */
185

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

    
208
    FeatureSet getFeatureSet(String filter) throws DataException;
209

    
210
    FeatureSet getFeatureSet(String filter, String sortBy) throws DataException;
211

    
212
    FeatureSet getFeatureSet(String filter, String sortBy, boolean asc) throws DataException;
213

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

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

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

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

    
278
    public List<Feature> getFeatures();
279

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

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

    
312
    /*
313
     * =============================================================
314
     *
315
     * Editing related services
316
     */
317

    
318
    /**
319
     * Enters editing state.
320
     */
321
    public void edit() throws DataException;
322

    
323
    /**
324
     * Enters editing state specifying the editing mode.
325
     *
326
     * @param mode
327
     *
328
     * @throws DataException
329
     */
330
    public void edit(int mode) throws DataException;
331

    
332
    /**
333
     * Cancels all editing since the last edit().
334
     *
335
     * @throws DataException
336
     */
337
    public void cancelEditing() throws DataException;
338

    
339
    /**
340
     * Exits editing state.
341
     *
342
     * @throws DataException
343
     */
344
    public void finishEditing() throws DataException;
345

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

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

    
367

    
368
    /**
369
     * Indicates whether this store is in editing state.
370
     *
371
     * @return
372
     *         true if this store is in editing state, false if not.
373
     */
374
    public boolean isEditing();
375

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

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

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

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

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

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

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

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

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

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

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

    
530
    /**
531
     * Indicates whether this store supports append mode.
532
     *
533
     * @return
534
     *         true if this store supports append mode.
535
     */
536
    public boolean isAppendModeSupported();
537

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

    
550
    /**
551
     * Finishes an editing group.
552
     *
553
     * @throws NeedEditingModeException
554
     */
555
    public void endEditingGroup() throws NeedEditingModeException;
556

    
557
    /*
558
     * =============================================================
559
     *
560
     * Index related services
561
     */
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 featureType
568
     *            The FeatureType to which the indexed attribute belongs.
569
     *
570
     * @param attributeName
571
     *            The name of the attributed to be indexed
572
     *
573
     * @param indexName
574
     *            The index name
575
     *
576
     * @return the resulting {@link FeatureIndex}
577
     *
578
     *
579
     * @throws FeatureIndexException
580
     *             if there is an error creating the index
581
     */
582
    public FeatureIndex createIndex(FeatureType featureType,
583
        String attributeName, String indexName) throws DataException;
584

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

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

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

    
700
    /**
701
     * Returns a FeatureIndexes structure containing all available indexes in
702
     * the store.
703
     *
704
     * @return
705
     */
706
    public FeatureIndexes getIndexes();
707

    
708
    /*
709
     * =============================================================
710
     *
711
     * Selection related services
712
     */
713

    
714
    /**
715
     * Sets the selection to the passed {@link FeatureSet}
716
     *
717
     * @param selection
718
     *            A {@link FeatureSet} with the requested selection
719
     */
720
    public void setSelection(FeatureSet selection) throws DataException;
721

    
722
    /**
723
     * Creates a {@link FeatureSelection}
724
     *
725
     * @return
726
     *         a {@link FeatureSelection}
727
     *
728
     * @throws DataException
729
     */
730
    public FeatureSelection createFeatureSelection() throws DataException;
731

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

    
750
    /*
751
     * =============================================================
752
     *
753
     * Lock related services
754
     */
755

    
756
    /**
757
     * Indicates whether this store supports locks.
758
     *
759
     * @return
760
     *         true if this store supports locks, false if not.
761
     */
762
    public boolean isLocksSupported();
763

    
764
    /**
765
     * Returns the set of locked features
766
     *
767
     * @return
768
     *         set of locked features
769
     *
770
     * @throws DataException
771
     */
772
    public FeatureLocks getLocks() throws DataException;
773

    
774
    /*
775
     * =============================================================
776
     * Transforms related services
777
     * =============================================================
778
     */
779

    
780
    /**
781
     * Returns this store transforms
782
     *
783
     * @return
784
     *         this store transforms
785
     */
786
    public FeatureStoreTransforms getTransforms();
787

    
788
    /**
789
     * Returns a new {@link FeatureQuery} associated to this store.
790
     *
791
     * @return
792
     *         a new {@link FeatureQuery} associated to this store.
793
     */
794
    public FeatureQuery createFeatureQuery();
795

    
796
    /**
797
     * Returns featue count of this store.
798
     *
799
     * @return
800
     * @throws DataException
801
     */
802
    public long getFeatureCount() throws DataException;
803

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

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

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

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

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

    
859
    public Iterator iterator();
860

    
861
    public ExpressionBuilder createExpressionBuilder();
862

    
863
    /**
864
     * 
865
     * @return 
866
     * @deprecated use createExpressionBuilder
867
     */
868
    public ExpressionBuilder createExpression();
869

    
870
    public void createCache(String name, DynObject parameters)
871
        throws DataException;
872

    
873
    public FeatureCache getCache();
874

    
875
    public boolean isBroken();
876

    
877
        public Throwable getBreakingsCause();
878

    
879
    /**
880
     * @param index
881
     * @return
882
     */
883
    SpatialIndex wrapSpatialIndex(SpatialIndex index);
884
}