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

History | View | Annotate | Download (43.9 KB)

1 40559 jjdelcerro
/**
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 40435 jjdelcerro
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 44023 jjdelcerro
import org.gvsig.expressionevaluator.Expression;
31 44042 jjdelcerro
import org.gvsig.expressionevaluator.ExpressionBuilder;
32 40435 jjdelcerro
33
import org.gvsig.fmap.dal.DataServerExplorer;
34
import org.gvsig.fmap.dal.DataStore;
35
import org.gvsig.fmap.dal.DataStoreParameters;
36 44259 jjdelcerro
import org.gvsig.fmap.dal.StoresRepository;
37 40435 jjdelcerro
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 43371 fdiaz
import org.gvsig.fmap.geom.SpatialIndex;
43 40435 jjdelcerro
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 44297 jjdelcerro
import org.gvsig.tools.resourcesstorage.ResourcesStorage;
50 44346 jjdelcerro
import org.gvsig.tools.util.UnmodifiableBasicList64;
51 40435 jjdelcerro
52
/**
53
 * <p>
54
 * A FeatureStore is a type of store whose data consists on sets of
55
 * {@link Feature}(s). {@link Feature}(s) from the same FeatureStore can be of
56
 * different {@link FeatureType}(s) (as in GML format for instance).
57
 * </p>
58 41818 fdiaz
 *
59 40435 jjdelcerro
 * <p>
60
 * FeatureStore allows:
61
 * </p>
62
 * <ul>
63
 * <li>Obtaining the default {@link FeatureType}. A FeatureStore always has one
64
 * and only one default FeatureType.
65
 * <li>Obtaining the list of {@link FeatureType}(s) defined in the FeatureStore.
66
 * <li>Obtaining, filtering and sorting subsets of data ({@link FeatureSet})
67
 * through {@link FeatureQuery}, as well as background loading.
68
 * <li>Obtaining the total {@link Envelope} (AKA bounding box or extent) of the
69
 * store.
70
 * <li>Support for editing {@link FeatureType}(s).
71
 * <li>Obtaining information about contained {@link Geometry} types.
72
 * <li>Exporting to another store.
73
 * <li>Indexing.
74
 * <li>Selection.
75
 * <li>Locks management.
76
 * </ul>
77 41818 fdiaz
 *
78 40435 jjdelcerro
 */
79
public interface FeatureStore extends DataStore, UndoRedoStack, Cloneable {
80
81
    public static final String METADATA_DEFINITION_NAME = "FeatureStore";
82
83
    /** Indicates that this store is in query mode */
84
    final static int MODE_QUERY = 0;
85
86
    /** Indicates that this store is in full edit mode */
87
    final static int MODE_FULLEDIT = 1;
88
89
    /** Indicates that this store is in append mode */
90
    final static int MODE_APPEND = 2;
91
92
    /*
93
     * =============================================================
94 41818 fdiaz
     *
95 40435 jjdelcerro
     * information related services
96
     */
97
98
    /**
99
     * Indicates whether this store allows writing.
100 41818 fdiaz
     *
101 40435 jjdelcerro
     * @return
102
     *         true if this store can be written, false if not.
103
     */
104
    public boolean allowWrite();
105
106
    /**
107
     * Returns this store's default {@link FeatureType}.
108 41818 fdiaz
     *
109 40435 jjdelcerro
     * @return
110
     *         this store's default {@link FeatureType}.
111 41818 fdiaz
     *
112 40435 jjdelcerro
     * @throws DataException
113
     */
114
    public FeatureType getDefaultFeatureType() throws DataException;
115
116
    /**
117
     * Returns this store's featureType {@link FeatureType} matches with
118
     * featureTypeId.
119 41818 fdiaz
     *
120 40435 jjdelcerro
     * @param featureTypeId
121 41818 fdiaz
     *
122 40435 jjdelcerro
     * @return this store's default {@link FeatureType}.
123 41818 fdiaz
     *
124 40435 jjdelcerro
     * @throws DataException
125
     */
126
    public FeatureType getFeatureType(String featureTypeId)
127
        throws DataException;
128
129
    /**
130
     * Returns this store's {@link FeatureType}(s).
131 41818 fdiaz
     *
132 40435 jjdelcerro
     * @return a list with this store's {@link FeatureType}(s).
133 41818 fdiaz
     *
134 40435 jjdelcerro
     * @throws DataException
135
     */
136
    public List getFeatureTypes() throws DataException;
137
138
    /**
139
     * Returns this store's parameters.
140 41818 fdiaz
     *
141 40435 jjdelcerro
     * @return
142
     *         {@link DataStoreParameters} containing this store's parameters
143
     */
144
    public DataStoreParameters getParameters();
145
146
    /**
147
     *@throws DataException
148
     * @deprecated Mirar de cambiarlo a metadatos
149
     */
150
    public boolean canWriteGeometry(int gvSIGgeometryType) throws DataException;
151
152
    /**
153
     * Returns this store's total envelope (extent).
154 41818 fdiaz
     *
155 40435 jjdelcerro
     * @return this store's total envelope (extent) or <code>null</code> if
156
     *         store not have geometry information
157
     */
158
    public Envelope getEnvelope() throws DataException;
159
160
    /**
161 41818 fdiaz
     *
162 40435 jjdelcerro
     * @deprecated use getDefaultFeatureType().getDefaultSRS()
163
     * @return
164
     * @throws DataException
165
     */
166
    public IProjection getSRSDefaultGeometry() throws DataException;
167
168
    /**
169
     * Exports this store to another store.
170 41818 fdiaz
     *
171 40435 jjdelcerro
     * @param explorer
172
     *            {@link DataServerExplorer} target
173
     * @param params
174
     *            New parameters of this store that will be used on the target
175
     *            explorer
176 41818 fdiaz
     *
177 40435 jjdelcerro
     * @throws DataException
178 41818 fdiaz
     *
179 40435 jjdelcerro
     * @Deprecated this method is unstable
180
     */
181
    public void export(DataServerExplorer explorer, String provider,
182
        NewFeatureStoreParameters params) throws DataException;
183
184 44318 jjdelcerro
    public void copyTo(FeatureStore target);
185
186 40435 jjdelcerro
    /*
187
     * =============================================================
188 41818 fdiaz
     *
189 40435 jjdelcerro
     * Query related services
190
     */
191 44346 jjdelcerro
192
    /**
193
     * Create a {@link FeatureQuery} with the restrictions indicateds.
194
     *
195
     * "filter" will be null or a valid filter expression for the store.
196
     *
197
     * "sortBy" can be null to use the store's default order.
198
     *
199
     * The parameter sortBy can be an attribute name or a comma separated list.
200
     * Each attribute name can be preceded or followed by "+" or "-" to indicate
201
     * the order to use to sort by that attribute.
202
     *
203
     * If no "+" or "-" is indicated, the "asc" parameter will be used to
204
     * determine if the order is ascending, "true" or decent, "false".
205
     *
206
     * @param filter an {@link String} expression used to filter the features in the store.
207
     * @param sortBy Attribute names separated by commas used to sort the list to return.
208
     * @param asc use order ascending, true, or descending, false.
209
     * @return a {@link FeatureQuery} with the restrictions.
210
     * @see {@link FeatureQuery}
211
     */
212
    public FeatureQuery createFeatureQuery(String filter, String sortBy, boolean asc);
213 40435 jjdelcerro
214 44346 jjdelcerro
    /**
215
     * Create a {@link FeatureQuery} with the restrictions indicateds.
216
     *
217
     * "filter" will be null or {@link Expression} valid for the store.
218
     *
219
     * "sortBy" can be null to use the store's default order.
220
     *
221
     * The parameter sortBy can be an attribute name or a comma separated list.
222
     * Each attribute name can be preceded or followed by "+" or "-" to indicate
223
     * the order to use to sort by that attribute.
224
     *
225
     * If no "+" or "-" is indicated, the "asc" parameter will be used to
226
     * determine if the order is ascending, "true" or decent, "false".
227
     *
228
     * @param filter an {@link String} expression used to filter the features in the store.
229
     * @param sortBy Attribute names separated by commas used to sort the list to return.
230
     * @param asc use order ascending, true, or descending, false.
231
     * @return a {@link FeatureQuery} with the restrictions.
232
     * @see {@link FeatureQuery}
233
     */
234
    public FeatureQuery createFeatureQuery(Expression filter, String sortBy, boolean asc);
235
236 40435 jjdelcerro
    /**
237
     * Returns all available features in the store.
238 41818 fdiaz
     *
239 44346 jjdelcerro
     * It is a utility method that calls {@link #getFeatureSet(FeatureQuery)}
240
     *
241
     * @return the {@link FeatureSet}
242
     * @throws ReadException if there is any error while reading the features
243
     * @see {@link #accept(org.gvsig.tools.visitor.Visitor)}, {@link #getFeatureSet(FeatureQuery)}
244 40435 jjdelcerro
     */
245
    FeatureSet getFeatureSet() throws DataException;
246
247 44346 jjdelcerro
    /**
248
     * Return a subset of features.
249
     *
250
     * It is a utility method that calls {@link #getFeatureSet(FeatureQuery)}
251
     *
252
     * @param filter an {@link String} expression used to filter the features in the store.
253
     * @return the {@link FeatureSet}
254
     * @throws ReadException if there is any error while reading the features
255
     * @see {@link #createFeatureQuery(Expression,String,boolean)}, {@link #getFeatureSet(FeatureQuery)}
256
     */
257 43533 jjdelcerro
    FeatureSet getFeatureSet(String filter) throws DataException;
258
259 44346 jjdelcerro
    /**
260
     * Return a subset of features.
261
     *
262
     * It is a utility method that calls {@link #getFeatureSet(FeatureQuery)}
263
     *
264
     * The sort order used is ascending.
265
     *
266
     * @param filter an {@link String} expression used to filter the features in the store.
267
     * @param sortBy Attribute names separated by commas used to sort the list to return.
268
     * @return the {@link FeatureSet}
269
     * @throws ReadException if there is any error while reading the features
270
     * @see {@link #createFeatureQuery(Expression,String,boolean)}, {@link #getFeatureSet(FeatureQuery)}
271
     */
272 43533 jjdelcerro
    FeatureSet getFeatureSet(String filter, String sortBy) throws DataException;
273
274 44346 jjdelcerro
    /**
275
     * Return a subset of features.
276
     *
277
     * It is a utility method that calls {@link #getFeatureSet(FeatureQuery)}
278
     *
279
     * @param filter an {@link String} expression used to filter the features in the store.
280
     * @param sortBy Attribute names separated by commas used to sort the list to return.
281
     * @param asc use order ascending, true, or descending, false.
282
     * @return the {@link FeatureSet}
283
     * @throws ReadException if there is any error while reading the features
284
     * @see {@link #createFeatureQuery(Expression,String,boolean)}, {@link #getFeatureSet(FeatureQuery)}
285
     */
286 43533 jjdelcerro
    FeatureSet getFeatureSet(String filter, String sortBy, boolean asc) throws DataException;
287
288 44346 jjdelcerro
    /**
289
     * Return a subset of features.
290
     *
291
     * It is a utility method that calls {@link #getFeatureSet(FeatureQuery)}
292
     *
293
     * @param filter an {@link Expression} used to filter the features in the store.
294
     * @return the {@link FeatureSet}
295
     * @throws DataException
296
     * @see {@link #createFeatureQuery(Expression,String,boolean)}, {@link #getFeatureSet(FeatureQuery)}
297
     */
298 44023 jjdelcerro
    FeatureSet getFeatureSet(Expression filter) throws DataException;
299
300 44346 jjdelcerro
    /**
301
     * Return a subset of features.
302
     *
303
     * It is a utility method that calls {@link #getFeatureSet(FeatureQuery)}
304
     *
305
     * The sort order used is ascending.
306
     *
307
     * @param filter an {@link Expression} used to filter the features in the store.
308
     * @param sortBy Attribute names separated by commas used to sort the list to return.
309
     * @return the {@link FeatureSet}
310
     * @throws ReadException if there is any error while reading the features
311
     * @see {@link #createFeatureQuery(Expression,String,boolean)}, {@link #getFeatureSet(FeatureQuery)}
312
     */
313 44023 jjdelcerro
    FeatureSet getFeatureSet(Expression filter, String sortBy) throws DataException;
314
315 44346 jjdelcerro
    /**
316
     * Return a subset of features.
317
     *
318
     * It is a utility method that calls {@link #getFeatureSet(FeatureQuery)}
319
     *
320
     * @param filter an {@link Expression} used to filter the features in the store.
321
     * @param sortBy Attribute names separated by commas used to sort the list to return.
322
     * @param asc use order ascending, true, or descending, false.
323
     * @return the {@link FeatureSet}
324
     * @throws DataException
325
     * @see {@link #createFeatureQuery(Expression,String,boolean)}, {@link #getFeatureSet(FeatureQuery)}
326
     */
327 44023 jjdelcerro
    FeatureSet getFeatureSet(Expression filter, String sortBy, boolean asc) throws DataException;
328 44346 jjdelcerro
329 40435 jjdelcerro
    /**
330
     * Returns a subset of features taking into account the properties and
331 44346 jjdelcerro
     * restrictions of the {@link FeatureQuery}.
332
     *
333
     * If {@link FeatureQuery} is null, return al features in the store.
334
     *
335 40435 jjdelcerro
     * <p>
336
     * <em>
337 41818 fdiaz
     * <strong>NOTE:</strong> if you use this method to get a
338
     * {@link FeatureSet}, you  must get sure it is disposed
339
     * (@see {@link DisposableIterator#dispose()}) in any case, even if an
340
     * error occurs while getting the data. It is recommended to use the
341
     * <code>accept</code> methods instead, which handle everything for you.
342
     * Take into account the accept methods may use a fast iterator to
343 40435 jjdelcerro
     * get the features.
344
     * </em>
345
     * </p>
346 41818 fdiaz
     *
347 44346 jjdelcerro
     * @param featureQuery defines the characteristics of the features to return.
348
     * @return the {@link FeatureSet}
349
     * @throws ReadException if there is any error while reading the features.
350
     * @see #accept(org.gvsig.tools.visitor.Visitor, org.gvsig.fmap.dal.DataQuery)
351 40435 jjdelcerro
     */
352
    FeatureSet getFeatureSet(FeatureQuery featureQuery) throws DataException;
353
354
    /**
355
     * Loads a subset of features taking into account the properties and
356 44346 jjdelcerro
     * restrictions of the FeatureQuery.
357
     * When feature loading is finished call the Observer passing the
358
     * {@link FeatureSet}  loaded.
359 41818 fdiaz
     *
360 44346 jjdelcerro
     * @param featureQuery defines the characteristics of the features to return.
361
     * @param observer to be notified when loading is finished.
362
     * @throws DataException if there is any error while loading the features
363 40435 jjdelcerro
     */
364 44346 jjdelcerro
    void getFeatureSet(FeatureQuery featureQuery, Observer observer) throws DataException;
365 40435 jjdelcerro
366
    /**
367
     * Loads all available feature in the store. The loading of Features is
368
     * performed by calling the Observer, once each loaded Feature.
369 41818 fdiaz
     *
370 44346 jjdelcerro
     * @param observer to be notified of each loaded Feature
371
     * @throws DataException if there is any error while loading the features
372 40435 jjdelcerro
     */
373
    void getFeatureSet(Observer observer) throws DataException;
374
375
    /**
376 42925 jjdelcerro
     * Return a paginated list of Features filtered by the query.
377 44346 jjdelcerro
     *
378
     * If the query  is null, return all features in the store sorteds
379
     * by default order.
380
     *
381
     * The return value implements {@link List} and {@link UnmodifiableBasicList64}
382
     * to support large list of features.
383
     *
384
     * The returned list of Features is paginated, and the page size
385
     * used is "pageSize".
386
     *
387
     * If the page size is less than or equal to 0, the default page size of
388
     * 100 will be used.
389 43371 fdiaz
     *
390 44346 jjdelcerro
     * @param query to filter and sort the returned feature list
391 42925 jjdelcerro
     * @param pageSize the page size of the list
392 44346 jjdelcerro
     * @return the {@link List}/{@link UnmodifiableBasicList64} of features
393 42925 jjdelcerro
     */
394
    public List<Feature> getFeatures(FeatureQuery query, int pageSize);
395 43371 fdiaz
396 44346 jjdelcerro
    /**
397
     * Return a paginated list of Features.
398
     *
399
     * It is a utility method that calls {@link #getFeatures(FeatureQuery, int)}
400
     * using the default page size.
401
     *
402
     * @param query to filter and sort the returned feature list
403
     * @return the {@link List}/{@link UnmodifiableBasicList64} of features
404
     * @see {@link #getFeatures(FeatureQuery, int)}
405
     */
406 43550 jjdelcerro
    public List<Feature> getFeatures(FeatureQuery query);
407
408 44346 jjdelcerro
    /**
409
     * Return a paginated list with al Features in the store.
410
     *
411
     * It is a utility method that calls {@link #getFeatures(FeatureQuery, int)}
412
     * using the default page size.
413
     *
414
     * @return the {@link List}/{@link UnmodifiableBasicList64} of features
415
     * @see {@link #getFeatures(FeatureQuery, int)}
416
     */
417 43020 jjdelcerro
    public List<Feature> getFeatures();
418 43371 fdiaz
419 44346 jjdelcerro
    /**
420
     * Return a paginated list of Features
421
     *
422
     * It is a utility method that calls {@link #getFeatures(FeatureQuery, int)}
423
     *
424
     * @param filter used to filter the features in the store.
425
     * @return the List of Features
426
     * @see {@link #getFeatures(FeatureQuery, int)}, {@link #createFeatureQuery(String,String,boolean)}
427
     */
428 43628 jjdelcerro
    public List<Feature> getFeatures(String filter);
429
430 44346 jjdelcerro
    /**
431
     * Return a paginated list of Features.
432
     *
433
     * It is a utility method that calls {@link #getFeatures(FeatureQuery, int)}
434
     * using the default page size.
435
     *
436
     * @param filter used to filter the features in the store.
437
     * @param sortBy Attribute names separated by commas used to sort the list to return.
438
     * @return the {@link List}/{@link UnmodifiableBasicList64} of features
439
     * @see {@link #getFeatures(FeatureQuery, int)}, {@link #createFeatureQuery(String,String,boolean)}
440
     */
441 43628 jjdelcerro
    public List<Feature> getFeatures(String filter, String sortBy);
442
443 44346 jjdelcerro
    /**
444
     * Return a paginated list of Features.
445
     *
446
     * It is a utility method that calls {@link #getFeatures(FeatureQuery, int)}
447
     * using the default page size.
448
     *
449
     * @param filter an {@link String} expression used to filter the features in the store.
450
     * @param sortBy Attribute names separated by commas used to sort the list to return.
451
     * @param asc use order ascending, true, or descending, false.
452
     * @return the {@link List}/{@link UnmodifiableBasicList64} of features
453
     * @see {@link #getFeatures(FeatureQuery, int)}, {@link #createFeatureQuery(String,String,boolean)}
454
     */
455 43628 jjdelcerro
    public List<Feature> getFeatures(String filter, String sortBy, boolean asc);
456
457 44346 jjdelcerro
    /**
458
     * Return a paginated list of Features
459
     *
460
     * It is a utility method that calls {@link #getFeatures(FeatureQuery, int)}
461
     * using the default page size.
462
     *
463
     * @param filter an {@link Expression} used to filter the features in the store.
464
     * @return the List of Features
465
     * @see {@link #getFeatures(FeatureQuery, int)}, {@link #createFeatureQuery(Expression,String,boolean)}
466
     */
467 44023 jjdelcerro
    public List<Feature> getFeatures(Expression filter);
468
469 44346 jjdelcerro
    /**
470
     * Return a paginated list of Features
471
     *
472
     * It is a utility method that calls {@link #getFeatures(FeatureQuery, int)}
473
     * using the default page size.
474
     *
475
     * @param filter an {@link Expression} used to filter the features in the store.
476
     * @param sortBy Attribute names separated by commas used to sort the list to return.
477
     * @return the {@link List}/{@link UnmodifiableBasicList64} of features
478
     * @see {@link #getFeatures(FeatureQuery, int)}, {@link #createFeatureQuery(Expression,String,boolean)}
479
     */
480 44023 jjdelcerro
    public List<Feature> getFeatures(Expression filter, String sortBy);
481
482 44346 jjdelcerro
    /**
483
     * Return a paginated list of Features
484
     *
485
     * It is a utility method that calls {@link #getFeatures(FeatureQuery, int)}
486
     * using the default page size.
487
     *
488
     * @param filter an {@link Expression} used to filter the features in the store.
489
     * @param sortBy Attribute names separated by commas used to sort the list to return.
490
     * @param asc use order ascending, true, or descending, false.
491
     * @return the {@link List}/{@link UnmodifiableBasicList64} of features
492
     * @see {@link #getFeatures(FeatureQuery, int)}, {@link #createFeatureQuery(Expression,String,boolean)}
493
     */
494 44023 jjdelcerro
    public List<Feature> getFeatures(Expression filter, String sortBy, boolean asc);
495
496 44346 jjdelcerro
    /**
497
     * Return the first {@link Feature} of the store.
498
     *
499
     * @return the first {@link Feature} or null if the store is empty.
500
     * @throws DataException
501
     */
502 44100 jjdelcerro
    public Feature first() throws DataException;
503
504 44346 jjdelcerro
    /**
505
     * Returns the first {@link Feature} that meets the criteria indicated.
506
     *
507
     * It is a utility method that calls {@link #findFirst(FeatureQuery)}.
508
     *
509
     * @param filter {@link String} expression used to filter the features.
510
     * @return the first {@link Feature} or null if the filter don't return any feature.
511
     * @throws DataException
512
     * @see {@link #findFirst(FeatureQuery)}, {@link #createFeatureQuery(String,String,boolean)}
513
     */
514 43628 jjdelcerro
    public Feature findFirst(String filter) throws DataException;
515
516 44346 jjdelcerro
    /**
517
     * Returns the first {@link Feature} that meets the criteria indicated.
518
     *
519
     * It is a utility method that calls {@link #findFirst(FeatureQuery)}.
520
     *
521
     * @param filter {@link String} expression used to filter the features.
522
     * @param sortBy Attribute names separated by commas used to sort the list to return.
523
     * @return the first {@link Feature} or null if the filter don't return any feature.
524
     * @throws DataException
525
     * @see {@link #findFirst(FeatureQuery)}, {@link #createFeatureQuery(String,String,boolean)}
526
     */
527 43628 jjdelcerro
    public Feature findFirst(String filter, String sortBy) throws DataException;
528
529 44346 jjdelcerro
    /**
530
     * Returns the first {@link Feature} that meets the criteria indicated.
531
     *
532
     * It is a utility method that calls {@link #findFirst(FeatureQuery)}.
533
     *
534
     * @param filter {@link String} expression used to filter the features.
535
     * @param sortBy Attribute names separated by commas used to sort the list to return.
536
     * @param asc use order ascending, true, or descending, false.
537
     * @return the first {@link Feature} or null if the filter don't return any feature.
538
     * @throws DataException
539
     * @see {@link #findFirst(FeatureQuery)}, {@link #createFeatureQuery(String,String,boolean)}
540
     */
541 43628 jjdelcerro
    public Feature findFirst(String filter, String sortBy, boolean asc) throws DataException;
542
543 44346 jjdelcerro
    /**
544
     * Returns the first {@link Feature} that meets the criteria indicated.
545
     *
546
     * It is a utility method that calls {@link #findFirst(FeatureQuery)}.
547
     *
548
     * @param filter {@link String} expression used to filter the features.
549
     * @return the first {@link Feature} or null if the filter don't return any feature.
550
     * @throws DataException
551
     * @see {@link #findFirst(FeatureQuery)}, {@link #createFeatureQuery(Expession,String,boolean)}
552
     */
553 44023 jjdelcerro
    public Feature findFirst(Expression filter) throws DataException;
554
555 44346 jjdelcerro
    /**
556
     * Returns the first {@link Feature} that meets the criteria indicated.
557
     *
558
     * It is a utility method that calls {@link #findFirst(FeatureQuery)}.
559
     *
560
     * @param filter {@link String} expression used to filter the features.
561
     * @param sortBy Attribute names separated by commas used to sort the list to return.
562
     * @return the first {@link Feature} or null if the filter don't return any feature.
563
     * @throws DataException
564
     * @see {@link #findFirst(FeatureQuery)}, {@link #createFeatureQuery(Expession,String,boolean)}
565
     */
566 44023 jjdelcerro
    public Feature findFirst(Expression filter, String sortBy) throws DataException;
567
568 44346 jjdelcerro
    /**
569
     * Returns the first {@link Feature} that meets the criteria indicated.
570
     *
571
     * It is a utility method that calls {@link #findFirst(FeatureQuery)}.
572
     *
573
     * @param filter {@link String} expression used to filter the features.
574
     * @param sortBy Attribute names separated by commas used to sort the list to return.
575
     * @param asc use order ascending, true, or descending, false.
576
     * @return the first {@link Feature} or null if the filter don't return any feature.
577
     * @throws DataException
578
     * @see {@link #findFirst(FeatureQuery)}, {@link #createFeatureQuery(Expession,String,boolean)}
579
     */
580 44023 jjdelcerro
    public Feature findFirst(Expression filter, String sortBy, boolean asc) throws DataException;
581
582 44346 jjdelcerro
    /**
583
     * Returns the first {@link Feature} that meets the criteria indicated.
584
     *
585
     * It is a utility method that calls {@link #findFirst(FeatureQuery)}.
586
     *
587
     * @param query to filter and sort the returned feature list
588
     * @return the first {@link Feature} or null if the filter don't return any feature.
589
     * @throws DataException
590
     * @see {@link #findFirst(FeatureQuery)}, {@link #createFeatureQuery(Expession,String,boolean)}
591
     */
592 44262 jjdelcerro
    public Feature findFirst(FeatureQuery query) throws DataException;
593 44346 jjdelcerro
594 42925 jjdelcerro
    /**
595 40435 jjdelcerro
     * Returns the feature given its reference.
596 41818 fdiaz
     *
597 44346 jjdelcerro
     * @param reference a unique FeatureReference
598
     * @return
599
     * @returnThe Feature
600 40435 jjdelcerro
     * @throws DataException
601 41818 fdiaz
     *
602 40435 jjdelcerro
     */
603 44346 jjdelcerro
    public Feature getFeatureByReference(FeatureReference reference) throws DataException;
604 40435 jjdelcerro
605
    /**
606
     * Returns the feature given its reference and feature type.
607 41818 fdiaz
     *
608 40435 jjdelcerro
     * @param reference
609
     *            a unique FeatureReference
610 41818 fdiaz
     *
611 40435 jjdelcerro
     * @param featureType
612
     *            FeatureType to which the requested Feature belongs
613 41818 fdiaz
     *
614 40435 jjdelcerro
     * @return
615
     *         The Feature
616 41818 fdiaz
     *
617 40435 jjdelcerro
     * @throws DataException
618 41818 fdiaz
     *
619 40435 jjdelcerro
     */
620
    public Feature getFeatureByReference(FeatureReference reference,
621
        FeatureType featureType) throws DataException;
622
623
    /*
624
     * =============================================================
625 41818 fdiaz
     *
626 40435 jjdelcerro
     * Editing related services
627
     */
628
629
    /**
630
     * Enters editing state.
631
     */
632
    public void edit() throws DataException;
633
634
    /**
635
     * Enters editing state specifying the editing mode.
636 41818 fdiaz
     *
637 40435 jjdelcerro
     * @param mode
638 41818 fdiaz
     *
639 40435 jjdelcerro
     * @throws DataException
640
     */
641
    public void edit(int mode) throws DataException;
642
643
    /**
644
     * Cancels all editing since the last edit().
645 41818 fdiaz
     *
646 40435 jjdelcerro
     * @throws DataException
647
     */
648
    public void cancelEditing() throws DataException;
649
650
    /**
651
     * Exits editing state.
652 41818 fdiaz
     *
653 40435 jjdelcerro
     * @throws DataException
654
     */
655
    public void finishEditing() throws DataException;
656
657
    /**
658
     * Save changes in the provider without leaving the edit mode.
659
     * Do not call observers to communicate a change of ediding mode.
660
     * The operation's history is eliminated to prevent inconsistencies
661
     * in the data.
662
     *
663
     * @throws DataException
664
     */
665
    public void commitChanges() throws DataException ;
666
667
    /**
668
     *
669
     * Returns true if you can call CommitChanges method.
670
     * If not in editing or changes have been made in the structure
671
     * return false.
672 41818 fdiaz
     *
673 40435 jjdelcerro
     * @return true if can call commitChanges
674 41818 fdiaz
     * @throws DataException
675 40435 jjdelcerro
     */
676
    public boolean canCommitChanges() throws DataException;
677
678 41818 fdiaz
679 40435 jjdelcerro
    /**
680
     * Indicates whether this store is in editing state.
681 41818 fdiaz
     *
682 40435 jjdelcerro
     * @return
683
     *         true if this store is in editing state, false if not.
684
     */
685
    public boolean isEditing();
686
687
    /**
688
     * Indicates whether this store is in appending state. In this state the new
689
     * features are automatically inserted at the end of the {@link FeatureSet}.
690 41818 fdiaz
     *
691 40435 jjdelcerro
     * @return true if this store is in appending state.
692
     */
693
    public boolean isAppending();
694
695
    /**
696
     * Updates a {@link FeatureType} in the store with the changes in the
697
     * {@link EditableFeatureType}.<br>
698 41818 fdiaz
     *
699 40435 jjdelcerro
     * Any {@link FeatureSet} from this store that are used will be invalidated.
700 41818 fdiaz
     *
701 40435 jjdelcerro
     * @param featureType
702
     *            an {@link EditableFeatureType} with the changes.
703 41818 fdiaz
     *
704 40435 jjdelcerro
     * @throws DataException
705
     */
706
    public void update(EditableFeatureType featureType) throws DataException;
707
708
    /**
709
     * Updates a {@link Feature} in the store with the changes in the
710
     * {@link EditableFeature}.<br>
711 41818 fdiaz
     *
712 40435 jjdelcerro
     * Any {@link FeatureSet} from this store that was still in use will be
713
     * invalidated. You can override this using
714
     * {@link FeatureSet#update(EditableFeature)}.
715 41818 fdiaz
     *
716 40435 jjdelcerro
     * @param feature
717
     *            the feature to be updated
718 41818 fdiaz
     *
719 40435 jjdelcerro
     * @throws DataException
720
     */
721
    public void update(EditableFeature feature) throws DataException;
722
723
    /**
724
     * Deletes a {@link Feature} from the store.<br>
725 41818 fdiaz
     *
726 40435 jjdelcerro
     * Any {@link FeatureSet} from this store that was still in use will be
727
     * invalidated. You can override this using {@link Iterator#remove()} from
728
     * {@link FeatureSet}.
729 41818 fdiaz
     *
730 40435 jjdelcerro
     * @param feature
731
     *            The feature to be deleted.
732 41818 fdiaz
     *
733 40435 jjdelcerro
     * @throws DataException
734
     */
735
    public void delete(Feature feature) throws DataException;
736
737
    /**
738
     * Inserts a {@link Feature} in the store.<br>
739 41818 fdiaz
     *
740 40435 jjdelcerro
     * Any {@link FeatureSet} from this store that was still in use will be
741
     * invalidated. You can override this using
742
     * {@link FeatureSet#insert(EditableFeature)}.
743 41818 fdiaz
     *
744 40435 jjdelcerro
     * @param feature
745
     *            The feature to be inserted
746 41818 fdiaz
     *
747 40435 jjdelcerro
     * @throws DataException
748
     */
749
    public void insert(EditableFeature feature) throws DataException;
750
751
    /**
752
     * Creates a new feature using the default feature type and returns it as an
753
     * {@link EditableFeature}
754 41818 fdiaz
     *
755 40435 jjdelcerro
     * @return a new feature in editable state
756 41818 fdiaz
     *
757 40435 jjdelcerro
     * @throws DataException
758
     */
759
    public EditableFeature createNewFeature() throws DataException;
760
761
    /**
762
     * Creates a new feature of the given {@link FeatureType} and uses the given
763
     * {@link Feature} as default values to initialize it.
764 41818 fdiaz
     *
765 40435 jjdelcerro
     * @param type
766
     *            the new feature's feature type
767 41818 fdiaz
     *
768 40435 jjdelcerro
     * @param defaultValues
769
     *            a feature whose values are used as default values for the new
770
     *            feature.
771 41818 fdiaz
     *
772 40435 jjdelcerro
     * @return the new feature.
773 41818 fdiaz
     *
774 40435 jjdelcerro
     * @throws DataException
775
     */
776
    public EditableFeature createNewFeature(FeatureType type,
777
        Feature defaultValues) throws DataException;
778
779
    /**
780
     * Creates a new feature of the given {@link FeatureType}. The flag
781
     * defaultValues is used to indicate whether the new feature should be
782
     * initialized with default values or not.
783 41818 fdiaz
     *
784 40435 jjdelcerro
     * @param type
785
     *            the new feature's feature type
786 41818 fdiaz
     *
787 40435 jjdelcerro
     * @param defaultValues
788
     *            if true the new feature is initialized with each attribute's
789
     *            default value.
790 41818 fdiaz
     *
791 40435 jjdelcerro
     * @return
792
     *         the new feature
793 41818 fdiaz
     *
794 40435 jjdelcerro
     * @throws DataException
795
     */
796
    public EditableFeature createNewFeature(FeatureType type,
797
        boolean defaultValues) throws DataException;
798
799
    /**
800
     * Creates a new feature of default {@link FeatureType}. The flag
801
     * defaultValues is used to indicate whether the new feature should be
802
     * initialized with default values or not.
803 41818 fdiaz
     *
804 40435 jjdelcerro
     * @param defaultValues
805
     *            if true the new feature is initialized with each attribute's
806
     *            default value.
807 41818 fdiaz
     *
808 40435 jjdelcerro
     * @return
809
     *         the new feature
810 41818 fdiaz
     *
811 40435 jjdelcerro
     * @throws DataException
812
     */
813
    public EditableFeature createNewFeature(boolean defaultValues)
814
        throws DataException;
815
816
    /**
817 43371 fdiaz
     * Creates a new feature of default {@link FeatureType}.
818
     * The new feature should be initialized with the values of the feature
819 42293 jjdelcerro
     * passed as parameter.
820
     * Values are inicialiced by name from the feature specified. Error in
821
     * value assignement are ignoreds.
822 43371 fdiaz
     *
823 42293 jjdelcerro
     * @param defaultValues the values to initialize the new feature.
824
     * @return the new feature
825 43371 fdiaz
     * @throws DataException
826 42293 jjdelcerro
     */
827
    public EditableFeature createNewFeature(Feature defaultValues)
828
        throws DataException;
829
830
    /**
831 40435 jjdelcerro
     * Applies the validation rules associated to the given mode to the active
832
     * {@link FeatureSet}.
833 41818 fdiaz
     *
834 40435 jjdelcerro
     * @param mode
835
     *            can be one of {MODE_QUERY, MODE_FULLEDIT, MODE_APPEND}
836 41818 fdiaz
     *
837 40435 jjdelcerro
     * @throws DataException
838
     */
839
    public void validateFeatures(int mode) throws DataException;
840
841
    /**
842
     * Indicates whether this store supports append mode.
843 41818 fdiaz
     *
844 40435 jjdelcerro
     * @return
845
     *         true if this store supports append mode.
846
     */
847
    public boolean isAppendModeSupported();
848
849
    /**
850
     * Initiates an editing group. This is typically used to group series of
851
     * store editing operations.
852 41818 fdiaz
     *
853 40435 jjdelcerro
     * @param description
854
     *            Description of the editing group.
855 41818 fdiaz
     *
856 40435 jjdelcerro
     * @throws NeedEditingModeException
857
     */
858
    public void beginEditingGroup(String description)
859
        throws NeedEditingModeException;
860
861
    /**
862
     * Finishes an editing group.
863 41818 fdiaz
     *
864 40435 jjdelcerro
     * @throws NeedEditingModeException
865
     */
866
    public void endEditingGroup() throws NeedEditingModeException;
867
868
    /*
869
     * =============================================================
870 41818 fdiaz
     *
871 40435 jjdelcerro
     * Index related services
872
     */
873
874
    /**
875
     * Creates an index which will be applied to the features of the given type,
876
     * by using the data of the given attribute.
877 41818 fdiaz
     *
878 40435 jjdelcerro
     * @param featureType
879
     *            The FeatureType to which the indexed attribute belongs.
880 41818 fdiaz
     *
881 40435 jjdelcerro
     * @param attributeName
882
     *            The name of the attributed to be indexed
883 41818 fdiaz
     *
884 40435 jjdelcerro
     * @param indexName
885
     *            The index name
886 41818 fdiaz
     *
887 40435 jjdelcerro
     * @return the resulting {@link FeatureIndex}
888 41818 fdiaz
     *
889
     *
890 40435 jjdelcerro
     * @throws FeatureIndexException
891
     *             if there is an error creating the index
892
     */
893
    public FeatureIndex createIndex(FeatureType featureType,
894
        String attributeName, String indexName) throws DataException;
895
896
    /**
897
     * Creates an index which will be applied to the features of the given type,
898
     * by using the data of the given attribute.
899 41818 fdiaz
     *
900 40435 jjdelcerro
     * @param indexTypeName
901
     *            the type of the index to be created. That name is
902
     *            related to one of the registered index providers
903
     * @param featureType
904
     *            The FeatureType to which the indexed attribute belongs.
905 41818 fdiaz
     *
906 40435 jjdelcerro
     * @param attributeName
907
     *            The name of the attributed to be indexed
908 41818 fdiaz
     *
909 40435 jjdelcerro
     * @param indexName
910
     *            The index name
911 41818 fdiaz
     *
912 40435 jjdelcerro
     * @return the resulting {@link FeatureIndex}
913 41818 fdiaz
     *
914
     *
915 40435 jjdelcerro
     * @throws FeatureIndexException
916
     *             if there is an error creating the index
917
     */
918
    public FeatureIndex createIndex(String indexTypeName,
919
        FeatureType featureType, String attributeName, String indexName)
920
        throws DataException;
921
922
    /**
923
     * Creates an index which will be applied to the features of the given type,
924
     * by using the data of the given attribute. This method will return without
925
     * waiting for the index to be filled, as that will be performed in
926
     * background. An optional {@link Observer} parameter is provided to be
927
     * notified ( {@link FeatureStoreNotification#INDEX_FILLING_SUCCESS} )
928
     * when the index has finished filling with data and is available to be
929
     * used.
930 41818 fdiaz
     *
931 40435 jjdelcerro
     * @param featureType
932
     *            The FeatureType to which the indexed attribute belongs.
933 41818 fdiaz
     *
934 40435 jjdelcerro
     * @param attributeName
935
     *            The name of the attributed to be indexed
936 41818 fdiaz
     *
937 40435 jjdelcerro
     * @param indexName
938
     *            The index name
939 41818 fdiaz
     *
940 40435 jjdelcerro
     * @param observer
941
     *            to notify to when the created index has finished filling
942
     *            with data and is available to be used. The observer will
943
     *            receive then a
944
     *            {@link FeatureStoreNotification#INDEX_FILLING_SUCCESS}
945
     *            notification, with the index object if it has finished
946
     *            successfully, or a
947
     *            {@link FeatureStoreNotification#INDEX_FILLING_ERROR}
948
     *            notification with the exception object if there has been
949
     *            any error in the process. Optional.
950 41818 fdiaz
     *
951 40435 jjdelcerro
     * @return the resulting {@link FeatureIndex}
952 41818 fdiaz
     *
953 40435 jjdelcerro
     * @see FeatureStoreNotification#INDEX_FILLING_STARTED
954
     * @see FeatureStoreNotification#INDEX_FILLING_SUCCESS
955
     * @see FeatureStoreNotification#INDEX_FILLING_CANCELLED
956
     * @see FeatureStoreNotification#INDEX_FILLING_ERROR
957 41818 fdiaz
     *
958 40435 jjdelcerro
     * @throws FeatureIndexException
959
     *             if there is an error creating the index
960
     */
961
    public FeatureIndex createIndex(FeatureType featureType,
962
        String attributeName, String indexName, Observer observer)
963
        throws DataException;
964
965
    /**
966
     * Creates an index which will be applied to the features of the given type,
967
     * by using the data of the given attribute. This method will return without
968
     * waiting for the index to be filled, as that will be performed in
969
     * background. An optional {@link Observer} parameter is provided to be
970
     * notified ( {@link FeatureStoreNotification#INDEX_FILLING_SUCCESS} )
971
     * when the index has finished filling with data and is available to be
972
     * used.
973 41818 fdiaz
     *
974 40435 jjdelcerro
     * @param indexTypeName
975
     *            the type of the index to be created. That name is
976
     *            related to one of the registered index providers
977
     * @param featureType
978
     *            The FeatureType to which the indexed attribute belongs.
979 41818 fdiaz
     *
980 40435 jjdelcerro
     * @param attributeName
981
     *            The name of the attributed to be indexed
982 41818 fdiaz
     *
983 40435 jjdelcerro
     * @param indexName
984
     *            The index name
985 41818 fdiaz
     *
986 40435 jjdelcerro
     * @param observer
987
     *            to notify to when the created index has finished filling
988
     *            with data and is available to be used. The observer will
989
     *            receive then a
990
     *            {@link FeatureStoreNotification#INDEX_FILLING_SUCCESS}
991
     *            notification, with the index object if it has finished
992
     *            successfully, or a
993
     *            {@link FeatureStoreNotification#INDEX_FILLING_ERROR}
994
     *            notification with the exception object if there has been
995
     *            any error in the process. Optional.
996 41818 fdiaz
     *
997 40435 jjdelcerro
     * @return the resulting {@link FeatureIndex}
998 41818 fdiaz
     *
999 40435 jjdelcerro
     * @see FeatureStoreNotification#INDEX_FILLING_STARTED
1000
     * @see FeatureStoreNotification#INDEX_FILLING_SUCCESS
1001
     * @see FeatureStoreNotification#INDEX_FILLING_CANCELLED
1002
     * @see FeatureStoreNotification#INDEX_FILLING_ERROR
1003 41818 fdiaz
     *
1004 40435 jjdelcerro
     * @throws FeatureIndexException
1005
     *             if there is an error creating the index
1006
     */
1007
    public FeatureIndex createIndex(String indexTypeName,
1008
        FeatureType featureType, String attributeName, String indexName,
1009
        Observer observer) throws DataException;
1010
1011
    /**
1012
     * Returns a FeatureIndexes structure containing all available indexes in
1013
     * the store.
1014 41818 fdiaz
     *
1015 40435 jjdelcerro
     * @return
1016
     */
1017
    public FeatureIndexes getIndexes();
1018
1019
    /*
1020
     * =============================================================
1021 41818 fdiaz
     *
1022 40435 jjdelcerro
     * Selection related services
1023
     */
1024
1025
    /**
1026
     * Sets the selection to the passed {@link FeatureSet}
1027 41818 fdiaz
     *
1028 40435 jjdelcerro
     * @param selection
1029
     *            A {@link FeatureSet} with the requested selection
1030
     */
1031
    public void setSelection(FeatureSet selection) throws DataException;
1032
1033
    /**
1034
     * Creates a {@link FeatureSelection}
1035 41818 fdiaz
     *
1036 40435 jjdelcerro
     * @return
1037
     *         a {@link FeatureSelection}
1038 41818 fdiaz
     *
1039 40435 jjdelcerro
     * @throws DataException
1040
     */
1041
    public FeatureSelection createFeatureSelection() throws DataException;
1042
1043
    /**
1044
     * Returns the current {@link FeatureSelection}.
1045
     * Create a empty selection if not exits.
1046 43358 jjdelcerro
     *
1047
     * Manage of the selection can be slow on some data sources.
1048
     * Use with care.
1049
     * In data sources that do not support position access to records,
1050
     * it may be slow to retrieve items from the selection. In some data
1051
     * sources it may be necessary to access to this to retrieve each
1052
     * item in the selection.
1053 41818 fdiaz
     *
1054 40435 jjdelcerro
     * @return
1055
     *         current {@link FeatureSelection}.
1056 41818 fdiaz
     *
1057 40435 jjdelcerro
     * @throws DataException
1058
     */
1059
    public FeatureSelection getFeatureSelection() throws DataException;
1060
1061
    /*
1062
     * =============================================================
1063 41818 fdiaz
     *
1064 40435 jjdelcerro
     * Lock related services
1065
     */
1066
1067
    /**
1068
     * Indicates whether this store supports locks.
1069 41818 fdiaz
     *
1070 40435 jjdelcerro
     * @return
1071
     *         true if this store supports locks, false if not.
1072
     */
1073
    public boolean isLocksSupported();
1074
1075
    /**
1076
     * Returns the set of locked features
1077 41818 fdiaz
     *
1078 40435 jjdelcerro
     * @return
1079
     *         set of locked features
1080 41818 fdiaz
     *
1081 40435 jjdelcerro
     * @throws DataException
1082
     */
1083
    public FeatureLocks getLocks() throws DataException;
1084
1085
    /*
1086
     * =============================================================
1087
     * Transforms related services
1088
     * =============================================================
1089
     */
1090
1091
    /**
1092
     * Returns this store transforms
1093 41818 fdiaz
     *
1094 40435 jjdelcerro
     * @return
1095
     *         this store transforms
1096
     */
1097
    public FeatureStoreTransforms getTransforms();
1098
1099
    /**
1100
     * Returns a new {@link FeatureQuery} associated to this store.
1101 41818 fdiaz
     *
1102 40435 jjdelcerro
     * @return
1103
     *         a new {@link FeatureQuery} associated to this store.
1104
     */
1105
    public FeatureQuery createFeatureQuery();
1106
1107
    /**
1108
     * Returns featue count of this store.
1109 41818 fdiaz
     *
1110 40435 jjdelcerro
     * @return
1111
     * @throws DataException
1112
     */
1113
    public long getFeatureCount() throws DataException;
1114
1115 43020 jjdelcerro
//    /**
1116
//     * Creates a vectorial cache that is used to save and retrieve data.
1117
//     *
1118
//     * @param name
1119
//     *            the cache name.
1120
//     * @param parameters
1121
//     *            parameters to create the stores used to save data.
1122
//     * @throws DataException
1123
//     */
1124
//    public void createCache(String name, DynObject parameters)
1125
//        throws DataException;
1126
//
1127
//    /**
1128
//     * @return the vectorial cache
1129
//     */
1130
//    public FeatureCache getCache();
1131 40435 jjdelcerro
1132
    /**
1133
     * Return if the provider knows the real envelope of a layer. If not,
1134
     * the {@link FeatureStoreProvider#getEnvelope()} method doesn't return
1135
     * the full envelope.
1136 41818 fdiaz
     *
1137 40435 jjdelcerro
     * @return
1138
     *         <true> if it knows the real envelope.
1139
     */
1140
    public boolean isKnownEnvelope();
1141
1142
    /**
1143
     * Return if the maximum number of features provided by the
1144
     * provider are limited.
1145 41818 fdiaz
     *
1146 40435 jjdelcerro
     * @return
1147
     *         <true> if there is a limit of features.
1148
     */
1149
    public boolean hasRetrievedFeaturesLimit();
1150
1151
    /**
1152
     * If the {@link FeatureStoreProvider#hasRetrievedFeaturesLimit()} returns
1153
     * true,
1154
     * it returns the limit of features retrieved from the provider.
1155 41818 fdiaz
     *
1156 40435 jjdelcerro
     * @return
1157
     *         The limit of the retrieved features.
1158
     */
1159
    public int getRetrievedFeaturesLimit();
1160 41818 fdiaz
1161
    /**
1162
     * Return the associated feature to the dynobject.
1163
     * If the dynobject isn't associated to a feature of this store, return null.
1164
     *
1165
     * @param dynobject
1166
     * @return
1167
     */
1168
    public Feature getFeature(DynObject dynobject);
1169 43371 fdiaz
1170 42293 jjdelcerro
    public Iterator iterator();
1171 43371 fdiaz
1172 43521 jjdelcerro
    public ExpressionBuilder createExpressionBuilder();
1173 43371 fdiaz
1174 43521 jjdelcerro
    /**
1175
     *
1176
     * @return
1177
     * @deprecated use createExpressionBuilder
1178
     */
1179
    public ExpressionBuilder createExpression();
1180
1181 43056 jjdelcerro
    public void createCache(String name, DynObject parameters)
1182
        throws DataException;
1183
1184 44443 jjdelcerro
    @Override
1185 43371 fdiaz
    public FeatureCache getCache();
1186
1187 43215 jjdelcerro
    public boolean isBroken();
1188 43371 fdiaz
1189 44443 jjdelcerro
    public Throwable getBreakingsCause();
1190 43371 fdiaz
1191
    /**
1192 44443 jjdelcerro
     * Indicates if the storage is temporary.
1193
     * There is no guarantee that a temporary store can be recovered from
1194
     * its parameters. In general these will not be persistent.
1195
     *
1196
     * @return true if the store is temporary, otherwise false.
1197
     */
1198
    public boolean isTemporary();
1199
1200
    /**
1201 43371 fdiaz
     * @param index
1202
     * @return
1203
     */
1204 44111 jjdelcerro
    public SpatialIndex wrapSpatialIndex(SpatialIndex index);
1205 43824 jjdelcerro
1206
    public FeatureReference getFeatureReference(String code);
1207 44111 jjdelcerro
1208
    /**
1209
     * Devuelbe el numero de operaciones pendientes de guardar en una sesion
1210
     * de edicion. Es un valor orientativo.
1211
     * Las operaciones pendientes son la suma de operaciones de borrado, insercion
1212
     * o modificacion de las features en una sesion de edicion.
1213
     *
1214
     * Retorna 0 si no esta en edicion.
1215
     *
1216
     * @return numero de operaciones pendientes.
1217
     */
1218
    public long getPendingChangesCount();
1219 44253 jjdelcerro
1220 44283 jjdelcerro
    public Feature getSampleFeature();
1221 44435 jjdelcerro
1222
    /**
1223
     * Return true when the default feature type of the store
1224
     * support references.
1225
     *
1226
     * @return true when support references.
1227
     */
1228
    public boolean supportReferences();
1229 40435 jjdelcerro
}