com.univocity.api.config
Class EngineConfiguration

java.lang.Object
  extended by com.univocity.api.config.EngineConfiguration

public class EngineConfiguration
extends Object

The EngineConfiguration provides the essential configuration of a DataIntegrationEngine. Use Univocity.registerEngine(EngineConfiguration) to register your engine, and DataIntegrationEngineFactory.getEngine(String) to obtain the DataIntegrationEngine instance.

uniVocity depends on a database for manipulating the metadata that enables most of its data mapping operations. Use setMetadataSettings(MetadataSettings) to provide the specific settings that enable uniVocity's persistent metadata. If no configuration for metadata is provided, an in-memory instance of a database with the essential metadata structure will be created automatically. This, of course, means any metadata information will be lost when the application is shut down.

Author:
uniVocity Software Pty Ltd - dev@univocity.com
See Also:
Univocity, DataIntegrationEngineFactory, DataIntegrationEngine, MetadataSettings

Constructor Summary
EngineConfiguration(String engineName, DataStoreConfiguration... dataStores)
          Creates a new engine configuration with the essential configuration required by uniVocity for enabling the definition and execution of data mappings.
 
Method Summary
 void addCustomDataStoreFactories(CustomDataStoreFactory<?>... customFactories)
          Adds instances of CustomDataStoreFactory that should be used by uniVocity to read any custom DataStoreConfiguration, provided by the user in the constructor of this class, to properly create instances of CustomDataStore.
 void addDataStoreConfigurations(DataStoreConfiguration... dataStores)
          Adds the configurations for data stores whose entities will be mapped using the engine created by this class.
 Set<CustomDataStoreFactory<?>> getCustomDataStoreFactories()
          Obtains the (unmodifiable) set of CustomDataStoreFactory instances that should be used by uniVocity to read any custom DataStoreConfiguration to properly create instances of CustomDataStore.
 Set<DataStoreConfiguration> getDataStoreConfigurations()
          Obtains the (unmodifiable) set of DataStoreConfiguration instances that will be used by uniVocity to instantiate the data stores manipulated by this engine.
 String getEngineName()
          Returns name of the engine that will be initialized with the configuration provided in this class.
 MetadataSettings getMetadataSettings()
          Obtains the database settings required by uniVocity to persist its metadata.
 ScopeStorageProvider getPersistentScopeStorageProvider()
          Obtains the storage provider configured to keep values stored in the EngineScope.PERSISTENT scope of the DataIntegrationEngine.
 void setMetadataSettings(MetadataSettings metadataSettings)
          Defines the database settings required by uniVocity to persist its metadata.
 void setPersistentStorageProvider(ScopeStorageProvider persistentStorageProvider)
          Defines a storage provider to keep values stored in the EngineScope.PERSISTENT scope of the DataIntegrationEngine which is instantiated by uniVocity with this configuration class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EngineConfiguration

public EngineConfiguration(String engineName,
                           DataStoreConfiguration... dataStores)
Creates a new engine configuration with the essential configuration required by uniVocity for enabling the definition and execution of data mappings.

Parameters:
engineName - the name of the new engine. The engine name is used to obtain instances of DataIntegrationEngine and manage them using Univocity
dataStores - optional parameter for the configurations of data stores that will have their entities mapped through this engine. More dataStores can be added later using addDataStoreConfigurations(DataStoreConfiguration...)
Method Detail

setMetadataSettings

public final void setMetadataSettings(MetadataSettings metadataSettings)
Defines the database settings required by uniVocity to persist its metadata.

If set to null, uniVocity will create an internal in-memory database for metadata handling while this engine is active.

Parameters:
metadataSettings - the database settings required for accessing and persisting metadata produced by this engine.

getEngineName

public final String getEngineName()
Returns name of the engine that will be initialized with the configuration provided in this class.

Returns:
the configured engine name

getMetadataSettings

public final MetadataSettings getMetadataSettings()
Obtains the database settings required by uniVocity to persist its metadata.

Defaults to to null. If no configuration is provided using setMetadataSettings(MetadataSettings), then an internal in-memory database will be used for metadata handling while this engine is active.

Returns:
the database settings required for accessing and persisting metadata produced by this engine.

addCustomDataStoreFactories

public final void addCustomDataStoreFactories(CustomDataStoreFactory<?>... customFactories)
Adds instances of CustomDataStoreFactory that should be used by uniVocity to read any custom DataStoreConfiguration, provided by the user in the constructor of this class, to properly create instances of CustomDataStore.

Parameters:
customFactories - the factories that process user-provided data store configurations and generate custom data store instances.

getCustomDataStoreFactories

public final Set<CustomDataStoreFactory<?>> getCustomDataStoreFactories()
Obtains the (unmodifiable) set of CustomDataStoreFactory instances that should be used by uniVocity to read any custom DataStoreConfiguration to properly create instances of CustomDataStore.

Returns:
the factories that process user-provided data store configurations and generate custom data store instances.

setPersistentStorageProvider

public final void setPersistentStorageProvider(ScopeStorageProvider persistentStorageProvider)
Defines a storage provider to keep values stored in the EngineScope.PERSISTENT scope of the DataIntegrationEngine which is instantiated by uniVocity with this configuration class.

Parameters:
persistentStorageProvider - the storage abstraction that retains and restores values in the EngineScope.PERSISTENT scope from persistent storage (such as a file, distributed cache, or database)

getPersistentScopeStorageProvider

public final ScopeStorageProvider getPersistentScopeStorageProvider()
Obtains the storage provider configured to keep values stored in the EngineScope.PERSISTENT scope of the DataIntegrationEngine.

Returns:
the configured ScopeStorageProvider instance that retains and restores values in the EngineScope.PERSISTENT scope from persistent storage (such as a file, distributed cache, or database)

addDataStoreConfigurations

public final void addDataStoreConfigurations(DataStoreConfiguration... dataStores)
Adds the configurations for data stores whose entities will be mapped using the engine created by this class.

Parameters:
dataStores - configurations of data stores that will have their entities mapped through this engine.

getDataStoreConfigurations

public final Set<DataStoreConfiguration> getDataStoreConfigurations()
Obtains the (unmodifiable) set of DataStoreConfiguration instances that will be used by uniVocity to instantiate the data stores manipulated by this engine.

Returns:
the configurations of all data stores whose entities will be mapped using the engine created by this class


Copyright © 2015 uniVocity Software Pty Ltd. All rights reserved.