本文整理汇总了Java中org.apache.shiro.mgt.DefaultSubjectDAO类的典型用法代码示例。如果您正苦于以下问题:Java DefaultSubjectDAO类的具体用法?Java DefaultSubjectDAO怎么用?Java DefaultSubjectDAO使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DefaultSubjectDAO类属于org.apache.shiro.mgt包,在下文中一共展示了DefaultSubjectDAO类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: getManager
import org.apache.shiro.mgt.DefaultSubjectDAO; //导入依赖的package包/类
@Bean("securityManager")
public DefaultWebSecurityManager getManager(Realm realm) {
DefaultWebSecurityManager manager = new DefaultWebSecurityManager();
manager.setRealm(realm);
DefaultSubjectDAO subjectDAO = new DefaultSubjectDAO();
DefaultSessionStorageEvaluator evaluator = new DefaultSessionStorageEvaluator();
evaluator.setSessionStorageEnabled(false);
subjectDAO.setSessionStorageEvaluator(evaluator);
manager.setSubjectDAO(subjectDAO);
return manager;
}
开发者ID:Eagle-OJ,项目名称:eagle-oj-api,代码行数:14,代码来源:ShiroConfig.java
示例2: securityManager
import org.apache.shiro.mgt.DefaultSubjectDAO; //导入依赖的package包/类
@Bean(name = "securityManager")
@ConditionalOnMissingBean
public DefaultSecurityManager securityManager(CacheManager shiroCacheManager) {
DefaultWebSecurityManager dwsm = new DefaultWebSecurityManager();
// 用自己的Factory实现替换默认
// 用于关闭session功能
dwsm.setSubjectFactory(new StatelessSubjectFactory());
dwsm.setSessionManager(defaultSessionManager());
// 关闭session存储
((DefaultSessionStorageEvaluator) ((DefaultSubjectDAO)dwsm.getSubjectDAO()).getSessionStorageEvaluator()).setSessionStorageEnabled(false);
// <!-- 用户授权/认证信息Cache, 采用EhCache 缓存 -->
dwsm.setCacheManager(shiroCacheManager);
SecurityUtils.setSecurityManager(dwsm);
return dwsm;
}
开发者ID:wanghongfei,项目名称:shiro-spring-boot-starter,代码行数:19,代码来源:ShiroManager.java
示例3: DefaultWebSecurityManager
import org.apache.shiro.mgt.DefaultSubjectDAO; //导入依赖的package包/类
public DefaultWebSecurityManager() {
super();
((DefaultSubjectDAO) this.subjectDAO).setSessionStorageEvaluator(new DefaultWebSessionStorageEvaluator());
this.sessionMode = HTTP_SESSION_MODE;
setSubjectFactory(new DefaultWebSubjectFactory());
setRememberMeManager(new CookieRememberMeManager());
setSessionManager(new ServletContainerSessionManager());
}
开发者ID:xuegongzi,项目名称:rabbitframework,代码行数:9,代码来源:DefaultWebSecurityManager.java
示例4: StalessSecurityManager
import org.apache.shiro.mgt.DefaultSubjectDAO; //导入依赖的package包/类
public StalessSecurityManager() {
setSubjectFactory(new StalessSubjectFactory()) ;
// Disabling Subject State Session Storage
// https://shiro.apache.org/session-management.html#disabling-subject-state-session-storage
DefaultSubjectDAO subjectDAO = (DefaultSubjectDAO)this.getSubjectDAO() ;
DefaultSessionStorageEvaluator sessionStorageEvaluator = (DefaultSessionStorageEvaluator)subjectDAO.getSessionStorageEvaluator() ;
sessionStorageEvaluator.setSessionStorageEnabled(false) ;
this.setRememberMeManager(null) ;
}
开发者ID:auslides,项目名称:stateless-shiro,代码行数:11,代码来源:StalessSecurityManager.java
示例5: applySessionManagerToSessionStorageEvaluatorIfPossible
import org.apache.shiro.mgt.DefaultSubjectDAO; //导入依赖的package包/类
private void applySessionManagerToSessionStorageEvaluatorIfPossible() {
SubjectDAO subjectDAO = getSubjectDAO();
if (subjectDAO instanceof DefaultSubjectDAO) {
SessionStorageEvaluator evaluator = ((DefaultSubjectDAO)subjectDAO).getSessionStorageEvaluator();
if (evaluator instanceof DefaultWebSessionStorageEvaluator) {
((DefaultWebSessionStorageEvaluator)evaluator).setSessionManager(getSessionManager());
}
}
}
开发者ID:xuegongzi,项目名称:rabbitframework,代码行数:10,代码来源:DefaultWebSecurityManager.java
示例6: SimpleWebSecurityManager
import org.apache.shiro.mgt.DefaultSubjectDAO; //导入依赖的package包/类
public SimpleWebSecurityManager() {
super();
super.setSubjectDAO(new SubjectDAOImpl());
((DefaultSubjectDAO) this.subjectDAO)
.setSessionStorageEvaluator(new SimpleWebSessionStorageEvaluator());
setSubjectFactory(new DefaultWebSubjectFactory());
setRememberMeManager(new CookieRememberMeManager());
setSessionManager(new ServletContainerSessionManager());
}
开发者ID:xuegongzi,项目名称:rabbitframework,代码行数:10,代码来源:SimpleWebSecurityManager.java
示例7: applySessionManagerToSessionStorageEvaluatorIfPossible
import org.apache.shiro.mgt.DefaultSubjectDAO; //导入依赖的package包/类
private void applySessionManagerToSessionStorageEvaluatorIfPossible() {
SubjectDAO subjectDAO = getSubjectDAO();
if (subjectDAO instanceof DefaultSubjectDAO) {
SessionStorageEvaluator evaluator = ((DefaultSubjectDAO) subjectDAO)
.getSessionStorageEvaluator();
if (evaluator instanceof SimpleWebSessionStorageEvaluator) {
((SimpleWebSessionStorageEvaluator) evaluator)
.setSessionManager(getSessionManager());
}
}
}
开发者ID:xuegongzi,项目名称:rabbitframework,代码行数:12,代码来源:SimpleWebSecurityManager.java
示例8: SessionlessSecurityManager
import org.apache.shiro.mgt.DefaultSubjectDAO; //导入依赖的package包/类
/**
* Constructs a new session-less security manager.
*/
public SessionlessSecurityManager() {
super();
DefaultSubjectDAO subjectDAO = new DefaultSubjectDAO();
DefaultSessionStorageEvaluator sessionStorageEvaluator = new DefaultSessionStorageEvaluator();
sessionStorageEvaluator.setSessionStorageEnabled(false);
subjectDAO.setSessionStorageEvaluator(sessionStorageEvaluator);
setSubjectDAO(subjectDAO);
}
开发者ID:litesolutions,项目名称:scm-ssh-plugin,代码行数:12,代码来源:SessionlessSecurityManager.java
示例9: LaputaSecurityManager
import org.apache.shiro.mgt.DefaultSubjectDAO; //导入依赖的package包/类
public LaputaSecurityManager() {
super();
((DefaultSubjectDAO) this.subjectDAO).setSessionStorageEvaluator(new LaputaSessionStorageEvaluator());
setSubjectFactory(new LaputaSubjectFactory());
setRememberMeManager(new CookieRememberMeManager());
setSessionManager(new LaputaSessionManager());
}
开发者ID:orctom,项目名称:laputa,代码行数:8,代码来源:LaputaSecurityManager.java
示例10: initializeSubjectDAO
import org.apache.shiro.mgt.DefaultSubjectDAO; //导入依赖的package包/类
private void initializeSubjectDAO(DefaultSecurityManager dsm) {
if(dsm.getSubjectDAO() instanceof DefaultSubjectDAO) {
((DefaultSubjectDAO) dsm.getSubjectDAO()).setSessionStorageEvaluator(new SessionStorageEvaluator());
}
}
开发者ID:obiba,项目名称:agate,代码行数:6,代码来源:SecurityManagerFactory.java
示例11: init
import org.apache.shiro.mgt.DefaultSubjectDAO; //导入依赖的package包/类
@Override
public void init() {
if (LOG.isTraceEnabled()) {
LOG.trace("Initializing the '" + getClass().getSimpleName()
+ "' using the default settings.");
}
// use the default realm
final MapDbAuthorizingRealm realm = new MapDbAuthorizingRealm(
handler.getDefaultLocation(true));
if (realm instanceof Initializable) {
realm.init();
}
// create a default manager and set it
final DefaultSecurityManager manager = new DefaultSecurityManager();
manager.setRealm(realm);
// get the manager and initialize it
if (manager instanceof Initializable) {
((Initializable) manager).init();
}
this.manager = manager;
final SessionManager sessionManager = this.manager.getSessionManager();
if (sessionManager instanceof AbstractValidatingSessionManager) {
((AbstractValidatingSessionManager) sessionManager)
.setSessionValidationSchedulerEnabled(false);
}
final SubjectDAO subjectDao = this.manager.getSubjectDAO();
if (subjectDao instanceof DefaultSubjectDAO) {
final SessionStorageEvaluator sessionStorageEvaluator = ((DefaultSubjectDAO) this.manager
.getSubjectDAO()).getSessionStorageEvaluator();
if (sessionStorageEvaluator instanceof DefaultSessionStorageEvaluator) {
((DefaultSessionStorageEvaluator) sessionStorageEvaluator)
.setSessionStorageEnabled(false);
}
}
this.builder = new Subject.Builder(manager);
this.builder.sessionCreationEnabled(false);
}
开发者ID:pmeisen,项目名称:dis-timeintervaldataanalyzer,代码行数:43,代码来源:ShiroAuthManager.java
注:本文中的org.apache.shiro.mgt.DefaultSubjectDAO类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论