com.webtair.session
Class SessionMan<T extends SessionInfo>

java.lang.Object
  extended by com.webtair.session.SessionMan<T>

public class SessionMan<T extends SessionInfo>
extends java.lang.Object

Entry poin of SessionMan library. Class that implements all buisness logic for session management.

Author:
Vaclav (Vyacheslav Yakovenko)

Constructor Summary
SessionMan()
          Default constructor
SessionMan(ConfigBean config)
          Constructor that populate SessionMan by provided config information
 
Method Summary
static java.lang.String generateSessionId(java.lang.String login)
          Generates unique session id for current login
 boolean isSessionExpired(java.lang.String idSession)
          Check if session expired or not.
 java.lang.String putSessionInfo(java.lang.String login, T sessionInfo)
          Register new user at SessionMan's HashMap.
 void removeSession(java.lang.String idSession)
          Remove session from session handler map
 boolean validateSession(java.lang.String idSession)
          Check if session is alive and update lastSessionUsedTime if true.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SessionMan

public SessionMan(ConfigBean config)
Constructor that populate SessionMan by provided config information

Parameters:
config - - config bean

SessionMan

public SessionMan()
Default constructor

Method Detail

generateSessionId

public static java.lang.String generateSessionId(java.lang.String login)
Generates unique session id for current login

Parameters:
login -
Returns:
unique idSession

putSessionInfo

public java.lang.String putSessionInfo(java.lang.String login,
                                       T sessionInfo)
Register new user at SessionMan's HashMap. Each user can have so much sessions as he want.

Parameters:
user - - user info
Returns:
idSession - newly created session

validateSession

public boolean validateSession(java.lang.String idSession)
Check if session is alive and update lastSessionUsedTime if true.

Parameters:
idSession -
Returns:
true if session is alive, and false if idSession not found or session is expired.

isSessionExpired

public boolean isSessionExpired(java.lang.String idSession)
Check if session expired or not.

Parameters:
idSession -
Returns:
true if and only if session expired.

removeSession

public void removeSession(java.lang.String idSession)
Remove session from session handler map

Parameters:
idSession - - session id


Copyright © 2006 webtair.com . All Rights Reserved.