|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object ikrs.util.session.AbstractSessionManager<K,V,U> ikrs.util.session.DefaultSessionManager<K,V,U>
public class DefaultSessionManager<K,V,U>
The DefaultSessionManager is a very simple SessionManager implementation that uses a treemap to find sessions by their ID. The search for user IDs is linear! All methods are synchronized (this manager implementation acts like a monitor).
Constructor Summary | |
---|---|
DefaultSessionManager(SessionFactory<K,V,U> sessionFactory,
int sessionTimeout_seconds)
Create a new DefaultSessionManager (not thread safe). |
|
DefaultSessionManager(SessionFactory<K,V,U> sessionFactory,
int sessionTimeout_seconds,
boolean threadSafe)
Create a new DefaultSessionManager. |
Method Summary | |
---|---|
Session<K,V,U> |
bind(U userID)
This method tries to create a new session for the given user (ID). |
boolean |
destroy(java.util.UUID sessionID)
Thie methos destroys the session with the specified SID. |
Session<K,V,U> |
get(java.util.UUID sessionID)
Retrieve the session with the given SID. |
Methods inherited from class ikrs.util.session.AbstractSessionManager |
---|
getSessionFactory, getSessionIDMap, getSessionTimeout, getSessionUserMap, setSessionTimeout |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DefaultSessionManager(SessionFactory<K,V,U> sessionFactory, int sessionTimeout_seconds) throws java.lang.NullPointerException, java.lang.IllegalArgumentException
sessionFactory
- The session factory to use to create new sessions.sessionTimeout_seconds
- The number of seconds a session may be untouched before it dies.
java.lang.NullPointerException
- If the sessionFactory is null.
java.lang.IllegalArgumentException
- If sessionTimeout_seconds <= 0.public DefaultSessionManager(SessionFactory<K,V,U> sessionFactory, int sessionTimeout_seconds, boolean threadSafe) throws java.lang.NullPointerException, java.lang.IllegalArgumentException
sessionFactory
- The session factory to use to create new sessions.sessionTimeout_seconds
- The number of seconds a session may be untouched before it dies.threadSafe
- If set to true the internal session map will be
synchronized (thread safe).
java.lang.NullPointerException
- If the sessionFactory is null.
java.lang.IllegalArgumentException
- If sessionTimeout_seconds <= 0.Method Detail |
---|
public Session<K,V,U> get(java.util.UUID sessionID)
get
in interface SessionManager<K,V,U>
get
in class AbstractSessionManager<K,V,U>
sessionID
- The desired session's unique ID.
public boolean destroy(java.util.UUID sessionID)
destroy
in interface SessionManager<K,V,U>
destroy
in class AbstractSessionManager<K,V,U>
sessionID
- The unique ID of the session you want to destroy.
public Session<K,V,U> bind(U userID)
bind
in interface SessionManager<K,V,U>
bind
in class AbstractSessionManager<K,V,U>
userID
- The user (ID) to create the new session for.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |