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 / DataManager.java @ 47436
History | View | Annotate | Download (24.5 KB)
1 | 40559 | jjdelcerro | /**
|
---|---|---|---|
2 | * gvSIG. Desktop Geographic Information System.
|
||
3 | 40435 | jjdelcerro | *
|
4 | 40559 | jjdelcerro | * Copyright (C) 2007-2013 gvSIG Association.
|
5 | 40435 | jjdelcerro | *
|
6 | 43020 | jjdelcerro | * This program is free software; you can redistribute it and/or modify it under
|
7 | * the terms of the GNU General Public License as published by the Free Software
|
||
8 | * Foundation; either version 3 of the License, or (at your option) any later
|
||
9 | * version.
|
||
10 | 40435 | jjdelcerro | *
|
11 | 43020 | jjdelcerro | * This program is distributed in the hope that it will be useful, but WITHOUT
|
12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||
13 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
||
14 | * details.
|
||
15 | 40435 | jjdelcerro | *
|
16 | 43020 | jjdelcerro | * You should have received a copy of the GNU General Public License along with
|
17 | * this program; if not, write to the Free Software Foundation, Inc., 51
|
||
18 | * Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||
19 | 40435 | jjdelcerro | *
|
20 | 43020 | jjdelcerro | * For any additional information, do not hesitate to contact us at info AT
|
21 | * gvsig.com, or visit our website www.gvsig.com.
|
||
22 | 40435 | jjdelcerro | */
|
23 | package org.gvsig.fmap.dal; |
||
24 | |||
25 | 43020 | jjdelcerro | import java.io.File; |
26 | 47080 | jjdelcerro | import java.util.Collections; |
27 | 40435 | jjdelcerro | import java.util.List; |
28 | 47209 | jjdelcerro | import java.util.Locale; |
29 | 45426 | fdiaz | import java.util.Map; |
30 | import java.util.Set; |
||
31 | 45696 | jjdelcerro | import java.util.function.Predicate; |
32 | 45043 | jjdelcerro | import javax.json.JsonObject; |
33 | 43984 | jjdelcerro | import org.gvsig.expressionevaluator.Expression; |
34 | 44042 | jjdelcerro | import org.gvsig.expressionevaluator.ExpressionBuilder; |
35 | 40435 | jjdelcerro | |
36 | 43205 | fdiaz | import org.gvsig.fmap.dal.exception.DataException; |
37 | 40435 | jjdelcerro | import org.gvsig.fmap.dal.exception.InitializeException; |
38 | import org.gvsig.fmap.dal.exception.ProviderNotRegisteredException; |
||
39 | import org.gvsig.fmap.dal.exception.ValidateDataParametersException; |
||
40 | 44750 | jjdelcerro | import org.gvsig.fmap.dal.expressionevaluator.DALExpressionBuilder; |
41 | 43983 | jjdelcerro | import org.gvsig.fmap.dal.expressionevaluator.FeatureSymbolTable; |
42 | 40435 | jjdelcerro | import org.gvsig.fmap.dal.feature.EditableFeatureType; |
43 | import org.gvsig.fmap.dal.feature.Feature; |
||
44 | import org.gvsig.fmap.dal.feature.FeatureIndex; |
||
45 | import org.gvsig.fmap.dal.feature.FeatureQuery; |
||
46 | import org.gvsig.fmap.dal.feature.FeatureStore; |
||
47 | 43989 | jjdelcerro | import org.gvsig.fmap.dal.feature.FeatureType; |
48 | 40435 | jjdelcerro | import org.gvsig.fmap.dal.feature.paging.FeaturePagingHelper; |
49 | 42775 | jjdelcerro | import org.gvsig.fmap.dal.resource.ResourceManager; |
50 | 43020 | jjdelcerro | import org.gvsig.tools.dataTypes.DataType; |
51 | 40435 | jjdelcerro | import org.gvsig.tools.dynobject.DynObject; |
52 | 42775 | jjdelcerro | import org.gvsig.tools.dynobject.DynStruct; |
53 | 42778 | jjdelcerro | import org.gvsig.tools.dynobject.Tags; |
54 | 40435 | jjdelcerro | import org.gvsig.tools.evaluator.Evaluator; |
55 | import org.gvsig.tools.exception.BaseException; |
||
56 | 43020 | jjdelcerro | import org.gvsig.tools.service.spi.Services; |
57 | 43989 | jjdelcerro | import org.gvsig.fmap.dal.expressionevaluator.FeatureAttributeEmulatorExpression; |
58 | 44128 | jjdelcerro | import org.gvsig.fmap.dal.feature.DataProfile; |
59 | 47209 | jjdelcerro | import org.gvsig.fmap.dal.feature.DataTypeDetector; |
60 | 45696 | jjdelcerro | import org.gvsig.fmap.dal.feature.EditableFeature; |
61 | 44753 | omartinez | import org.gvsig.fmap.dal.feature.EditableFeatureAttributeDescriptor; |
62 | 45696 | jjdelcerro | import org.gvsig.fmap.dal.feature.FeatureAttributeDescriptor; |
63 | 45739 | jjdelcerro | import org.gvsig.fmap.dal.feature.FeatureRuleExpression; |
64 | 45696 | jjdelcerro | import org.gvsig.fmap.dal.feature.FeatureSet; |
65 | 46996 | jjdelcerro | import org.gvsig.fmap.dal.feature.LabelsCacheForFieldValues; |
66 | 44871 | jjdelcerro | import org.gvsig.tools.observer.Observer; |
67 | 47080 | jjdelcerro | import org.gvsig.tools.resourcesstorage.BytesResource; |
68 | 44328 | jjdelcerro | import org.gvsig.tools.resourcesstorage.ResourcesStorage; |
69 | 46996 | jjdelcerro | import org.gvsig.tools.task.SimpleTaskStatus; |
70 | 45461 | jjdelcerro | import org.gvsig.tools.util.Factory; |
71 | 46996 | jjdelcerro | import org.gvsig.tools.util.Invocable; |
72 | 47138 | jjdelcerro | import org.gvsig.tools.util.PropertiesSupport; |
73 | 40435 | jjdelcerro | |
74 | /**
|
||
75 | 43020 | jjdelcerro | * There are two top level management roles within DAL: data access and resource
|
76 | * management.
|
||
77 | 40435 | jjdelcerro | *
|
78 | 43020 | jjdelcerro | * This class is responsible of the data access management role. It provides
|
79 | * ways for registering and instantiating {@link DataServerExplorer}(s),
|
||
80 | * {@link DataStore}(s), {@link Evaluator}(s) and {@link FeatureIndex}(es).
|
||
81 | 40435 | jjdelcerro | *
|
82 | * @see ResourceManager
|
||
83 | *
|
||
84 | */
|
||
85 | 47138 | jjdelcerro | public interface DataManager extends Services, PropertiesSupport { |
86 | 40435 | jjdelcerro | |
87 | 46015 | jjdelcerro | public static final int RECOMENDED_SIZE_FOR_CLOB = 4096; |
88 | |||
89 | 43020 | jjdelcerro | public static final String CREATE_STORE_AUTHORIZATION = "dal-create-store"; |
90 | public static final String READ_STORE_AUTHORIZATION = "dal-read-store"; |
||
91 | public static final String WRITE_STORE_AUTHORIZATION = "dal-write-store"; |
||
92 | 40435 | jjdelcerro | |
93 | 44262 | jjdelcerro | public static final String DAL_SYMBOL_TABLE = "DAL.SymbolTable.Global"; |
94 | 44750 | jjdelcerro | // public static final String DAL_SYMBOL_TABLE_FEATURE = "DAL.SymbolTable.Feature";
|
95 | 44253 | jjdelcerro | |
96 | 44262 | jjdelcerro | public static final String FUNCTION_FOREING_VALUE = "FOREING_VALUE"; |
97 | 46778 | jjdelcerro | public static final String FUNCTION_FOREIGN_VALUE = "FOREIGN_VALUE"; |
98 | 44748 | jjdelcerro | public static final String FUNCTION_SELECT = "SELECT"; |
99 | 45198 | jjdelcerro | public static final String FUNCTION_UPDATE = "UPDATE"; |
100 | 44748 | jjdelcerro | public static final String FUNCTION_SELECT_COUNT = "SELECT_COUNT"; |
101 | public static final String FUNCTION_EXISTS = "EXISTS"; |
||
102 | 44858 | jjdelcerro | public static final String FUNCTION_EXISTS_TABLE = "EXISTS_TABLE"; |
103 | public static final String FUNCTION_ROW_TAG = "ROW_TAG"; |
||
104 | public static final String FUNCTION_SET_ROW_TAG = "SET_ROW_TAG"; |
||
105 | 44748 | jjdelcerro | public static final String FUNCTION_CURRENT_ROW = "CURRENT_ROW"; |
106 | public static final String FUNCTION_CURRENT_STORE = "CURRENT_STORE"; |
||
107 | public static final String FUNCTION_ISSELECTED_CURRENT_ROW = "ISSELECTED_CURRENT_ROW"; |
||
108 | 44853 | jjdelcerro | public static final String FUNCTION_GEOMETRY = "GEOMETRY"; |
109 | 44858 | jjdelcerro | public static final String FUNCTION_CREATE_IN_MEMORY_TABLE = "CREATE_IN_MEMORY_TABLE"; |
110 | public static final String FUNCTION_INSERT_INTO_TABLE = "INSERT_INTO_TABLE"; |
||
111 | 45043 | jjdelcerro | public static final String FUNCTION_CREATE_TABLE = "CREATE_TABLE"; |
112 | public static final String FUNCTION_CREATE_TABLE_STRUCTURE = "CREATE_TABLE_STRUCTURE"; |
||
113 | 46100 | jjdelcerro | public static final String FUNCTION_SELECT_FROM_SELECTION = "SELECTFROMSELECTION"; |
114 | public static final String FUNCTION_SELECT_COUNT_FROM_SELECTION = "SELECTCOUNTFROMSELECTION"; |
||
115 | 47053 | jjdelcerro | public static final String FUNCTION_EXECUTESQL = "EXECUTESQL"; |
116 | 44262 | jjdelcerro | |
117 | 44340 | jjdelcerro | public static final String DAL_PREFERRED_COLUMNS = "DAL.Preferred.Columns"; |
118 | |||
119 | 44351 | jjdelcerro | public static final String DAL_USE_LABELS = "DAL.useLabels"; |
120 | 46285 | jjdelcerro | |
121 | public static final String DAL_USE_LARGE_SELECTION = "DAL.useLargeSelection"; |
||
122 | 46361 | jjdelcerro | public static final String DAL_STORE_ENVELOPE = "DAL.forcedEnvelope"; |
123 | 46677 | jjdelcerro | public static final String DAL_FEATURETYPE_MODE_EDIT = "DAL.featureTypeEditMode"; |
124 | 46682 | jjdelcerro | public static final String DAL_FEATURETYPE_MODE_EDIT_MSG = "DAL.featureTypeEditMode.msg"; |
125 | 44871 | jjdelcerro | |
126 | 44351 | jjdelcerro | public static final int USE_LABELS_YES = 0; |
127 | public static final int USE_LABELS_NO = 1; |
||
128 | public static final int USE_LABELS_BOTH = 2; |
||
129 | |||
130 | 43020 | jjdelcerro | /**
|
131 | 44262 | jjdelcerro | *
|
132 | 43020 | jjdelcerro | * Returns the default DAL's temporary directory
|
133 | *
|
||
134 | * @return Temporary directory name
|
||
135 | 43241 | jjdelcerro | * @deprecated use FoldersManager of org.gvsig.tools
|
136 | 43020 | jjdelcerro | */
|
137 | public String getTemporaryDirectory(); |
||
138 | 40435 | jjdelcerro | |
139 | 43020 | jjdelcerro | /*
|
140 | * ====================================================================
|
||
141 | *
|
||
142 | * Store related services
|
||
143 | */
|
||
144 | /**
|
||
145 | * Creates, initializes and returns an instance of DataStoreParameters given
|
||
146 | * the name with which their provider is registered.
|
||
147 | *
|
||
148 | * @param name provider name
|
||
149 | 45043 | jjdelcerro | * @param arguments
|
150 | 43020 | jjdelcerro | * @return the data store parameters
|
151 | *
|
||
152 | * @throws ProviderNotRegisteredException if the memory provider is not
|
||
153 | * registered
|
||
154 | * @throws InitializeException if there is an error initializing the
|
||
155 | * parameters for the memory provider
|
||
156 | *
|
||
157 | */
|
||
158 | 44738 | jjdelcerro | public DataStoreParameters createStoreParameters(String name, Object... arguments) |
159 | 43020 | jjdelcerro | throws InitializeException, ProviderNotRegisteredException;
|
160 | 45272 | omartinez | |
161 | public DataStoreParameters createStoreParameters(String name) |
||
162 | throws InitializeException, ProviderNotRegisteredException;
|
||
163 | 40435 | jjdelcerro | |
164 | 44304 | jjdelcerro | public DataStoreParameters createStoreParameters(byte[] data); |
165 | |||
166 | 43020 | jjdelcerro | /**
|
167 | * Creates, initializes and fill an instance of DataStoreParameters from the
|
||
168 | * tags of the DynStruct passed as parameter.
|
||
169 | *
|
||
170 | * @param struct structure from which tags were created ths parameters.
|
||
171 | * @return the data store parameters
|
||
172 | *
|
||
173 | * @throws ProviderNotRegisteredException if the memory provider is not
|
||
174 | * registered
|
||
175 | * @throws InitializeException if there is an error initializing the
|
||
176 | * parameters for the memory provider
|
||
177 | *
|
||
178 | */
|
||
179 | public DataStoreParameters createStoreParameters(DynStruct struct)
|
||
180 | throws InitializeException, ProviderNotRegisteredException;
|
||
181 | 40435 | jjdelcerro | |
182 | 43020 | jjdelcerro | public DataStoreParameters createStoreParameters(Tags tags) throws InitializeException, ProviderNotRegisteredException; |
183 | 42778 | jjdelcerro | |
184 | 43020 | jjdelcerro | /**
|
185 | * Creates, initializes and returns an instance of NewDataStoreParameters
|
||
186 | * given the name with which their provider is registered.
|
||
187 | *
|
||
188 | * @param explorer
|
||
189 | * @param provider
|
||
190 | * @return
|
||
191 | *
|
||
192 | * @throws InitializeException
|
||
193 | * @throws ProviderNotRegisteredException
|
||
194 | */
|
||
195 | public NewDataStoreParameters createNewStoreParameters(String explorer, String provider) |
||
196 | throws InitializeException, ProviderNotRegisteredException;
|
||
197 | 40435 | jjdelcerro | |
198 | 45043 | jjdelcerro | public NewDataStoreParameters createNewStoreParameters(String provider) |
199 | throws InitializeException, ProviderNotRegisteredException;
|
||
200 | |||
201 | 43020 | jjdelcerro | /**
|
202 | *
|
||
203 | * Creates, initializes and returns an instance of DataStore given the
|
||
204 | * DataStoreParameters.
|
||
205 | *
|
||
206 | * @param provider
|
||
207 | * @param parameters parameters used to instantiate and initialize the
|
||
208 | * DataStore
|
||
209 | * @return
|
||
210 | *
|
||
211 | * @throws ProviderNotRegisteredException if the memory provider is not
|
||
212 | * registered
|
||
213 | * @throws InitializeException if there is an error initializing the
|
||
214 | * parameters for the memory provider
|
||
215 | * @throws ValidateDataParametersException if the parameters to open the
|
||
216 | * memory based store are not valid
|
||
217 | */
|
||
218 | public DataStore openStore(String provider, DynObject parameters) |
||
219 | throws InitializeException, ProviderNotRegisteredException,
|
||
220 | ValidateDataParametersException; |
||
221 | 40435 | jjdelcerro | |
222 | 43020 | jjdelcerro | public DataStore openStore(String provider, DataStoreParameters parameters) |
223 | throws InitializeException, ProviderNotRegisteredException,
|
||
224 | ValidateDataParametersException; |
||
225 | 42775 | jjdelcerro | |
226 | 45966 | jjdelcerro | public DataStore openStore(String providerName, DataStoreParameters |
227 | parameters, boolean ignoreDALResource)
|
||
228 | throws InitializeException, ProviderNotRegisteredException,
|
||
229 | ValidateDataParametersException; |
||
230 | |||
231 | 43093 | jjdelcerro | public DataStore openStore(
|
232 | 43205 | fdiaz | String providerName,
|
233 | Object... arguments)
|
||
234 | throws
|
||
235 | InitializeException, |
||
236 | ProviderNotRegisteredException, |
||
237 | ValidateDataParametersException; |
||
238 | |||
239 | 43020 | jjdelcerro | public DataStore openStore(DynStruct struct)
|
240 | throws InitializeException, ProviderNotRegisteredException, ValidateDataParametersException;
|
||
241 | 42775 | jjdelcerro | |
242 | 43020 | jjdelcerro | /**
|
243 | * Create a new physical store
|
||
244 | *
|
||
245 | * @param explorer
|
||
246 | * @param provider
|
||
247 | * @param parameters
|
||
248 | * @param overwrite
|
||
249 | *
|
||
250 | * @throws InitializeException
|
||
251 | * @throws ProviderNotRegisteredException
|
||
252 | * @throws ValidateDataParametersException
|
||
253 | */
|
||
254 | public void newStore(String explorer, String provider, NewDataStoreParameters parameters, boolean overwrite) |
||
255 | throws InitializeException, ProviderNotRegisteredException,
|
||
256 | ValidateDataParametersException; |
||
257 | 40435 | jjdelcerro | |
258 | 45043 | jjdelcerro | public void newStore(String provider, NewDataStoreParameters parameters, boolean overwrite) |
259 | throws InitializeException, ProviderNotRegisteredException,
|
||
260 | ValidateDataParametersException; |
||
261 | |||
262 | 43020 | jjdelcerro | /**
|
263 | * Returns a list of Strings containing the names of all available DataStore
|
||
264 | * providers.
|
||
265 | *
|
||
266 | * @return list of String containing available DataStore provider names
|
||
267 | */
|
||
268 | public List getStoreProviders(); |
||
269 | 42624 | jjdelcerro | |
270 | 43020 | jjdelcerro | /**
|
271 | * Returns a list of Strings containing the names of all available DataStore
|
||
272 | * providers for an explorer.
|
||
273 | *
|
||
274 | * @param name
|
||
275 | * @return
|
||
276 | */
|
||
277 | public List<String> getStoreProviders(String name); |
||
278 | 42624 | jjdelcerro | |
279 | 43020 | jjdelcerro | /*
|
280 | * ====================================================================
|
||
281 | *
|
||
282 | * Explorer related services
|
||
283 | */
|
||
284 | /**
|
||
285 | * Returns an instance of {@link DataServerExplorerParameters} corresponding
|
||
286 | * to the given name.
|
||
287 | *
|
||
288 | * @param name name of a registered server explorer provider
|
||
289 | * @return
|
||
290 | *
|
||
291 | * @throws InitializeException if parameter initialization causes an error.
|
||
292 | *
|
||
293 | * @throws ProviderNotRegisteredException if could not find a provider by
|
||
294 | * the given name.
|
||
295 | *
|
||
296 | *
|
||
297 | */
|
||
298 | public DataServerExplorerParameters createServerExplorerParameters(
|
||
299 | String name)
|
||
300 | throws InitializeException, ProviderNotRegisteredException;
|
||
301 | 40435 | jjdelcerro | |
302 | 43020 | jjdelcerro | /**
|
303 | * Returns an instance of {@link DataServerExplorer} given its parameters.
|
||
304 | *
|
||
305 | * @param name
|
||
306 | * @param parameters parameters used to instantiate and initialize the
|
||
307 | * {@link DataServerExplorer}.
|
||
308 | *
|
||
309 | * @return an instance of {@link DataServerExplorer}.
|
||
310 | *
|
||
311 | * @throws InitializeException
|
||
312 | *
|
||
313 | * @throws ProviderNotRegisteredException
|
||
314 | * @throws ValidateDataParametersException
|
||
315 | */
|
||
316 | public DataServerExplorer openServerExplorer(
|
||
317 | String name,
|
||
318 | DataServerExplorerParameters parameters) |
||
319 | throws InitializeException, ProviderNotRegisteredException,
|
||
320 | ValidateDataParametersException; |
||
321 | 43205 | fdiaz | |
322 | 43093 | jjdelcerro | public DataServerExplorer openServerExplorer(
|
323 | 43205 | fdiaz | String explorerName,
|
324 | 43093 | jjdelcerro | Object... arguments)
|
325 | 43205 | fdiaz | throws
|
326 | InitializeException, |
||
327 | ProviderNotRegisteredException, |
||
328 | 43093 | jjdelcerro | ValidateDataParametersException; |
329 | 43020 | jjdelcerro | /**
|
330 | 43045 | jjdelcerro | * @param parameters
|
331 | 43205 | fdiaz | * @return
|
332 | * @throws org.gvsig.fmap.dal.exception.InitializeException
|
||
333 | * @throws org.gvsig.fmap.dal.exception.ProviderNotRegisteredException
|
||
334 | * @throws org.gvsig.fmap.dal.exception.ValidateDataParametersException
|
||
335 | 43020 | jjdelcerro | * @deprecated see openServerExplorer
|
336 | */
|
||
337 | public DataServerExplorer createServerExplorer(
|
||
338 | DataServerExplorerParameters parameters) |
||
339 | throws InitializeException, ProviderNotRegisteredException,
|
||
340 | ValidateDataParametersException; |
||
341 | 43205 | fdiaz | |
342 | 43020 | jjdelcerro | /**
|
343 | 43045 | jjdelcerro | * @param parameters
|
344 | 43205 | fdiaz | * @return
|
345 | * @throws org.gvsig.fmap.dal.exception.InitializeException
|
||
346 | * @throws org.gvsig.fmap.dal.exception.ProviderNotRegisteredException
|
||
347 | * @throws org.gvsig.fmap.dal.exception.ValidateDataParametersException
|
||
348 | 43045 | jjdelcerro | * @deprecated see openStore
|
349 | */
|
||
350 | public DataStore createStore(DataStoreParameters parameters)
|
||
351 | throws InitializeException, ProviderNotRegisteredException,
|
||
352 | ValidateDataParametersException; |
||
353 | 43205 | fdiaz | |
354 | 43045 | jjdelcerro | /**
|
355 | 43020 | jjdelcerro | * Returns a list of String containing the names of the available
|
356 | * DataServerExplorer providers.
|
||
357 | *
|
||
358 | * @return list of String containing the names of the available
|
||
359 | * DataServerExplorer providers.
|
||
360 | */
|
||
361 | public List<String> getExplorerProviders(); |
||
362 | 40435 | jjdelcerro | |
363 | 44023 | jjdelcerro | /**
|
364 | * Creates an instance of Evaluator that represents the given expression.
|
||
365 | 43020 | jjdelcerro | *
|
366 | 44023 | jjdelcerro | * @param expression String containing a CQL expression.
|
367 | * @return instance of Evaluator representing the given expression.
|
||
368 | * @throws InitializeException
|
||
369 | * @deprecated use createFilter
|
||
370 | 43020 | jjdelcerro | */
|
371 | 44023 | jjdelcerro | public Evaluator createExpresion(String expression) |
372 | throws InitializeException;
|
||
373 | |||
374 | 43020 | jjdelcerro | /**
|
375 | 44023 | jjdelcerro | * Creates an instance of Evaluator that represents the given expression.
|
376 | 43020 | jjdelcerro | *
|
377 | 44023 | jjdelcerro | * @param expression a Expression with the filter
|
378 | * @return instance of Evaluator representing the given expression.
|
||
379 | * @throws InitializeException
|
||
380 | * @deprecated use createFilter
|
||
381 | 43020 | jjdelcerro | */
|
382 | 44023 | jjdelcerro | public Evaluator createExpresion(Expression expression) |
383 | throws InitializeException;
|
||
384 | 40435 | jjdelcerro | |
385 | 43020 | jjdelcerro | /**
|
386 | * Creates an instance of Evaluator that represents the given expression.
|
||
387 | *
|
||
388 | * @param expression String containing a CQL expression.
|
||
389 | * @return instance of Evaluator representing the given expression.
|
||
390 | * @throws InitializeException
|
||
391 | */
|
||
392 | 44023 | jjdelcerro | public Evaluator createFilter(String expression) |
393 | 43020 | jjdelcerro | throws InitializeException;
|
394 | 43205 | fdiaz | |
395 | 44023 | jjdelcerro | /**
|
396 | * Creates an instance of Evaluator that represents the given expression.
|
||
397 | *
|
||
398 | * @param expression a Expression with the filter
|
||
399 | * @return instance of Evaluator representing the given expression.
|
||
400 | * @throws InitializeException
|
||
401 | */
|
||
402 | public Evaluator createFilter(Expression expression) |
||
403 | 43984 | jjdelcerro | throws InitializeException;
|
404 | |||
405 | 43020 | jjdelcerro | /*
|
406 | * ====================================================================
|
||
407 | *
|
||
408 | * Index related services
|
||
409 | */
|
||
410 | /**
|
||
411 | * Returns a list of String containing the names of the available index
|
||
412 | * providers.
|
||
413 | *
|
||
414 | * @return list of strings with the names of the available index providers
|
||
415 | */
|
||
416 | public List<String> getFeatureIndexProviders(); |
||
417 | 40435 | jjdelcerro | |
418 | 43020 | jjdelcerro | /**
|
419 | * Sets the default DataIndexProvider for the given data type.
|
||
420 | *
|
||
421 | * @param dataType one of the data types defined in {@link DataTypes}.
|
||
422 | * @param name Provider's name
|
||
423 | */
|
||
424 | 40435 | jjdelcerro | public void setDefaultFeatureIndexProviderName(int dataType, String name); |
425 | |||
426 | 43020 | jjdelcerro | /**
|
427 | * Returns the default DataIndexProvider name, given a data type. Data types
|
||
428 | * are defined in {@link DataTypes}.
|
||
429 | *
|
||
430 | * @param dataType one of the constants in {@link DataTypes}.
|
||
431 | *
|
||
432 | * @return the name of the default {@link FeatureIndexProvider} if there is
|
||
433 | * anyone available for the given data type.
|
||
434 | */
|
||
435 | 40435 | jjdelcerro | public String getDefaultFeatureIndexProviderName(int dataType); |
436 | |||
437 | /**
|
||
438 | 43020 | jjdelcerro | * Utility method to create the {@link DataStoreParameters} to create a
|
439 | * {@link FeatureStore} based on the {@link MemoryStoreProvider}.
|
||
440 | *
|
||
441 | * @param autoOrderAttributeName the name of the {@link Feature} attribute
|
||
442 | * to be used to order the store {@link Feature}s by default. Set to null if
|
||
443 | * you don't want any order by default
|
||
444 | * @return the parameters for the memory based store
|
||
445 | * @throws InitializeException if there is an error initializing the
|
||
446 | * parameters for the memory provider
|
||
447 | */
|
||
448 | public DataStoreParameters createMemoryStoreParameters(
|
||
449 | String autoOrderAttributeName) throws InitializeException; |
||
450 | 40435 | jjdelcerro | |
451 | 43020 | jjdelcerro | /**
|
452 | * Utility method to create the a {@link FeatureStore} based on the
|
||
453 | * {@link MemoryStoreProvider}.
|
||
454 | *
|
||
455 | * @param autoOrderAttributeName the name of the {@link Feature} attribute
|
||
456 | * to be used to order the store {@link Feature}s by default. Set to null if
|
||
457 | * you don't want any order by default
|
||
458 | * @return the the memory based store
|
||
459 | * @throws InitializeException if there is an error initializing the
|
||
460 | * parameters for the memory provider
|
||
461 | */
|
||
462 | public FeatureStore createMemoryStore(String autoOrderAttributeName) |
||
463 | throws InitializeException;
|
||
464 | 40435 | jjdelcerro | |
465 | /**
|
||
466 | * Creates a {@link FeaturePagingHelper} to paginate data from a
|
||
467 | * {@link FeatureStore}.
|
||
468 | 43020 | jjdelcerro | *
|
469 | * @param featureStore to get the {@link Feature}s from
|
||
470 | * @param pageSize the page size
|
||
471 | 40435 | jjdelcerro | * @return a {@link FeaturePagingHelper}
|
472 | 43020 | jjdelcerro | * @throws BaseException if there is an error creating the helper
|
473 | 40435 | jjdelcerro | */
|
474 | 43020 | jjdelcerro | public FeaturePagingHelper createFeaturePagingHelper(
|
475 | FeatureStore featureStore, int pageSize) throws BaseException; |
||
476 | 40435 | jjdelcerro | |
477 | 43020 | jjdelcerro | /**
|
478 | 40435 | jjdelcerro | * Creates a {@link FeaturePagingHelper} to paginate data from a
|
479 | * {@link FeatureStore}.
|
||
480 | 43020 | jjdelcerro | *
|
481 | * @param featureStore to get the {@link Feature}s from
|
||
482 | * @param featureQuery to filter and/or order the data
|
||
483 | * @param pageSize the page size
|
||
484 | 40435 | jjdelcerro | * @return a {@link FeaturePagingHelper}
|
485 | 43020 | jjdelcerro | * @throws BaseException if there is an error creating the helper
|
486 | 40435 | jjdelcerro | */
|
487 | 43020 | jjdelcerro | public FeaturePagingHelper createFeaturePagingHelper(
|
488 | FeatureStore featureStore, FeatureQuery featureQuery, int pageSize)
|
||
489 | throws BaseException;
|
||
490 | 40435 | jjdelcerro | |
491 | 43020 | jjdelcerro | public void setOpenErrorHandler(OpenErrorHandler handler); |
492 | 42775 | jjdelcerro | |
493 | 43020 | jjdelcerro | public OpenErrorHandler getOpenErrorHandler();
|
494 | |||
495 | public DataStoreProviderFactory getStoreProviderFactory(String name); |
||
496 | |||
497 | public EditableFeatureType createFeatureType();
|
||
498 | 45043 | jjdelcerro | |
499 | public EditableFeatureType createFeatureType(JsonObject json);
|
||
500 | 43020 | jjdelcerro | |
501 | public DataServerExplorerPool getDataServerExplorerPool();
|
||
502 | |||
503 | public void setDataServerExplorerPool(DataServerExplorerPool pool); |
||
504 | |||
505 | public void setResourcesLoader(ClassLoader loader); |
||
506 | |||
507 | public void setResourcesLoader(File folder); |
||
508 | |||
509 | /**
|
||
510 | * Return a list of the DataTypes supported for the type of the feature
|
||
511 | * attributes. The list is only informative.
|
||
512 | *
|
||
513 | * @return
|
||
514 | */
|
||
515 | public List<DataType> getDataTypes(); |
||
516 | |||
517 | public Register getStoreRegister();
|
||
518 | |||
519 | public Register getStoreProviderRegister();
|
||
520 | |||
521 | public Register getServerExplorerRegister();
|
||
522 | |||
523 | public Register getFeatureIndexRegister();
|
||
524 | 43040 | jjdelcerro | |
525 | /**
|
||
526 | * Creates a default ExpressionBuilder.
|
||
527 | 43205 | fdiaz | *
|
528 | * This ExpressionBuilder is not dependent on a data source,
|
||
529 | 43040 | jjdelcerro | * and is not advisable to use it.
|
530 | 43205 | fdiaz | *
|
531 | 43040 | jjdelcerro | * @return the ExpressionBuilder
|
532 | 44023 | jjdelcerro | * @deprecated use ExpressionEvaluatorManager.createExpressionBuilder()
|
533 | 43040 | jjdelcerro | */
|
534 | public ExpressionBuilder createExpressionBuilder();
|
||
535 | 43205 | fdiaz | |
536 | 43056 | jjdelcerro | /**
|
537 | * Returns a list of String containing the names of the available cache providers.
|
||
538 | *
|
||
539 | * @return
|
||
540 | * list of strings with the names of the available cache providers
|
||
541 | 43205 | fdiaz | */
|
542 | 43056 | jjdelcerro | public List getFeatureCacheProviders(); |
543 | |||
544 | /**
|
||
545 | * Returns an instance of {@link DataServerExplorerParameters} corresponding
|
||
546 | * to the given name used by the cache to create a store to save the
|
||
547 | * retrieved data.
|
||
548 | 43205 | fdiaz | *
|
549 | 43056 | jjdelcerro | * @param name
|
550 | * name of a registered feature cache provider
|
||
551 | 43212 | jjdelcerro | * @return
|
552 | 43205 | fdiaz | *
|
553 | 43056 | jjdelcerro | * @throws InitializeException
|
554 | * if parameter initialization causes an error.
|
||
555 | 43205 | fdiaz | *
|
556 | 43056 | jjdelcerro | * @throws ProviderNotRegisteredException
|
557 | * if could not find a cache provider by the given name.
|
||
558 | 43205 | fdiaz | *
|
559 | 43056 | jjdelcerro | */
|
560 | public DynObject createCacheParameters(String name) |
||
561 | throws InitializeException, ProviderNotRegisteredException;
|
||
562 | 43205 | fdiaz | |
563 | /**
|
||
564 | * @param providerName
|
||
565 | * @param params
|
||
566 | * @param overwrite
|
||
567 | * @throws DataException
|
||
568 | */
|
||
569 | 43212 | jjdelcerro | public void createFileStore(String providerName, NewDataStoreParameters params, boolean overwrite) throws DataException; |
570 | 43205 | fdiaz | |
571 | 43983 | jjdelcerro | public FeatureSymbolTable createFeatureSymbolTable();
|
572 | 45739 | jjdelcerro | |
573 | public FeatureSymbolTable createFeatureSymbolTable(String name); |
||
574 | 43989 | jjdelcerro | |
575 | 46012 | jjdelcerro | public EditableFeatureAttributeDescriptor createFeatureAttributeDescriptor(String name, int type); |
576 | 44753 | omartinez | |
577 | 43989 | jjdelcerro | public FeatureAttributeEmulatorExpression createFeatureAttributeEmulatorExpression(FeatureType type, Expression expression); |
578 | 44128 | jjdelcerro | |
579 | public void registerDataProfile(DataProfile profile); |
||
580 | |||
581 | public List<DataProfile> getDataProfiles(); |
||
582 | |||
583 | public DataProfile getDataProfile(String name); |
||
584 | 44253 | jjdelcerro | |
585 | public StoresRepository getStoresRepository();
|
||
586 | |||
587 | 44304 | jjdelcerro | public DatabaseWorkspaceManager createDatabaseWorkspaceManager(DataServerExplorerParameters connection);
|
588 | 44328 | jjdelcerro | |
589 | 44346 | jjdelcerro | public void addDatabaseWorkspace(DatabaseWorkspaceManager DatabaseWorkspace); |
590 | |||
591 | 44821 | jjdelcerro | public void removeDatabaseWorkspace(DatabaseWorkspaceManager DatabaseWorkspace); |
592 | |||
593 | public void addDatabaseWorkspaceListener(DatabaseWorkspaceManager.DatabaseWorkspaceListener listener); |
||
594 | 44419 | jjdelcerro | |
595 | 44346 | jjdelcerro | public DatabaseWorkspaceManager getDatabaseWorkspace(String name); |
596 | |||
597 | public DatabaseWorkspaceManager getDatabaseWorkspace(DataStoreParameters params);
|
||
598 | 46338 | fdiaz | |
599 | public DatabaseWorkspaceManager getDatabaseWorkspace(DataServerExplorerParameters params);
|
||
600 | 44346 | jjdelcerro | |
601 | 44328 | jjdelcerro | public void writeDALResource(ResourcesStorage resources, DataStore store); |
602 | |||
603 | public void writeDALResource(ResourcesStorage resources, FeatureType featureType); |
||
604 | 44304 | jjdelcerro | |
605 | 44419 | jjdelcerro | /**
|
606 | * Return a 35-40 characters unique identifier.
|
||
607 | *
|
||
608 | * @return the unique identifier
|
||
609 | */
|
||
610 | public String createUniqueID(); |
||
611 | |||
612 | 44719 | jjdelcerro | public void clearAvailableValuesCache(); |
613 | |||
614 | 44750 | jjdelcerro | public DALExpressionBuilder createDALExpressionBuilder();
|
615 | 44831 | jjdelcerro | |
616 | public boolean isTheOldRasterRegistered(); |
||
617 | 44871 | jjdelcerro | |
618 | public void addStoreObserver(Observer observer); |
||
619 | |||
620 | public void removeStoreObserver(Observer observer); |
||
621 | 45043 | jjdelcerro | |
622 | public String getServerExplorerFromStore(String name); |
||
623 | 45426 | fdiaz | |
624 | public void setMaxSizeForSmallFeatureSelection(long size); |
||
625 | |||
626 | public long getMaxSizeForSmallFeatureSelection(); |
||
627 | |||
628 | 45461 | jjdelcerro | public void registerLargeMap(Factory factory); |
629 | |||
630 | public void registerLargeSet(Factory factory); |
||
631 | |||
632 | 45426 | fdiaz | public Map createLargeMap(); |
633 | |||
634 | public Set createLargeSet(); |
||
635 | 45445 | jjdelcerro | |
636 | public DataTransaction createTransaction();
|
||
637 | 45696 | jjdelcerro | |
638 | public void putFeaturesInClipboard(FeatureSet set); |
||
639 | |||
640 | public List<EditableFeature> getFeaturesFromClipboard( |
||
641 | FeatureStore store, |
||
642 | Predicate<FeatureAttributeDescriptor> attrFilter
|
||
643 | ) throws DataException;
|
||
644 | 45739 | jjdelcerro | |
645 | public FeatureRuleExpression createFeatureRuleExpression();
|
||
646 | 46361 | jjdelcerro | |
647 | public DataFactory getStoreFactory(DataStoreParameters parameters);
|
||
648 | 46805 | jjdelcerro | |
649 | public File getCacheResourcesFolder(); |
||
650 | |||
651 | public void clearAllCachedResources(); |
||
652 | 46996 | jjdelcerro | |
653 | public LabelsCacheForFieldValues createLabelsCacheForFieldValues(Invocable labelFormulaProvider, SimpleTaskStatus status);
|
||
654 | 47080 | jjdelcerro | |
655 | public List<FeatureType> getFeatureTypesFromDAL(byte[] daldata); |
||
656 | |||
657 | public byte[] getDALBytesFromFeatureType(FeatureType ftype); |
||
658 | 47209 | jjdelcerro | |
659 | public DataTypeDetector createDataTypeDetector(Locale locale); |
||
660 | 40596 | jjdelcerro | } |