Search in sources :

Example 1 with GlobalVersionCache

use of com.evolveum.midpoint.repo.cache.global.GlobalVersionCache 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);
}
Also used : GlobalQueryCache(com.evolveum.midpoint.repo.cache.global.GlobalQueryCache) GlobalVersionCache(com.evolveum.midpoint.repo.cache.global.GlobalVersionCache) LocalVersionCache(com.evolveum.midpoint.repo.cache.local.LocalVersionCache) LocalQueryCache(com.evolveum.midpoint.repo.cache.local.LocalQueryCache) LocalObjectCache(com.evolveum.midpoint.repo.cache.local.LocalObjectCache) GlobalObjectCache(com.evolveum.midpoint.repo.cache.global.GlobalObjectCache)

Aggregations

GlobalObjectCache (com.evolveum.midpoint.repo.cache.global.GlobalObjectCache)1 GlobalQueryCache (com.evolveum.midpoint.repo.cache.global.GlobalQueryCache)1 GlobalVersionCache (com.evolveum.midpoint.repo.cache.global.GlobalVersionCache)1 LocalObjectCache (com.evolveum.midpoint.repo.cache.local.LocalObjectCache)1 LocalQueryCache (com.evolveum.midpoint.repo.cache.local.LocalQueryCache)1 LocalVersionCache (com.evolveum.midpoint.repo.cache.local.LocalVersionCache)1