Interface ReadThruProvider
-
- All Superinterfaces:
java.lang.AutoCloseable
public interface ReadThruProvider extends java.lang.AutoCloseable
Contains methods used to read an object by its key from the master data source. Must be implemented by read-through components. ReadThruProvider is an interface that is need to be implemented in order to allow cache to read data from your data source.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
init(java.util.Map<java.lang.String,java.lang.String> parameters, java.lang.String cacheId)
Perform tasks like allocating resources or acquiring connections etc.ProviderDataStructureItem
loadDataStructureFromSource(java.lang.String key, DistributedDataStructureType distributedDataStructureType)
Responsible for loading the Data Strucutre from the data source.ProviderCacheItem
loadFromSource(java.lang.String key)
Responsible for loading the object from the data source.java.util.Map<java.lang.String,ProviderCacheItem>
loadFromSource(java.util.Collection<java.lang.String> keys)
Responsible for loading list of objects from the data source.
-
-
-
Method Detail
-
init
void init(java.util.Map<java.lang.String,java.lang.String> parameters, java.lang.String cacheId) throws java.lang.Exception
Perform tasks like allocating resources or acquiring connections etc.- Parameters:
parameters
- Startup parameters defined in the configuration.cacheId
- Id of the Cache.- Throws:
java.lang.Exception
-
loadFromSource
ProviderCacheItem loadFromSource(java.lang.String key) throws java.lang.Exception
Responsible for loading the object from the data source. Key is passed as parameter.- Parameters:
key
- key used to reference object.- Returns:
- Provider Cache item present against the key.
- Throws:
java.lang.Exception
-
loadFromSource
java.util.Map<java.lang.String,ProviderCacheItem> loadFromSource(java.util.Collection<java.lang.String> keys) throws java.lang.Exception
Responsible for loading list of objects from the data source. Keys are passed as parameter.- Parameters:
keys
- The collection of keys to be loaded from the data source.- Returns:
- A map that contains keys and corresponding provider items.
- Throws:
java.lang.Exception
-
loadDataStructureFromSource
ProviderDataStructureItem loadDataStructureFromSource(java.lang.String key, DistributedDataStructureType distributedDataStructureType) throws java.lang.Exception
Responsible for loading the Data Strucutre from the data source.- Parameters:
key
- Key used to reference Data Structure.distributedDataStructureType
- Type of collection.- Returns:
- ProviderDataStructureItem present against the key.
- Throws:
java.lang.Exception
-
-