use of org.wso2.carbon.identity.application.mgt.internal.cache.ApplicationBasicInfoNameCacheKey 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);
}
use of org.wso2.carbon.identity.application.mgt.internal.cache.ApplicationBasicInfoNameCacheKey in project carbon-identity-framework by wso2.
the class CacheBackedApplicationDAO method getApplicationBasicInfoFromCacheByName.
private ApplicationBasicInfo getApplicationBasicInfoFromCacheByName(String name, String tenantDomain) {
ApplicationBasicInfo applicationBasicInfo = null;
if (name != null) {
ApplicationBasicInfoNameCacheKey cacheKey = new ApplicationBasicInfoNameCacheKey(name);
ApplicationBasicInfoCacheEntry entry = appBasicInfoCacheByName.getValueFromCache(cacheKey, tenantDomain);
if (entry != null) {
applicationBasicInfo = entry.getApplicationBasicInfo();
}
}
if (applicationBasicInfo == null) {
if (log.isDebugEnabled()) {
log.debug("Cache miss for the application with name: " + name);
}
} else {
if (log.isDebugEnabled()) {
log.debug("Cache hit for the application with name: " + name);
}
}
return applicationBasicInfo;
}
Aggregations