Package org.openiam.esb.cache
Class ManagedSysCacheSweeper
- java.lang.Object
-
- org.openiam.cache.AbstractRedisCacheProvider
-
- org.openiam.cache.AbstractCacheSweeper
-
- org.openiam.common.cache.AbstractBackendSweeper
-
- org.openiam.esb.cache.ManagedSysCacheSweeper
-
- All Implemented Interfaces:
Sweepable
@Component @DependsOn("springContextProvider") public class ManagedSysCacheSweeper extends AbstractBackendSweeper
Sweeper that caches managed systems into Redis every 5 minutesThese objects don't change too often, and the cache doesn't have to be distributed due to the fact that the objects are read-only 99% of the time.
- Author:
- lbornova
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.openiam.cache.AbstractCacheSweeper
AbstractCacheSweeper.CacheMode
-
Nested classes/interfaces inherited from class org.openiam.cache.AbstractRedisCacheProvider
AbstractRedisCacheProvider.CacheType, AbstractRedisCacheProvider.Context
-
-
Field Summary
-
Fields inherited from class org.openiam.common.cache.AbstractBackendSweeper
transactionTemplate
-
Fields inherited from class org.openiam.cache.AbstractCacheSweeper
log, redissonClient
-
-
Constructor Summary
Constructors Constructor Description ManagedSysCacheSweeper(org.springframework.data.redis.core.RedisTemplate<String,ManagedSysDto> managedSysCache, org.springframework.data.redis.core.RedisTemplate<String,String> managedSystemPasswordCache, ResourceService resourceService, LoginDataService loginDataService, String systemId, ManagedSystemService managedSystemService)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
forceSweep()
protected AbstractRedisCacheProvider.CacheType
getCacheType()
protected int
getSweepTime()
void
sweep()
Placeholder for Spring to call via Quartz.-
Methods inherited from class org.openiam.common.cache.AbstractBackendSweeper
getContext, init
-
Methods inherited from class org.openiam.cache.AbstractCacheSweeper
evictOldKeys, getCacheMode, getDateCacheKey, getLockCacheKey
-
Methods inherited from class org.openiam.cache.AbstractRedisCacheProvider
buildCacheKey, buildCacheKey
-
-
-
-
Constructor Detail
-
ManagedSysCacheSweeper
public ManagedSysCacheSweeper(@Qualifier("managedSystemRedisTemplate") org.springframework.data.redis.core.RedisTemplate<String,ManagedSysDto> managedSysCache, @Qualifier("managedSystemPasswordCache") org.springframework.data.redis.core.RedisTemplate<String,String> managedSystemPasswordCache, ResourceService resourceService, LoginDataService loginDataService, @Value("${org.openiam.idm.system.user.id}") String systemId, ManagedSystemService managedSystemService)
-
-
Method Detail
-
sweep
@Scheduled(fixedDelayString="${org.openiam.idm.managed.sys.cache.sweeptime}", initialDelayString="${org.openiam.idm.managed.sys.cache.sweeptime}") public void sweep()
Description copied from interface:Sweepable
Placeholder for Spring to call via Quartz. Required for @Transactional sweeper methods.- Specified by:
sweep
in interfaceSweepable
- Overrides:
sweep
in classAbstractBackendSweeper
-
getSweepTime
protected int getSweepTime()
- Specified by:
getSweepTime
in classAbstractCacheSweeper
-
forceSweep
public void forceSweep()
- Specified by:
forceSweep
in classAbstractCacheSweeper
-
getCacheType
protected AbstractRedisCacheProvider.CacheType getCacheType()
- Specified by:
getCacheType
in classAbstractRedisCacheProvider
-
-