public Sessioninfo getSessioninfo(String sessionid) {
return sessionids.get(sessionid);
}
public void register(Authentication auth, String sessionid) throws SessionException {
Sessioninfo existed = getSessioninfo(sessionid);
String principal = auth.getName();
// 是否为重复注册
if (null != existed && ObjectUtils.equals(existed.getUsername(), principal)) return;
// 争取名额
boolean success = controller.onRegister(auth, sessionid, this);
if (!success) throw new SessionException("security.OvermaxSession");
// 注销同会话的其它账户
if (null != existed) {
existed.addRemark(" expired with replacement.");
remove(sessionid);
}
// 新生
sessionids.put(sessionid, sessioninfoBuilder.build(auth, controller.getServerName(), sessionid));
Set<String> sessionsUsedByPrincipal = principals.get(principal);