Package com.skava.service.impl
Class CacheImpl<T>
java.lang.Object
com.skava.service.impl.CacheImpl<T>
- Type Parameters:
T
- the class
This class has all the cache related functionalities like save to cache, delete from cache
and get cache.
- Author:
- Infosys Equinox
-
Constructor Summary
ConstructorsConstructorDescriptionCacheImpl
(org.springframework.cache.CacheManager cacheManager, com.fasterxml.jackson.databind.ObjectMapper objectMapper) -
Method Summary
Modifier and TypeMethodDescriptionvoid
clearCache
(Set<String> cacheNames) clearCache Used to clear the cache for the given cacheNames.<P> Object
covertObj
(P value) covertObjdeleteCache
(String cacheName) deleteCache.deleteCacheWithKey
(String cacheName, String cacheKey) deleteCacheWithKey.org.springframework.cache.Cache
getCache.getValueFromCache
(String cacheName, String key) Gets the Object value from cache according to the given cache name and key.saveDetailsToCache
(String cacheName, String cacheKey, T entity) Used to save details in cache.
-
Constructor Details
-
CacheImpl
@Autowired public CacheImpl(org.springframework.cache.CacheManager cacheManager, com.fasterxml.jackson.databind.ObjectMapper objectMapper)
-
-
Method Details
-
getCache
getCache.
-
covertObj
covertObj- Parameters:
value
- of type P which is to be converted.- Returns:
- the converted object.
-
saveDetailsToCache
Used to save details in cache. -
deleteCacheWithKey
deleteCacheWithKey.
- Parameters:
cacheName
- Holds cache name used for deleting cache with name and key.cacheKey
- Holds cache key used for deleting cache with name and key..- Returns:
- a
Object
object.
-
deleteCache
deleteCache.
-
getValueFromCache
Gets the Object value from cache according to the given cache name and key. -
clearCache
clearCache Used to clear the cache for the given cacheNames.- Parameters:
cacheNames
- a list of cacheNames for which the cache is to be cleared.
-