Package org.gvsig.fmap.dal
Interface DataManager
- All Superinterfaces:
org.gvsig.tools.util.PropertiesSupport,org.gvsig.tools.service.spi.Services
public interface DataManager
extends org.gvsig.tools.service.spi.Services, org.gvsig.tools.util.PropertiesSupport
There are two top level management roles within DAL: data access and resource
management.
This class is responsible of the data access management role. It provides
ways for registering and instantiating
DataServerExplorer(s),
DataStore(s), Evaluator(s) and FeatureIndex(es).- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final StringDeprecated.static final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final intstatic final intstatic final intstatic final intstatic final String -
Method Summary
Modifier and TypeMethodDescriptionvoidaddDatabaseWorkspace(DatabaseWorkspaceManager DatabaseWorkspace) voidvoidaddStoreObserver(org.gvsig.tools.observer.Observer observer) voidvoidorg.gvsig.tools.dynobject.DynObjectcreateCacheParameters(String name) Returns an instance ofDataServerExplorerParameterscorresponding to the given name used by the cache to create a store to save the retrieved data.createDataTypeDetector(Locale locale) org.gvsig.tools.evaluator.EvaluatorcreateExpresion(String expression) Creates an instance of Evaluator that represents the given expression.org.gvsig.tools.evaluator.EvaluatorcreateExpresion(org.gvsig.expressionevaluator.Expression expression) Creates an instance of Evaluator that represents the given expression.org.gvsig.expressionevaluator.ExpressionBuilderCreates a default ExpressionBuilder.createFeatureAttributeDescriptor(String name, int type) createFeatureAttributeEmulatorExpression(FeatureType type, org.gvsig.expressionevaluator.Expression expression) createFeaturePagingHelper(FeatureStore featureStore, int pageSize) Creates aFeaturePagingHelperto paginate data from aFeatureStore.createFeaturePagingHelper(FeatureStore featureStore, FeatureQuery featureQuery, int pageSize) Creates aFeaturePagingHelperto paginate data from aFeatureStore.createFeatureType(javax.json.JsonObject json) voidcreateFileStore(String providerName, NewDataStoreParameters params, boolean overwrite) org.gvsig.tools.evaluator.EvaluatorcreateFilter(String expression) Creates an instance of Evaluator that represents the given expression.org.gvsig.tools.evaluator.EvaluatorcreateFilter(org.gvsig.expressionevaluator.Expression expression) Creates an instance of Evaluator that represents the given expression.createLabelsCacheForFieldValues(org.gvsig.tools.util.Invocable labelFormulaProvider, org.gvsig.tools.task.SimpleTaskStatus status) createMemoryStore(String autoOrderAttributeName) Utility method to create the aFeatureStorebased on the.invalid reference
MemoryStoreProvidercreateMemoryStoreParameters(String autoOrderAttributeName) Utility method to create theDataStoreParametersto create aFeatureStorebased on the.invalid reference
MemoryStoreProvidercreateNewStoreParameters(String provider) createNewStoreParameters(String explorer, String provider) Creates, initializes and returns an instance of NewDataStoreParameters given the name with which their provider is registered.createServerExplorer(DataServerExplorerParameters parameters) Returns an instance ofDataServerExplorerParameterscorresponding to the given name.createStore(DataStoreParameters parameters) createStoreParameters(byte[] data) createStoreParameters(String name) createStoreParameters(String name, Object... arguments) Creates, initializes and returns an instance of DataStoreParameters given the name with which their provider is registered.createStoreParameters(org.gvsig.tools.dynobject.DynStruct struct) Creates, initializes and fill an instance of DataStoreParameters from the tags of the DynStruct passed as parameter.createStoreParameters(org.gvsig.tools.dynobject.Tags tags) Return a 35-40 characters unique identifier.byte[]getDatabaseWorkspace(String name) getDataProfile(String name) List<org.gvsig.tools.dataTypes.DataType> Return a list of the DataTypes supported for the type of the feature attributes.getDefaultFeatureIndexProviderName(int dataType) Returns the default DataIndexProvider name, given a data type.Returns a list of String containing the names of the available DataServerExplorer providers.Returns a list of String containing the names of the available cache providers.Returns a list of String containing the names of the available index providers.getFeaturesFromClipboard(FeatureStore store, Predicate<FeatureAttributeDescriptor> attrFilter) getFeatureTypesFromDAL(byte[] daldata) getLocalResourcesFolder(DataServerExplorerParameters parameters) longgetStoreFactory(DataStoreParameters parameters) Returns a list of Strings containing the names of all available DataStore providers.getStoreProviders(String name) Returns a list of Strings containing the names of all available DataStore providers for an explorer.Returns the default DAL's temporary directorybooleanvoidnewStore(String explorer, String provider, NewDataStoreParameters parameters, boolean overwrite) Create a new physical storevoidnewStore(String provider, NewDataStoreParameters parameters, boolean overwrite) openServerExplorer(String explorerName, Object... arguments) openServerExplorer(String name, DataServerExplorerParameters parameters) Returns an instance ofDataServerExplorergiven its parameters.openStore(String provider, DataStoreParameters parameters) openStore(String providerName, DataStoreParameters parameters, boolean ignoreDALResource) Creates, initializes and returns an instance of DataStore given the DataStoreParameters.openStore(DataTransaction transaction, String provider, DataStoreParameters parameters) openStore(DataTransaction transaction, String providerName, DataStoreParameters parameters, boolean ignoreDALResource) openStore(org.gvsig.tools.dynobject.DynStruct struct) voidvoidregisterDataProfile(DataProfile profile) voidregisterLargeMap(org.gvsig.tools.util.Factory factory) voidregisterLargeSet(org.gvsig.tools.util.Factory factory) voidremoveDatabaseWorkspace(DatabaseWorkspaceManager DatabaseWorkspace) voidremoveStoreObserver(org.gvsig.tools.observer.Observer observer) voidvoidsetDefaultFeatureIndexProviderName(int dataType, String name) Sets the default DataIndexProvider for the given data type.voidsetLocalResourcesFolder(File resourcesFolder) voidsetMaxSizeForSmallFeatureSelection(long size) voidsetOpenErrorHandler(OpenErrorHandler handler) voidsetResourcesLoader(File folder) voidsetResourcesLoader(ClassLoader loader) voidwriteDALResource(org.gvsig.tools.resourcesstorage.ResourcesStorage resources, DataStore store) voidwriteDALResource(org.gvsig.tools.resourcesstorage.ResourcesStorage resources, FeatureType featureType) Methods inherited from interface org.gvsig.tools.util.PropertiesSupport
getProperties, getProperty, setProperty
-
Field Details
-
RECOMENDED_SIZE_FOR_CLOB
static final int RECOMENDED_SIZE_FOR_CLOB- See Also:
-
CREATE_STORE_AUTHORIZATION
- See Also:
-
READ_STORE_AUTHORIZATION
- See Also:
-
WRITE_STORE_AUTHORIZATION
- See Also:
-
DAL_SYMBOL_TABLE
- See Also:
-
FUNCTION_FOREING_VALUE
Deprecated.- See Also:
-
FUNCTION_FOREIGN_VALUE
- See Also:
-
FUNCTION_SELECT
- See Also:
-
FUNCTION_UPDATE
- See Also:
-
FUNCTION_SELECT_COUNT
- See Also:
-
FUNCTION_EXISTS
- See Also:
-
FUNCTION_EXISTS_TABLE
- See Also:
-
FUNCTION_ROW_TAG
- See Also:
-
FUNCTION_SET_ROW_TAG
- See Also:
-
FUNCTION_CURRENT_ROW
- See Also:
-
FUNCTION_CURRENT_STORE
- See Also:
-
FUNCTION_ISSELECTED_CURRENT_ROW
- See Also:
-
FUNCTION_GEOMETRY
- See Also:
-
FUNCTION_CREATE_IN_MEMORY_TABLE
- See Also:
-
FUNCTION_INSERT_INTO_TABLE
- See Also:
-
FUNCTION_CREATE_TABLE
- See Also:
-
FUNCTION_CREATE_TABLE_STRUCTURE
- See Also:
-
FUNCTION_SELECT_FROM_SELECTION
- See Also:
-
FUNCTION_SELECT_COUNT_FROM_SELECTION
- See Also:
-
FUNCTION_EXECUTESQL
- See Also:
-
DAL_PREFERRED_COLUMNS
- See Also:
-
DAL_USE_LABELS
- See Also:
-
DAL_USE_LARGE_SELECTION
- See Also:
-
DAL_STORE_ENVELOPE
- See Also:
-
DAL_FEATURETYPE_MODE_EDIT
- See Also:
-
DAL_FEATURETYPE_MODE_EDIT_MSG
- See Also:
-
USE_LABELS_YES
static final int USE_LABELS_YES- See Also:
-
USE_LABELS_NO
static final int USE_LABELS_NO- See Also:
-
USE_LABELS_BOTH
static final int USE_LABELS_BOTH- See Also:
-
-
Method Details
-
getTemporaryDirectory
String getTemporaryDirectory()Returns the default DAL's temporary directory- Returns:
- Temporary directory name
-
createStoreParameters
DataStoreParameters createStoreParameters(String name, Object... arguments) throws InitializeException, ProviderNotRegisteredException Creates, initializes and returns an instance of DataStoreParameters given the name with which their provider is registered.- Parameters:
name- provider namearguments-- Returns:
- the data store parameters
- Throws:
ProviderNotRegisteredException- if the memory provider is not registeredInitializeException- if there is an error initializing the parameters for the memory provider
-
createStoreParameters
DataStoreParameters createStoreParameters(String name) throws InitializeException, ProviderNotRegisteredException -
createStoreParameters
-
createStoreParameters
DataStoreParameters createStoreParameters(org.gvsig.tools.dynobject.DynStruct struct) throws InitializeException, ProviderNotRegisteredException Creates, initializes and fill an instance of DataStoreParameters from the tags of the DynStruct passed as parameter.- Parameters:
struct- structure from which tags were created ths parameters.- Returns:
- the data store parameters
- Throws:
ProviderNotRegisteredException- if the memory provider is not registeredInitializeException- if there is an error initializing the parameters for the memory provider
-
createStoreParameters
DataStoreParameters createStoreParameters(org.gvsig.tools.dynobject.Tags tags) throws InitializeException, ProviderNotRegisteredException -
createNewStoreParameters
NewDataStoreParameters createNewStoreParameters(String explorer, String provider) throws InitializeException, ProviderNotRegisteredException Creates, initializes and returns an instance of NewDataStoreParameters given the name with which their provider is registered.- Parameters:
explorer-provider-- Returns:
- Throws:
InitializeExceptionProviderNotRegisteredException
-
createNewStoreParameters
NewDataStoreParameters createNewStoreParameters(String provider) throws InitializeException, ProviderNotRegisteredException -
openStore
DataStore openStore(String provider, org.gvsig.tools.dynobject.DynObject parameters) throws InitializeException, ProviderNotRegisteredException, ValidateDataParametersException Creates, initializes and returns an instance of DataStore given the DataStoreParameters.- Parameters:
provider-parameters- parameters used to instantiate and initialize the DataStore- Returns:
- Throws:
ProviderNotRegisteredException- if the memory provider is not registeredInitializeException- if there is an error initializing the parameters for the memory providerValidateDataParametersException- if the parameters to open the memory based store are not valid
-
openStore
DataStore openStore(DataTransaction transaction, String provider, DataStoreParameters parameters) throws InitializeException, ProviderNotRegisteredException, ValidateDataParametersException -
openStore
DataStore openStore(String provider, DataStoreParameters parameters) throws InitializeException, ProviderNotRegisteredException, ValidateDataParametersException -
openStore
DataStore openStore(String providerName, DataStoreParameters parameters, boolean ignoreDALResource) throws InitializeException, ProviderNotRegisteredException, ValidateDataParametersException -
openStore
DataStore openStore(DataTransaction transaction, String providerName, DataStoreParameters parameters, boolean ignoreDALResource) throws InitializeException, ProviderNotRegisteredException, ValidateDataParametersException -
openStore
DataStore openStore(String providerName, Object... arguments) throws InitializeException, ProviderNotRegisteredException, ValidateDataParametersException -
openStore
DataStore openStore(org.gvsig.tools.dynobject.DynStruct struct) throws InitializeException, ProviderNotRegisteredException, ValidateDataParametersException -
newStore
void newStore(String explorer, String provider, NewDataStoreParameters parameters, boolean overwrite) throws InitializeException, ProviderNotRegisteredException, ValidateDataParametersException Create a new physical store- Parameters:
explorer-provider-parameters-overwrite-- Throws:
InitializeExceptionProviderNotRegisteredExceptionValidateDataParametersException
-
newStore
void newStore(String provider, NewDataStoreParameters parameters, boolean overwrite) throws InitializeException, ProviderNotRegisteredException, ValidateDataParametersException -
getStoreProviders
List getStoreProviders()Returns a list of Strings containing the names of all available DataStore providers.- Returns:
- list of String containing available DataStore provider names
-
getStoreProviders
Returns a list of Strings containing the names of all available DataStore providers for an explorer.- Parameters:
name-- Returns:
-
createServerExplorerParameters
DataServerExplorerParameters createServerExplorerParameters(String name) throws InitializeException, ProviderNotRegisteredException Returns an instance ofDataServerExplorerParameterscorresponding to the given name.- Parameters:
name- name of a registered server explorer provider- Returns:
- Throws:
InitializeException- if parameter initialization causes an error.ProviderNotRegisteredException- if could not find a provider by the given name.
-
openServerExplorer
DataServerExplorer openServerExplorer(String name, DataServerExplorerParameters parameters) throws InitializeException, ProviderNotRegisteredException, ValidateDataParametersException Returns an instance ofDataServerExplorergiven its parameters.- Parameters:
name-parameters- parameters used to instantiate and initialize theDataServerExplorer.- Returns:
- an instance of
DataServerExplorer. - Throws:
InitializeExceptionProviderNotRegisteredExceptionValidateDataParametersException
-
openServerExplorer
DataServerExplorer openServerExplorer(String explorerName, Object... arguments) throws InitializeException, ProviderNotRegisteredException, ValidateDataParametersException -
createServerExplorer
DataServerExplorer createServerExplorer(DataServerExplorerParameters parameters) throws InitializeException, ProviderNotRegisteredException, ValidateDataParametersException - Parameters:
parameters-- Returns:
- Throws:
InitializeExceptionProviderNotRegisteredExceptionValidateDataParametersException
-
createStore
DataStore createStore(DataStoreParameters parameters) throws InitializeException, ProviderNotRegisteredException, ValidateDataParametersException - Parameters:
parameters-- Returns:
- Throws:
InitializeExceptionProviderNotRegisteredExceptionValidateDataParametersException
-
getExplorerProviders
Returns a list of String containing the names of the available DataServerExplorer providers.- Returns:
- list of String containing the names of the available DataServerExplorer providers.
-
createExpresion
Creates an instance of Evaluator that represents the given expression.- Parameters:
expression- String containing a CQL expression.- Returns:
- instance of Evaluator representing the given expression.
- Throws:
InitializeException
-
createExpresion
org.gvsig.tools.evaluator.Evaluator createExpresion(org.gvsig.expressionevaluator.Expression expression) throws InitializeException Creates an instance of Evaluator that represents the given expression.- Parameters:
expression- a Expression with the filter- Returns:
- instance of Evaluator representing the given expression.
- Throws:
InitializeException
-
createFilter
Creates an instance of Evaluator that represents the given expression.- Parameters:
expression- String containing a CQL expression.- Returns:
- instance of Evaluator representing the given expression.
- Throws:
InitializeException
-
createFilter
org.gvsig.tools.evaluator.Evaluator createFilter(org.gvsig.expressionevaluator.Expression expression) throws InitializeException Creates an instance of Evaluator that represents the given expression.- Parameters:
expression- a Expression with the filter- Returns:
- instance of Evaluator representing the given expression.
- Throws:
InitializeException
-
getFeatureIndexProviders
Returns a list of String containing the names of the available index providers.- Returns:
- list of strings with the names of the available index providers
-
setDefaultFeatureIndexProviderName
Sets the default DataIndexProvider for the given data type.- Parameters:
dataType- one of the data types defined inDataTypes.name- Provider's name
-
getDefaultFeatureIndexProviderName
Returns the default DataIndexProvider name, given a data type. Data types are defined inDataTypes.- Parameters:
dataType- one of the constants inDataTypes.- Returns:
- the name of the default
if there is anyone available for the given data type.
invalid reference
FeatureIndexProvider
-
createMemoryStoreParameters
DataStoreParameters createMemoryStoreParameters(String autoOrderAttributeName) throws InitializeException Utility method to create theDataStoreParametersto create aFeatureStorebased on the.invalid reference
MemoryStoreProvider- Parameters:
autoOrderAttributeName- the name of theFeatureattribute to be used to order the storeFeatures by default. Set to null if you don't want any order by default- Returns:
- the parameters for the memory based store
- Throws:
InitializeException- if there is an error initializing the parameters for the memory provider
-
createMemoryStore
Utility method to create the aFeatureStorebased on the.invalid reference
MemoryStoreProvider- Parameters:
autoOrderAttributeName- the name of theFeatureattribute to be used to order the storeFeatures by default. Set to null if you don't want any order by default- Returns:
- the the memory based store
- Throws:
InitializeException- if there is an error initializing the parameters for the memory provider
-
createFeaturePagingHelper
FeaturePagingHelper createFeaturePagingHelper(FeatureStore featureStore, int pageSize) throws org.gvsig.tools.exception.BaseException Creates aFeaturePagingHelperto paginate data from aFeatureStore.- Parameters:
featureStore- to get theFeatures frompageSize- the page size- Returns:
- a
FeaturePagingHelper - Throws:
org.gvsig.tools.exception.BaseException- if there is an error creating the helper
-
createFeaturePagingHelper
FeaturePagingHelper createFeaturePagingHelper(FeatureStore featureStore, FeatureQuery featureQuery, int pageSize) throws org.gvsig.tools.exception.BaseException Creates aFeaturePagingHelperto paginate data from aFeatureStore.- Parameters:
featureStore- to get theFeatures fromfeatureQuery- to filter and/or order the datapageSize- the page size- Returns:
- a
FeaturePagingHelper - Throws:
org.gvsig.tools.exception.BaseException- if there is an error creating the helper
-
setOpenErrorHandler
-
getOpenErrorHandler
OpenErrorHandler getOpenErrorHandler() -
getStoreProviderFactory
-
createFeatureType
EditableFeatureType createFeatureType() -
createFeatureType
-
getDataServerExplorerPool
DataServerExplorerPool getDataServerExplorerPool() -
setDataServerExplorerPool
-
setResourcesLoader
-
setResourcesLoader
-
getDataTypes
List<org.gvsig.tools.dataTypes.DataType> getDataTypes()Return a list of the DataTypes supported for the type of the feature attributes. The list is only informative.- Returns:
-
getStoreRegister
Register getStoreRegister() -
getStoreProviderRegister
Register getStoreProviderRegister() -
getServerExplorerRegister
Register getServerExplorerRegister() -
getFeatureIndexRegister
Register getFeatureIndexRegister() -
createExpressionBuilder
org.gvsig.expressionevaluator.ExpressionBuilder createExpressionBuilder()Creates a default ExpressionBuilder. This ExpressionBuilder is not dependent on a data source, and is not advisable to use it.- Returns:
- the ExpressionBuilder
-
getFeatureCacheProviders
List getFeatureCacheProviders()Returns a list of String containing the names of the available cache providers.- Returns:
- list of strings with the names of the available cache providers
-
createCacheParameters
org.gvsig.tools.dynobject.DynObject createCacheParameters(String name) throws InitializeException, ProviderNotRegisteredException Returns an instance ofDataServerExplorerParameterscorresponding to the given name used by the cache to create a store to save the retrieved data.- Parameters:
name- name of a registered feature cache provider- Returns:
- Throws:
InitializeException- if parameter initialization causes an error.ProviderNotRegisteredException- if could not find a cache provider by the given name.
-
createFileStore
void createFileStore(String providerName, NewDataStoreParameters params, boolean overwrite) throws DataException - Parameters:
providerName-params-overwrite-- Throws:
DataException
-
createFeatureSymbolTable
FeatureSymbolTable createFeatureSymbolTable() -
createFeatureSymbolTable
-
createFeatureAttributeDescriptor
-
createFeatureAttributeEmulatorExpression
FeatureAttributeEmulatorExpression createFeatureAttributeEmulatorExpression(FeatureType type, org.gvsig.expressionevaluator.Expression expression) -
registerDataProfile
-
getDataProfiles
List<DataProfile> getDataProfiles() -
getDataProfile
-
getStoresRepository
StoresRepository getStoresRepository() -
createDatabaseWorkspaceManager
-
addDatabaseWorkspace
-
removeDatabaseWorkspace
-
addDatabaseWorkspaceListener
-
getDatabaseWorkspace
-
getDatabaseWorkspace
-
getDatabaseWorkspace
-
writeDALResource
-
writeDALResource
void writeDALResource(org.gvsig.tools.resourcesstorage.ResourcesStorage resources, FeatureType featureType) -
createUniqueID
String createUniqueID()Return a 35-40 characters unique identifier.- Returns:
- the unique identifier
-
clearAvailableValuesCache
void clearAvailableValuesCache() -
createDALExpressionBuilder
DALExpressionBuilder createDALExpressionBuilder() -
isTheOldRasterRegistered
boolean isTheOldRasterRegistered() -
addStoreObserver
void addStoreObserver(org.gvsig.tools.observer.Observer observer) -
removeStoreObserver
void removeStoreObserver(org.gvsig.tools.observer.Observer observer) -
getServerExplorerFromStore
-
setMaxSizeForSmallFeatureSelection
void setMaxSizeForSmallFeatureSelection(long size) -
getMaxSizeForSmallFeatureSelection
long getMaxSizeForSmallFeatureSelection() -
registerLargeMap
void registerLargeMap(org.gvsig.tools.util.Factory factory) -
registerLargeSet
void registerLargeSet(org.gvsig.tools.util.Factory factory) -
createLargeMap
Map createLargeMap() -
createLargeSet
Set createLargeSet() -
createTransaction
DataTransaction createTransaction() -
putFeaturesInClipboard
-
getFeaturesFromClipboard
List<EditableFeature> getFeaturesFromClipboard(FeatureStore store, Predicate<FeatureAttributeDescriptor> attrFilter) throws DataException - Throws:
DataException
-
createFeatureRuleExpression
FeatureRuleExpression createFeatureRuleExpression() -
getStoreFactory
-
getCacheResourcesFolder
File getCacheResourcesFolder() -
clearAllCachedResources
void clearAllCachedResources() -
createLabelsCacheForFieldValues
LabelsCacheForFieldValues createLabelsCacheForFieldValues(org.gvsig.tools.util.Invocable labelFormulaProvider, org.gvsig.tools.task.SimpleTaskStatus status) -
getFeatureTypesFromDAL
-
getDALBytesFromFeatureType
-
createDataTypeDetector
-
getLocalResourcesFolder
File getLocalResourcesFolder() -
getLocalResourcesFolder
-
setLocalResourcesFolder
-