|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.pow2.user.UserManager
Manage the User entities.
This class is a facade to the user package functions.
Field Summary | |
static String |
USER_KEY
Session User key |
Method Summary | |
void |
deleteUser(HttpServletRequest request)
Remove the current user from the Session context. |
void |
deleteUser(String id)
Remove the User entry having the input identifier from the database. |
User |
getUser(HttpServletRequest request)
Retrieve the User object from the Session context. |
User |
getUser(HttpServletRequest request,
boolean authenticate)
Get the User object. |
User |
getUser(String login,
String passwd)
Retrieve a registered User object from the database. |
static UserManager |
instance()
Get the unique instance of UserManager class. |
void |
setGuestUser(HttpServletRequest request)
Set a guest user into the session context. |
void |
setGuestUser(HttpServletRequest request,
Class userClass)
Set a guest user into the session context. |
void |
setUser(HttpServletRequest request,
User user)
Store the input User object into the session context. |
void |
setUser(User user)
Persist the user informations into the database. |
void |
setUser(User user,
RegistrationForm form,
boolean update)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final String USER_KEY
Method Detail |
public static UserManager instance()
public User getUser(HttpServletRequest request)
request
- Description of the Parameter
public User getUser(String login, String passwd) throws Exception
login
- the user loginpasswd
- the user password
Exception
public User getUser(HttpServletRequest request, boolean authenticate) throws Exception
authenticate
is true:
login
and passwd
parameters, update the login
and passwd
user properties with that values.
getProfile
.
request
- the HttpServletRequest objectauthenticate
- true if the user must be authenticated versus the user database;
false otherwise.
Exception
public void deleteUser(HttpServletRequest request)
request
- Description of the Parameterpublic void deleteUser(String id)
id
- the identifier of the User entry to remove
from the databasepublic void setGuestUser(HttpServletRequest request) throws Exception
setGuestUser
creates and place the new not-authenticated user into the session context.
request
- the HttpServletRequest object
Exception
- if any error occurspublic void setGuestUser(HttpServletRequest request, Class userClass) throws Exception
setGuestUser
creates and place the new not-authenticated user into the session context.
request
- the HttpServletRequest objectuserClass
- the class of the User object to store into the session context.
The class MUST extends com.pow2.user.User
.
Exception
- if any error occurspublic void setUser(HttpServletRequest request, User user)
request
- the HttpServletRequest request used to retrieve the current
Session object or to create a new oneuser
- the user object to store into the Session contextpublic void setUser(User user)
user
- the user object to persist into the databasepublic void setUser(User user, RegistrationForm form, boolean update)
user
-
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |