|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.openxava.util.Users
public class Users
Utilities to work with users.
| Constructor Summary | |
|---|---|
Users()
|
|
| Method Summary | |
|---|---|
static java.lang.String |
getCurrent()
The user name associated to the current thread. |
static java.util.prefs.Preferences |
getCurrentPreferences()
Preferences of the user associated to the current thread. |
static UserInfo |
getCurrentUserInfo()
Info about the current logged user. |
static void |
setCurrent(HttpServletRequest request)
Associated the user of the request to the current thread. |
static void |
setCurrent(java.lang.String userName)
Associated an user to the current thread. |
static void |
setCurrentUserInfo(UserInfo userInfo)
Associated the UserInfo object to the current thread. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Users()
| Method Detail |
|---|
public static java.lang.String getCurrent()
null if no user logged.
public static java.util.prefs.Preferences getCurrentPreferences()
throws java.util.prefs.BackingStoreException
You can use this preference for read and update user preferences, in this way:
// Obtain preferences for the current user and node (an arbitrary category of your choice).
Preferences preferences = Users.getCurrentPreferences().node("mynode");
// Read a property value
boolean rowsHidden = preferences.getBoolean(ROWS_HIDDEN, false);
// Modify and save a property
preferences.putBoolean(ROWS_HIDDEN, rowsHidden);
preferences.flush();
Remember, you must call flush() always in order to make persistent the changes in
preferences.
java.util.prefs.BackingStoreException - Some problem on load preferences.public static UserInfo getCurrentUserInfo()
It only returns meaningful info if we are inside a portal.
public static void setCurrent(java.lang.String userName)
public static void setCurrentUserInfo(UserInfo userInfo)
public static void setCurrent(HttpServletRequest request)
Takes into account JetSpeed 1.5 user managament, althought it's generic enought to work in any servlet container.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||