use of com.evolveum.midpoint.repo.cache.global.GlobalObjectCache in project midpoint by Evolveum.
the class CacheSetAccessInfoFactory method determine.
private <T extends ObjectType> CacheSetAccessInfo<T> determine(Class<T> type, boolean alsoQuery) {
CacheAccessInfo<GlobalObjectCache, T> globalObject = new CacheAccessInfo<>(globalObjectCache, globalObjectCache.getConfiguration(), type, globalObjectCache.isAvailable());
CacheAccessInfo<GlobalVersionCache, T> globalVersion = new CacheAccessInfo<>(globalVersionCache, globalVersionCache.getConfiguration(), type, globalVersionCache.isAvailable());
CacheAccessInfo<GlobalQueryCache, T> globalQuery = alsoQuery ? new CacheAccessInfo<>(globalQueryCache, globalQueryCache.getConfiguration(), type, globalQueryCache.isAvailable()) : CacheAccessInfo.createNotAvailable();
LocalObjectCache localObjectCache = getLocalObjectCache();
LocalVersionCache localVersionCache = getLocalVersionCache();
LocalQueryCache localQueryCache = getLocalQueryCache();
CacheAccessInfo<LocalObjectCache, T> localObject = localObjectCache != null ? new CacheAccessInfo<>(localObjectCache, localObjectCache.getConfiguration(), type, true) : new CacheAccessInfo<>(null, cacheConfigurationManager.getConfiguration(LOCAL_REPO_OBJECT_CACHE), type, false);
CacheAccessInfo<LocalVersionCache, T> localVersion = localVersionCache != null ? new CacheAccessInfo<>(localVersionCache, localVersionCache.getConfiguration(), type, true) : new CacheAccessInfo<>(null, cacheConfigurationManager.getConfiguration(LOCAL_REPO_VERSION_CACHE), type, false);
CacheAccessInfo<LocalQueryCache, T> localQuery;
if (alsoQuery) {
localQuery = localQueryCache != null ? new CacheAccessInfo<>(localQueryCache, localQueryCache.getConfiguration(), type, true) : new CacheAccessInfo<>(null, cacheConfigurationManager.getConfiguration(LOCAL_REPO_QUERY_CACHE), type, false);
} else {
localQuery = CacheAccessInfo.createNotAvailable();
}
return new CacheSetAccessInfo<>(localObject, localVersion, localQuery, globalObject, globalVersion, globalQuery);
}
Aggregations