Search in sources :

Example 1 with ApplicationBasicInfoResourceIdCacheKey

use of org.wso2.carbon.identity.application.mgt.internal.cache.ApplicationBasicInfoResourceIdCacheKey in project carbon-identity-framework by wso2.

the class CacheBackedApplicationDAO method getApplicationBasicInfoFromCacheByResourceId.

private ApplicationBasicInfo getApplicationBasicInfoFromCacheByResourceId(String resourceId, String tenantDomain) {
    ApplicationBasicInfo applicationBasicInfo = null;
    if (resourceId != null) {
        ApplicationBasicInfoResourceIdCacheKey cacheKey = new ApplicationBasicInfoResourceIdCacheKey(resourceId);
        ApplicationBasicInfoCacheEntry entry = appBasicInfoCacheByResourceId.getValueFromCache(cacheKey, tenantDomain);
        if (entry != null) {
            applicationBasicInfo = entry.getApplicationBasicInfo();
        }
    }
    if (applicationBasicInfo == null) {
        if (log.isDebugEnabled()) {
            log.debug("Cache miss for the application with resourceId: " + resourceId);
        }
    } else {
        if (log.isDebugEnabled()) {
            log.debug("Cache hit for the application with resourceId: " + resourceId);
        }
    }
    return applicationBasicInfo;
}
Also used : ApplicationBasicInfoResourceIdCacheKey(org.wso2.carbon.identity.application.mgt.internal.cache.ApplicationBasicInfoResourceIdCacheKey) ApplicationBasicInfo(org.wso2.carbon.identity.application.common.model.ApplicationBasicInfo) ApplicationBasicInfoCacheEntry(org.wso2.carbon.identity.application.mgt.internal.cache.ApplicationBasicInfoCacheEntry)

Example 2 with ApplicationBasicInfoResourceIdCacheKey

use of org.wso2.carbon.identity.application.mgt.internal.cache.ApplicationBasicInfoResourceIdCacheKey in project carbon-identity-framework by wso2.

the class CacheBackedApplicationDAO method addAppBasicInfoToCache.

private void addAppBasicInfoToCache(ApplicationBasicInfo appBasicInfo, String tenantDomain) {
    if (log.isDebugEnabled()) {
        log.debug("Add cache for the application " + appBasicInfo.getApplicationName() + "@" + tenantDomain);
    }
    ApplicationBasicInfoResourceIdCacheKey key = new ApplicationBasicInfoResourceIdCacheKey(appBasicInfo.getApplicationResourceId());
    ApplicationBasicInfoCacheEntry entry = new ApplicationBasicInfoCacheEntry(appBasicInfo);
    appBasicInfoCacheByResourceId.addToCache(key, entry, tenantDomain);
    ApplicationBasicInfoNameCacheKey nameKey = new ApplicationBasicInfoNameCacheKey(appBasicInfo.getApplicationName());
    appBasicInfoCacheByName.addToCache(nameKey, entry, tenantDomain);
}
Also used : ApplicationBasicInfoNameCacheKey(org.wso2.carbon.identity.application.mgt.internal.cache.ApplicationBasicInfoNameCacheKey) ApplicationBasicInfoResourceIdCacheKey(org.wso2.carbon.identity.application.mgt.internal.cache.ApplicationBasicInfoResourceIdCacheKey) ApplicationBasicInfoCacheEntry(org.wso2.carbon.identity.application.mgt.internal.cache.ApplicationBasicInfoCacheEntry)

Aggregations

ApplicationBasicInfoCacheEntry (org.wso2.carbon.identity.application.mgt.internal.cache.ApplicationBasicInfoCacheEntry)2 ApplicationBasicInfoResourceIdCacheKey (org.wso2.carbon.identity.application.mgt.internal.cache.ApplicationBasicInfoResourceIdCacheKey)2 ApplicationBasicInfo (org.wso2.carbon.identity.application.common.model.ApplicationBasicInfo)1 ApplicationBasicInfoNameCacheKey (org.wso2.carbon.identity.application.mgt.internal.cache.ApplicationBasicInfoNameCacheKey)1