|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface UserUtil
This is a back end service level interface that defines an API for user level operations.
| Nested Class Summary | |
|---|---|
static interface |
UserUtil.PasswordResetToken
|
static interface |
UserUtil.PasswordResetTokenValidation
|
| Field Summary | |
|---|---|
static String |
META_PROPERTY_PREFIX
|
| Method Summary | |
|---|---|
void |
addToJiraUsePermission(User user)
Deprecated. Use addToJiraUsePermission(com.atlassian.crowd.embedded.api.User) instead. Since v4.3 |
void |
addToJiraUsePermission(com.atlassian.crowd.embedded.api.User user)
Takes the given user and adds him/her to all the groups that grant a user the global JIRA use permission. |
void |
addUserToGroup(com.atlassian.crowd.embedded.api.Group group,
com.atlassian.crowd.embedded.api.User userToAdd)
This is used to add a specified user to a specified group. |
void |
addUserToGroup(Group group,
User userToAdd)
Deprecated. Use addUserToGroup(com.atlassian.crowd.embedded.api.Group, com.atlassian.crowd.embedded.api.User) instead. Since v4.3 |
void |
addUserToGroups(Collection<Group> groups,
User userToAdd)
Deprecated. Use addUserToGroups(java.util.Collection, com.atlassian.crowd.embedded.api.User) instead. Since v4.3 |
void |
addUserToGroups(Collection<com.atlassian.crowd.embedded.api.Group> groups,
com.atlassian.crowd.embedded.api.User userToAdd)
This is used to add a user to many groups at once. |
boolean |
canActivateNumberOfUsers(int numUsers)
Returns true if, after adding the specified number of users, the number of active users in JIRA does not exceed the user limit allowed by the license. |
boolean |
canActivateUsers(Collection<String> userNames)
Returns true if, after adding the specified users, the number of active users in JIRA does not exceed the user limit allowed by the license. |
void |
changePassword(User user,
String newPassword)
Deprecated. Use changePassword(com.atlassian.crowd.embedded.api.User, String) instead. Since v4.3 |
void |
changePassword(com.atlassian.crowd.embedded.api.User user,
String newPassword)
Can be called to set the password for a user. |
void |
clearActiveUserCount()
Clears the cache of the active user count so that it can be recalculated. |
User |
createUserNoEvent(String username,
String password,
String email,
String fullname)
Deprecated. Please use createUserNoNotification(String, String, String, String). Since v4.3 |
com.atlassian.crowd.embedded.api.User |
createUserNoNotification(String username,
String password,
String emailAddress,
String displayName)
Creates a User from supplied details. |
com.atlassian.crowd.embedded.api.User |
createUserNoNotification(String username,
String password,
String emailAddress,
String displayName,
Long directoryId)
Creates a User from supplied details. |
User |
createUserWithEvent(String username,
String password,
String email,
String fullname,
int userEventType)
Deprecated. Please use createUserWithNotification(String, String, String, String, int). Since v4.3 |
com.atlassian.crowd.embedded.api.User |
createUserWithNotification(String username,
String password,
String email,
String fullname,
int userEventType)
Creates a User from supplied details. |
com.atlassian.crowd.embedded.api.User |
createUserWithNotification(String username,
String password,
String email,
String fullname,
Long directoryId,
int userEventType)
Creates a User from supplied details. |
UserUtil.PasswordResetToken |
generatePasswordResetToken(com.atlassian.crowd.embedded.api.User user)
This is used to generate a reset password token that last a certain time and allows a person to access a page anonymously so they can reset their password. |
UserUtil.PasswordResetToken |
generatePasswordResetToken(User user)
This is used to generate a reset password token that last a certain time and allows a person to access a page anonymously so they can reset their password. |
int |
getActiveUserCount()
Returns the number of users that are currently 'active'. |
Collection<User> |
getAdministrators()
Deprecated. Since v4.3. Use getJiraAdministrators(). |
Set<User> |
getAllUsers()
Deprecated. Since v4.3. Use getUsers(). |
SortedSet<com.atlassian.crowd.embedded.api.User> |
getAllUsersInGroupNames(Collection<String> groupNames)
Returns a collection of User objects that belong to any of the passed in collection of group names. |
SortedSet<com.atlassian.crowd.embedded.api.User> |
getAllUsersInGroups(Collection<com.atlassian.crowd.embedded.api.Group> groups)
Returns a collection of User objects that are found within the passed in collection of Group objects. |
Collection<ProjectComponent> |
getComponentsUserLeads(User user)
Deprecated. Use getComponentsUserLeads(com.atlassian.crowd.embedded.api.User) instead. Since v4.3 |
Collection<ProjectComponent> |
getComponentsUserLeads(com.atlassian.crowd.embedded.api.User user)
Retrieve a collection of ProjectComponents - where the lead of each component is the specified user. |
String |
getDisplayableNameSafely(com.atlassian.crowd.embedded.api.User user)
Takes the given user and returns a "displayable name" by cautiously checking the different edge cases for users. |
String |
getDisplayableNameSafely(User user)
Deprecated. Use getDisplayableNameSafely(com.atlassian.crowd.embedded.api.User) instead. Since v4.3 |
Group |
getGroup(String groupName)
Deprecated. Since v4.3. Use getGroupObject(String). |
SortedSet<String> |
getGroupNamesForUser(String userName)
Returns a collection of the names of the groups that the user belongs to. |
com.atlassian.crowd.embedded.api.Group |
getGroupObject(String groupName)
Returns a Group based on user name. |
SortedSet<com.atlassian.crowd.embedded.api.Group> |
getGroupsForUser(String userName)
Returns a collection of Group objects that the user belongs to. |
Collection<com.atlassian.crowd.embedded.api.User> |
getJiraAdministrators()
Returns a list of JIRA admin Users. |
Collection<com.atlassian.crowd.embedded.api.User> |
getJiraSystemAdministrators()
Returns a list of JIRA system admin Users. |
long |
getNumberOfAssignedIssuesIgnoreSecurity(com.atlassian.crowd.embedded.api.User loggedInUser,
com.atlassian.crowd.embedded.api.User user)
Returns number of issues assigned to user |
long |
getNumberOfAssignedIssuesIgnoreSecurity(User loggedInUser,
User user)
Deprecated. Use getNumberOfAssignedIssuesIgnoreSecurity(com.atlassian.crowd.embedded.api.User, com.atlassian.crowd.embedded.api.User) instead. Since v4.3 |
long |
getNumberOfReportedIssuesIgnoreSecurity(com.atlassian.crowd.embedded.api.User loggedInUser,
com.atlassian.crowd.embedded.api.User user)
Returns number of issues reported by user |
long |
getNumberOfReportedIssuesIgnoreSecurity(User loggedInUser,
User user)
Deprecated. Use getNumberOfReportedIssuesIgnoreSecurity(com.atlassian.crowd.embedded.api.User, com.atlassian.crowd.embedded.api.User) instead. Since v4.3 |
Collection<Project> |
getProjectsLeadBy(com.atlassian.crowd.embedded.api.User user)
Returns all the projects that leadUser is the project lead for. |
Collection<org.ofbiz.core.entity.GenericValue> |
getProjectsUserLeads(User user)
Deprecated. Use getProjectsLeadBy(com.atlassian.crowd.embedded.api.User) instead. Since v4.3 |
Collection<User> |
getSystemAdministrators()
Deprecated. Since v4.3. Use getJiraSystemAdministrators() . |
int |
getTotalUserCount()
Returns the total number of users defined in JIRA, regardless of whether they are active or not. |
User |
getUser(String userName)
Deprecated. Since v4.3. Use getUserObject(String) . |
com.atlassian.crowd.embedded.api.User |
getUserObject(String userName)
Returns a user based on user name. |
Collection<com.atlassian.crowd.embedded.api.User> |
getUsers()
Returns the all users defined in JIRA, regardless of whether they are active or not. |
SortedSet<User> |
getUsersInGroupNames(Collection<String> groupNames)
Deprecated. Use getAllUsersInGroupNames(java.util.Collection) instead. Since v4.3 |
SortedSet<User> |
getUsersInGroups(Collection<Group> groups)
Deprecated. Use getAllUsersInGroups(java.util.Collection) instead. Since v4.3 |
boolean |
hasExceededUserLimit()
Returns true if this JIRA instance has more active users, than allowed by the license. |
boolean |
isNonSysAdminAttemptingToDeleteSysAdmin(User loggedInUser,
User user)
Deprecated. Use isNonSysAdminAttemptingToDeleteSysAdmin(com.atlassian.crowd.embedded.api.User, com.atlassian.crowd.embedded.api.User) instead. Since v4.3 |
boolean |
isNonSysAdminAttemptingToDeleteSysAdmin(com.atlassian.crowd.embedded.api.User loggedInUser,
com.atlassian.crowd.embedded.api.User user)
Checking if user without SYSTEM_ADMIN rights tries to remove user with SYSTEM_ADMIN rights. |
void |
removeUser(com.atlassian.crowd.embedded.api.User loggedInUser,
com.atlassian.crowd.embedded.api.User user)
This will remove the user and removes the user from all the groups. |
void |
removeUser(User loggedInUser,
User user,
I18nHelper i18nBean)
Deprecated. Use removeUser(com.atlassian.crowd.embedded.api.User, com.atlassian.crowd.embedded.api.User) instead. Since v4.3 |
void |
removeUserFromGroup(Group group,
User userToRemove)
Deprecated. Use removeUserFromGroup(com.atlassian.crowd.embedded.api.Group, com.atlassian.crowd.embedded.api.User) instead. Since v4.3 |
void |
removeUserFromGroup(com.atlassian.crowd.embedded.api.Group group,
com.atlassian.crowd.embedded.api.User userToRemove)
This is used to remove a specified user from a specified group. |
void |
removeUserFromGroups(Collection<Group> groups,
User userToRemove)
Deprecated. Use removeUserFromGroups(java.util.Collection, com.atlassian.crowd.embedded.api.User) instead. Since v4.3 |
void |
removeUserFromGroups(Collection<com.atlassian.crowd.embedded.api.Group> groups,
com.atlassian.crowd.embedded.api.User userToRemove)
This is used to remove a user from many groups at once. |
boolean |
userExists(String userName)
Returns true if the a user exists with the specified userName |
UserUtil.PasswordResetTokenValidation |
validatePasswordResetToken(com.atlassian.crowd.embedded.api.User user,
String token)
This can be called to validate a token against the user. |
| Field Detail |
|---|
static final String META_PROPERTY_PREFIX
| Method Detail |
|---|
int getTotalUserCount()
@NotNull Set<User> getAllUsers()
getUsers().
WARNING: This method will be changed in the future to return a set of Crowd User objects. Since v4.3.
@NotNull Collection<com.atlassian.crowd.embedded.api.User> getUsers()
WARNING: This method will be changed in the future to return a set of Crowd User objects. Since v4.3.
Group getGroup(@Nullable
String groupName)
getGroupObject(String).
Group based on user name.
WARNING: This method will be changed in the future to return a Crowd Group object. Since v4.3.
groupName - the user name of the group
com.atlassian.crowd.embedded.api.Group getGroupObject(@Nullable
String groupName)
Group based on user name.
WARNING: This method will be changed in the future to return a Crowd Group object. Since v4.3.
groupName - the user name of the group
User createUserWithEvent(String username,
String password,
String email,
String fullname,
int userEventType)
throws ImmutableException
createUserWithNotification(String, String, String, String, int). Since v4.3
Email notification will be send to created user.
username - The username of the new user. Needs to be lowercase and unique.password - The password for the new user.email - The email for the new user. Needs to be a valid email address.fullname - The full name for the new useruserEventType - The event type dispatched on user creation
ImmutableException - Generic exception ocurred when creating the user
com.atlassian.crowd.embedded.api.User createUserWithNotification(String username,
String password,
String email,
String fullname,
int userEventType)
throws PermissionException,
CreateException
Email notification will be send to created user.
username - The username of the new user. Needs to be lowercase and unique.password - The password for the new user.email - The email for the new user. Needs to be a valid email address.fullname - The full name for the new useruserEventType - The event type dispatched on user creation
PermissionException - If the operation was not permitted.
CreateException
com.atlassian.crowd.embedded.api.User createUserWithNotification(String username,
String password,
String email,
String fullname,
Long directoryId,
int userEventType)
throws PermissionException,
CreateException
Email notification will be send to created user.
username - The username of the new user. Needs to be lowercase and unique.password - The password for the new user.email - The email for the new user. Needs to be a valid email address.fullname - The full name for the new userdirectoryId - The directory to create the user in. Null means "first writable directory".userEventType - The event type dispatched on user creation
PermissionException - If the operation was not permitted.
CreateException
User createUserNoEvent(String username,
String password,
String email,
String fullname)
throws ImmutableException
createUserNoNotification(String, String, String, String). Since v4.3
No email notification will be send to created user.
username - The username of the new user. Needs to be lowercase and unique.password - The password for the new user.email - The email for the new user. Needs to be a valid email address.fullname - The full name for the new user
ImmutableException - Generic exception occurred when creating the user
com.atlassian.crowd.embedded.api.User createUserNoNotification(String username,
String password,
String emailAddress,
String displayName)
throws PermissionException,
CreateException
No email notification will be send to created user.
username - The username of the new user. Needs to be lowercase and unique.password - The password for the new user.emailAddress - The email for the new user. Needs to be a valid email address.displayName - The display name for the new user
PermissionException - If the operation was not permitted.
CreateException
com.atlassian.crowd.embedded.api.User createUserNoNotification(String username,
String password,
String emailAddress,
String displayName,
Long directoryId)
throws PermissionException,
CreateException
No email notification will be send to created user.
username - The username of the new user. Needs to be lowercase and unique.password - The password for the new user.emailAddress - The email for the new user. Needs to be a valid email address.displayName - The display name for the new userdirectoryId - The directory to create the user in. Null means "first writable directory".
PermissionException - If the operation was not permitted.
CreateException
void removeUser(com.atlassian.crowd.embedded.api.User loggedInUser,
com.atlassian.crowd.embedded.api.User user)
loggedInUser - the user performing operationuser - the user to delete
void removeUser(User loggedInUser,
User user,
I18nHelper i18nBean)
removeUser(com.atlassian.crowd.embedded.api.User, com.atlassian.crowd.embedded.api.User) instead. Since v4.3
loggedInUser - user performing operationuser - the user to deletei18nBean - unused may as well be null
void addUserToGroup(com.atlassian.crowd.embedded.api.Group group,
com.atlassian.crowd.embedded.api.User userToAdd)
throws PermissionException,
AddException
group - the group to add the user to.userToAdd - the user to add to the group.
PermissionException
AddException
void addUserToGroup(Group group,
User userToAdd)
addUserToGroup(com.atlassian.crowd.embedded.api.Group, com.atlassian.crowd.embedded.api.User) instead. Since v4.3
group - the group to add the user to.userToAdd - the user to add to the group.
void addUserToGroups(Collection<Group> groups,
User userToAdd)
addUserToGroups(java.util.Collection, com.atlassian.crowd.embedded.api.User) instead. Since v4.3
groups - a list containing the groups to add the user to.userToAdd - the user to add to the group.
void addUserToGroups(Collection<com.atlassian.crowd.embedded.api.Group> groups,
com.atlassian.crowd.embedded.api.User userToAdd)
throws PermissionException,
AddException
groups - a list containing the groups to add the user to.userToAdd - the user to add to the group.
PermissionException
AddException
void removeUserFromGroup(Group group,
User userToRemove)
removeUserFromGroup(com.atlassian.crowd.embedded.api.Group, com.atlassian.crowd.embedded.api.User) instead. Since v4.3
group - the group to add the user to.userToRemove - the user to add to the group.
void removeUserFromGroup(com.atlassian.crowd.embedded.api.Group group,
com.atlassian.crowd.embedded.api.User userToRemove)
throws PermissionException,
RemoveException
group - the group to add the user to.userToRemove - the user to add to the group.
PermissionException
RemoveException
void removeUserFromGroups(Collection<Group> groups,
User userToRemove)
removeUserFromGroups(java.util.Collection, com.atlassian.crowd.embedded.api.User) instead. Since v4.3
groups - a list containing the groups to add the user to.userToRemove - the user to add to the group.
void removeUserFromGroups(Collection<com.atlassian.crowd.embedded.api.Group> groups,
com.atlassian.crowd.embedded.api.User userToRemove)
throws PermissionException,
RemoveException
groups - a list containing the groups to add the user to.userToRemove - the user to add to the group.
PermissionException
RemoveExceptionUserUtil.PasswordResetToken generatePasswordResetToken(com.atlassian.crowd.embedded.api.User user)
user - the user in question. This MUST not be null
UserUtil.PasswordResetToken generatePasswordResetToken(User user)
user - the user in question. This MUST not be null
UserUtil.PasswordResetTokenValidation validatePasswordResetToken(com.atlassian.crowd.embedded.api.User user,
String token)
user - the user in playtoken - the token they provided
void changePassword(User user,
String newPassword)
throws ImmutableException
changePassword(com.atlassian.crowd.embedded.api.User, String) instead. Since v4.3
user - the user in playnewPassword - their new password
ImmutableException - when the underlying user provider does not allow password change
void changePassword(com.atlassian.crowd.embedded.api.User user,
String newPassword)
throws com.atlassian.crowd.exception.UserNotFoundException,
com.atlassian.crowd.exception.InvalidCredentialException,
com.atlassian.crowd.exception.OperationNotPermittedException,
PermissionException
user - the user in playnewPassword - their new password
com.atlassian.crowd.exception.UserNotFoundException - if the user does not exist
com.atlassian.crowd.exception.InvalidCredentialException - if the password is invalid
com.atlassian.crowd.exception.OperationNotPermittedException - if the underlying User Directory is read-only
PermissionExceptionint getActiveUserCount()
clearActiveUserCount() to clear the cache.
Please note that the calculation will be run if the license does not specify a user limit.
Permissionsvoid clearActiveUserCount()
boolean hasExceededUserLimit()
boolean canActivateNumberOfUsers(int numUsers)
numUsers - the number of users to add to the JIRA instance. If 0, all things being equal, this method will
return true. Must not be negative!
boolean canActivateUsers(Collection<String> userNames)
userNames - the names of the users to add to the JIRA instance. Must not be null!
User getUser(String userName)
getUserObject(String) .
WARNING: This method will be changed in the future to return a Crowd User object. Since v4.3.
userName - the user name of the user
com.atlassian.crowd.embedded.api.User getUserObject(String userName)
WARNING: This method will be changed in the future to return a Crowd User object. Since v4.3.
userName - the user name of the user
boolean userExists(String userName)
userName - the name of the user
Collection<User> getAdministrators()
getJiraAdministrators().
Users.
WARNING: This method will be changed in the future to return a Collection of Crowd User objects. Since v4.3.
Users.Collection<com.atlassian.crowd.embedded.api.User> getJiraAdministrators()
Users.
WARNING: This method will be changed in the future to return a Collection of Crowd User objects. Since v4.3.
Users.Collection<User> getSystemAdministrators()
getJiraSystemAdministrators() .
Users.
WARNING: This method will be changed in the future to return a Collection of Crowd User objects. Since v4.3.
User's that are associated with the Permissions.SYSTEM_ADMIN permission.Collection<com.atlassian.crowd.embedded.api.User> getJiraSystemAdministrators()
Users.
WARNING: This method will be changed in the future to return a Collection of Crowd User objects. Since v4.3.
User's that are associated with the Permissions.SYSTEM_ADMIN permission.void addToJiraUsePermission(User user)
addToJiraUsePermission(com.atlassian.crowd.embedded.api.User) instead. Since v4.3
Permissions.USE) Note: operation is only performed if by doing so we will not
exceed the user limit (if the current license happens to specify a limit)
user - The user to be added to the USE permission
void addToJiraUsePermission(com.atlassian.crowd.embedded.api.User user)
throws PermissionException
Permissions.USE) Note: operation is only performed if by doing so we will not
exceed the user limit (if the current license happens to specify a limit)
user - The user to be added to the USE permission
PermissionExceptionCollection<ProjectComponent> getComponentsUserLeads(User user)
getComponentsUserLeads(com.atlassian.crowd.embedded.api.User) instead. Since v4.3
user - User leading components
Collection<ProjectComponent> getComponentsUserLeads(com.atlassian.crowd.embedded.api.User user)
user - User leading components
Collection<org.ofbiz.core.entity.GenericValue> getProjectsUserLeads(User user)
getProjectsLeadBy(com.atlassian.crowd.embedded.api.User) instead. Since v4.3
user - the user in play
GenericValuesCollection<Project> getProjectsLeadBy(com.atlassian.crowd.embedded.api.User user)
user - the user in play
GenericValues
boolean isNonSysAdminAttemptingToDeleteSysAdmin(User loggedInUser,
User user)
isNonSysAdminAttemptingToDeleteSysAdmin(com.atlassian.crowd.embedded.api.User, com.atlassian.crowd.embedded.api.User) instead. Since v4.3
loggedInUser - User performing operationuser - User for remove
boolean isNonSysAdminAttemptingToDeleteSysAdmin(com.atlassian.crowd.embedded.api.User loggedInUser,
com.atlassian.crowd.embedded.api.User user)
loggedInUser - User performing operationuser - User for remove
long getNumberOfReportedIssuesIgnoreSecurity(com.atlassian.crowd.embedded.api.User loggedInUser,
com.atlassian.crowd.embedded.api.User user)
throws SearchException
loggedInUser - the logged in useruser - the user to find the issue count for
SearchException - if something goes wrong
long getNumberOfReportedIssuesIgnoreSecurity(User loggedInUser,
User user)
throws SearchException
getNumberOfReportedIssuesIgnoreSecurity(com.atlassian.crowd.embedded.api.User, com.atlassian.crowd.embedded.api.User) instead. Since v4.3
loggedInUser - the logged in useruser - the user to find the issue count for
SearchException - if something goes wrong
long getNumberOfAssignedIssuesIgnoreSecurity(com.atlassian.crowd.embedded.api.User loggedInUser,
com.atlassian.crowd.embedded.api.User user)
throws SearchException
loggedInUser - the logged in useruser - the user to find the issue count for
SearchException - if something goes wrong
long getNumberOfAssignedIssuesIgnoreSecurity(User loggedInUser,
User user)
throws SearchException
getNumberOfAssignedIssuesIgnoreSecurity(com.atlassian.crowd.embedded.api.User, com.atlassian.crowd.embedded.api.User) instead. Since v4.3
loggedInUser - the logged in useruser - the user to find the issue count for
SearchException - if something goes wrongString getDisplayableNameSafely(com.atlassian.crowd.embedded.api.User user)
user - the user. May be null.
String getDisplayableNameSafely(User user)
getDisplayableNameSafely(com.atlassian.crowd.embedded.api.User) instead. Since v4.3
user - the user. May be null.
SortedSet<com.atlassian.crowd.embedded.api.Group> getGroupsForUser(String userName)
Group objects that the user belongs to.
userName - A User name
SortedSet<String> getGroupNamesForUser(String userName)
userName - A User name
SortedSet<com.atlassian.crowd.embedded.api.User> getAllUsersInGroupNames(Collection<String> groupNames)
User objects that belong to any of the passed in collection of group names.
groupNames - a collection of group name strings
UserBestNameComparator
orderSortedSet<User> getUsersInGroupNames(Collection<String> groupNames)
getAllUsersInGroupNames(java.util.Collection) instead. Since v4.3
User objects that are found within the passed in collection
of group names. Null users are excluded even if they exist in the underlying data.
groupNames - a collection of group name strings
SortedSet<com.atlassian.crowd.embedded.api.User> getAllUsersInGroups(Collection<com.atlassian.crowd.embedded.api.Group> groups)
User objects that are found within the passed in collection of Group objects.
groups - a collection of Group objects
UserBestNameComparator
orderSortedSet<User> getUsersInGroups(Collection<Group> groups)
getAllUsersInGroups(java.util.Collection) instead. Since v4.3
User objects that are found within the passed in collection
of Group objects. Null users are excluded even if they exist in the underlying data.
groups - a collection of Group objects
UserBestNameComparator
order
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||