本文整理了Java中org.sakaiproject.tool.api.Session.setActive()
方法的一些代码示例,展示了Session.setActive()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Session.setActive()
方法的具体详情如下:
包路径:org.sakaiproject.tool.api.Session
类名称:Session
方法名:setActive
[英]Mark the session as still active, delaying timeout by another period.
[中]将会话标记为仍处于活动状态,将超时时间再延迟一段时间。
代码示例来源:origin: sakaiproject/sakai
/**
* Set active session according to sessionId parameter
*/
private void setSession( HttpServletRequest req )
{
String sessionId = req.getParameter("session");
if ( sessionId != null)
{
Session session = sessionManager.getSession(sessionId);
if (session != null)
{
session.setActive();
sessionManager.setCurrentSession(session);
}
}
}
代码示例来源:origin: sakaiproject/sakai
s.setActive();
代码示例来源:origin: org.sakaiproject.kernel/sakai-kernel-api
s.setActive();
代码示例来源:origin: sakaiproject/sakai
requestSession.setUserEid(usr.getEid());
requestSession.setUserId(usr.getId());
requestSession.setActive();
} catch (UserNotDefinedException e) {
log.error(e.getMessage(), e); }
代码示例来源:origin: org.sakaiproject.kernel/sakai-kernel-api
requestSession.setUserEid(usr.getEid());
requestSession.setUserId(usr.getId());
requestSession.setActive();
} catch (UserNotDefinedException e) {
log.error(e.getMessage(), e); }
代码示例来源:origin: sakaiproject/sakai
public String setCurrentUser(String userReference) {
if (userReference == null) {
throw new IllegalArgumentException("userReference cannot be null");
}
String userId = getUserIdFromRef(userReference);
try {
// make sure the user id is valid
userDirectoryService.getUser(userId);
} catch (UserNotDefinedException e) {
throw new IllegalArgumentException("Invalid user reference ("+userReference+"), could not find user");
}
Session currentSession = sessionManager.getCurrentSession();
if (currentSession == null) {
// start a session if none is around
currentSession = sessionManager.startSession(userId);
}
String currentUserId = currentSession.getUserId();
if (currentSession.getAttribute(CURRENT_USER_MARKER) == null) {
// only set this if it is not already set
if (currentUserId == null) {
currentUserId = "";
}
currentSession.setAttribute(CURRENT_USER_MARKER, currentUserId);
}
currentSession.setUserId(userId);
currentSession.setActive();
sessionManager.setCurrentSession(currentSession);
authzGroupService.refreshUser(userId);
return getUserRefFromUserId(currentUserId);
}
内容来源于网络,如有侵权,请联系作者删除!