本文整理汇总了Java中org.apache.shiro.subject.SubjectContext.getSessionId方法的典型用法代码示例。如果您正苦于以下问题:Java SubjectContext.getSessionId方法的具体用法?Java SubjectContext.getSessionId怎么用?Java SubjectContext.getSessionId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.shiro.subject.SubjectContext
的用法示例。
在下文中一共展示了SubjectContext.getSessionId方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getSessionKey
import org.apache.shiro.subject.SubjectContext; //导入方法依赖的package包/类
@Override
protected SessionKey getSessionKey(SubjectContext context) {
if (WebUtils.isWeb(context)) {
Serializable sessionId = context.getSessionId();
ServletRequest request = WebUtils.getRequest(context);
ServletResponse response = WebUtils.getResponse(context);
return new WebSessionKey(sessionId, request, response);
} else {
return super.getSessionKey(context);
}
}
示例2: getSessionKey
import org.apache.shiro.subject.SubjectContext; //导入方法依赖的package包/类
protected SessionKey getSessionKey(SubjectContext context) {
Serializable sessionId = context.getSessionId();
if (sessionId != null) {
return new DefaultSessionKey(sessionId);
}
return null;
}
示例3: createSessionContext
import org.apache.shiro.subject.SubjectContext; //导入方法依赖的package包/类
protected SessionContext createSessionContext(SubjectContext subjectContext) {
DefaultSessionContext sessionContext = new DefaultSessionContext();
if (!CollectionUtils.isEmpty(subjectContext)) {
sessionContext.putAll(subjectContext);
}
Serializable sessionId = subjectContext.getSessionId();
if (sessionId != null) {
sessionContext.setSessionId(sessionId);
}
String host = subjectContext.resolveHost();
if (host != null) {
sessionContext.setHost(host);
}
return sessionContext;
}
示例4: getSessionKey
import org.apache.shiro.subject.SubjectContext; //导入方法依赖的package包/类
@Override
protected SessionKey getSessionKey(SubjectContext context) {
if (WebUtils.isWeb(context)) {
Serializable sessionId = context.getSessionId();
ServletRequest request = WebUtils.getRequest(context);
ServletResponse response = WebUtils.getResponse(context);
return new WebSessionKey(sessionId, request, response);
} else {
return super.getSessionKey(context);
}
}
示例5: getSessionKey
import org.apache.shiro.subject.SubjectContext; //导入方法依赖的package包/类
@Override
protected SessionKey getSessionKey(SubjectContext subjectContext) {
if (subjectContext instanceof ContextSource) {
Context context = ((ContextSource) subjectContext).getContext();
//SessionFacade session = context.getSession(false);
//if (session != null) return new JWebSessionKey(session.getId(), context);
return new JWebSessionKey(subjectContext.getSessionId(), context);
}
return super.getSessionKey(subjectContext);
}
示例6: getSessionKey
import org.apache.shiro.subject.SubjectContext; //导入方法依赖的package包/类
@Override
protected SessionKey getSessionKey(SubjectContext subjectContext) {
Serializable sessionId = subjectContext.getSessionId();
RequestWrapper requestWrapper = getRequestWrapper(subjectContext);
ResponseWrapper responseWrapper = getResponseWrapper(subjectContext);
return new LaputaSessionKey(sessionId, requestWrapper, responseWrapper);
}
示例7: resolveContextSession
import org.apache.shiro.subject.SubjectContext; //导入方法依赖的package包/类
protected IOTClient resolveContextSession( SubjectContext context) throws InvalidSessionException {
Serializable sessionId = context.getSessionId();
if (sessionId != null) {
SessionKey key = new DefaultSessionKey(sessionId);
return (IOTClient) getSession(key);
}
return null;
}