|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.atlassian.core.user.UserUtils
UserUtils instead. Since v4.4.
public class UserUtils
A utility class for operating on users.
GroupUtils| Constructor Summary | |
|---|---|
UserUtils()
Deprecated. |
|
| Method Summary | |
|---|---|
static void |
changePassword(User user,
String password)
Deprecated. Changes the password for a given user. |
static User |
createUser(String username,
String email)
Deprecated. This method is used when a user is created automatically, or by another user (for example an administrator). |
static User |
createUser(String username,
String email,
String fullname)
Deprecated. This method is used when a user is created automatically, or by another user (for example an administrator). |
static User |
createUser(String username,
String password,
String email,
String fullname)
Deprecated. Generic method which actually creates users, and fires the given event. |
static User |
createUser(String username,
String password,
String email,
String fullname,
Collection groups)
Deprecated. Creates a new user with given attributes and associates the user with given collection of groups. |
static boolean |
existsUser(String username)
Deprecated. Checks if a user with given username exists. |
static Collection |
getAllUsers()
Deprecated. |
static User |
getUser(String username)
Deprecated. Retrieves and returns the user by given username. |
static User |
getUserByEmail(String email)
Deprecated. Return the first user found that matches thie email address. |
static Collection |
getUsers(Collection groups)
Deprecated. Get a list of users in a set of groups (either Group objects or String group names) |
static List |
getUsersByEmail(String email)
Deprecated. Finds the users by the given e-mail address. |
static void |
removeUser(User user)
Deprecated. Removes the given user. |
static String |
resetPassword(User user)
Deprecated. For a user, create a new password, and dispatch an 'forgot password' event |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public UserUtils()
| Method Detail |
|---|
public static User getUser(String username)
throws EntityNotFoundException
EntityNotFoundException.
username - usename to lookup
EntityNotFoundException - if user with given username not foundpublic static boolean existsUser(String username)
username - username to look up
public static Collection getAllUsers()
public static User getUserByEmail(String email)
throws EntityNotFoundException
email - user email
EntityNotFoundException - if no user is found.public static List getUsersByEmail(String email)
email - e-mail address
public static Collection getUsers(Collection groups)
groups - collection of groups (either Group objects or String group names)
User objects
public static User createUser(String username,
String email)
throws DuplicateEntityException,
ImmutableException
username - usernameemail - user's e-mail address
DuplicateEntityException - if user already exists
ImmutableException - if setting the user's password fails
public static User createUser(String username,
String email,
String fullname)
throws DuplicateEntityException,
ImmutableException
username - usernameemail - e-mail addressfullname - user's full name
DuplicateEntityException - if user already exists
ImmutableException - if setting the user's password fails
public static User createUser(String username,
String password,
String email,
String fullname)
throws DuplicateEntityException,
ImmutableException
username - usernamepassword - passwordemail - e-mail addressfullname - user's full name
DuplicateEntityException - if user already exists
ImmutableException - if setting the user's password fails
public static User createUser(String username,
String password,
String email,
String fullname,
Collection groups)
throws DuplicateEntityException,
ImmutableException
username - usernamepassword - passwodemail - e-mail addressfullname - user's full namegroups - group names (String objects) the user will belong to
DuplicateEntityException - if user already exists
ImmutableException - if setting the user's password fails
public static void removeUser(User user)
throws Exception
ImmutableException is thrown if given user cannot be removed.
user - user to remove
Exception - if user cannot be removed
public static String resetPassword(User user)
throws ImmutableException
user - The user whose password needs to be reset.
ImmutableException - if password cannot be changed
public static void changePassword(User user,
String password)
throws ImmutableException
user - user to change password forpassword - new password
ImmutableException - if password cannot be changed
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||