use of org.wso2.carbon.identity.application.mgt.cache.DefaultAuthSeqMgtCacheEntry in project carbon-identity-framework by wso2.
the class DefaultAuthSeqMgtServiceImpl method addDefaultAuthSeqToCache.
private void addDefaultAuthSeqToCache(DefaultAuthenticationSequence sequence, String tenantDomain) {
if (DefaultAuthSeqMgtCache.getInstance().isEnabled()) {
DefaultAuthSeqMgtCacheEntry entry = new DefaultAuthSeqMgtCacheEntry(sequence);
DefaultAuthSeqMgtCache.getInstance().addToCache(sequence.getName(), entry, tenantDomain);
if (log.isDebugEnabled()) {
log.debug("Default authentication sequence for tenant: " + tenantDomain + " is added to cache.");
}
}
}
use of org.wso2.carbon.identity.application.mgt.cache.DefaultAuthSeqMgtCacheEntry in project carbon-identity-framework by wso2.
the class DefaultAuthSeqMgtServiceImpl method doGetDefaultAuthSeq.
private DefaultAuthenticationSequence doGetDefaultAuthSeq(String sequenceName, String tenantDomain) throws DefaultAuthSeqMgtException {
if (DefaultAuthSeqMgtCache.getInstance().isEnabled()) {
DefaultAuthSeqMgtCacheEntry entry = DefaultAuthSeqMgtCache.getInstance().getValueFromCache(sequenceName, tenantDomain);
if (entry != null) {
if (log.isDebugEnabled()) {
log.debug("Default authentication sequence of tenant: " + tenantDomain + " is retrieved from cache.");
}
return entry.getSequence();
}
}
DefaultAuthSeqMgtDAO seqMgtDAO = new DefaultAuthSeqMgtDAOImpl();
DefaultAuthenticationSequence sequence = seqMgtDAO.getDefaultAuthenticationSeq(sequenceName, tenantDomain);
if (sequence != null) {
addDefaultAuthSeqToCache(sequence, tenantDomain);
}
return sequence;
}
Aggregations