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;
}
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;
}
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());
}
}
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;
}
Aggregations