org.gvsig.fmap.dal
Interface DataManager


public interface DataManager

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:
ResourceManager

Method Summary
 DynObject createCacheParameters(String name)
          Returns an instance of DataServerExplorerParameters corresponding to the given name used by the cache to create a store to save the retrieved data.
 Evaluator createExpresion(String expression)
          Creates an instance of Evaluator that represents the given expression.
 FeatureAttributeGetter createFeatureAttributeGetter(String name)
          Creates a FeatureAttributeGetter by name.
 FeaturePagingHelper createFeaturePagingHelper(FeatureStore featureStore, FeatureQuery featureQuery, int pageSize)
          Creates a FeaturePagingHelper to paginate data from a FeatureStore.
 FeaturePagingHelper createFeaturePagingHelper(FeatureStore featureStore, int pageSize)
          Creates a FeaturePagingHelper to paginate data from a FeatureStore.
 EditableFeatureType createFeatureType()
           
 FeatureStore createMemoryStore(String autoOrderAttributeName)
          Utility method to create the a FeatureStore based on the MemoryStoreProvider.
 DataStoreParameters createMemoryStoreParameters(String autoOrderAttributeName)
          Utility method to create the DataStoreParameters to create a FeatureStore based on the MemoryStoreProvider.
 NewDataStoreParameters createNewStoreParameters(String explorer, String provider)
          Creates, initializes and returns an instance of NewDataStoreParameters given the name with which their provider is registered.
 DataServerExplorer createServerExplorer(DataServerExplorerParameters parameters)
          Deprecated. see openServerExplorer
 DataServerExplorerParameters createServerExplorerParameters(String name)
          Returns an instance of DataServerExplorerParameters corresponding to the given name.
 DataStore createStore(DataStoreParameters parameters)
          Deprecated. see openStore
 DataStoreParameters createStoreParameters(String name)
          Creates, initializes and returns an instance of DataStoreParameters given the name with which their provider is registered.
 List getDataTypes()
           
 String getDefaultFeatureIndexProviderName(int dataType)
          Returns the default DataIndexProvider name, given a data type.
 List getExplorerProviders()
          Returns a list of String containing the names of the available DataServerExplorer providers.
 List getFeatureCacheProviders()
          Returns a list of String containing the names of the available cache providers.
 List getFeatureIndexProviders()
          Returns a list of String containing the names of the available index providers.
 DataStoreProviderFactory getStoreProviderFactory(String name)
           
 List getStoreProviders()
          Returns a list of Strings containing the names of all available DataStore providers.
 List getStoreProviders(String name)
          Returns a list of Strings containing the names of all available DataStore providers for an explorer.
 String getTemporaryDirectory()
          Returns the default DAL's temporary directory
 void newStore(String explorer, String provider, NewDataStoreParameters parameters, boolean overwrite)
          Create a new physical store
 DataServerExplorer openServerExplorer(String name, DataServerExplorerParameters parameters)
          Returns an instance of DataServerExplorer given its parameters.
 DataStore openStore(String provider, DataStoreParameters parameters)
          Creates, initializes and returns an instance of DataStore given the DataStoreParameters.
 void registerDefaultEvaluator(Class evaluator)
          Registers the default expression evaluator.
 void registerFeatureAttributeGetter(String name, Class clazz)
          Registers a class that can be used to create a FeatureAttributeGetter and associate it to a FeatureAttributeDescriptor.
 void setDefaultFeatureIndexProviderName(int dataType, String name)
          Sets the default DataIndexProvider for the given data type.
 void setOpenErrorHandler(OpenErrorHandler handler)
           
 

Method Detail

getTemporaryDirectory

String getTemporaryDirectory()
Returns the default DAL's temporary directory

Returns:
Temporary directory name

createStoreParameters

DataStoreParameters createStoreParameters(String name)
                                          throws InitializeException,
                                                 ProviderNotRegisteredException
Creates, initializes and returns an instance of DataStoreParameters given the name with which their provider is registered.

Parameters:
name - provider name
Throws:
ProviderNotRegisteredException - if the memory provider is not registered
InitializeException - if there is an error initializing the parameters for the memory provider

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:
name -
Throws:
InitializeException
ProviderNotRegisteredException

openStore

DataStore openStore(String provider,
                    DataStoreParameters parameters)
                    throws InitializeException,
                           ProviderNotRegisteredException,
                           ValidateDataParametersException
Creates, initializes and returns an instance of DataStore given the DataStoreParameters.

Parameters:
parameters - parameters used to instantiate and initialize the DataStore
Throws:
ProviderNotRegisteredException - if the memory provider is not registered
InitializeException - if there is an error initializing the parameters for the memory provider
ValidateDataParametersException - if the parameters to open the memory based store are not valid

createStore

DataStore createStore(DataStoreParameters parameters)
                      throws InitializeException,
                             ProviderNotRegisteredException,
                             ValidateDataParametersException
Deprecated. see openStore

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:
parameters -
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

List getStoreProviders(String name)
Returns a list of Strings containing the names of all available DataStore providers for an explorer.

Parameters:
explorer - name

createServerExplorerParameters

DataServerExplorerParameters createServerExplorerParameters(String name)
                                                            throws InitializeException,
                                                                   ProviderNotRegisteredException
Returns an instance of DataServerExplorerParameters corresponding to the given name.

Parameters:
name - name of a registered server explorer provider
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 of DataServerExplorer given its parameters.

Parameters:
parameters - parameters used to instantiate and initialize the DataServerExplorer.
Returns:
an instance of DataServerExplorer.
Throws:
InitializeException
ProviderNotRegisteredException
ValidateDataParametersException

createServerExplorer

DataServerExplorer createServerExplorer(DataServerExplorerParameters parameters)
                                        throws InitializeException,
                                               ProviderNotRegisteredException,
                                               ValidateDataParametersException
Deprecated. see openServerExplorer

Throws:
InitializeException
ProviderNotRegisteredException
ValidateDataParametersException

getExplorerProviders

List 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.

registerDefaultEvaluator

void registerDefaultEvaluator(Class evaluator)
Registers the default expression evaluator. It is used by DAL to evaluate and resolve query filters and expressions.

Parameters:
evaluator - Class that will be called to evaluate the expression. It must implement Evaluator.

createExpresion

Evaluator createExpresion(String expression)
                          throws InitializeException
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

getFeatureIndexProviders

List 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

void setDefaultFeatureIndexProviderName(int dataType,
                                        String name)
Sets the default DataIndexProvider for the given data type.

Parameters:
dataType - one of the data types defined in DataTypes.
name - Provider's name

getDefaultFeatureIndexProviderName

String getDefaultFeatureIndexProviderName(int dataType)
Returns the default DataIndexProvider name, given a data type. Data types are defined in DataTypes.

Parameters:
dataType - one of the constants in DataTypes.
Returns:
the name of the default FeatureIndexProvider if there is anyone available for the given data type.

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

DynObject createCacheParameters(String name)
                                throws InitializeException,
                                       ProviderNotRegisteredException
Returns an instance of DataServerExplorerParameters corresponding 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
Throws:
InitializeException - if parameter initialization causes an error.
ProviderNotRegisteredException - if could not find a cache provider by the given name.

createMemoryStoreParameters

DataStoreParameters createMemoryStoreParameters(String autoOrderAttributeName)
                                                throws InitializeException
Utility method to create the DataStoreParameters to create a FeatureStore based on the MemoryStoreProvider.

Parameters:
autoOrderAttributeName - the name of the Feature attribute to be used to order the store Features 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

FeatureStore createMemoryStore(String autoOrderAttributeName)
                               throws InitializeException
Utility method to create the a FeatureStore based on the MemoryStoreProvider.

Parameters:
autoOrderAttributeName - the name of the Feature attribute to be used to order the store Features 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 BaseException
Creates a FeaturePagingHelper to paginate data from a FeatureStore.

Parameters:
featureStore - to get the Features from
pageSize - the page size
Returns:
a FeaturePagingHelper
Throws:
BaseException - if there is an error creating the helper

createFeaturePagingHelper

FeaturePagingHelper createFeaturePagingHelper(FeatureStore featureStore,
                                              FeatureQuery featureQuery,
                                              int pageSize)
                                              throws BaseException
Creates a FeaturePagingHelper to paginate data from a FeatureStore.

Parameters:
featureStore - to get the Features from
featureQuery - to filter and/or order the data
pageSize - the page size
Returns:
a FeaturePagingHelper
Throws:
BaseException - if there is an error creating the helper

setOpenErrorHandler

void setOpenErrorHandler(OpenErrorHandler handler)

getStoreProviderFactory

DataStoreProviderFactory getStoreProviderFactory(String name)

createFeatureType

EditableFeatureType createFeatureType()

getDataTypes

List getDataTypes()

registerFeatureAttributeGetter

void registerFeatureAttributeGetter(String name,
                                    Class clazz)
Registers a class that can be used to create a FeatureAttributeGetter and associate it to a FeatureAttributeDescriptor.

Parameters:
name - the name used to register the class.
clazz - it has to be an instance of FeatureAttributeDescriptor

createFeatureAttributeGetter

FeatureAttributeGetter createFeatureAttributeGetter(String name)
                                                    throws InitializeException
Creates a FeatureAttributeGetter by name. If there is not any class registered with this name or if there is any error an exception is thrown.

Parameters:
name - the name that was used to register the class
Returns:
a FeatureAttributeGetter
Throws:
InitializeException - if there is any error creating the object


Copyright © 2004-2012 gvSIG. All Rights Reserved.