Class BaseUserCache
- java.lang.Object
-
- org.flowable.ui.common.service.idm.cache.BaseUserCache
-
- All Implemented Interfaces:
UserCache
- Direct Known Subclasses:
RemoteIdmUserCache
public abstract class BaseUserCache extends Object implements UserCache
Cache containing User objects to prevent too much DB-traffic (users exist separately from the Flowable tables, they need to be fetched afterward one by one to join with those entities).TODO: This could probably be made more efficient with bulk getting. The Google cache impl allows this: override loadAll and use getAll() to fetch multiple entities.
- Author:
- Frederik Heremans, Joram Barrez, Filip Hrisafov
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.flowable.ui.common.service.idm.cache.UserCache
UserCache.CachedUser
-
-
Field Summary
Fields Modifier and Type Field Description protected FlowableCommonAppPropertiespropertiesprotected com.google.common.cache.LoadingCache<String,UserCache.CachedUser>userCache
-
Constructor Summary
Constructors Modifier Constructor Description protectedBaseUserCache(FlowableCommonAppProperties properties)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description UserCache.CachedUsergetUser(String userId)UserCache.CachedUsergetUser(String userId, boolean throwExceptionOnNotFound, boolean throwExceptionOnInactive, boolean checkValidity)protected voidinitCache()voidinvalidate(String userId)protected abstract UserCache.CachedUserloadUser(String userId)voidputUser(String userId, UserCache.CachedUser cachedUser)
-
-
-
Field Detail
-
properties
protected final FlowableCommonAppProperties properties
-
userCache
protected com.google.common.cache.LoadingCache<String,UserCache.CachedUser> userCache
-
-
Constructor Detail
-
BaseUserCache
protected BaseUserCache(FlowableCommonAppProperties properties)
-
-
Method Detail
-
initCache
@PostConstruct protected void initCache()
-
loadUser
protected abstract UserCache.CachedUser loadUser(String userId)
-
putUser
public void putUser(String userId, UserCache.CachedUser cachedUser)
-
getUser
public UserCache.CachedUser getUser(String userId)
-
getUser
public UserCache.CachedUser getUser(String userId, boolean throwExceptionOnNotFound, boolean throwExceptionOnInactive, boolean checkValidity)
-
invalidate
public void invalidate(String userId)
- Specified by:
invalidatein interfaceUserCache
-
-