Revision 32899 branches/v2_0_0_prep/libraries/libFMap_dal/src/org/gvsig/fmap/dal/DataManager.java

View differences:

DataManager.java
31 31
import org.gvsig.fmap.dal.exception.InitializeException;
32 32
import org.gvsig.fmap.dal.exception.ProviderNotRegisteredException;
33 33
import org.gvsig.fmap.dal.exception.ValidateDataParametersException;
34
import org.gvsig.fmap.dal.feature.Feature;
34 35
import org.gvsig.fmap.dal.feature.FeatureIndex;
36
import org.gvsig.fmap.dal.feature.FeatureStore;
35 37
import org.gvsig.fmap.dal.feature.spi.index.FeatureIndexProvider;
36 38
import org.gvsig.fmap.dal.resource.ResourceManager;
39
import org.gvsig.fmap.dal.store.memory.MemoryStoreProvider;
37 40
import org.gvsig.tools.dynobject.DynObject;
38 41
import org.gvsig.tools.evaluator.Evaluator;
39 42

  
40 43
/**
41
 * There are two top level management roles within DAL: data access and resource
42
 * management.
43
 * 
44
 * This class is responsible of the data access management role. It provides
45
 * ways for registering and instantiating {@link DataServerExplorer}(s),
46
 * {@link DataStore}(s), {@link Evaluator}(s) and {@link FeatureIndex}(es).
47
 * 
44
 * There are two top level management roles within DAL: data access and resource management.
45
 *
46
 * This class is responsible of the data access management role. It provides ways
47
 * for registering and instantiating {@link DataServerExplorer}(s), {@link DataStore}(s),
48
 * {@link Evaluator}(s) and {@link FeatureIndex}(es).
49
 *
48 50
 * @see ResourceManager
49
 * 
51
 *
50 52
 */
51 53

  
52 54
public interface DataManager {
53 55

  
54 56
	/**
55 57
	 * Returns the default DAL's temporary directory
56
	 * 
58
	 *
57 59
	 * @return Temporary directory name
58 60
	 */
59 61
	public String getTemporaryDirectory();
60 62

  
61 63
	/*
62 64
	 * ====================================================================
63
	 * 
65
	 *
64 66
	 * Store related services
65 67
	 */
66 68

  
......
71 73
	 * @param name
72 74
	 *            provider name
73 75
	 * 
76
	 * @throws ProviderNotRegisteredException
77
	 *             if the memory provider is not registered
74 78
	 * @throws InitializeException
75
	 * 
76
	 * @throws InitializeException
77
	 * @throws ProviderNotRegisteredException
79
	 *             if there is an error initializing the parameters for the
80
	 *             memory provider
78 81
	 **/
79 82
	public DataStoreParameters createStoreParameters(String name)
80 83
			throws InitializeException, ProviderNotRegisteredException;
81 84

  
82 85
	/**
86
	 * 
83 87
	 * Creates, initializes and returns an instance of NewDataStoreParameters
84 88
	 * given the name with which their provider is registered.
85 89
	 * 
......
96 100
	 * Creates, initializes and returns an instance of DataStore given the
97 101
	 * DataStoreParameters.
98 102
	 * 
99
	 * @param name of the provider
100 103
	 * @param parameters
101 104
	 *            parameters used to instantiate and initialize the DataStore
102 105
	 * 
106
	 * @throws ProviderNotRegisteredException
107
	 *             if the memory provider is not registered
103 108
	 * @throws InitializeException
104
	 * 
105
	 * @throws ProviderNotRegisteredException
109
	 *             if there is an error initializing the parameters for the
110
	 *             memory provider
106 111
	 * @throws ValidateDataParametersException
107
	 **/
112
	 *             if the parameters to open the memory based store are not
113
	 *             valid
114
	 */
108 115
	public DataStore openStore(String provider, DataStoreParameters parameters)
109 116
			throws InitializeException, ProviderNotRegisteredException,
110 117
			ValidateDataParametersException;
......
132 139
	/**
133 140
	 * Returns a list of Strings containing the names of all available DataStore
134 141
	 * providers.
135
	 * 
142
	 *
136 143
	 * @return list of String containing available DataStore provider names
137 144
	 */
138 145
	public List getStoreProviders();
......
148 155

  
149 156
	/*
150 157
	 * ====================================================================
151
	 * 
158
	 *
152 159
	 * Explorer related services
153 160
	 */
154 161
	/**
155
	 * Returns an instance of {@link DataServerExplorerParameters} corresponding
156
	 * to the given name.
157
	 * 
162
	 * Returns an instance of {@link DataServerExplorerParameters} corresponding to
163
	 * the given name.
164
	 *
158 165
	 * @param name
159 166
	 *            name of a registered server explorer provider
160
	 * 
167
	 *
161 168
	 * @throws InitializeException
162
	 *             if parameter initialization causes an error.
163
	 * 
169
	 * 			if parameter initialization causes an error.
170
	 *
164 171
	 * @throws ProviderNotRegisteredException
165
	 *             if could not find a provider by the given name.
166
	 * 
172
	 * 			if could not find a provider by the given name.
173
	 *
167 174
	 **/
168 175
	public DataServerExplorerParameters createServerExplorerParameters(
169
			String name) throws InitializeException,
170
			ProviderNotRegisteredException;
176
			String name)
177
			throws InitializeException, ProviderNotRegisteredException;
171 178

  
172 179
	/**
173 180
	 * Returns an instance of {@link DataServerExplorer} given its parameters.
174
	 * 
175
	 * @param name of the explorer
181
	 *
176 182
	 * @param parameters
177 183
	 *            parameters used to instantiate and initialize the
178 184
	 *            {@link DataServerExplorer}.
179
	 * 
185
	 *
180 186
	 * @return an instance of {@link DataServerExplorer}.
181
	 * 
187
	 *
182 188
	 * @throws InitializeException
183
	 * 
189
	 *
184 190
	 * @throws ProviderNotRegisteredException
185 191
	 * @throws ValidateDataParametersException
186 192
	 */
......
201 207
	/**
202 208
	 * Returns a list of String containing the names of the available
203 209
	 * DataServerExplorer providers.
204
	 * 
210
	 *
205 211
	 * @return list of String containing the names of the available
206 212
	 *         DataServerExplorer providers.
207 213
	 */
......
209 215

  
210 216
	/*
211 217
	 * ====================================================================
212
	 * 
218
	 *
213 219
	 * Expression evaluation related services
214 220
	 */
215 221

  
216 222
	/**
217 223
	 * Registers the default expression evaluator. It is used by DAL to evaluate
218 224
	 * and resolve query filters and expressions.
219
	 * 
225
	 *
220 226
	 * @param evaluator
221 227
	 *            Class that will be called to evaluate the expression. It must
222 228
	 *            implement {@link Evaluator}.
......
225 231

  
226 232
	/**
227 233
	 * Creates an instance of Evaluator that represents the given expression.
228
	 * 
234
	 *
229 235
	 * @param expression
230 236
	 *            String containing a CQL expression.
231 237
	 * @return instance of Evaluator representing the given expression.
......
236 242

  
237 243
	/*
238 244
	 * ====================================================================
239
	 * 
245
	 *
240 246
	 * Index related services
241 247
	 */
242 248

  
249

  
243 250
	/**
244
	 * Returns a list of String containing the names of the available index
245
	 * providers.
246
	 * 
247
	 * @return list of strings with the names of the available index providers
251
	 * Returns a list of String containing the names of the available index providers.
252
	 *
253
	 * @return
254
	 * 		list of strings with the names of the available index providers
248 255
	 */
249 256
	public List getFeatureIndexProviders();
250 257

  
251 258
	/**
252 259
	 * Sets the default DataIndexProvider for the given data type.
253
	 * 
260
	 *
254 261
	 * @param dataType
255
	 *            one of the data types defined in {@link DataTypes}.
262
	 * 				one of the data types defined in {@link DataTypes}.
256 263
	 * @param name
257
	 *            Provider's name
264
	 * 			Provider's name
258 265
	 */
259
	public void setDefaultFeatureIndexProviderName(int dataType, String name);
266
    public void setDefaultFeatureIndexProviderName(int dataType, String name);
260 267

  
261 268
	/**
262 269
	 * Returns the default DataIndexProvider name, given a data type. Data types
263 270
	 * are defined in {@link DataTypes}.
264
	 * 
271
	 *
265 272
	 * @param dataType
266 273
	 *            one of the constants in {@link DataTypes}.
267
	 * 
268
	 * @return the name of the default {@link FeatureIndexProvider} if there is
269
	 *         anyone available for the given data type.
274
	 *
275
	 * @return
276
	 * 		the name of the default {@link FeatureIndexProvider} if there is
277
	 * 		anyone available for the given data type.
270 278
	 */
271
	public String getDefaultFeatureIndexProviderName(int dataType);
279
    public String getDefaultFeatureIndexProviderName(int dataType);
272 280

  
281
    /**
282
	 * Returns a list of String containing the names of the available cache providers.
283
	 *
284
	 * @return
285
	 * 		list of strings with the names of the available cache providers
286
	 */    
287
    public List getFeatureCacheProviders();
288

  
273 289
	/**
274
	 * Returns a list of String containing the names of the available cache
275
	 * providers.
290
	 * Returns an instance of {@link DataServerExplorerParameters} corresponding
291
	 * to the given name used by the cache to create a store to save the
292
	 * retrieved data.
276 293
	 * 
277
	 * @return list of strings with the names of the available cache providers
278
	 */
279
	public List getFeatureCacheProviders();
280
    
281
	/**
282
	 * Returns an instance of {@link DataServerExplorerParameters} corresponding to
283
	 * the given name used by the cache to create a store to save the retrieved data.
284
	 *
285 294
	 * @param name
286 295
	 *            name of a registered feature cache provider
287
	 *
296
	 * 
288 297
	 * @throws InitializeException
289
	 * 			if parameter initialization causes an error.
290
	 *
298
	 *             if parameter initialization causes an error.
299
	 * 
291 300
	 * @throws ProviderNotRegisteredException
292
	 * 			if could not find a cache provider by the given name.
293
	 *
294
	 **/
295
    public DynObject createCacheParameters(String name) throws InitializeException, 
296
    	ProviderNotRegisteredException;
297
    
301
	 *             if could not find a cache provider by the given name.
302
	 * 
303
	 */
304
	public DynObject createCacheParameters(String name)
305
			throws InitializeException, ProviderNotRegisteredException;
298 306

  
307
	/**
308
	 * Utility method to create the {@link DataStoreParameters} to create a
309
	 * {@link FeatureStore} based on the {@link MemoryStoreProvider}.
310
	 * 
311
	 * @param autoOrderAttributeName
312
	 *            the name of the {@link Feature} attribute to be used to order
313
	 *            the store {@link Feature}s by default. Set to null if you
314
	 *            don't want any order by default
315
	 * @return the parameters for the memory based store
316
	 * @throws InitializeException
317
	 *             if there is an error initializing the parameters for the
318
	 *             memory provider
319
	 */
320
	public DataStoreParameters createMemoryStoreParameters(
321
			String autoOrderAttributeName) throws InitializeException;
299 322

  
323
	/**
324
	 * Utility method to create the a {@link FeatureStore} based on the
325
	 * {@link MemoryStoreProvider}.
326
	 * 
327
	 * @param autoOrderAttributeName
328
	 *            the name of the {@link Feature} attribute to be used to order
329
	 *            the store {@link Feature}s by default. Set to null if you
330
	 *            don't want any order by default
331
	 * @return the the memory based store
332
	 * @throws InitializeException
333
	 *             if there is an error initializing the parameters for the
334
	 *             memory provider
335
	 */
336
	public FeatureStore createMemoryStore(String autoOrderAttributeName)
337
			throws InitializeException;
300 338
}

Also available in: Unified diff