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

History | View | Annotate | Download (28.2 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(FeatureQuery query);
279

    
280
    public List<Feature> getFeatures();
281

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

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

    
314
    /*
315
     * =============================================================
316
     *
317
     * Editing related services
318
     */
319

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

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

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

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

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

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

    
369

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    
559
    /*
560
     * =============================================================
561
     *
562
     * Index related services
563
     */
564

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

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

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

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

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

    
710
    /*
711
     * =============================================================
712
     *
713
     * Selection related services
714
     */
715

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

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

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

    
752
    /*
753
     * =============================================================
754
     *
755
     * Lock related services
756
     */
757

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

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

    
776
    /*
777
     * =============================================================
778
     * Transforms related services
779
     * =============================================================
780
     */
781

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

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

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

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

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

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

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

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

    
861
    public Iterator iterator();
862

    
863
    public ExpressionBuilder createExpressionBuilder();
864

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

    
872
    public void createCache(String name, DynObject parameters)
873
        throws DataException;
874

    
875
    public FeatureCache getCache();
876

    
877
    public boolean isBroken();
878

    
879
        public Throwable getBreakingsCause();
880

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