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

History | View | Annotate | Download (49.3 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
import javax.json.JsonObject;
29

    
30
import org.cresques.cts.IProjection;
31
import org.gvsig.expressionevaluator.Expression;
32
import org.gvsig.expressionevaluator.ExpressionBuilder;
33

    
34
import org.gvsig.fmap.dal.DataServerExplorer;
35
import org.gvsig.fmap.dal.DataStore;
36
import org.gvsig.fmap.dal.DataStoreParameters;
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
import org.gvsig.tools.util.GetItemWithSizeAndIterator64;
50
import org.gvsig.tools.util.GetItemWithSizeIsEmptyAndIterator64;
51
import org.gvsig.tools.util.PropertiesSupport;
52
import org.gvsig.tools.util.Size64;
53
import org.gvsig.tools.util.UnmodifiableBasicList64;
54

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

    
87
    public static final String METADATA_DEFINITION_NAME = "FeatureStore";
88

    
89
    /** Indicates that this store is in query mode */
90
    final static int MODE_QUERY = 0;
91

    
92
    /** Indicates that this store is in full edit mode */
93
    final static int MODE_FULLEDIT = 1;
94

    
95
    /** Indicates that this store is in append mode */
96
    final static int MODE_APPEND = 2;
97
    
98
    final static int MODE_PASS_THROUGH = 3;
99

    
100
    /*
101
     * =============================================================
102
     *
103
     * information related services
104
     */
105

    
106
    /**
107
     * Indicates whether this store allows writing.
108
     *
109
     * @return
110
     *         true if this store can be written, false if not.
111
     */
112
    public boolean allowWrite();
113

    
114
    /**
115
     * Returns this store's default {@link FeatureType}.
116
     *
117
     * @return
118
     *         this store's default {@link FeatureType}.
119
     *
120
     * @throws DataException
121
     */
122
    public FeatureType getDefaultFeatureType() throws DataException;
123
    
124
    public FeatureType getDefaultFeatureTypeQuietly();
125

    
126
    /**
127
     * Returns this store's featureType {@link FeatureType} matches with
128
     * featureTypeId.
129
     *
130
     * @param featureTypeId
131
     *
132
     * @return this store's default {@link FeatureType}.
133
     *
134
     * @throws DataException
135
     */
136
    public FeatureType getFeatureType(String featureTypeId)
137
        throws DataException;
138

    
139
    /**
140
     * Returns this store's {@link FeatureType}(s).
141
     *
142
     * @return a list with this store's {@link FeatureType}(s).
143
     *
144
     * @throws DataException
145
     */
146
    public List getFeatureTypes() throws DataException;
147

    
148
    /**
149
     * Returns this store's parameters.
150
     *
151
     * @return
152
     *         {@link DataStoreParameters} containing this store's parameters
153
     */
154
    public DataStoreParameters getParameters();
155

    
156
    /**
157
     * @param gvSIGgeometryType
158
     * @return 
159
     * @throws DataException
160
     * @deprecated Mirar de cambiarlo a metadatos
161
     */
162
    public boolean canWriteGeometry(int gvSIGgeometryType) throws DataException;
163

    
164
    /**
165
     * Returns this store's total envelope (extent).
166
     *
167
     * @return this store's total envelope (extent) or <code>null</code> if
168
     *         store not have geometry information
169
     * @throws org.gvsig.fmap.dal.exception.DataException
170
     */
171
    public Envelope getEnvelope() throws DataException;
172

    
173
    /**
174
     *
175
     * @deprecated use getDefaultFeatureType().getDefaultSRS()
176
     * @return
177
     * @throws DataException
178
     */
179
    public IProjection getSRSDefaultGeometry() throws DataException;
180

    
181
    /**
182
     * Exports this store to another store.
183
     *
184
     * @param explorer
185
     *            {@link DataServerExplorer} target
186
     * @param provider
187
     * @param params
188
     *            New parameters of this store that will be used on the target
189
     *            explorer
190
     *
191
     * @throws DataException
192
     *
193
     * @Deprecated this method is unstable
194
     */
195
    public void export(DataServerExplorer explorer, String provider,
196
        NewFeatureStoreParameters params) throws DataException;
197

    
198
    public void copyTo(FeatureStore target);
199

    
200
    /*
201
     * =============================================================
202
     *
203
     * Query related services
204
     */
205
    
206
    /** 
207
     * Create a {@link FeatureQuery} with the restrictions indicateds.
208
     * 
209
     * "filter" will be null or a valid filter expression for the store.
210
     * 
211
     * "sortBy" can be null to use the store's default order.
212
     * 
213
     * The parameter sortBy can be an attribute name or a comma separated list. 
214
     * Each attribute name can be preceded or followed by "+" or "-" to indicate 
215
     * the order to use to sort by that attribute. 
216
     * 
217
     * If no "+" or "-" is indicated, the "asc" parameter will be used to 
218
     * determine if the order is ascending, "true" or decent, "false".
219
     * 
220
     * @param filter an {@link String} expression used to filter the features in the store.
221
     * @param sortBy Attribute names separated by commas used to sort the list to return.
222
     * @param asc use order ascending, true, or descending, false.
223
     * @return a {@link FeatureQuery} with the restrictions.
224
     * @see {@link FeatureQuery}
225
     */
226
    public FeatureQuery createFeatureQuery(String filter, String sortBy, boolean asc);
227
    public FeatureQuery createFeatureQuery(String filter);
228
    public FeatureQuery createFeatureQuery(Expression filter);
229

    
230
    /** 
231
     * Create a {@link FeatureQuery} with the restrictions indicateds.
232
     * 
233
     * "filter" will be null or {@link Expression} valid for the store.
234
     * 
235
     * "sortBy" can be null to use the store's default order.
236
     * 
237
     * The parameter sortBy can be an attribute name or a comma separated list. 
238
     * Each attribute name can be preceded or followed by "+" or "-" to indicate 
239
     * the order to use to sort by that attribute. 
240
     * 
241
     * If no "+" or "-" is indicated, the "asc" parameter will be used to 
242
     * determine if the order is ascending, "true" or decent, "false".
243
     * 
244
     * @param filter an {@link String} expression used to filter the features in the store.
245
     * @param sortBy Attribute names separated by commas used to sort the list to return.
246
     * @param asc use order ascending, true, or descending, false.
247
     * @return a {@link FeatureQuery} with the restrictions.
248
     * @see {@link FeatureQuery}
249
     */
250
    public FeatureQuery createFeatureQuery(Expression filter, String sortBy, boolean asc);
251
        
252
    /** 
253
     * Create a {@link FeatureQuery} with the restrictions indicateds.
254
     * 
255
     * "filter" will be null or {@link Expression} valid for the store.
256
     * 
257
     * "sortBy" can be null to use the store's default order.
258
     * 
259
     * The parameter sortBy can be an attribute name or a comma separated list. 
260
     * Each attribute name can be preceded or followed by "+" or "-" to indicate 
261
     * the order to use to sort by that attribute. 
262
     * 
263
     * If no "+" or "-" is indicated, the "asc" parameter will be used to 
264
     * determine if the order is ascending, "true" or decent, "false".
265
     * 
266
     * @param filter an {@link String} expression used to filter the features in the store.
267
     * @param sortBy expression used to order the features in the store.
268
     * @param asc use order ascending, true, or descending, false.
269
     * @return a {@link FeatureQuery} with the restrictions.
270
     * @see {@link FeatureQuery}
271
     */
272
    public FeatureQuery createFeatureQuery(Expression filter, Expression sortBy, boolean asc);
273
    
274
    /** 
275
     * Create a {@link FeatureQuery} with the restrictions indicateds.
276
     * 
277
     * "filter" will be null or {@link Expression} valid for the store.
278
     * 
279
     * "sortBy" can be null to use the store's default order.
280
     * 
281
     * The parameter sortBy can be an attribute name or a comma separated list. 
282
     * Each attribute name can be preceded or followed by "+" or "-" to indicate 
283
     * the order to use to sort by that attribute. 
284
     * 
285
     * If no "+" or "-" is indicated, the "asc" parameter will be used to 
286
     * determine if the order is ascending, "true" or decent, "false".
287
     * 
288
     * @param filter an {@link String} expression used to filter the features in the store.
289
     * @param sortBy expression used to order the features in the store.
290
     * @param asc use order ascending, true, or descending, false.
291
     * @return a {@link FeatureQuery} with the restrictions.
292
     * @see {@link FeatureQuery}
293
     */
294
    public FeatureQuery createFeatureQuery(String filter, Expression sortBy, boolean asc);
295

    
296
    
297
    
298
    /**
299
     * Returns all available features in the store.
300
     *
301
     * It is a utility method that calls {@link #getFeatureSet(FeatureQuery)}
302
     * 
303
     * @return the {@link FeatureSet} 
304
     * @throws ReadException if there is any error while reading the features
305
     * @see {@link #accept(org.gvsig.tools.visitor.Visitor)}, {@link #getFeatureSet(FeatureQuery)}
306
     */
307
    FeatureSet getFeatureSet() throws DataException;
308

    
309
    /**
310
     * Return a subset of features.
311
     * 
312
     * It is a utility method that calls {@link #getFeatureSet(FeatureQuery)}
313
     * 
314
     * @param filter an {@link String} expression used to filter the features in the store.
315
     * @return the {@link FeatureSet} 
316
     * @throws ReadException if there is any error while reading the features
317
     * @see {@link #createFeatureQuery(Expression,String,boolean)}, {@link #getFeatureSet(FeatureQuery)}
318
     */
319
    FeatureSet getFeatureSet(String filter) throws DataException;
320

    
321
    /**
322
     * Return a subset of features.
323
     * 
324
     * It is a utility method that calls {@link #getFeatureSet(FeatureQuery)}
325
     * 
326
     * The sort order used is ascending.
327
     * 
328
     * @param filter an {@link String} expression used to filter the features in the store.
329
     * @param sortBy Attribute names separated by commas used to sort the list to return.
330
     * @return the {@link FeatureSet} 
331
     * @throws ReadException if there is any error while reading the features
332
     * @see {@link #createFeatureQuery(Expression,String,boolean)}, {@link #getFeatureSet(FeatureQuery)}
333
     */
334
    FeatureSet getFeatureSet(String filter, String sortBy) throws DataException;
335

    
336
    /**
337
     * Return a subset of features.
338
     * 
339
     * It is a utility method that calls {@link #getFeatureSet(FeatureQuery)}
340
     * 
341
     * @param filter an {@link String} expression used to filter the features in the store.
342
     * @param sortBy Attribute names separated by commas used to sort the list to return.
343
     * @param asc use order ascending, true, or descending, false.
344
     * @return the {@link FeatureSet} 
345
     * @throws ReadException if there is any error while reading the features
346
     * @see {@link #createFeatureQuery(Expression,String,boolean)}, {@link #getFeatureSet(FeatureQuery)}
347
     */
348
    FeatureSet getFeatureSet(String filter, String sortBy, boolean asc) throws DataException;
349

    
350
    /**
351
     * Return a subset of features.
352
     * 
353
     * It is a utility method that calls {@link #getFeatureSet(FeatureQuery)}
354
     * 
355
     * @param filter an {@link Expression} used to filter the features in the store.
356
     * @return the {@link FeatureSet} 
357
     * @throws DataException 
358
     * @see {@link #createFeatureQuery(Expression,String,boolean)}, {@link #getFeatureSet(FeatureQuery)}
359
     */
360
    FeatureSet getFeatureSet(Expression filter) throws DataException;
361

    
362
    /**
363
     * Return a subset of features.
364
     * 
365
     * It is a utility method that calls {@link #getFeatureSet(FeatureQuery)}
366
     * 
367
     * The sort order used is ascending.
368
     * 
369
     * @param filter an {@link Expression} used to filter the features in the store.
370
     * @param sortBy Attribute names separated by commas used to sort the list to return.
371
     * @return the {@link FeatureSet} 
372
     * @throws ReadException if there is any error while reading the features
373
     * @see {@link #createFeatureQuery(Expression,String,boolean)}, {@link #getFeatureSet(FeatureQuery)}
374
     */
375
    FeatureSet getFeatureSet(Expression filter, String sortBy) throws DataException;
376

    
377
    /**
378
     * Return a subset of features.
379
     * 
380
     * It is a utility method that calls {@link #getFeatureSet(FeatureQuery)}
381
     * 
382
     * @param filter an {@link Expression} used to filter the features in the store.
383
     * @param sortBy Attribute names separated by commas used to sort the list to return.
384
     * @param asc use order ascending, true, or descending, false.
385
     * @return the {@link FeatureSet} 
386
     * @throws DataException 
387
     * @see {@link #createFeatureQuery(Expression,String,boolean)}, {@link #getFeatureSet(FeatureQuery)}
388
     */
389
    FeatureSet getFeatureSet(Expression filter, String sortBy, boolean asc) throws DataException;
390

    
391
    /**
392
     * Returns a subset of features taking into account the properties and
393
     * restrictions of the {@link FeatureQuery}.
394
     * 
395
     * If {@link FeatureQuery} is null, return al features in the store.
396
     * 
397
     * <p>
398
     * <em>
399
     * <strong>NOTE:</strong> if you use this method to get a
400
     * {@link FeatureSet}, you  must get sure it is disposed
401
     * (@see {@link DisposableIterator#dispose()}) in any case, even if an
402
     * error occurs while getting the data. It is recommended to use the
403
     * <code>accept</code> methods instead, which handle everything for you.
404
     * Take into account the accept methods may use a fast iterator to
405
     * get the features.
406
     * </em>
407
     * </p>
408
     *
409
     * @param featureQuery defines the characteristics of the features to return.
410
     * @return the {@link FeatureSet} 
411
     * @throws ReadException if there is any error while reading the features.
412
     * @see #accept(org.gvsig.tools.visitor.Visitor, org.gvsig.fmap.dal.DataQuery)
413
     */
414
    FeatureSet getFeatureSet(FeatureQuery featureQuery) throws DataException;
415

    
416
    /**
417
     * Loads a subset of features taking into account the properties and
418
     * restrictions of the FeatureQuery. 
419
     * When feature loading is finished call the Observer passing the
420
     * {@link FeatureSet}  loaded.
421
     *
422
     * @param featureQuery defines the characteristics of the features to return.
423
     * @param observer to be notified when loading is finished.
424
     * @throws DataException if there is any error while loading the features
425
     */
426
    void getFeatureSet(FeatureQuery featureQuery, Observer observer) throws DataException;
427

    
428
    /**
429
     * Loads all available feature in the store. The loading of Features is
430
     * performed by calling the Observer, once each loaded Feature.
431
     *
432
     * @param observer to be notified of each loaded Feature
433
     * @throws DataException if there is any error while loading the features
434
     */
435
    void getFeatureSet(Observer observer) throws DataException;
436

    
437
    /**
438
     * Return a paginated list of Features filtered by the query.
439
     * 
440
     * If the query  is null, return all features in the store sorteds 
441
     * by default order.
442
     * 
443
     * The return value implements {@link List} and {@link UnmodifiableBasicList64} 
444
     * to support large list of features.
445
     * 
446
     * The returned list of Features is paginated, and the page size
447
     * used is "pageSize". 
448
     * 
449
     * If the page size is less than or equal to 0, the default page size of 
450
     * 100 will be used.
451
     *
452
     * @param query to filter and sort the returned feature list
453
     * @param pageSize the page size of the list
454
     * @return the {@link List}/{@link UnmodifiableBasicList64} of features
455
     */
456
    public List<Feature> getFeatures(FeatureQuery query, int pageSize);
457

    
458
    /**
459
     * Return a paginated list of Features.
460
     * 
461
     * It is a utility method that calls {@link #getFeatures(FeatureQuery, int)}
462
     * using the default page size.
463
     * 
464
     * @param query to filter and sort the returned feature list
465
     * @return the {@link List}/{@link UnmodifiableBasicList64} of features
466
     * @see {@link #getFeatures(FeatureQuery, int)}
467
     */
468
    public List<Feature> getFeatures(FeatureQuery query);
469

    
470
    /**
471
     * Return a paginated list with al Features in the store.
472
     * 
473
     * It is a utility method that calls {@link #getFeatures(FeatureQuery, int)}
474
     * using the default page size.
475
     * 
476
     * @return the {@link List}/{@link UnmodifiableBasicList64} of features
477
     * @see {@link #getFeatures(FeatureQuery, int)}
478
     */
479
    public List<Feature> getFeatures();
480

    
481
    /**
482
     * Return a paginated list of Features
483
     * 
484
     * It is a utility method that calls {@link #getFeatures(FeatureQuery, int)}
485
     * 
486
     * @param filter used to filter the features in the store.
487
     * @return the List of Features
488
     * @see {@link #getFeatures(FeatureQuery, int)}, {@link #createFeatureQuery(String,String,boolean)}
489
     */
490
    public List<Feature> getFeatures(String filter);
491

    
492
    /**
493
     * Return a paginated list of Features.
494
     * 
495
     * It is a utility method that calls {@link #getFeatures(FeatureQuery, int)}
496
     * using the default page size.
497
     * 
498
     * @param filter used to filter the features in the store.
499
     * @param sortBy Attribute names separated by commas used to sort the list to return.
500
     * @return the {@link List}/{@link UnmodifiableBasicList64} of features
501
     * @see {@link #getFeatures(FeatureQuery, int)}, {@link #createFeatureQuery(String,String,boolean)}
502
     */
503
    public List<Feature> getFeatures(String filter, String sortBy);
504

    
505
    /**
506
     * Return a paginated list of Features.
507
     *  
508
     * It is a utility method that calls {@link #getFeatures(FeatureQuery, int)}
509
     * using the default page size.
510
     * 
511
     * @param filter an {@link String} expression used to filter the features in the store.
512
     * @param sortBy Attribute names separated by commas used to sort the list to return.
513
     * @param asc use order ascending, true, or descending, false.
514
     * @return the {@link List}/{@link UnmodifiableBasicList64} of features
515
     * @see {@link #getFeatures(FeatureQuery, int)}, {@link #createFeatureQuery(String,String,boolean)}
516
     */
517
    public List<Feature> getFeatures(String filter, String sortBy, boolean asc);
518

    
519
    /**
520
     * Return a paginated list of Features
521
     * 
522
     * It is a utility method that calls {@link #getFeatures(FeatureQuery, int)}
523
     * using the default page size.
524
     * 
525
     * @param filter an {@link Expression} used to filter the features in the store.
526
     * @return the List of Features
527
     * @see {@link #getFeatures(FeatureQuery, int)}, {@link #createFeatureQuery(Expression,String,boolean)}
528
     */
529
    public List<Feature> getFeatures(Expression filter);
530

    
531
    /**
532
     * Return a paginated list of Features
533
     * 
534
     * It is a utility method that calls {@link #getFeatures(FeatureQuery, int)}
535
     * using the default page size.
536
     * 
537
     * @param filter an {@link Expression} used to filter the features in the store.
538
     * @param sortBy Attribute names separated by commas used to sort the list to return.
539
     * @return the {@link List}/{@link UnmodifiableBasicList64} of features
540
     * @see {@link #getFeatures(FeatureQuery, int)}, {@link #createFeatureQuery(Expression,String,boolean)}
541
     */
542
    public List<Feature> getFeatures(Expression filter, String sortBy);
543

    
544
    /**
545
     * Return a paginated list of Features
546
     * 
547
     * It is a utility method that calls {@link #getFeatures(FeatureQuery, int)}
548
     * using the default page size.
549
     * 
550
     * @param filter an {@link Expression} used to filter the features in the store.
551
     * @param sortBy Attribute names separated by commas used to sort the list to return.
552
     * @param asc use order ascending, true, or descending, false.
553
     * @return the {@link List}/{@link UnmodifiableBasicList64} of features
554
     * @see {@link #getFeatures(FeatureQuery, int)}, {@link #createFeatureQuery(Expression,String,boolean)}
555
     */
556
    public List<Feature> getFeatures(Expression filter, String sortBy, boolean asc);
557

    
558
    public GetItemWithSizeIsEmptyAndIterator64<Feature> getFeatures64();
559

    
560
    public GetItemWithSizeIsEmptyAndIterator64<Feature> getFeatures64(String filter);
561
    
562
    public GetItemWithSizeIsEmptyAndIterator64<Feature> getFeatures64(String filter, String sortBy, boolean asc);
563
    
564
    public GetItemWithSizeIsEmptyAndIterator64<Feature> getFeatures64(FeatureQuery query, int pageSize);
565
    
566
    /**
567
     * Return the first {@link Feature} of the store.
568
     * 
569
     * @return the first {@link Feature} or null if the store is empty.
570
     * @throws DataException 
571
     */
572
    public Feature first() throws DataException;
573

    
574
    /**
575
     * Returns the first {@link Feature} that meets the criteria indicated.
576
     * 
577
     * It is a utility method that calls {@link #findFirst(FeatureQuery)}.
578
     * 
579
     * @param filter {@link String} expression used to filter the features.
580
     * @return the first {@link Feature} or null if the filter don't return any feature.
581
     * @throws DataException 
582
     * @see {@link #findFirst(FeatureQuery)}, {@link #createFeatureQuery(String,String,boolean)}
583
     */
584
    public Feature findFirst(String filter) throws DataException;
585

    
586
    /**
587
     * Returns the first {@link Feature} that meets the criteria indicated.
588
     * 
589
     * It is a utility method that calls {@link #findFirst(FeatureQuery)}.
590
     * 
591
     * @param filter {@link String} expression used to filter the features.
592
     * @param sortBy Attribute names separated by commas used to sort the list to return.
593
     * @return the first {@link Feature} or null if the filter don't return any feature.
594
     * @throws DataException 
595
     * @see {@link #findFirst(FeatureQuery)}, {@link #createFeatureQuery(String,String,boolean)}
596
     */
597
    public Feature findFirst(String filter, String sortBy) throws DataException;
598

    
599
    /**
600
     * Returns the first {@link Feature} that meets the criteria indicated.
601
     * 
602
     * It is a utility method that calls {@link #findFirst(FeatureQuery)}.
603
     * 
604
     * @param filter {@link String} expression used to filter the features.
605
     * @param sortBy Attribute names separated by commas used to sort the list to return.
606
     * @param asc use order ascending, true, or descending, false.
607
     * @return the first {@link Feature} or null if the filter don't return any feature.
608
     * @throws DataException 
609
     * @see {@link #findFirst(FeatureQuery)}, {@link #createFeatureQuery(String,String,boolean)}
610
     */
611
    public Feature findFirst(String filter, String sortBy, boolean asc) throws DataException;
612

    
613
    
614
    /**
615
     * Returns the first {@link Feature} that meets the criteria indicated.
616
     * 
617
     * It is a utility method that calls {@link #findFirst(FeatureQuery)}.
618
     * 
619
     * @param filter {@link String} expression used to filter the features.
620
     * @param sortBy Expression
621
     * @param asc use order ascending, true, or descending, false.
622
     * @return the first {@link Feature} or null if the filter don't return any feature.
623
     * @throws DataException 
624
     * @see {@link #findFirst(FeatureQuery)}, {@link #createFeatureQuery(String,String,boolean)}
625
     */
626
    public Feature findFirst(String filter, Expression sortBy, boolean asc) throws DataException;
627

    
628
    /**
629
     * Returns the first {@link Feature} that meets the criteria indicated.
630
     * 
631
     * It is a utility method that calls {@link #findFirst(FeatureQuery)}.
632
     * 
633
     * @param filter {@link String} expression used to filter the features.
634
     * @return the first {@link Feature} or null if the filter don't return any feature.
635
     * @throws DataException 
636
     * @see {@link #findFirst(FeatureQuery)}, {@link #createFeatureQuery(Expession,String,boolean)}
637
     */
638
    public Feature findFirst(Expression filter) throws DataException;
639

    
640
    /**
641
     * Returns the first {@link Feature} that meets the criteria indicated.
642
     * 
643
     * It is a utility method that calls {@link #findFirst(FeatureQuery)}.
644
     * 
645
     * @param filter {@link String} expression used to filter the features.
646
     * @param sortBy Attribute names separated by commas used to sort the list to return.
647
     * @return the first {@link Feature} or null if the filter don't return any feature.
648
     * @throws DataException 
649
     * @see {@link #findFirst(FeatureQuery)}, {@link #createFeatureQuery(Expession,String,boolean)}
650
     */
651
    public Feature findFirst(Expression filter, String sortBy) throws DataException;
652

    
653
    /**
654
     * Returns the first {@link Feature} that meets the criteria indicated.
655
     * 
656
     * It is a utility method that calls {@link #findFirst(FeatureQuery)}.
657
     * 
658
     * @param filter {@link String} expression used to filter the features.
659
     * @param sortBy Attribute names separated by commas used to sort the list to return.
660
     * @param asc use order ascending, true, or descending, false.
661
     * @return the first {@link Feature} or null if the filter don't return any feature.
662
     * @throws DataException 
663
     * @see {@link #findFirst(FeatureQuery)}, {@link #createFeatureQuery(Expession,String,boolean)}
664
     */
665
    public Feature findFirst(Expression filter, String sortBy, boolean asc) throws DataException;
666

    
667
    /**
668
     * Returns the first {@link Feature} that meets the criteria indicated.
669
     * 
670
     * It is a utility method that calls {@link #findFirst(FeatureQuery)}.
671
     * 
672
     * @param filter {@link String} expression used to filter the features.
673
     * @param sortBy expression used to sort features
674
     * @param asc use order ascending, true, or descending, false.
675
     * @return the first {@link Feature} or null if the filter don't return any feature.
676
     * @throws DataException 
677
     * @see {@link #findFirst(FeatureQuery)}, {@link #createFeatureQuery(Expession,String,boolean)}
678
     */
679
    public Feature findFirst(Expression filter, Expression sortBy, boolean asc) throws DataException;
680

    
681
    /**
682
     * Returns the first {@link Feature} that meets the criteria indicated.
683
     * 
684
     * It is a utility method that calls {@link #findFirst(FeatureQuery)}.
685
     * 
686
     * @param query to filter and sort the returned feature list
687
     * @return the first {@link Feature} or null if the filter don't return any feature.
688
     * @throws DataException 
689
     * @see {@link #findFirst(FeatureQuery)}, {@link #createFeatureQuery(Expession,String,boolean)}
690
     */
691
    public Feature findFirst(FeatureQuery query) throws DataException;
692

    
693
    /**
694
     * Returns the feature given its reference.
695
     *
696
     * @param reference a unique FeatureReference
697
     * @return 
698
     * @returnThe Feature
699
     * @throws DataException
700
     *
701
     */
702
    public Feature getFeatureByReference(FeatureReference reference) throws DataException;
703

    
704
    /**
705
     * Returns the feature given its reference and feature type.
706
     *
707
     * @param reference
708
     *            a unique FeatureReference
709
     *
710
     * @param featureType
711
     *            FeatureType to which the requested Feature belongs
712
     *
713
     * @return
714
     *         The Feature
715
     *
716
     * @throws DataException
717
     *
718
     */
719
    public Feature getFeatureByReference(FeatureReference reference,
720
        FeatureType featureType) throws DataException;
721

    
722
    /*
723
     * =============================================================
724
     *
725
     * Editing related services
726
     */
727

    
728
    /**
729
     * Enters editing state.
730
     * @throws org.gvsig.fmap.dal.exception.DataException
731
     */
732
    public void edit() throws DataException;
733

    
734
    /**
735
     * Enters editing state specifying the editing mode.
736
     *
737
     * @param mode
738
     *
739
     * @throws DataException
740
     */
741
    public void edit(int mode) throws DataException;
742

    
743
    /**
744
     * Cancels all editing since the last edit().
745
     *
746
     * @throws DataException
747
     */
748
    public void cancelEditing() throws DataException;
749

    
750
    public boolean cancelEditingQuietly();
751

    
752
    /**
753
     * Exits editing state.
754
     *
755
     * @throws DataException
756
     */
757
    public void finishEditing() throws DataException;
758

    
759
    public boolean finishEditingQuietly();
760
    
761
    /**
762
     * Save changes in the provider without leaving the edit mode.
763
     * Do not call observers to communicate a change of ediding mode.
764
     * The operation's history is eliminated to prevent inconsistencies
765
     * in the data.
766
     *
767
     * @throws DataException
768
     */
769
    public void commitChanges() throws DataException ;
770

    
771
    /**
772
     *
773
     * Returns true if you can call CommitChanges method.
774
     * If not in editing or changes have been made in the structure
775
     * return false.
776
     *
777
     * @return true if can call commitChanges
778
     * @throws DataException
779
     */
780
    public boolean canCommitChanges() throws DataException;
781

    
782

    
783
    /**
784
     * Indicates whether this store is in editing state.
785
     *
786
     * @return
787
     *         true if this store is in editing state, false if not.
788
     */
789
    public boolean isEditing();
790

    
791
    /**
792
     * Indicates whether this store is in appending state. In this state the new
793
     * features are automatically inserted at the end of the {@link FeatureSet}.
794
     *
795
     * @return true if this store is in appending state.
796
     */
797
    public boolean isAppending();
798

    
799
    /**
800
     * Updates a {@link FeatureType} in the store with the changes in the
801
     * {@link EditableFeatureType}.<br>
802
     *
803
     * Any {@link FeatureSet} from this store that are used will be invalidated.
804
     *
805
     * @param featureType
806
     *            an {@link EditableFeatureType} with the changes.
807
     *
808
     * @throws DataException
809
     */
810
    public void update(EditableFeatureType featureType) throws DataException;
811

    
812
    /**
813
     * Updates a {@link Feature} in the store with the changes in the
814
     * {@link EditableFeature}.<br>
815
     *
816
     * Any {@link FeatureSet} from this store that was still in use will be
817
     * invalidated. You can override this using
818
     * {@link FeatureSet#update(EditableFeature)}.
819
     *
820
     * @param feature
821
     *            the feature to be updated
822
     *
823
     * @throws DataException
824
     */
825
    public void update(EditableFeature feature) throws DataException;
826

    
827
    public void update(Object... parameters) throws DataException;
828

    
829
    /**
830
     * Deletes a {@link Feature} from the store.<br>
831
     *
832
     * Any {@link FeatureSet} from this store that was still in use will be
833
     * invalidated. You can override this using {@link Iterator#remove()} from
834
     * {@link FeatureSet}.
835
     *
836
     * @param feature
837
     *            The feature to be deleted.
838
     *
839
     * @throws DataException
840
     */
841
    public void delete(Feature feature) throws DataException;
842
    
843
    public void delete(String filter);
844
    
845
    public void delete(Expression filter);
846

    
847
    /**
848
     * Inserts a {@link Feature} in the store.<br>
849
     *
850
     * Any {@link FeatureSet} from this store that was still in use will be
851
     * invalidated. You can override this using
852
     * {@link FeatureSet#insert(EditableFeature)}.
853
     *
854
     * @param feature
855
     *            The feature to be inserted
856
     *
857
     * @throws DataException
858
     */
859
    public void insert(EditableFeature feature) throws DataException;
860

    
861
    /**
862
     * Inserts a set of {@link Feature} in the store.
863
     * 
864
     * The attributes of the feature are copied from the features of the set 
865
     * by name, forcing the conversion of types if necessary.
866
     *
867
     * Any {@link FeatureSet} from this store that was still in use will be
868
     * invalidated.
869
     *
870
     * @param set, set with the source features.
871
     * @throws DataException
872
     */
873
    public void insert(FeatureSet set) throws DataException;
874
    
875
    /**
876
     * Creates a new feature using the default feature type and returns it as an
877
     * {@link EditableFeature}
878
     *
879
     * @return a new feature in editable state
880
     *
881
     * @throws DataException
882
     */
883
    public EditableFeature createNewFeature() throws DataException;
884

    
885
    /**
886
     * Creates a new feature of the given {@link FeatureType} and uses the given
887
     * {@link Feature} as default values to initialize it.
888
     *
889
     * @param type
890
     *            the new feature's feature type
891
     *
892
     * @param defaultValues
893
     *            a feature whose values are used as default values for the new
894
     *            feature.
895
     *
896
     * @return the new feature.
897
     *
898
     * @throws DataException
899
     */
900
    public EditableFeature createNewFeature(FeatureType type,
901
        Feature defaultValues) throws DataException;
902

    
903
    /**
904
     * Creates a new feature of the given {@link FeatureType}. The flag
905
     * defaultValues is used to indicate whether the new feature should be
906
     * initialized with default values or not.
907
     *
908
     * @param type
909
     *            the new feature's feature type
910
     *
911
     * @param defaultValues
912
     *            if true the new feature is initialized with each attribute's
913
     *            default value.
914
     *
915
     * @return
916
     *         the new feature
917
     *
918
     * @throws DataException
919
     */
920
    public EditableFeature createNewFeature(FeatureType type,
921
        boolean defaultValues) throws DataException;
922

    
923
    /**
924
     * Creates a new feature of default {@link FeatureType}. The flag
925
     * defaultValues is used to indicate whether the new feature should be
926
     * initialized with default values or not.
927
     *
928
     * @param defaultValues
929
     *            if true the new feature is initialized with each attribute's
930
     *            default value.
931
     *
932
     * @return
933
     *         the new feature
934
     *
935
     * @throws DataException
936
     */
937
    public EditableFeature createNewFeature(boolean defaultValues)
938
        throws DataException;
939

    
940
    /**
941
     * Creates a new feature of default {@link FeatureType}.
942
     * The new feature should be initialized with the values of the feature
943
     * passed as parameter.
944
     * Values are inicialiced by name from the feature specified. Error in
945
     * value assignement are ignoreds.
946
     *
947
     * @param defaultValues the values to initialize the new feature.
948
     * @return the new feature
949
     * @throws DataException
950
     */
951
    public EditableFeature createNewFeature(Feature defaultValues)
952
        throws DataException;
953

    
954
    public EditableFeature createNewFeature(JsonObject defaultValues)
955
        throws DataException;
956

    
957
    /**
958
     * Applies the validation rules associated to the given mode to the active
959
     * {@link FeatureSet}.
960
     *
961
     * @param mode
962
     *            can be one of {MODE_QUERY, MODE_FULLEDIT, MODE_APPEND}
963
     *
964
     * @throws DataException
965
     */
966
    public void validateFeatures(int mode) throws DataException;
967

    
968
    /**
969
     * Indicates whether this store supports append mode.
970
     *
971
     * @return
972
     *         true if this store supports append mode.
973
     */
974
    public boolean isAppendModeSupported();
975

    
976
    /**
977
     * Initiates an editing group. This is typically used to group series of
978
     * store editing operations.
979
     *
980
     * @param description
981
     *            Description of the editing group.
982
     *
983
     * @throws NeedEditingModeException
984
     */
985
    public void beginEditingGroup(String description)
986
        throws NeedEditingModeException;
987

    
988
    /**
989
     * Finishes an editing group.
990
     *
991
     * @throws NeedEditingModeException
992
     */
993
    public void endEditingGroup() throws NeedEditingModeException;
994

    
995
    /*
996
     * =============================================================
997
     *
998
     * Index related services
999
     */
1000

    
1001
    /**
1002
     * Creates an index which will be applied to the features of the given type,
1003
     * by using the data of the given attribute.
1004
     *
1005
     * @param featureType
1006
     *            The FeatureType to which the indexed attribute belongs.
1007
     *
1008
     * @param attributeName
1009
     *            The name of the attributed to be indexed
1010
     *
1011
     * @param indexName
1012
     *            The index name
1013
     *
1014
     * @return the resulting {@link FeatureIndex}
1015
     *
1016
     *
1017
     * @throws FeatureIndexException
1018
     *             if there is an error creating the index
1019
     */
1020
    public FeatureIndex createIndex(FeatureType featureType,
1021
        String attributeName, String indexName) throws DataException;
1022

    
1023
    /**
1024
     * Creates an index which will be applied to the features of the given type,
1025
     * by using the data of the given attribute.
1026
     *
1027
     * @param indexTypeName
1028
     *            the type of the index to be created. That name is
1029
     *            related to one of the registered index providers
1030
     * @param featureType
1031
     *            The FeatureType to which the indexed attribute belongs.
1032
     *
1033
     * @param attributeName
1034
     *            The name of the attributed to be indexed
1035
     *
1036
     * @param indexName
1037
     *            The index name
1038
     *
1039
     * @return the resulting {@link FeatureIndex}
1040
     *
1041
     *
1042
     * @throws FeatureIndexException
1043
     *             if there is an error creating the index
1044
     */
1045
    public FeatureIndex createIndex(String indexTypeName,
1046
        FeatureType featureType, String attributeName, String indexName)
1047
        throws DataException;
1048

    
1049
    /**
1050
     * Creates an index which will be applied to the features of the given type,
1051
     * by using the data of the given attribute. This method will return without
1052
     * waiting for the index to be filled, as that will be performed in
1053
     * background. An optional {@link Observer} parameter is provided to be
1054
     * notified ( {@link FeatureStoreNotification#INDEX_FILLING_SUCCESS} )
1055
     * when the index has finished filling with data and is available to be
1056
     * used.
1057
     *
1058
     * @param featureType
1059
     *            The FeatureType to which the indexed attribute belongs.
1060
     *
1061
     * @param attributeName
1062
     *            The name of the attributed to be indexed
1063
     *
1064
     * @param indexName
1065
     *            The index name
1066
     *
1067
     * @param observer
1068
     *            to notify to when the created index has finished filling
1069
     *            with data and is available to be used. The observer will
1070
     *            receive then a
1071
     *            {@link FeatureStoreNotification#INDEX_FILLING_SUCCESS}
1072
     *            notification, with the index object if it has finished
1073
     *            successfully, or a
1074
     *            {@link FeatureStoreNotification#INDEX_FILLING_ERROR}
1075
     *            notification with the exception object if there has been
1076
     *            any error in the process. Optional.
1077
     *
1078
     * @return the resulting {@link FeatureIndex}
1079
     *
1080
     * @see FeatureStoreNotification#INDEX_FILLING_STARTED
1081
     * @see FeatureStoreNotification#INDEX_FILLING_SUCCESS
1082
     * @see FeatureStoreNotification#INDEX_FILLING_CANCELLED
1083
     * @see FeatureStoreNotification#INDEX_FILLING_ERROR
1084
     *
1085
     * @throws FeatureIndexException
1086
     *             if there is an error creating the index
1087
     */
1088
    public FeatureIndex createIndex(FeatureType featureType,
1089
        String attributeName, String indexName, Observer observer)
1090
        throws DataException;
1091

    
1092
    /**
1093
     * Creates an index which will be applied to the features of the given type,
1094
     * by using the data of the given attribute. This method will return without
1095
     * waiting for the index to be filled, as that will be performed in
1096
     * background. An optional {@link Observer} parameter is provided to be
1097
     * notified ( {@link FeatureStoreNotification#INDEX_FILLING_SUCCESS} )
1098
     * when the index has finished filling with data and is available to be
1099
     * used.
1100
     *
1101
     * @param indexTypeName
1102
     *            the type of the index to be created. That name is
1103
     *            related to one of the registered index providers
1104
     * @param featureType
1105
     *            The FeatureType to which the indexed attribute belongs.
1106
     *
1107
     * @param attributeName
1108
     *            The name of the attributed to be indexed
1109
     *
1110
     * @param indexName
1111
     *            The index name
1112
     *
1113
     * @param observer
1114
     *            to notify to when the created index has finished filling
1115
     *            with data and is available to be used. The observer will
1116
     *            receive then a
1117
     *            {@link FeatureStoreNotification#INDEX_FILLING_SUCCESS}
1118
     *            notification, with the index object if it has finished
1119
     *            successfully, or a
1120
     *            {@link FeatureStoreNotification#INDEX_FILLING_ERROR}
1121
     *            notification with the exception object if there has been
1122
     *            any error in the process. Optional.
1123
     *
1124
     * @return the resulting {@link FeatureIndex}
1125
     *
1126
     * @see FeatureStoreNotification#INDEX_FILLING_STARTED
1127
     * @see FeatureStoreNotification#INDEX_FILLING_SUCCESS
1128
     * @see FeatureStoreNotification#INDEX_FILLING_CANCELLED
1129
     * @see FeatureStoreNotification#INDEX_FILLING_ERROR
1130
     *
1131
     * @throws FeatureIndexException
1132
     *             if there is an error creating the index
1133
     */
1134
    public FeatureIndex createIndex(String indexTypeName,
1135
        FeatureType featureType, String attributeName, String indexName,
1136
        Observer observer) throws DataException;
1137

    
1138
    /**
1139
     * Returns a FeatureIndexes structure containing all available indexes in
1140
     * the store.
1141
     *
1142
     * @return
1143
     */
1144
    public FeatureIndexes getIndexes();
1145

    
1146
    /*
1147
     * =============================================================
1148
     *
1149
     * Selection related services
1150
     */
1151

    
1152
    /**
1153
     * Sets the selection to the passed {@link FeatureSet}
1154
     *
1155
     * @param selection
1156
     *            A {@link FeatureSet} with the requested selection
1157
     * @throws org.gvsig.fmap.dal.exception.DataException
1158
     */
1159
    public void setSelection(FeatureSet selection) throws DataException;
1160

    
1161
    /**
1162
     * Creates a {@link FeatureSelection}
1163
     *
1164
     * @return
1165
     *         a {@link FeatureSelection}
1166
     *
1167
     * @throws DataException
1168
     */
1169
    public FeatureSelection createFeatureSelection() throws DataException;
1170

    
1171
    /**
1172
     * Returns the current {@link FeatureSelection}.
1173
     * Create a empty selection if not exits.
1174
     * 
1175
     * Manage of the selection can be slow on some data sources. 
1176
     * Use with care.
1177
     * In data sources that do not support position access to records, 
1178
     * it may be slow to retrieve items from the selection. In some data 
1179
     * sources it may be necessary to access to this to retrieve each 
1180
     * item in the selection.
1181
     *
1182
     * @return
1183
     *         current {@link FeatureSelection}.
1184
     *
1185
     * @throws DataException
1186
     */
1187
    public FeatureSelection getFeatureSelection() throws DataException;
1188

    
1189
    /*
1190
     * =============================================================
1191
     *
1192
     * Lock related services
1193
     */
1194

    
1195
    /**
1196
     * Indicates whether this store supports locks.
1197
     *
1198
     * @return
1199
     *         true if this store supports locks, false if not.
1200
     */
1201
    public boolean isLocksSupported();
1202

    
1203
    /**
1204
     * Returns the set of locked features
1205
     *
1206
     * @return
1207
     *         set of locked features
1208
     *
1209
     * @throws DataException
1210
     */
1211
    public FeatureLocks getLocks() throws DataException;
1212

    
1213
    /*
1214
     * =============================================================
1215
     * Transforms related services
1216
     * =============================================================
1217
     */
1218

    
1219
    /**
1220
     * Returns this store transforms
1221
     *
1222
     * @return
1223
     *         this store transforms
1224
     */
1225
    public FeatureStoreTransforms getTransforms();
1226

    
1227
    /**
1228
     * Returns a new {@link FeatureQuery} associated to this store.
1229
     *
1230
     * @return
1231
     *         a new {@link FeatureQuery} associated to this store.
1232
     */
1233
    public FeatureQuery createFeatureQuery();
1234

    
1235
    /**
1236
     * Returns featue count of this store.
1237
     *
1238
     * @return
1239
     * @throws DataException
1240
     */
1241
    public long getFeatureCount() throws DataException;
1242

    
1243
//    /**
1244
//     * Creates a vectorial cache that is used to save and retrieve data.
1245
//     *
1246
//     * @param name
1247
//     *            the cache name.
1248
//     * @param parameters
1249
//     *            parameters to create the stores used to save data.
1250
//     * @throws DataException
1251
//     */
1252
//    public void createCache(String name, DynObject parameters)
1253
//        throws DataException;
1254
//
1255
//    /**
1256
//     * @return the vectorial cache
1257
//     */
1258
//    public FeatureCache getCache();
1259

    
1260
    /**
1261
     * Return if the provider knows the real envelope of a layer. If not,
1262
     * the {@link FeatureStoreProvider#getEnvelope()} method doesn't return
1263
     * the full envelope.
1264
     *
1265
     * @return true if it knows the real envelope.
1266
     */
1267
    public boolean isKnownEnvelope();
1268

    
1269
    /**
1270
     * Return if the maximum number of features provided by the
1271
     * provider are limited.
1272
     *
1273
     * @return true if there is a limit of features.
1274
     */
1275
    public boolean hasRetrievedFeaturesLimit();
1276

    
1277
    /**
1278
     * If the {@link FeatureStoreProvider#hasRetrievedFeaturesLimit()} returns
1279
     * true,
1280
     * it returns the limit of features retrieved from the provider.
1281
     *
1282
     * @return
1283
     *         The limit of the retrieved features.
1284
     */
1285
    public int getRetrievedFeaturesLimit();
1286

    
1287
    /**
1288
     * Return the associated feature to the dynobject.
1289
     * If the dynobject isn't associated to a feature of this store, return null.
1290
     *
1291
     * @param dynobject
1292
     * @return
1293
     */
1294
    public Feature getFeature(DynObject dynobject);
1295

    
1296

    
1297
    public ExpressionBuilder createExpressionBuilder();
1298

    
1299
    /**
1300
     * 
1301
     * @return 
1302
     * @deprecated use createExpressionBuilder
1303
     */
1304
    public ExpressionBuilder createExpression();
1305

    
1306
    public void createCache(String name, DynObject parameters)
1307
        throws DataException;
1308

    
1309
    @Override
1310
    public FeatureCache getCache();
1311

    
1312
    public boolean isBroken();
1313

    
1314
    public Throwable getBreakingsCause();
1315

    
1316
    /**
1317
     * Indicates if the storage is temporary.
1318
     * There is no guarantee that a temporary store can be recovered from 
1319
     * its parameters. In general these will not be persistent.
1320
     * 
1321
     * @return true if the store is temporary, otherwise false.
1322
     */
1323
    public boolean isTemporary();
1324
    
1325
    /**
1326
     * @param index
1327
     * @return
1328
     */
1329
    public SpatialIndex wrapSpatialIndex(SpatialIndex index);
1330
    
1331
    public FeatureReference getFeatureReference(String code);
1332

    
1333
    /**
1334
     * Devuelbe el numero de operaciones pendientes de guardar en una sesion
1335
     * de edicion. Es un valor orientativo.
1336
     * Las operaciones pendientes son la suma de operaciones de borrado, insercion
1337
     * o modificacion de las features en una sesion de edicion.
1338
     * 
1339
     * Retorna 0 si no esta en edicion.
1340
     * 
1341
     * @return numero de operaciones pendientes. 
1342
     */
1343
    public long getPendingChangesCount();
1344
    
1345
    public Feature getSampleFeature();
1346
    
1347
    /**
1348
     * Return true when the default feature type of the store 
1349
     * support references.
1350
     * 
1351
     * @return true when support references.
1352
     */
1353
    public boolean supportReferences();
1354
}