use of org.wso2.carbon.identity.claim.metadata.mgt.cache.ExternalClaimCacheKey in project carbon-identity-framework by wso2.
the class CacheBackedExternalClaimDAO method updateExternalClaim.
public void updateExternalClaim(ExternalClaim externalClaim, int tenantId) throws ClaimMetadataException {
externalClaimDAO.updateExternalClaim(externalClaim, tenantId);
String externalClaimDialectURI = externalClaim.getClaimDialectURI();
ExternalClaimCacheKey cacheKey = new ExternalClaimCacheKey(externalClaimDialectURI);
externalClaimCache.clearCacheEntry(cacheKey, tenantId);
}
use of org.wso2.carbon.identity.claim.metadata.mgt.cache.ExternalClaimCacheKey in project carbon-identity-framework by wso2.
the class CacheBackedExternalClaimDAO method removeExternalClaimCache.
/**
* Remove mapped external claims at post removing claim dialect.
*
* @param externalClaimDialectURI External claim dialect uri
* @param tenantId Tenant Id
*/
public void removeExternalClaimCache(String externalClaimDialectURI, int tenantId) {
ExternalClaimCacheKey cacheKey = new ExternalClaimCacheKey(externalClaimDialectURI);
externalClaimCache.clearCacheEntry(cacheKey, tenantId);
}
use of org.wso2.carbon.identity.claim.metadata.mgt.cache.ExternalClaimCacheKey in project carbon-identity-framework by wso2.
the class CacheBackedExternalClaimDAO method getExternalClaims.
public List<ExternalClaim> getExternalClaims(String externalDialectURI, int tenantId) throws ClaimMetadataException {
ExternalClaimCacheKey cacheKey = new ExternalClaimCacheKey(externalDialectURI);
List<ExternalClaim> externalClaimList = externalClaimCache.getValueFromCache(cacheKey, tenantId);
if (externalClaimList == null) {
if (log.isDebugEnabled()) {
log.debug("Cache miss for external claim list for dialect: " + externalDialectURI + " in tenant: " + tenantId);
}
externalClaimList = externalClaimDAO.getExternalClaims(externalDialectURI, tenantId);
externalClaimCache.addToCache(cacheKey, new ArrayList<>(externalClaimList), tenantId);
} else {
if (log.isDebugEnabled()) {
log.debug("Cache hit for external claim list for dialect: " + externalDialectURI + " in tenant: " + tenantId);
}
}
return externalClaimList;
}
use of org.wso2.carbon.identity.claim.metadata.mgt.cache.ExternalClaimCacheKey in project carbon-identity-framework by wso2.
the class CacheBackedExternalClaimDAO method removeExternalClaim.
public void removeExternalClaim(String externalClaimDialectURI, String externalClaimURI, int tenantId) throws ClaimMetadataException {
externalClaimDAO.removeExternalClaim(externalClaimDialectURI, externalClaimURI, tenantId);
ExternalClaimCacheKey cacheKey = new ExternalClaimCacheKey(externalClaimDialectURI);
externalClaimCache.clearCacheEntry(cacheKey, tenantId);
}
use of org.wso2.carbon.identity.claim.metadata.mgt.cache.ExternalClaimCacheKey in project carbon-identity-framework by wso2.
the class CacheBackedExternalClaimDAO method addExternalClaim.
public void addExternalClaim(ExternalClaim externalClaim, int tenantId) throws ClaimMetadataException {
externalClaimDAO.addExternalClaim(externalClaim, tenantId);
String externalClaimDialectURI = externalClaim.getClaimDialectURI();
ExternalClaimCacheKey cacheKey = new ExternalClaimCacheKey(externalClaimDialectURI);
externalClaimCache.clearCacheEntry(cacheKey, tenantId);
}
Aggregations