use of org.wso2.carbon.identity.application.authentication.framework.cache.AuthenticationResultCacheKey in project carbon-identity-framework by wso2.
the class FrameworkUtils method removeAuthenticationResultFromCache.
/**
* Removes authentication result from cache.
* @param autheticationResultId
*/
public static void removeAuthenticationResultFromCache(String autheticationResultId) {
if (autheticationResultId != null) {
AuthenticationResultCacheKey cacheKey = new AuthenticationResultCacheKey(autheticationResultId);
AuthenticationResultCache.getInstance().clearCacheEntry(cacheKey);
}
}
use of org.wso2.carbon.identity.application.authentication.framework.cache.AuthenticationResultCacheKey in project carbon-identity-framework by wso2.
the class FrameworkUtils method addAuthenticationResultToCache.
/**
* @param key
* @param authenticationResult
*/
public static void addAuthenticationResultToCache(String key, AuthenticationResult authenticationResult) {
AuthenticationResultCacheKey cacheKey = new AuthenticationResultCacheKey(key);
AuthenticationResultCacheEntry cacheEntry = new AuthenticationResultCacheEntry();
cacheEntry.setResult(authenticationResult);
cacheEntry.setValidityPeriod(TimeUnit.MINUTES.toNanos(IdentityUtil.getOperationCleanUpTimeout()));
AuthenticationResultCache.getInstance().addToCache(cacheKey, cacheEntry);
}
use of org.wso2.carbon.identity.application.authentication.framework.cache.AuthenticationResultCacheKey in project carbon-identity-framework by wso2.
the class FrameworkUtils method getAuthenticationResultFromCache.
/**
* To get authentication cache result from cache.
* @param key
* @return
*/
public static AuthenticationResultCacheEntry getAuthenticationResultFromCache(String key) {
AuthenticationResultCacheKey cacheKey = new AuthenticationResultCacheKey(key);
AuthenticationResultCacheEntry authResult = AuthenticationResultCache.getInstance().getValueFromCache(cacheKey);
return authResult;
}
Aggregations