public class SessionManager extends ConcurrentHashMap<String,UserSession>
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
Modifier and Type | Method and Description |
---|---|
int |
countOpened()
Counts the number of opened sessions
|
UserSession |
get(Object sessionId) |
static SessionManager |
getInstance() |
List<UserSession> |
getSessions()
Returns the list of sessions ordered by ascending status and creation
date.
|
List<UserSession> |
getSessionsByUserObject(Object userObject)
Returns the list of sessions for the specified user object
|
boolean |
isValid(String sessionId)
Checks if a sessions is valid or not.
|
void |
kill(String sessionId)
Kills an existing session
|
String |
newSession(String username,
Object userObject)
Creates a new session and stores it in the pool of opened sessions.
|
UserSession |
remove(Object key) |
void |
renew(String sessionId)
Renews an opened session
|
clear, contains, containsKey, containsValue, elements, entrySet, isEmpty, keys, keySet, put, putAll, putIfAbsent, remove, replace, replace, size, values
clone, equals, hashCode, toString
public static final SessionManager getInstance()
public String newSession(String username, Object userObject)
username
- public void kill(String sessionId)
public UserSession remove(Object key)
remove
in interface Map<String,UserSession>
remove
in class ConcurrentHashMap<String,UserSession>
public void renew(String sessionId)
sessionId
- The session to be renewedpublic boolean isValid(String sessionId)
sessionId
- The session identifierpublic UserSession get(Object sessionId)
get
in interface Map<String,UserSession>
get
in class ConcurrentHashMap<String,UserSession>
public int countOpened()
public List<UserSession> getSessions()
public List<UserSession> getSessionsByUserObject(Object userObject)
Copyright © 2008-2014 Logical Objects. All Rights Reserved.