org.xlightweb.server
Class SessionManager

Package class diagram package SessionManager
java.lang.Object
  extended by org.xlightweb.server.SessionManager
All Implemented Interfaces:
Closeable, ISessionManager

public class SessionManager
extends Object
implements ISessionManager

In-memory SessionManager implementation.


Field Summary
static Logger LOG
           
 
Constructor Summary
SessionManager()
          constructor
 
Method Summary
 void close()
          
 int getNumCreatedSessions()
           
 int getNumExpiredSessions()
           
 int getNumRemovedSessions()
           
 HttpSession getSession(String sessionId)
          returns the session for a session id
 Map<String,HttpSession> getSessionMap()
          return the session map
 boolean isEmtpy()
          returns true, if no session exists
 String newSession(String idPrefix)
          creates a new session
 void registerSession(HttpSession session)
          registers a session
 void removeSession(String sessionId)
          removes a session
 void saveSession(String sessionId)
          save the session
 String toString()
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

LOG

public static final Logger LOG
Constructor Detail

SessionManager

public SessionManager()
constructor

Method Detail

isEmtpy

public boolean isEmtpy()
returns true, if no session exists

Specified by:
isEmtpy in interface ISessionManager
Returns:
true, if no session exists

getSession

public HttpSession getSession(String sessionId)
returns the session for a session id

Specified by:
getSession in interface ISessionManager
Parameters:
sessionId - the session id
Returns:
the session or null

getSessionMap

public Map<String,HttpSession> getSessionMap()
return the session map

Specified by:
getSessionMap in interface ISessionManager
Returns:
the session map

registerSession

public void registerSession(HttpSession session)
                     throws IOException
registers a session

Specified by:
registerSession in interface ISessionManager
Parameters:
session - the session
Throws:
IOException - if an exception occurs

saveSession

public void saveSession(String sessionId)
                 throws IOException
save the session

Specified by:
saveSession in interface ISessionManager
Throws:
IOException - if an exception occurs

newSession

public String newSession(String idPrefix)
                  throws IOException
creates a new session

Specified by:
newSession in interface ISessionManager
Parameters:
idPrefix - the id prefix
Returns:
the session id
Throws:
IOException - if an exception occurs

removeSession

public void removeSession(String sessionId)
removes a session

Specified by:
removeSession in interface ISessionManager

close

public void close()

Specified by:
close in interface Closeable

getNumCreatedSessions

public int getNumCreatedSessions()

getNumRemovedSessions

public int getNumRemovedSessions()

getNumExpiredSessions

public int getNumExpiredSessions()

toString

public String toString()

Overrides:
toString in class Object