|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.web_auth.bizobj.impl.UserSession
An abstract class to model any type of user sessions. A user session is created after a user successful logs in. The user session then stores the user object in the session. The user object can be retrieved at any time before the session is expired or the user logs out.
Constructor Summary | |
UserSession()
|
Method Summary | |
boolean |
createSession(java.sql.Connection conn,
java.lang.String username)
Creates a user session. |
java.lang.String |
getId()
|
abstract int |
getSessionType()
Subclass needs to implement this method to return a unique int that represents the type of user session. |
IUser |
getUser(javax.servlet.http.HttpServletRequest request)
Get the IUser object from the current session |
void |
invalidateSession(java.sql.Connection conn)
Makes this user session invalid. |
static void |
InvalidateSession(java.sql.Connection conn,
java.lang.String sessId)
Makes a user session invalid. |
boolean |
isLoggedIn(java.sql.Connection conn,
javax.servlet.http.HttpServletRequest request)
Checked whether a user has logged in or not based on whether the current HTTP session is a valid or not. |
boolean |
isValidSession(java.sql.Connection conn)
Check whether the session object is a valid session or not. |
void |
setId(java.lang.String val)
|
void |
setUser(javax.servlet.http.HttpServletRequest request,
IUser user)
Set the User object to the current session. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public UserSession()
Method Detail |
public java.lang.String getId()
getId
in interface IUserSession
public void setId(java.lang.String val)
setId
in interface IUserSession
public abstract int getSessionType()
public IUser getUser(javax.servlet.http.HttpServletRequest request)
getUser
in interface IUserSession
request
- The HttpSevletRequest object that links to the current session
public void setUser(javax.servlet.http.HttpServletRequest request, IUser user)
setUser
in interface IUserSession
request
- The HttpSevletRequest object that links to the current sessionuser
- the IUser object to be setpublic boolean isValidSession(java.sql.Connection conn)
isValidSession
in interface IUserSession
conn
- the database connection object for connecting to the database
public boolean createSession(java.sql.Connection conn, java.lang.String username)
createSession
in interface IUserSession
conn
- the database connection object for connecting to the databaseusername
- the username associated to this session.
public static void InvalidateSession(java.sql.Connection conn, java.lang.String sessId)
conn
- the database connection object for connecting to the databasesessId
- the id of the session to be invalidatedpublic void invalidateSession(java.sql.Connection conn)
invalidateSession
in interface IUserSession
conn
- the database connection object for connecting to the databasepublic boolean isLoggedIn(java.sql.Connection conn, javax.servlet.http.HttpServletRequest request)
isLoggedIn
in interface IUserSession
conn
- the database connection object for connecting to the databaserequest
- an HttpServletRequest
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |