com.univocity.api.engine
Interface ScopeStorageProvider


public interface ScopeStorageProvider

User provided storage mechanism to enable the persistent scope (EngineScope.PERSISTENT).

A persistent scope ideally retains values produced by a DataIntegrationEngine even after the application stops. Its expected to be able to restore these values once the application is started again, so no expensive processing has to happen

The ScopeStorageProvider instance will have its initialize() method when a DataIntegrationEngine is loaded from Univocity. A call to deactivate() is made when the engine is shut down.

uniVocity will obtain instances of this interface through EngineConfiguration.getPersistentScopeStorageProvider().

Author:
uniVocity Software Pty Ltd - dev@univocity.com
See Also:
EngineConfiguration, DataIntegrationEngine, EngineScope

Method Summary
 boolean contains(Object key)
          Queries the storage for the presence of a key.
 void deactivate()
          Deactivates the storage provider.
 Object getValue(Object key)
          Obtains a value associated with a key in the scope storage.
 void initialize()
          Initializes the storage provider.
 Object setValue(Object key, Object value)
          Associates a value to a key in this scope storage.
 

Method Detail

getValue

Object getValue(Object key)
Obtains a value associated with a key in the scope storage.

Parameters:
key - the key that refers to a value stored in this scope
Returns:
the value associated with the given key, or null if this scope does not contain a value for the key.

setValue

Object setValue(Object key,
                Object value)
Associates a value to a key in this scope storage.

Parameters:
key - the key to be associated with a value in this storage
value - the value associated with the given key
Returns:
the previous value associated with the given key, if any.

contains

boolean contains(Object key)
Queries the storage for the presence of a key.

Parameters:
key - that refers to a value stored in this scope
Returns:
true if this storage contains the given key, false otherwise.

initialize

void initialize()
Initializes the storage provider. This is invoked when a DataIntegrationEngine that uses this storage provider is started.


deactivate

void deactivate()
Deactivates the storage provider. This is invoked when the DataIntegrationEngine that uses this storage provider is shut down.



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