More tidying...
This commit is contained in:
parent
510cd5050f
commit
7fcdd4a6ff
|
@ -47,24 +47,21 @@ import javax.servlet.http.HttpSession;
|
||||||
* @author Ben Alex
|
* @author Ben Alex
|
||||||
* @version $Id$
|
* @version $Id$
|
||||||
*/
|
*/
|
||||||
public class SessionRegistryImpl implements SessionRegistry,
|
public class SessionRegistryImpl implements SessionRegistry, ApplicationListener {
|
||||||
ApplicationListener {
|
// ~ Instance fields ===============================================================================================
|
||||||
// ~ Instance fields
|
|
||||||
// ========================================================
|
|
||||||
|
|
||||||
private Map principals = Collections.synchronizedMap(new HashMap()); // <principal:Object,SessionIdSet>
|
private Map principals = Collections.synchronizedMap(new HashMap()); // <principal:Object,SessionIdSet>
|
||||||
private Map sessionIds = Collections.synchronizedMap(new HashMap()); // <sessionId:Object,SessionInformation>
|
private Map sessionIds = Collections.synchronizedMap(new HashMap()); // <sessionId:Object,SessionInformation>
|
||||||
|
|
||||||
// ~ Methods
|
// ~ Methods =======================================================================================================
|
||||||
// ================================================================
|
|
||||||
|
|
||||||
public Object[] getAllPrincipals() {
|
public Object[] getAllPrincipals() {
|
||||||
return principals.keySet().toArray();
|
return principals.keySet().toArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
public SessionInformation[] getAllSessions(Object principal,
|
public SessionInformation[] getAllSessions(Object principal, boolean includeExpiredSessions) {
|
||||||
boolean includeExpiredSessions) {
|
|
||||||
Set sessionsUsedByPrincipal = (Set) principals.get(principal);
|
Set sessionsUsedByPrincipal = (Set) principals.get(principal);
|
||||||
|
|
||||||
if (sessionsUsedByPrincipal == null) {
|
if (sessionsUsedByPrincipal == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@ -116,8 +113,7 @@ public class SessionRegistryImpl implements SessionRegistry,
|
||||||
removeSessionInformation(sessionId);
|
removeSessionInformation(sessionId);
|
||||||
}
|
}
|
||||||
|
|
||||||
sessionIds.put(sessionId, new SessionInformation(principal, sessionId,
|
sessionIds.put(sessionId, new SessionInformation(principal, sessionId, new Date()));
|
||||||
new Date()));
|
|
||||||
|
|
||||||
Set sessionsUsedByPrincipal = (Set) principals.get(principal);
|
Set sessionsUsedByPrincipal = (Set) principals.get(principal);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue