|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.activemath.webapp.user.account.AccountManager
public class AccountManager
Singleton to manage the accounts of ActiveMath's users.
It provides the methods needed to create, remove and tend the user's
accounts.
Delegates most of the work to UserStorage now.
| Field Summary | |
|---|---|
static String |
CHARSET
|
static Logger |
log
|
| Method Summary | |
|---|---|
boolean |
accountExists(String userId)
returns true if an account for the given userId exists,
false otherwise. |
void |
changePassword(String userId,
String newPassword)
Changes the password for the given user to newPassword. |
boolean |
checkAuthentication(String userId,
String password)
Returns true if the authentication of the user succeded,
false otherwise. |
boolean |
checkAuthentication(String userId,
String password,
boolean isHashed)
|
boolean |
checkAuthenticationHashed(String userId,
String password)
|
void |
createAccount(String userId,
String password)
Creates an account with the given userId, if it is not already taken. |
void |
createAccountNoCheck(String userId,
String password)
|
void |
destroyAccount(String userId)
Destroys the account of the user with the given userId. |
AccountInfo |
getAccountInfo(String userId)
Get the AccountInfo for the given userId from persistence. |
static AccountManager |
getInstance()
Gets the instance of the AccountManager singleton. |
List<String> |
listAccounts()
Returns a list of all registered userId's. |
List<String> |
listAccountsForGroup(String groupId)
Returns a list af registered userIds belonging to the supplied groupId |
List<String> |
listAccountsMatching(String filterText)
Returns a list af registered userIds matching filterText. |
List<String> |
listAccountsWithRole(String role)
Returns a list af registered userIds matching role |
List<String> |
listGroupsForTutor(String userId)
Returns a list of a tutor's groups. |
List<String> |
listZombieAccounts()
Returns a list of all userId's that have accounts but no user data |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final Logger log
public static final String CHARSET
| Method Detail |
|---|
public static AccountManager getInstance()
AccountManager singleton.
AccountManager instance
public void createAccount(String userId,
String password)
throws UsernameTakenException
userId - the desired userId to create an account forpassword - the password to assign to the new user
UsernameTakenException - if the userId was already taken.
public void createAccountNoCheck(String userId,
String password)
throws UsernameTakenException
UsernameTakenExceptionpublic void destroyAccount(String userId)
userId - The Id of the user account to be destroyedpublic AccountInfo getAccountInfo(String userId)
null.public boolean accountExists(String userId)
true if an account for the given userId exists,
false otherwise.
userId - The user id to check
true if such an account exists, false
otherwise.public List<String> listAccounts()
public List<String> listZombieAccounts()
public List<String> listAccountsForGroup(String groupId)
groupId
public List<String> listAccountsMatching(String filterText)
filterText.
The resulting list may return duplicates (AMATH-1898).
public List<String> listAccountsWithRole(String role)
role
public List<String> listGroupsForTutor(String userId)
public boolean checkAuthentication(String userId,
String password)
true if the authentication of the user succeded,
false otherwise.
If user is authenticated by the old IdentDB, his account
is migrated to this account manager.
userId - the userId to authenticatepassword - the supplied password to check (plain text)
true if authentication succeded,
false otherwise.
public boolean checkAuthenticationHashed(String userId,
String password)
public boolean checkAuthentication(String userId,
String password,
boolean isHashed)
public void changePassword(String userId,
String newPassword)
throws AccountManagerException
true if the modification succeeded, false
otherwise.
userId - The id of the user to update the pwd fornewPassword - The value of the new password
AccountManagerException - If there was no such user.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||