Interface ReadThruProvider
-
- All Superinterfaces:
java.lang.AutoCloseable
public interface ReadThruProvider extends java.lang.AutoCloseableContains methods used to read an object by its key from the master data source. Must be implemented by read-through components.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidinit(java.util.Map<java.lang.String,java.lang.String> parameters, java.lang.String cacheId)Perform tasks like allocating resources or acquiring connections, etc.ProviderDataStructureItemloadDataStructureFromSource(java.lang.String key, DistributedDataStructureType distributedDataStructureType)Responsible for loading the object from the data source.ProviderCacheItemloadFromSource(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.ExceptionPerform 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 CacheItem 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 object from the data source. Key is passed as a parameter.- Parameters:
key- Key used to reference the object.distributedDataStructureType- Type of collection.- Returns:
- A CacheItem with some limited fields.
- Throws:
java.lang.Exception
-
-