Revision 35115

View differences:

branches/dal_time_support/libraries/libFMap_dal/src/org/gvsig/fmap/dal/spi/DataManagerProviderServices.java
29 29

  
30 30
import org.gvsig.fmap.dal.DataManager;
31 31
import org.gvsig.fmap.dal.DataServerExplorerParameters;
32
import org.gvsig.fmap.dal.DataStoreParameters;
32 33
import org.gvsig.fmap.dal.DataTypes;
33 34
import org.gvsig.fmap.dal.exception.DataException;
34 35
import org.gvsig.fmap.dal.exception.InitializeException;
......
137 138
	  * @return A cache provider
138 139
	  * @throws DataException
139 140
	  */
140
	 
141
	  
142 141
	 public FeatureCacheProvider createFeatureCacheProvider(String name, DynObject parameters) throws DataException;
143 142

  
143

  
144
	 /**
145
	  *
146
	  * Creates a new instance of the provider associated to the passed parameters.
147
	  * 
148
	  * @param store
149
	  * @param parameters
150
	  * @return
151
	  * @throws InitializeException
152
	  * @throws ProviderNotRegisteredException
153
	  */
154
	 public DataStoreProvider createProvider(DataStoreProviderServices providerServices, DataStoreParameters parameters) throws InitializeException, ProviderNotRegisteredException;	 
155

  
144 156
}
branches/dal_time_support/libraries/libFMap_dal/src/org/gvsig/fmap/dal/feature/FeatureStore.java
26 26
 * {@link Feature}(s). {@link Feature}(s) from the same FeatureStore can be of
27 27
 * different {@link FeatureType}(s) (as in GML format for instance).
28 28
 * </p>
29
 *
29
 * 
30 30
 * <p>
31 31
 * FeatureStore allows:
32 32
 * </p>
......
45 45
 * <li>Selection.
46 46
 * <li>Locks management.
47 47
 * </ul>
48
 *
48
 * 
49 49
 */
50 50
public interface FeatureStore extends DataStore, UndoRedoStack {
51 51

  
52
	public static final String METADATA_DEFINITION_NAME = "FeatureStore";
52
    public static final String METADATA_DEFINITION_NAME = "FeatureStore";
53 53

  
54
	/** Indicates that this store is in query mode */
55
	final static int MODE_QUERY = 0;
54
    /** Indicates that this store is in query mode */
55
    final static int MODE_QUERY = 0;
56 56

  
57
	/** Indicates that this store is in full edit mode */
58
	final static int MODE_FULLEDIT = 1;
57
    /** Indicates that this store is in full edit mode */
58
    final static int MODE_FULLEDIT = 1;
59 59

  
60
	/** Indicates that this store is in append mode */
61
	final static int MODE_APPEND = 2;
60
    /** Indicates that this store is in append mode */
61
    final static int MODE_APPEND = 2;
62 62

  
63
	/*
64
	 * =============================================================
65
	 *
66
	 * information related services
67
	 */
63
    /*
64
     * =============================================================
65
     * 
66
     * information related services
67
     */
68 68

  
69
	/**
70
	 * Indicates whether this store allows writing.
71
	 *
72
	 * @return
73
	 * 		true if this store can be written, false if not.
74
	 */
75
	public boolean allowWrite();
69
    /**
70
     * Indicates whether this store allows writing.
71
     * 
72
     * @return
73
     *         true if this store can be written, false if not.
74
     */
75
    public boolean allowWrite();
76 76

  
77
	/**
78
	 * Returns this store's default {@link FeatureType}.
79
	 *
80
	 * @return
81
	 * 		this store's default {@link FeatureType}.
82
	 *
83
	 * @throws DataException
84
	 */
85
	public FeatureType getDefaultFeatureType() throws DataException;
77
    /**
78
     * Returns this store's default {@link FeatureType}.
79
     * 
80
     * @return
81
     *         this store's default {@link FeatureType}.
82
     * 
83
     * @throws DataException
84
     */
85
    public FeatureType getDefaultFeatureType() throws DataException;
86 86

  
87
	/**
88
	 * Returns this store's featureType {@link FeatureType} matches with
89
	 * featureTypeId.
90
	 *
91
	 * @param featureTypeId
92
	 *
93
	 * @return this store's default {@link FeatureType}.
94
	 *
95
	 * @throws DataException
96
	 */
97
	public FeatureType getFeatureType(String featureTypeId)
98
			throws DataException;
87
    /**
88
     * Returns this store's featureType {@link FeatureType} matches with
89
     * featureTypeId.
90
     * 
91
     * @param featureTypeId
92
     * 
93
     * @return this store's default {@link FeatureType}.
94
     * 
95
     * @throws DataException
96
     */
97
    public FeatureType getFeatureType(String featureTypeId)
98
        throws DataException;
99 99

  
100
	/**
101
	 * Returns this store's {@link FeatureType}(s).
102
	 *
103
	 * @return a list with this store's {@link FeatureType}(s).
104
	 *
105
	 * @throws DataException
106
	 */
107
	public List getFeatureTypes() throws DataException;
100
    /**
101
     * Returns this store's {@link FeatureType}(s).
102
     * 
103
     * @return a list with this store's {@link FeatureType}(s).
104
     * 
105
     * @throws DataException
106
     */
107
    public List getFeatureTypes() throws DataException;
108 108

  
109
	/**
110
	 * Returns this store's parameters.
111
	 *
112
	 * @return
113
	 * 		{@link DataStoreParameters} containing this store's parameters
114
	 */
115
	public DataStoreParameters getParameters();
109
    /**
110
     * Returns this store's parameters.
111
     * 
112
     * @return
113
     *         {@link DataStoreParameters} containing this store's parameters
114
     */
115
    public DataStoreParameters getParameters();
116 116

  
117
	/**
118
	 *@throws DataException
119
	 * @deprecated Mirar de cambiarlo a metadatos
120
	 */
121
	public boolean canWriteGeometry(int gvSIGgeometryType) throws DataException;
117
    /**
118
     *@throws DataException
119
     * @deprecated Mirar de cambiarlo a metadatos
120
     */
121
    public boolean canWriteGeometry(int gvSIGgeometryType) throws DataException;
122 122

  
123
	/**
124
	 * Returns this store's total envelope (extent).
125
	 * 
126
	 * @return this store's total envelope (extent) or <code>null</code> if
127
	 *         store not have geometry information
128
	 */
129
	public Envelope getEnvelope() throws DataException;
123
    /**
124
     * Returns this store's total envelope (extent).
125
     * 
126
     * @return this store's total envelope (extent) or <code>null</code> if
127
     *         store not have geometry information
128
     */
129
    public Envelope getEnvelope() throws DataException;
130 130

  
131
	/**
132
	 *
133
	 * @deprecated use getDefaultFeatureType().getDefaultSRS()
134
	 * @return
135
	 * @throws DataException
136
	 */
137
	public IProjection getSRSDefaultGeometry() throws DataException;
131
    /**
132
     * 
133
     * @deprecated use getDefaultFeatureType().getDefaultSRS()
134
     * @return
135
     * @throws DataException
136
     */
137
    public IProjection getSRSDefaultGeometry() throws DataException;
138 138

  
139
	/**
140
	 * Exports this store to another store.
141
	 *
142
	 * @param explorer
143
	 *            {@link DataServerExplorer} target
144
	 * @param params
145
	 *            New parameters of this store that will be used on the target
146
	 *            explorer
147
	 *
148
	 * @throws DataException
149
	 *
150
	 * @Deprecated this method is unstable
151
	 */
152
	public void export(DataServerExplorer explorer, String provider, NewFeatureStoreParameters params)
153
			throws DataException;
139
    /**
140
     * Exports this store to another store.
141
     * 
142
     * @param explorer
143
     *            {@link DataServerExplorer} target
144
     * @param params
145
     *            New parameters of this store that will be used on the target
146
     *            explorer
147
     * 
148
     * @throws DataException
149
     * 
150
     * @Deprecated this method is unstable
151
     */
152
    public void export(DataServerExplorer explorer, String provider,
153
        NewFeatureStoreParameters params) throws DataException;
154 154

  
155
	/*
156
	 * =============================================================
157
	 *
158
	 * Query related services
159
	 */
155
    /*
156
     * =============================================================
157
     * 
158
     * Query related services
159
     */
160 160

  
161
	/**
162
	 * Returns all available features in the store.
163
	 * <p>
164
	 * <em>
165
	 * <strong>NOTE:</strong> if you use this method to get a 
166
	 * {@link FeatureSet}, you  must get sure it is disposed 
161
    /**
162
     * Returns all available features in the store.
163
     * <p>
164
     * <em>
165
     * <strong>NOTE:</strong> if you use this method to get a 
166
     * {@link FeatureSet}, you  must get sure it is disposed 
167 167
	 * (@see {@link DisposableIterator#dispose()}) in any case, even if an 
168 168
	 * error occurs while getting the data. It is recommended to use the 
169 169
	 * <code>accept</code> methods instead, which handle everything for you. 
170 170
	 * Take into account the accept methods may use a fast iterator to 
171 171
	 * get the features.
172 172
	 * </em>
173
	 * </p>
174
	 * 
175
	 * @see #accept(org.gvsig.tools.visitor.Visitor)
176
	 * 
177
	 * @return a collection of features
178
	 * @throws ReadException
179
	 *             if there is any error while reading the features
180
	 */
181
	FeatureSet getFeatureSet() throws DataException;
173
     * </p>
174
     * 
175
     * @see #accept(org.gvsig.tools.visitor.Visitor)
176
     * 
177
     * @return a collection of features
178
     * @throws ReadException
179
     *             if there is any error while reading the features
180
     */
181
    FeatureSet getFeatureSet() throws DataException;
182 182

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

  
210
	/**
211
	 * Loads a subset of features taking into account the properties and
212
	 * restrictions of the FeatureQuery. Feature loading is performed by calling
213
	 * the Observer, once each loaded Feature.
214
	 *
215
	 * @param featureQuery
216
	 *            defines the characteristics of the features to return
217
	 * @param observer
218
	 *            to be notified of each loaded Feature
219
	 * @throws DataException
220
	 *             if there is any error while loading the features
221
	 */
222
	void getFeatureSet(FeatureQuery featureQuery, Observer observer)
223
	throws DataException;
209
    /**
210
     * Loads a subset of features taking into account the properties and
211
     * restrictions of the FeatureQuery. Feature loading is performed by calling
212
     * the Observer, once each loaded Feature.
213
     * 
214
     * @param featureQuery
215
     *            defines the characteristics of the features to return
216
     * @param observer
217
     *            to be notified of each loaded Feature
218
     * @throws DataException
219
     *             if there is any error while loading the features
220
     */
221
    void getFeatureSet(FeatureQuery featureQuery, Observer observer)
222
        throws DataException;
224 223

  
225
	/**
226
	 * Loads all available feature in the store. The loading of Features is
227
	 * performed by calling the Observer, once each loaded Feature.
228
	 *
229
	 * @param observer
230
	 *            to be notified of each loaded Feature
231
	 * @throws DataException
232
	 *             if there is any error while loading the features
233
	 */
234
	void getFeatureSet(Observer observer) throws DataException;
224
    /**
225
     * Loads all available feature in the store. The loading of Features is
226
     * performed by calling the Observer, once each loaded Feature.
227
     * 
228
     * @param observer
229
     *            to be notified of each loaded Feature
230
     * @throws DataException
231
     *             if there is any error while loading the features
232
     */
233
    void getFeatureSet(Observer observer) throws DataException;
235 234

  
236
	/**
237
	 * Returns the feature given its reference.
238
	 *
239
	 * @param reference
240
	 *            a unique FeatureReference
241
	 * @return
242
	 * 		The Feature
243
	 *
244
	 * @throws DataException
245
	 *
246
	 */
247
	public Feature getFeatureByReference(FeatureReference reference) throws DataException;
235
    /**
236
     * Returns the feature given its reference.
237
     * 
238
     * @param reference
239
     *            a unique FeatureReference
240
     * @return
241
     *         The Feature
242
     * 
243
     * @throws DataException
244
     * 
245
     */
246
    public Feature getFeatureByReference(FeatureReference reference)
247
        throws DataException;
248 248

  
249
	/**
250
	 * Returns the feature given its reference and feature type.
251
	 *
252
	 * @param reference
253
	 *            a unique FeatureReference
254
	 *
255
	 * @param featureType
256
	 *            FeatureType to which the requested Feature belongs
257
	 *
258
	 * @return
259
	 * 		The Feature
260
	 *
261
	 * @throws DataException
262
	 *
263
	 */
264
	public Feature getFeatureByReference(FeatureReference reference, FeatureType featureType)
265
			throws DataException;
249
    /**
250
     * Returns the feature given its reference and feature type.
251
     * 
252
     * @param reference
253
     *            a unique FeatureReference
254
     * 
255
     * @param featureType
256
     *            FeatureType to which the requested Feature belongs
257
     * 
258
     * @return
259
     *         The Feature
260
     * 
261
     * @throws DataException
262
     * 
263
     */
264
    public Feature getFeatureByReference(FeatureReference reference,
265
        FeatureType featureType) throws DataException;
266 266

  
267
	/*
268
	 * =============================================================
269
	 *
270
	 * Editing related services
271
	 */
267
    /*
268
     * =============================================================
269
     * 
270
     * Editing related services
271
     */
272 272

  
273
	/**
274
	 * Enters editing state.
275
	 */
276
	public void edit() throws DataException;
273
    /**
274
     * Enters editing state.
275
     */
276
    public void edit() throws DataException;
277 277

  
278
	/**
279
	 * Enters editing state specifying the editing mode.
280
	 *
281
	 * @param mode
282
	 *
283
	 * @throws DataException
284
	 */
285
	public void edit(int mode) throws DataException;
278
    /**
279
     * Enters editing state specifying the editing mode.
280
     * 
281
     * @param mode
282
     * 
283
     * @throws DataException
284
     */
285
    public void edit(int mode) throws DataException;
286 286

  
287
	/**
288
	 * Cancels all editing since the last edit().
289
	 *
290
	 * @throws DataException
291
	 */
292
	public void cancelEditing() throws DataException;
287
    /**
288
     * Cancels all editing since the last edit().
289
     * 
290
     * @throws DataException
291
     */
292
    public void cancelEditing() throws DataException;
293 293

  
294
	/**
295
	 * Exits editing state.
296
	 *
297
	 * @throws DataException
298
	 */
299
	public void finishEditing() throws DataException;
294
    /**
295
     * Exits editing state.
296
     * 
297
     * @throws DataException
298
     */
299
    public void finishEditing() throws DataException;
300 300

  
301
	/**
302
	 * Indicates whether this store is in editing state.
303
	 *
304
	 * @return
305
	 * 		true if this store is in editing state, false if not.
306
	 */
307
	public boolean isEditing();
301
    /**
302
     * Indicates whether this store is in editing state.
303
     * 
304
     * @return
305
     *         true if this store is in editing state, false if not.
306
     */
307
    public boolean isEditing();
308 308

  
309
	/**
310
	 * Indicates whether this store is in appending state. In this state the new
311
	 * features are automatically inserted at the end of the {@link FeatureSet}.
312
	 *
313
	 * @return true if this store is in appending state.
314
	 */
315
	public boolean isAppending();
309
    /**
310
     * Indicates whether this store is in appending state. In this state the new
311
     * features are automatically inserted at the end of the {@link FeatureSet}.
312
     * 
313
     * @return true if this store is in appending state.
314
     */
315
    public boolean isAppending();
316 316

  
317
	/**
318
	 * Updates a {@link FeatureType} in the store with the changes in the
319
	 * {@link EditableFeatureType}.<br>
320
	 *
321
	 * Any {@link FeatureSet} from this store that are used will be invalidated.
322
	 *
323
	 * @param featureType
324
	 *            an {@link EditableFeatureType} with the changes.
325
	 *
326
	 * @throws DataException
327
	 */
328
	public void update(EditableFeatureType featureType) throws DataException;
317
    /**
318
     * Updates a {@link FeatureType} in the store with the changes in the
319
     * {@link EditableFeatureType}.<br>
320
     * 
321
     * Any {@link FeatureSet} from this store that are used will be invalidated.
322
     * 
323
     * @param featureType
324
     *            an {@link EditableFeatureType} with the changes.
325
     * 
326
     * @throws DataException
327
     */
328
    public void update(EditableFeatureType featureType) throws DataException;
329 329

  
330
	/**
331
	 * Updates a {@link Feature} in the store with the changes in the
332
	 * {@link EditableFeature}.<br>
333
	 *
334
	 * Any {@link FeatureSet} from this store that was still in use will be
335
	 * invalidated. You can override this using
336
	 * {@link FeatureSet#update(EditableFeature)}.
337
	 *
338
	 * @param feature
339
	 *            the feature to be updated
340
	 *
341
	 * @throws DataException
342
	 */
343
	public void update(EditableFeature feature) throws DataException;
330
    /**
331
     * Updates a {@link Feature} in the store with the changes in the
332
     * {@link EditableFeature}.<br>
333
     * 
334
     * Any {@link FeatureSet} from this store that was still in use will be
335
     * invalidated. You can override this using
336
     * {@link FeatureSet#update(EditableFeature)}.
337
     * 
338
     * @param feature
339
     *            the feature to be updated
340
     * 
341
     * @throws DataException
342
     */
343
    public void update(EditableFeature feature) throws DataException;
344 344

  
345
	/**
346
	 * Deletes a {@link Feature} from the store.<br>
347
	 *
348
	 * Any {@link FeatureSet} from this store that was still in use will be
349
	 * invalidated. You can override this using {@link Iterator#remove()} from
350
	 * {@link FeatureSet}.
351
	 *
352
	 * @param feature
353
	 *            The feature to be deleted.
354
	 *
355
	 * @throws DataException
356
	 */
357
	public void delete(Feature feature) throws DataException;
345
    /**
346
     * Deletes a {@link Feature} from the store.<br>
347
     * 
348
     * Any {@link FeatureSet} from this store that was still in use will be
349
     * invalidated. You can override this using {@link Iterator#remove()} from
350
     * {@link FeatureSet}.
351
     * 
352
     * @param feature
353
     *            The feature to be deleted.
354
     * 
355
     * @throws DataException
356
     */
357
    public void delete(Feature feature) throws DataException;
358 358

  
359
	/**
360
	 * Inserts a {@link Feature} in the store.<br>
361
	 *
362
	 * Any {@link FeatureSet} from this store that was still in use will be
363
	 * invalidated. You can override this using
364
	 * {@link FeatureSet#insert(EditableFeature)}.
365
	 *
366
	 * @param feature
367
	 *            The feature to be inserted
368
	 *
369
	 * @throws DataException
370
	 */
371
	public void insert(EditableFeature feature) throws DataException;
359
    /**
360
     * Inserts a {@link Feature} in the store.<br>
361
     * 
362
     * Any {@link FeatureSet} from this store that was still in use will be
363
     * invalidated. You can override this using
364
     * {@link FeatureSet#insert(EditableFeature)}.
365
     * 
366
     * @param feature
367
     *            The feature to be inserted
368
     * 
369
     * @throws DataException
370
     */
371
    public void insert(EditableFeature feature) throws DataException;
372 372

  
373
	/**
374
	 * Creates a new feature using the default feature type and returns it as an
375
	 * {@link EditableFeature}
376
	 *
377
	 * @return a new feature in editable state
378
	 *
379
	 * @throws DataException
380
	 */
381
	public EditableFeature createNewFeature() throws DataException;
373
    /**
374
     * Creates a new feature using the default feature type and returns it as an
375
     * {@link EditableFeature}
376
     * 
377
     * @return a new feature in editable state
378
     * 
379
     * @throws DataException
380
     */
381
    public EditableFeature createNewFeature() throws DataException;
382 382

  
383
	/**
384
	 * Creates a new feature of the given {@link FeatureType} and uses the given
385
	 * {@link Feature} as default values to initialize it.
386
	 *
387
	 * @param type
388
	 *            the new feature's feature type
389
	 *
390
	 * @param defaultValues
391
	 *            a feature whose values are used as default values for the new
392
	 *            feature.
393
	 *
394
	 * @return the new feature.
395
	 *
396
	 * @throws DataException
397
	 */
398
	public EditableFeature createNewFeature(FeatureType type,
399
			Feature defaultValues) throws DataException;
383
    /**
384
     * Creates a new feature of the given {@link FeatureType} and uses the given
385
     * {@link Feature} as default values to initialize it.
386
     * 
387
     * @param type
388
     *            the new feature's feature type
389
     * 
390
     * @param defaultValues
391
     *            a feature whose values are used as default values for the new
392
     *            feature.
393
     * 
394
     * @return the new feature.
395
     * 
396
     * @throws DataException
397
     */
398
    public EditableFeature createNewFeature(FeatureType type,
399
        Feature defaultValues) throws DataException;
400 400

  
401
	/**
402
	 * Creates a new feature of the given {@link FeatureType}. The flag
403
	 * defaultValues is used to indicate whether the new feature should be
404
	 * initialized with default values or not.
405
	 *
406
	 * @param type
407
	 *            the new feature's feature type
408
	 *
409
	 * @param defaultValues
410
	 * 			if true the new feature is initialized with each attribute's default value.
411
	 *
412
	 * @return
413
	 * 		the new feature
414
	 *
415
	 * @throws DataException
416
	 */
417
	public EditableFeature createNewFeature(FeatureType type,
418
			boolean defaultValues) throws DataException;
401
    /**
402
     * Creates a new feature of the given {@link FeatureType}. The flag
403
     * defaultValues is used to indicate whether the new feature should be
404
     * initialized with default values or not.
405
     * 
406
     * @param type
407
     *            the new feature's feature type
408
     * 
409
     * @param defaultValues
410
     *            if true the new feature is initialized with each attribute's
411
     *            default value.
412
     * 
413
     * @return
414
     *         the new feature
415
     * 
416
     * @throws DataException
417
     */
418
    public EditableFeature createNewFeature(FeatureType type,
419
        boolean defaultValues) throws DataException;
419 420

  
420
	/**
421
	 * Creates a new feature of default {@link FeatureType}. The flag
422
	 * defaultValues is used to indicate whether the new feature should be
423
	 * initialized with default values or not.
424
	 *
425
	 * @param defaultValues
426
	 * 				if true the new feature is initialized with each attribute's default value.
427
	 *
428
	 * @return
429
	 * 		the new feature
430
	 *
431
	 * @throws DataException
432
	 */
433
	public EditableFeature createNewFeature(boolean defaultValues)
434
			throws DataException;
421
    /**
422
     * Creates a new feature of default {@link FeatureType}. The flag
423
     * defaultValues is used to indicate whether the new feature should be
424
     * initialized with default values or not.
425
     * 
426
     * @param defaultValues
427
     *            if true the new feature is initialized with each attribute's
428
     *            default value.
429
     * 
430
     * @return
431
     *         the new feature
432
     * 
433
     * @throws DataException
434
     */
435
    public EditableFeature createNewFeature(boolean defaultValues)
436
        throws DataException;
435 437

  
436
	/**
437
	 * Applies the validation rules associated to the given mode to the active {@link FeatureSet}.
438
	 *
439
	 * @param mode
440
	 *            can be one of {MODE_QUERY, MODE_FULLEDIT, MODE_APPEND}
441
	 *
442
	 * @throws DataException
443
	 */
444
	public void validateFeatures(int mode) throws DataException;
438
    /**
439
     * Applies the validation rules associated to the given mode to the active
440
     * {@link FeatureSet}.
441
     * 
442
     * @param mode
443
     *            can be one of {MODE_QUERY, MODE_FULLEDIT, MODE_APPEND}
444
     * 
445
     * @throws DataException
446
     */
447
    public void validateFeatures(int mode) throws DataException;
445 448

  
446
	/**
447
	 * Indicates whether this store supports append mode.
448
	 *
449
	 * @return
450
	 * 		true if this store supports append mode.
451
	 */
452
	public boolean isAppendModeSupported();
449
    /**
450
     * Indicates whether this store supports append mode.
451
     * 
452
     * @return
453
     *         true if this store supports append mode.
454
     */
455
    public boolean isAppendModeSupported();
453 456

  
454
	/**
455
	 * Initiates an editing group. This is typically used to group series of
456
	 * store editing operations.
457
	 *
458
	 * @param description
459
	 *            Description of the editing group.
460
	 *
461
	 * @throws NeedEditingModeException
462
	 */
463
	public void beginEditingGroup(String description)
464
			throws NeedEditingModeException;
457
    /**
458
     * Initiates an editing group. This is typically used to group series of
459
     * store editing operations.
460
     * 
461
     * @param description
462
     *            Description of the editing group.
463
     * 
464
     * @throws NeedEditingModeException
465
     */
466
    public void beginEditingGroup(String description)
467
        throws NeedEditingModeException;
465 468

  
466
	/**
467
	 * Finishes an editing group.
468
	 *
469
	 * @throws NeedEditingModeException
470
	 */
471
	public void endEditingGroup() throws NeedEditingModeException;
469
    /**
470
     * Finishes an editing group.
471
     * 
472
     * @throws NeedEditingModeException
473
     */
474
    public void endEditingGroup() throws NeedEditingModeException;
472 475

  
473
	/*
474
	 * =============================================================
475
	 *
476
	 * Index related services
477
	 */
476
    /*
477
     * =============================================================
478
     * 
479
     * Index related services
480
     */
478 481

  
479
	/**
480
	 * Creates a FeatureIndex with name indexName, given the attributeName and
481
	 * its featureType.
482
	 *
483
	 * @param featureType
484
	 *            The FeatureType to which the indexed attribute belongs.
485
	 *
486
	 * @param attributeName
487
	 *            The name of the attributed to be indexed
488
	 *
489
	 * @param indexName
490
	 *            The index name
491
	 *
492
	 * @return the resulting FeatureIndex
493
	 *
494
	 *
495
	 * @throws FeatureIndexException
496
	 */
497
	public FeatureIndex createIndex(FeatureType featureType,
498
			String attributeName, String indexName) throws DataException;
482
    /**
483
     * Creates a FeatureIndex with name indexName, given the attributeName and
484
     * its featureType.
485
     * 
486
     * @param featureType
487
     *            The FeatureType to which the indexed attribute belongs.
488
     * 
489
     * @param attributeName
490
     *            The name of the attributed to be indexed
491
     * 
492
     * @param indexName
493
     *            The index name
494
     * 
495
     * @return the resulting FeatureIndex
496
     * 
497
     * 
498
     * @throws FeatureIndexException
499
     */
500
    public FeatureIndex createIndex(FeatureType featureType,
501
        String attributeName, String indexName) throws DataException;
499 502

  
500
	/**
501
	 * Creates a FeatureIndex with name indexName, given the attributeName and
502
	 * its featureType. This method is intended for background indexing. It
503
	 * receives an observer that will be notified by the process.
504
	 *
505
	 * @param featureType
506
	 *            The FeatureType to which the indexed attribute belongs.
507
	 *
508
	 * @param attributeName
509
	 *            The name of the attributed to be indexed
510
	 *
511
	 * @param indexName
512
	 *            The index name
513
	 *
514
	 * @param observer
515
	 *            an observer that will be notified of the indexing process
516
	 *            progress.
517
	 *
518
	 * @return the resulting FeatureIndex
519
	 *
520
	 *
521
	 * @throws FeatureIndexException
522
	 */
523
	public FeatureIndex createIndex(FeatureType featureType,
524
			String attributeName, String indexName, Observer observer) throws DataException;
525
	/**
526
	 * Returns a FeatureIndexes structure containing all available indexes in
527
	 * the store.
528
	 *
529
	 * @return
530
	 */
531
	public FeatureIndexes getIndexes();
503
    public FeatureIndex createIndex(String indexTypeName,
504
        FeatureType featureType, String attributeName, String indexName)
505
        throws DataException;
532 506

  
533
	/*
534
	 * =============================================================
535
	 *
536
	 * Selection related services
537
	 */
507
    /**
508
     * Creates a FeatureIndex with name indexName, given the attributeName and
509
     * its featureType. This method is intended for background indexing. It
510
     * receives an observer that will be notified by the process.
511
     * 
512
     * @param featureType
513
     *            The FeatureType to which the indexed attribute belongs.
514
     * 
515
     * @param attributeName
516
     *            The name of the attributed to be indexed
517
     * 
518
     * @param indexName
519
     *            The index name
520
     * 
521
     * @param observer
522
     *            an observer that will be notified of the indexing process
523
     *            progress.
524
     * 
525
     * @return the resulting FeatureIndex
526
     * 
527
     * 
528
     * @throws FeatureIndexException
529
     */
530
    public FeatureIndex createIndex(FeatureType featureType,
531
        String attributeName, String indexName, Observer observer)
532
        throws DataException;
538 533

  
539
	/**
540
	 * Sets the selection to the passed {@link FeatureSet}
541
	 *
542
	 * @param selection
543
	 *            A {@link FeatureSet} with the requested selection
544
	 */
545
	public void setSelection(FeatureSet selection) throws DataException;
534
    public FeatureIndex createIndex(String indexTypeName,
535
        FeatureType featureType, String attributeName, String indexName,
536
        Observer observer) throws DataException;
546 537

  
547
	/**
548
	 * Creates a {@link FeatureSelection}
549
	 *
550
	 * @return
551
	 * 		a {@link FeatureSelection}
552
	 *
553
	 * @throws DataException
554
	 */
555
	public FeatureSelection createFeatureSelection() throws DataException;
538
    /**
539
     * Returns a FeatureIndexes structure containing all available indexes in
540
     * the store.
541
     * 
542
     * @return
543
     */
544
    public FeatureIndexes getIndexes();
556 545

  
557
	/**
558
	 * Returns the current {@link FeatureSelection}.
559
	 *
560
	 * @return
561
	 * 		current {@link FeatureSelection}.
562
	 *
563
	 * @throws DataException
564
	 */
565
	public FeatureSelection getFeatureSelection() throws DataException;
546
    /*
547
     * =============================================================
548
     * 
549
     * Selection related services
550
     */
566 551

  
567
	/*
568
	 * =============================================================
569
	 *
570
	 * Lock related services
571
	 */
552
    /**
553
     * Sets the selection to the passed {@link FeatureSet}
554
     * 
555
     * @param selection
556
     *            A {@link FeatureSet} with the requested selection
557
     */
558
    public void setSelection(FeatureSet selection) throws DataException;
572 559

  
573
	/**
574
	 * Indicates whether this store supports locks.
575
	 *
576
	 * @return
577
	 * 		true if this store supports locks, false if not.
578
	 */
579
	public boolean isLocksSupported();
560
    /**
561
     * Creates a {@link FeatureSelection}
562
     * 
563
     * @return
564
     *         a {@link FeatureSelection}
565
     * 
566
     * @throws DataException
567
     */
568
    public FeatureSelection createFeatureSelection() throws DataException;
580 569

  
581
	/**
582
	 * Returns the set of locked features
583
	 *
584
	 * @return
585
	 * 		set of locked features
586
	 *
587
	 * @throws DataException
588
	 */
589
	public FeatureLocks getLocks() throws DataException;
570
    /**
571
     * Returns the current {@link FeatureSelection}.
572
     * 
573
     * @return
574
     *         current {@link FeatureSelection}.
575
     * 
576
     * @throws DataException
577
     */
578
    public FeatureSelection getFeatureSelection() throws DataException;
590 579

  
591
	/*
592
	 * =============================================================
593
	 * Transforms related services
594
	 * =============================================================
595
	 */
580
    /*
581
     * =============================================================
582
     * 
583
     * Lock related services
584
     */
596 585

  
597
	/**
598
	 * Returns this store transforms
599
	 *
600
	 * @return
601
	 * 		this store transforms
602
	 */
603
	public FeatureStoreTransforms getTransforms();
586
    /**
587
     * Indicates whether this store supports locks.
588
     * 
589
     * @return
590
     *         true if this store supports locks, false if not.
591
     */
592
    public boolean isLocksSupported();
604 593

  
605
	/**
606
	 * Returns a new {@link FeatureQuery} associated to this store.
607
	 *
608
	 * @return
609
	 * 		a new {@link FeatureQuery} associated to this store.
610
	 */
611
	public FeatureQuery createFeatureQuery();
594
    /**
595
     * Returns the set of locked features
596
     * 
597
     * @return
598
     *         set of locked features
599
     * 
600
     * @throws DataException
601
     */
602
    public FeatureLocks getLocks() throws DataException;
612 603

  
613
	/**
614
	 * Returns featue count of this store.
615
	 *
616
	 * @return
617
	 * @throws DataException
618
	 */
619
	public long getFeatureCount() throws DataException;
620
	
621
	/**
622
	 * Creates a vectorial cache that is used to save and retrieve data.
623
	 * @param name the cache name.
624
	 * @param parameters parameters to create the stores used to save data.
625
	 * @throws DataException
626
	 */
627
	public void createCache(String name, DynObject parameters) throws DataException;
604
    /*
605
     * =============================================================
606
     * Transforms related services
607
     * =============================================================
608
     */
628 609

  
629
	
630
	/**
631
	 * @return the vectorial cache
632
	 */
633
	public FeatureCache getCache();
634
	
635
	 /**
610
    /**
611
     * Returns this store transforms
612
     * 
613
     * @return
614
     *         this store transforms
615
     */
616
    public FeatureStoreTransforms getTransforms();
617

  
618
    /**
619
     * Returns a new {@link FeatureQuery} associated to this store.
620
     * 
621
     * @return
622
     *         a new {@link FeatureQuery} associated to this store.
623
     */
624
    public FeatureQuery createFeatureQuery();
625

  
626
    /**
627
     * Returns featue count of this store.
628
     * 
629
     * @return
630
     * @throws DataException
631
     */
632
    public long getFeatureCount() throws DataException;
633

  
634
    /**
635
     * Creates a vectorial cache that is used to save and retrieve data.
636
     * 
637
     * @param name
638
     *            the cache name.
639
     * @param parameters
640
     *            parameters to create the stores used to save data.
641
     * @throws DataException
642
     */
643
    public void createCache(String name, DynObject parameters)
644
        throws DataException;
645

  
646
    /**
647
     * @return the vectorial cache
648
     */
649
    public FeatureCache getCache();
650

  
651
    /**
636 652
     * Return if the provider knows the real envelope of a layer. If not,
637 653
     * the {@link FeatureStoreProvider#getEnvelope()} method doesn't return
638 654
     * the full envelope.
639 655
     * 
640 656
     * @return
641
     * <true> if it knows the real envelope.
657
     *         <true> if it knows the real envelope.
642 658
     */
643
    public boolean isKnownEnvelope(); 
644
    
659
    public boolean isKnownEnvelope();
660

  
645 661
    /**
646 662
     * Return if the maximum number of features provided by the
647 663
     * provider are limited.
648 664
     * 
649 665
     * @return
650
     * <true> if there is a limit of features.
666
     *         <true> if there is a limit of features.
651 667
     */
652 668
    public boolean hasRetrievedFeaturesLimit();
653
    
669

  
654 670
    /**
655
     * If the {@link FeatureStoreProvider#hasRetrievedFeaturesLimit()} returns true,
671
     * If the {@link FeatureStoreProvider#hasRetrievedFeaturesLimit()} returns
672
     * true,
656 673
     * it returns the limit of features retrieved from the provider.
674
     * 
657 675
     * @return
658
     * The limit of the retrieved features.
676
     *         The limit of the retrieved features.
659 677
     */
660 678
    public int getRetrievedFeaturesLimit();
661 679
}
662

  
branches/dal_time_support/libraries/libFMap_dal/src/org/gvsig/fmap/dal/feature/Feature.java
383 383
	 */
384 384
	public List getSRSs();
385 385
	
386
	public Instant getTimeInstant(int index);
386
	public Instant getInstant(int index);
387 387

  
388
	public Instant getTimeInstant(String name);
388
	public Instant getInstant(String name);
389 389

  
390
	public Interval getTimeInterval(int index);
390
	public Interval getInterval(int index);
391 391

  
392
	public Interval getTimeInterval(String name);
392
	public Interval getInterval(String name);
393 393
}
branches/dal_time_support/libraries/libFMap_dal/src/org/gvsig/fmap/dal/feature/FeatureSet.java
7 7
import org.gvsig.tools.dispose.DisposableIterator;
8 8
import org.gvsig.tools.dynobject.DynObject;
9 9
import org.gvsig.tools.dynobject.DynObjectSet;
10
import org.gvsig.tools.exception.BaseException;
10 11
import org.gvsig.tools.visitor.IndexedVisitable;
12
import org.gvsig.tools.visitor.Visitor;
11 13

  
12 14
/**
13 15
 * A FeatureSet represents a set of {@link Feature}(s). These sets of features
......
63 65
	 */
64 66
    public long getSize() throws DataException;
65 67

  
66
	/**
67
	 * Returns an iterator over the elements in this collection, in the order
68
	 * (if any) defined when the collection was obtained.
69
	 * 
70
	 * The iterator starts at the specified position in this collection. The
71
	 * specified index indicates the first element that would be returned by an
72
	 * initial call to the <tt>next</tt> method. An initial call to the
73
	 * <tt>previous</tt> method would return the element with the specified
74
	 * index minus one.
75
	 * 
76
	 * <p>
77
	 * <em>
78
	 * <strong>NOTE:</strong> if you use this method to get the iterator, you
79
	 * must get sure the iterator is disposed (@see
80
	 * {@link DisposableIterator#dispose()}) in any case, even if an error occurs
81
	 * while getting the data. It is recommended to use the <code>accept</code>
82
	 * methods instead, which handle everything for you. 
83
	 * Take into account the accept methods may use a fast iterator to 
84
	 * get the features.
85
	 * </em>
86
	 * </p>
87
	 * 
88
	 * @see #accept(org.gvsig.tools.visitor.Visitor)
89
	 * @see #accept(org.gvsig.tools.visitor.Visitor, long)
90
	 * 
91
	 * @param index
92
	 *            index of first element to be returned from the iterator (by a
93
	 *            call to the <tt>next</tt> method).
94
	 * @return an iterator of the elements in this collection (in proper
95
	 *         sequence), starting at the specified position in the collection.
96
	 * @throws DataException
97
	 *             if the index is out of range (index &lt; 0 || index &gt;
98
	 *             size()).
99
	 */
68
    /**
69
     * Returns an iterator over the elements in this collection, in the order
70
     * (if any) defined when the collection was obtained.
71
     * 
72
     * The iterator starts at the specified position in this collection. The
73
     * specified index indicates the first element that would be returned by an
74
     * initial call to the <tt>next</tt> method. An initial call to the
75
     * <tt>previous</tt> method would return the element with the specified
76
     * index minus one.
77
     * 
78
     * <p>
79
     * <em>
80
     * <strong>NOTE:</strong> if you use this method to get the iterator, you
81
     * must get sure the iterator is disposed (@see
82
     * {@link DisposableIterator#dispose()}) in any case, even if an error occurs
83
     * while getting the data. It is recommended to use the <code>accept</code>
84
     * methods instead, which handle everything for you. 
85
     * Take into account the accept methods may use a fast iterator to 
86
     * get the features.
87
     * </em>
88
     * </p>
89
     * 
90
     * @see #accept(org.gvsig.tools.visitor.Visitor)
91
     * @see #accept(org.gvsig.tools.visitor.Visitor, long)
92
     * @see #fastIterator()
93
     * @see #fastIterator(long)
94
     * 
95
     * @param index
96
     *            index of first element to be returned from the iterator (by a
97
     *            call to the <tt>next</tt> method).
98
     * @return an iterator of the elements in this collection (in proper
99
     *         sequence), starting at the specified position in the collection.
100
     * @throws DataException
101
     *             if the index is out of range (index &lt; 0 || index &gt;
102
     *             size()).
103
     * @deprecated use {@link #fastIterator(long)} instead
104
     */
100 105
	DisposableIterator iterator(long index) throws DataException;
101 106

  
102
	/**
103
	 * Returns an iterator over the elements in this collection, in the order
104
	 * (if any) defined when the collection was obtained.
105
	 * 
106
	 * <p>
107
	 * <em>
108
	 * <strong>NOTE:</strong> if you use this method to get the iterator, you
109
	 * must get sure the iterator is disposed (@see
110
	 * {@link DisposableIterator#dispose()}) in any case, even if an error occurs
111
	 * while getting the data. It is recommended to use the <code>accept</code>
112
	 * methods instead, which handle everything for you. 
113
	 * Take into account the accept methods may use a fast iterator to 
114
	 * get the features.
115
	 * </em>
116
	 * </p>
117
	 * 
118
	 * @see #accept(org.gvsig.tools.visitor.Visitor)
119
	 * @see #accept(org.gvsig.tools.visitor.Visitor, long)
120
	 * 
121
	 * @return an iterator of the elements in this collection (in proper
122
	 *         sequence).
123
	 * 
124
	 * @throws DataException
125
	 */
107
    /**
108
     * Returns an iterator over the elements in this collection, in the order
109
     * (if any) defined when the collection was obtained.
110
     * 
111
     * <p>
112
     * <em>
113
     * <strong>NOTE:</strong> if you use this method to get the iterator, you
114
     * must get sure the iterator is disposed (@see
115
     * {@link DisposableIterator#dispose()}) in any case, even if an error occurs
116
     * while getting the data. It is recommended to use the <code>accept</code>
117
     * methods instead, which handle everything for you. 
118
     * Take into account the accept methods may use a fast iterator to 
119
     * get the features.
120
     * </em>
121
     * </p>
122
     * 
123
     * @see #accept(org.gvsig.tools.visitor.Visitor)
124
     * @see #accept(org.gvsig.tools.visitor.Visitor, long)
125
     * @see #fastIterator()
126
     * @see #fastIterator(long)
127
     * 
128
     * @return an iterator of the elements in this collection (in proper
129
     *         sequence).
130
     * 
131
     * @throws DataException
132
     *             if there is an error getting the iterator
133
     * 
134
     * @deprecated use {@link #fastIterator()} instead
135
     */
126 136
	DisposableIterator iterator() throws DataException;
127 137

  
128
	/**
129
	 * Returns a fast iterator over this set.
130
	 * 
131
	 * <p>
132
	 * <em>
133
	 * <strong>NOTE:</strong> if you use this method to get the iterator, you
134
	 * must get sure the iterator is disposed (@see
135
	 * {@link DisposableIterator#dispose()}) in any case, even if an error occurs
136
	 * while getting the data. It is recommended to use the <code>accept</code>
137
	 * methods instead, which handle everything for you. 
138
	 * Take into account the accept methods may use a fast iterator to 
139
	 * get the features.
140
	 * </em>
141
	 * </p>
142
	 * 
143
	 * @see #accept(org.gvsig.tools.visitor.Visitor)
144
	 * @see #accept(org.gvsig.tools.visitor.Visitor, long)
145
	 * 
146
	 * @return an iterator over this set.
147
	 * 
148
	 * @throws DataException
149
	 */
138
    /**
139
     * Returns a fast iterator over this set.
140
     * <p>
141
     * Fast in this case means that each of the elements returned may be a
142
     * reused or pooled object instance, so don't use it to be stored in any
143
     * way.
144
     * </p>
145
     * <p>
146
     * If you need to store one of the {@link Feature} of the iterator, use the
147
     * {@link Feature#getCopy()} to create a clone of the object.
148
     * </p>
149
     * 
150
     * <p>
151
     * <em>
152
     * <strong>NOTE:</strong> if you use this method to get the iterator, you
153
     * must get sure the iterator is disposed (@see
154
     * {@link DisposableIterator#dispose()}) in any case, even if an error occurs
155
     * while getting the data. It is recommended to use the <code>accept</code>
156
     * methods instead, which handle everything for you. 
157
     * Take into account the accept methods may use a fast iterator to 
158
     * get the features.
159
     * </em>
160
     * </p>
161
     * 
162
     * @see #accept(org.gvsig.tools.visitor.Visitor)
163
     * @see #accept(org.gvsig.tools.visitor.Visitor, long)
164
     * 
165
     * @return an iterator over this set.
166
     * 
167
     * @throws DataException
168
     */
150 169
	public DisposableIterator fastIterator() throws DataException;
151 170

  
152
	/**
153
	 * Returns a fast iterator over this set, starting from the given index.
154
	 * 
155
	 * <p>
156
	 * <em>
157
	 * <strong>NOTE:</strong> if you use this method to get the iterator, you
158
	 * must get sure the iterator is disposed (@see
159
	 * {@link DisposableIterator#dispose()}) in any case, even if an error occurs
160
	 * while getting the data. It is recommended to use the <code>accept</code>
161
	 * methods instead, which handle everything for you. 
162
	 * Take into account the accept methods may use a fast iterator to 
163
	 * get the features.
164
	 * </em>
165
	 * </p>
166
	 * 
167
	 * @see #accept(org.gvsig.tools.visitor.Visitor)
168
	 * @see #accept(org.gvsig.tools.visitor.Visitor, long)
169
	 * 
170
	 * @param index
171
	 *            position in which the iterator is initially located.
172
	 * 
173
	 * @return an iterator initially located at the position indicated by the
174
	 *         given index
175
	 * 
176
	 * @throws DataException
177
	 */
171
    /**
172
     * Returns a fast iterator over this set, starting from the given index.
173
     * <p>
174
     * Fast in this case means that each of the elements returned may be a
175
     * reused or pooled object instance, so don't use it to be stored in any
176
     * way.
177
     * </p>
178
     * <p>
179
     * If you need to store one of the {@link Feature} of the iterator, use the
180
     * {@link Feature#getCopy()} to create a clone of the object.
181
     * </p>
182
     * 
183
     * <p>
184
     * <em>
185
     * <strong>NOTE:</strong> if you use this method to get the iterator, you
186
     * must get sure the iterator is disposed (@see
187
     * {@link DisposableIterator#dispose()}) in any case, even if an error occurs
188
     * while getting the data. It is recommended to use the <code>accept</code>
189
     * methods instead, which handle everything for you. 
190
     * Take into account the accept methods may use a fast iterator to 
191
     * get the features.
192
     * </em>
193
     * </p>
194
     * 
195
     * @see #accept(org.gvsig.tools.visitor.Visitor)
196
     * @see #accept(org.gvsig.tools.visitor.Visitor, long)
197
     * 
198
     * @param index
199
     *            position in which the iterator is initially located.
200
     * 
201
     * @return an iterator initially located at the position indicated by the
202
     *         given index
203
     * 
204
     * @throws DataException
205
     */
178 206
	public DisposableIterator fastIterator(long index) throws DataException;
179 207

  
180 208
	/**
......
250 278
     */
251 279
    public DynObjectSet getDynObjectSet(boolean fast);
252 280

  
281
    /**
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff