public class DefaultDataManager extends Object implements DataManager, DataManagerProviderServices, Services
Modifier and Type | Field and Description |
---|---|
static String |
FILESYSTEM_EXPLORER_NAME |
CREATE_STORE_AUTHORIZATION, READ_STORE_AUTHORIZATION, WRITE_STORE_AUTHORIZATION
Constructor and Description |
---|
DefaultDataManager() |
Modifier and Type | Method and Description |
---|---|
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.
|
ExpressionBuilder |
createExpressionBuilder()
Creates a default ExpressionBuilder.
|
FeatureCacheProvider |
createFeatureCacheProvider(String name,
DynObject parameters) |
FeatureIndexProviderServices |
createFeatureIndexProvider(String name,
FeatureStore store,
FeatureType type,
String indexName,
FeatureAttributeDescriptor attr)
Returns a DataIndexProvider compatible with the attribute data type.
|
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() |
void |
createFileStore(String providerName,
NewDataStoreParameters params,
boolean overwrite) |
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 explorerName,
String providerName)
Creates, initializes and returns an instance of NewDataStoreParameters
given the name with which their provider is registered.
|
DataStoreProvider |
createProvider(DataStoreProviderServices providerServices,
DataStoreParameters parameters)
Creates a new instance of the provider associated to the passed
parameters.
|
DataServerExplorer |
createServerExplorer(DataServerExplorerParameters parameters)
Deprecated.
see openServerExplorer
|
DataServerExplorerParameters |
createServerExplorerParameters(String explorerName)
Returns an instance of
DataServerExplorerParameters corresponding
to the given name. |
DataStore |
createStore(DataStoreParameters parameters)
Deprecated.
use openStore
|
DataStoreParameters |
createStoreParameters(DynStruct struct)
Creates, initializes and fill an instance of DataStoreParameters from the
tags of the DynStruct passed as parameter.
|
DataStoreParameters |
createStoreParameters(String providerName)
Creates, initializes and returns an instance of DataStoreParameters given
the name with which their provider is registered.
|
DataStoreParameters |
createStoreParameters(Tags tags) |
DataServerExplorerPool |
getDataServerExplorerPool() |
List<DataType> |
getDataTypes()
Return a list of the DataTypes supported for the type of the feature
attributes.
|
String |
getDefaultFeatureIndexProviderName(int dataType)
Returns the default DataIndexProvider name, given a data type.
|
List<String> |
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<String> |
getFeatureIndexProviders()
Returns a list of String containing the names of the available index
providers.
|
Register |
getFeatureIndexRegister() |
OpenErrorHandler |
getOpenErrorHandler() |
URL |
getResource(Object reourceLoader,
String name)
Return the URL associated to the indicated resource.
|
InputStream |
getResourceAsStream(Object reourceLoader,
String name)
Return the InputStream associated to the indicated resource.
|
Register |
getServerExplorerRegister() |
DataStoreProviderFactory |
getStoreProviderFactory(String providerName) |
Register |
getStoreProviderRegister() |
List<String> |
getStoreProviders()
Returns a list of Strings containing the names of all available DataStore
providers.
|
List<String> |
getStoreProviders(String explorerName)
Returns a list of Strings containing the names of all available DataStore
providers for an explorer.
|
Register |
getStoreRegister() |
String |
getTemporaryDirectory()
Returns the default DAL's temporary directory
|
void |
newStore(String explorerName,
String providerName,
NewDataStoreParameters parameters,
boolean overwrite)
Create a new physical store
|
DataServerExplorer |
openServerExplorer(String explorerName,
DataServerExplorerParameters parameters)
Returns an instance of
DataServerExplorer given its parameters. |
DataServerExplorer |
openServerExplorer(String explorerName,
Object... arguments) |
DataStore |
openStore(DynStruct struct) |
DataStore |
openStore(String providerName,
DataStoreParameters parameters) |
DataStore |
openStore(String provider,
DynObject parameters)
Creates, initializes and returns an instance of DataStore given the
DataStoreParameters.
|
DataStore |
openStore(String providerName,
Object... arguments) |
void |
registerDefaultEvaluator(EvaluatorFactory evaluatorFactory)
Registers the default expression evaluator.
|
void |
registerDefaultRasterStore(Class rasterStoreClass)
Deprecated.
|
void |
registerExplorerProvider(String name,
Class explorerClass,
Class parametersClass) |
void |
registerFeatureCacheProvider(FeatureCacheProviderFactory providerFactory) |
void |
registerServerExplorerFactory(DataServerExplorerFactory factory) |
void |
registerStoreFactory(DataStoreFactory_v2_4 factory) |
void |
registerStoreFactory(String name,
Class storeFactoryClass)
Deprecated.
|
void |
registerStoreProvider(String name,
Class storeProviderClass,
Class parametersClass)
Deprecated.
use registerStoreProviderFactory
|
void |
registerStoreProviderFactory(DataStoreProviderFactory factory) |
void |
setDataServerExplorerPool(DataServerExplorerPool pool) |
void |
setDefaultFeatureIndexProviderName(int dataType,
String name)
Sets the default DataIndexProvider for the given data type.
|
void |
setOpenErrorHandler(OpenErrorHandler handler) |
void |
setResourcesLoader(ClassLoader loader) |
void |
setResourcesLoader(File folder) |
DataStoreParameters |
toDataStoreParameters(String provider,
DynObject params) |
public static final String FILESYSTEM_EXPLORER_NAME
public Register getStoreRegister()
getStoreRegister
in interface DataManager
public Register getStoreProviderRegister()
getStoreProviderRegister
in interface DataManager
public Register getServerExplorerRegister()
getServerExplorerRegister
in interface DataManager
public Register getFeatureIndexRegister()
getFeatureIndexRegister
in interface DataManager
public void registerDefaultRasterStore(Class rasterStoreClass)
DataManagerProviderServices
registerDefaultRasterStore
in interface DataManagerProviderServices
public void registerStoreFactory(String name, Class storeFactoryClass)
DataManagerProviderServices
registerStoreFactory
in interface DataManagerProviderServices
public void registerStoreProvider(String name, Class storeProviderClass, Class parametersClass)
DataManagerProviderServices
registerStoreProvider
in interface DataManagerProviderServices
name
- storeProviderClass
- parametersClass
- public void registerExplorerProvider(String name, Class explorerClass, Class parametersClass)
registerExplorerProvider
in interface DataManagerProviderServices
explorerClass
- class of providerparametersClass
- parameters class of providerpublic void registerStoreFactory(DataStoreFactory_v2_4 factory)
registerStoreFactory
in interface DataManagerProviderServices
public void registerStoreProviderFactory(DataStoreProviderFactory factory)
registerStoreProviderFactory
in interface DataManagerProviderServices
public void registerServerExplorerFactory(DataServerExplorerFactory factory)
registerServerExplorerFactory
in interface DataManagerProviderServices
public DataStoreParameters createStoreParameters(String providerName) throws InitializeException, ProviderNotRegisteredException
DataManager
createStoreParameters
in interface DataManager
providerName
- provider nameInitializeException
- if there is an error initializing the
parameters for the memory providerProviderNotRegisteredException
- if the memory provider is not
registeredpublic NewDataStoreParameters createNewStoreParameters(String explorerName, String providerName) throws InitializeException, ProviderNotRegisteredException
DataManager
createNewStoreParameters
in interface DataManager
InitializeException
ProviderNotRegisteredException
public DataServerExplorerParameters createServerExplorerParameters(String explorerName) throws InitializeException, ProviderNotRegisteredException
DataManager
DataServerExplorerParameters
corresponding
to the given name.createServerExplorerParameters
in interface DataManager
explorerName
- name of a registered server explorer providerInitializeException
- if parameter initialization causes an error.ProviderNotRegisteredException
- if could not find a provider by
the given name.public DataStoreParameters createMemoryStoreParameters(String autoOrderAttributeName) throws InitializeException
DataManager
DataStoreParameters
to create a
FeatureStore
based on the MemoryStoreProvider
.createMemoryStoreParameters
in interface DataManager
autoOrderAttributeName
- the name of the Feature
attribute
to be used to order the store Feature
s by default. Set to null if
you don't want any order by defaultInitializeException
- if there is an error initializing the
parameters for the memory providerpublic DataServerExplorer openServerExplorer(String explorerName, DataServerExplorerParameters parameters) throws InitializeException, ProviderNotRegisteredException, ValidateDataParametersException
DataManager
DataServerExplorer
given its parameters.openServerExplorer
in interface DataManager
parameters
- parameters used to instantiate and initialize the
DataServerExplorer
.DataServerExplorer
.InitializeException
ProviderNotRegisteredException
ValidateDataParametersException
public DataServerExplorer openServerExplorer(String explorerName, Object... arguments) throws InitializeException, ProviderNotRegisteredException, ValidateDataParametersException
openServerExplorer
in interface DataManager
InitializeException
ProviderNotRegisteredException
ValidateDataParametersException
public DataServerExplorer createServerExplorer(DataServerExplorerParameters parameters) throws InitializeException, ProviderNotRegisteredException, ValidateDataParametersException
createServerExplorer
in interface DataManager
parameters
- InitializeException
ProviderNotRegisteredException
ValidateDataParametersException
public DataStore createStore(DataStoreParameters parameters) throws InitializeException, ProviderNotRegisteredException, ValidateDataParametersException
createStore
in interface DataManager
parameters
- InitializeException
ProviderNotRegisteredException
ValidateDataParametersException
public DataStore openStore(String providerName, DataStoreParameters parameters) throws InitializeException, ProviderNotRegisteredException, ValidateDataParametersException
openStore
in interface DataManager
InitializeException
ProviderNotRegisteredException
ValidateDataParametersException
public DataStore openStore(String provider, DynObject parameters) throws InitializeException, ProviderNotRegisteredException, ValidateDataParametersException
DataManager
openStore
in interface DataManager
parameters
- parameters used to instantiate and initialize the
DataStoreInitializeException
- if there is an error initializing the
parameters for the memory providerProviderNotRegisteredException
- if the memory provider is not
registeredValidateDataParametersException
- if the parameters to open the
memory based store are not validpublic DataStore openStore(String providerName, Object... arguments) throws InitializeException, ProviderNotRegisteredException, ValidateDataParametersException
openStore
in interface DataManager
InitializeException
ProviderNotRegisteredException
ValidateDataParametersException
public FeatureStore createMemoryStore(String autoOrderAttributeName) throws InitializeException
DataManager
FeatureStore
based on the
MemoryStoreProvider
.createMemoryStore
in interface DataManager
autoOrderAttributeName
- the name of the Feature
attribute
to be used to order the store Feature
s by default. Set to null if
you don't want any order by defaultInitializeException
- if there is an error initializing the
parameters for the memory providerpublic DataStoreProviderFactory getStoreProviderFactory(String providerName)
getStoreProviderFactory
in interface DataManager
public List<String> getStoreProviders()
DataManager
getStoreProviders
in interface DataManager
public List<String> getStoreProviders(String explorerName)
DataManager
getStoreProviders
in interface DataManager
public List<String> getExplorerProviders()
DataManager
getExplorerProviders
in interface DataManager
public DataStoreProvider createProvider(DataStoreProviderServices providerServices, DataStoreParameters parameters) throws InitializeException, ProviderNotRegisteredException
DataManagerProviderServices
createProvider
in interface DataManagerProviderServices
InitializeException
ProviderNotRegisteredException
public List<String> getFeatureIndexProviders()
DataManager
getFeatureIndexProviders
in interface DataManager
public void setDefaultFeatureIndexProviderName(int dataType, String name)
DataManager
setDefaultFeatureIndexProviderName
in interface DataManager
dataType
- one of the data types defined in DataTypes
.name
- Provider's namepublic String getDefaultFeatureIndexProviderName(int dataType)
DataManager
DataTypes
.getDefaultFeatureIndexProviderName
in interface DataManager
dataType
- one of the constants in DataTypes
.FeatureIndexProvider
if there is
anyone available for the given data type.public FeatureIndexProviderServices createFeatureIndexProvider(String name, FeatureStore store, FeatureType type, String indexName, FeatureAttributeDescriptor attr) throws InitializeException, ProviderNotRegisteredException
DataManagerProviderServices
createFeatureIndexProvider
in interface DataManagerProviderServices
store
- associated FeatureStoretype
- associated FeatureTypeattr
- associated FeatureAttributeDescriptorInitializeException
ProviderNotRegisteredException
public String getTemporaryDirectory()
DataManager
getTemporaryDirectory
in interface DataManager
public DataStoreParameters createStoreParameters(DynStruct struct) throws InitializeException, ProviderNotRegisteredException
DataManager
createStoreParameters
in interface DataManager
struct
- structure from which tags were created ths parameters.InitializeException
- if there is an error initializing the
parameters for the memory providerProviderNotRegisteredException
- if the memory provider is not
registeredpublic DataStoreParameters createStoreParameters(Tags tags) throws InitializeException, ProviderNotRegisteredException
createStoreParameters
in interface DataManager
InitializeException
ProviderNotRegisteredException
public DataStore openStore(DynStruct struct) throws InitializeException, ProviderNotRegisteredException, ValidateDataParametersException
openStore
in interface DataManager
InitializeException
ProviderNotRegisteredException
ValidateDataParametersException
public void newStore(String explorerName, String providerName, NewDataStoreParameters parameters, boolean overwrite) throws InitializeException, ProviderNotRegisteredException, ValidateDataParametersException
DataManager
newStore
in interface DataManager
InitializeException
ProviderNotRegisteredException
ValidateDataParametersException
public void registerDefaultEvaluator(EvaluatorFactory evaluatorFactory)
DataManager
registerDefaultEvaluator
in interface DataManager
public Evaluator createExpresion(String expression) throws InitializeException
DataManager
createExpresion
in interface DataManager
expression
- String containing a CQL expression.InitializeException
public FeaturePagingHelper createFeaturePagingHelper(FeatureStore featureStore, int pageSize) throws BaseException
DataManager
FeaturePagingHelper
to paginate data from a
FeatureStore
.createFeaturePagingHelper
in interface DataManager
featureStore
- to get the Feature
s frompageSize
- the page sizeFeaturePagingHelper
BaseException
- if there is an error creating the helperpublic FeaturePagingHelper createFeaturePagingHelper(FeatureStore featureStore, FeatureQuery featureQuery, int pageSize) throws BaseException
DataManager
FeaturePagingHelper
to paginate data from a
FeatureStore
.createFeaturePagingHelper
in interface DataManager
featureStore
- to get the Feature
s fromfeatureQuery
- to filter and/or order the datapageSize
- the page sizeFeaturePagingHelper
BaseException
- if there is an error creating the helperpublic void setOpenErrorHandler(OpenErrorHandler handler)
setOpenErrorHandler
in interface DataManager
public OpenErrorHandler getOpenErrorHandler()
getOpenErrorHandler
in interface DataManager
public EditableFeatureType createFeatureType()
createFeatureType
in interface DataManager
public DataServerExplorerPool getDataServerExplorerPool()
getDataServerExplorerPool
in interface DataManager
public void setDataServerExplorerPool(DataServerExplorerPool pool)
setDataServerExplorerPool
in interface DataManager
public DataStoreParameters toDataStoreParameters(String provider, DynObject params) throws InitializeException, ProviderNotRegisteredException
public List<DataType> getDataTypes()
DataManager
getDataTypes
in interface DataManager
public void setResourcesLoader(ClassLoader loader)
setResourcesLoader
in interface DataManager
public void setResourcesLoader(File folder)
setResourcesLoader
in interface DataManager
public URL getResource(Object reourceLoader, String name)
DataManagerProviderServices
getResource
in interface DataManagerProviderServices
public InputStream getResourceAsStream(Object reourceLoader, String name)
DataManagerProviderServices
getResourceAsStream
in interface DataManagerProviderServices
public ExpressionBuilder createExpressionBuilder()
DataManager
createExpressionBuilder
in interface DataManager
public void registerFeatureCacheProvider(FeatureCacheProviderFactory providerFactory)
public FeatureCacheProvider createFeatureCacheProvider(String name, DynObject parameters) throws DataException
DataException
public List getFeatureCacheProviders()
DataManager
getFeatureCacheProviders
in interface DataManager
public DynObject createCacheParameters(String name) throws InitializeException, ProviderNotRegisteredException
DataManager
DataServerExplorerParameters
corresponding
to the given name used by the cache to create a store to save the
retrieved data.createCacheParameters
in interface DataManager
name
- name of a registered feature cache providerInitializeException
- if parameter initialization causes an error.ProviderNotRegisteredException
- if could not find a cache provider by the given name.public void createFileStore(String providerName, NewDataStoreParameters params, boolean overwrite) throws DataException
createFileStore
in interface DataManager
DataException