Search in sources :

Example 1 with ExternalClaimCacheKey

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);
}
Also used : ExternalClaimCacheKey(org.wso2.carbon.identity.claim.metadata.mgt.cache.ExternalClaimCacheKey)

Example 2 with ExternalClaimCacheKey

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);
}
Also used : ExternalClaimCacheKey(org.wso2.carbon.identity.claim.metadata.mgt.cache.ExternalClaimCacheKey)

Example 3 with ExternalClaimCacheKey

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;
}
Also used : ExternalClaimCacheKey(org.wso2.carbon.identity.claim.metadata.mgt.cache.ExternalClaimCacheKey) ExternalClaim(org.wso2.carbon.identity.claim.metadata.mgt.model.ExternalClaim)

Example 4 with ExternalClaimCacheKey

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);
}
Also used : ExternalClaimCacheKey(org.wso2.carbon.identity.claim.metadata.mgt.cache.ExternalClaimCacheKey)

Example 5 with ExternalClaimCacheKey

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);
}
Also used : ExternalClaimCacheKey(org.wso2.carbon.identity.claim.metadata.mgt.cache.ExternalClaimCacheKey)

Aggregations

ExternalClaimCacheKey (org.wso2.carbon.identity.claim.metadata.mgt.cache.ExternalClaimCacheKey)5 ExternalClaim (org.wso2.carbon.identity.claim.metadata.mgt.model.ExternalClaim)1