Search in sources :

Example 1 with DefaultSessionManager

use of org.apache.shiro.session.mgt.DefaultSessionManager in project killbill by killbill.

the class SessionDAOProvider method get.

@Override
public SessionDAO get() {
    final CachingSessionDAO sessionDao;
    if (redisCacheConfig.isRedisCachingEnabled()) {
        sessionDao = new RedisSessionDao();
    } else {
        sessionDao = new JDBCSessionDao(dbi, roDbi);
    }
    if (sessionManager instanceof DefaultSessionManager) {
        final DefaultSessionManager defaultSessionManager = (DefaultSessionManager) sessionManager;
        defaultSessionManager.setSessionDAO(sessionDao);
        defaultSessionManager.setGlobalSessionTimeout(rbacConfig.getGlobalSessionTimeout().getMillis());
    }
    return sessionDao;
}
Also used : DefaultSessionManager(org.apache.shiro.session.mgt.DefaultSessionManager) JDBCSessionDao(org.killbill.billing.util.security.shiro.dao.JDBCSessionDao) RedisSessionDao(org.killbill.billing.util.security.shiro.dao.RedisSessionDao) CachingSessionDAO(org.apache.shiro.session.mgt.eis.CachingSessionDAO)

Example 2 with DefaultSessionManager

use of org.apache.shiro.session.mgt.DefaultSessionManager in project killbill by killbill.

the class JDBCSessionDaoProvider method get.

@Override
public JDBCSessionDao get() {
    final JDBCSessionDao jdbcSessionDao = new JDBCSessionDao(dbi);
    if (sessionManager instanceof DefaultSessionManager) {
        final DefaultSessionManager defaultSessionManager = (DefaultSessionManager) sessionManager;
        defaultSessionManager.setSessionDAO(jdbcSessionDao);
        defaultSessionManager.setGlobalSessionTimeout(rbacConfig.getGlobalSessionTimeout().getMillis());
    }
    return jdbcSessionDao;
}
Also used : DefaultSessionManager(org.apache.shiro.session.mgt.DefaultSessionManager) JDBCSessionDao(org.killbill.billing.util.security.shiro.dao.JDBCSessionDao)

Example 3 with DefaultSessionManager

use of org.apache.shiro.session.mgt.DefaultSessionManager in project geode by apache.

the class IntegratedSecurityService method increaseShiroGlobalSessionTimeout.

private void increaseShiroGlobalSessionTimeout(final DefaultSecurityManager shiroManager) {
    SessionManager sessionManager = shiroManager.getSessionManager();
    if (DefaultSessionManager.class.isInstance(sessionManager)) {
        DefaultSessionManager defaultSessionManager = (DefaultSessionManager) sessionManager;
        defaultSessionManager.setGlobalSessionTimeout(Long.MAX_VALUE);
        long value = defaultSessionManager.getGlobalSessionTimeout();
        if (value != Long.MAX_VALUE) {
            logger.error("Unable to set Shiro Global Session Timeout. Current value is '{}'.", value);
        }
    } else {
        logger.error("Unable to set Shiro Global Session Timeout. Current SessionManager is '{}'.", sessionManager == null ? "null" : sessionManager.getClass());
    }
}
Also used : DefaultSessionManager(org.apache.shiro.session.mgt.DefaultSessionManager) SessionManager(org.apache.shiro.session.mgt.SessionManager) DefaultSessionManager(org.apache.shiro.session.mgt.DefaultSessionManager)

Example 4 with DefaultSessionManager

use of org.apache.shiro.session.mgt.DefaultSessionManager in project shiro by apache.

the class AbstractShiroConfiguration method sessionManager.

protected SessionManager sessionManager() {
    DefaultSessionManager sessionManager = new DefaultSessionManager();
    sessionManager.setSessionDAO(sessionDAO());
    sessionManager.setSessionFactory(sessionFactory());
    sessionManager.setDeleteInvalidSessions(sessionManagerDeleteInvalidSessions);
    return sessionManager;
}
Also used : DefaultSessionManager(org.apache.shiro.session.mgt.DefaultSessionManager)

Aggregations

DefaultSessionManager (org.apache.shiro.session.mgt.DefaultSessionManager)4 JDBCSessionDao (org.killbill.billing.util.security.shiro.dao.JDBCSessionDao)2 SessionManager (org.apache.shiro.session.mgt.SessionManager)1 CachingSessionDAO (org.apache.shiro.session.mgt.eis.CachingSessionDAO)1 RedisSessionDao (org.killbill.billing.util.security.shiro.dao.RedisSessionDao)1