public class DefaultUserService extends Object implements UserService
UserService
interface. Contains metohods to create/delete users hiding UserUtil internals.UserService.CreateUsernameValidationResult, UserService.CreateUserValidationResult, UserService.DeleteUserValidationResult, UserService.FieldName, UserService.UpdateUserValidationResult
Constructor and Description |
---|
DefaultUserService(UserUtil userUtil,
UserDeleteVeto userDeleteVeto,
PermissionManager permissionManager,
UserManager userManager,
JiraContactHelper jiraContactHelper,
I18nHelper.BeanFactory i18nFactory,
JiraAuthenticationContext jiraAuthenticationContext,
com.atlassian.event.api.EventPublisher eventPublisher,
PreDeleteUserErrorsManager preDeleteUserErrorsManager,
PasswordPolicyManager passwordPolicyManager) |
Modifier and Type | Method and Description |
---|---|
com.atlassian.crowd.embedded.api.User |
createUserFromSignup(UserService.CreateUserValidationResult result)
Given a valid validation result, this will create the user using the details provided in the validation result.
|
com.atlassian.crowd.embedded.api.User |
createUserNoNotification(UserService.CreateUserValidationResult result)
Given a valid validation result, this will create the user using the details provided in the validation result.
|
com.atlassian.crowd.embedded.api.User |
createUserWithNotification(UserService.CreateUserValidationResult result)
Given a valid validation result, this will create the user using the details provided in the validation result.
|
void |
removeUser(ApplicationUser loggedInUser,
UserService.DeleteUserValidationResult result)
Given a valid validation result, this will remove the user and removes the user from all the groups.
|
void |
removeUser(com.atlassian.crowd.embedded.api.User loggedInUser,
UserService.DeleteUserValidationResult result)
Given a valid validation result, this will remove the user and removes the user from all the groups.
|
void |
updateUser(UserService.UpdateUserValidationResult updateUserValidationResult)
Execute the update using the validation result from
UserService.validateUpdateUser(User) . |
UserService.CreateUserValidationResult |
validateCreateUserForAdmin(com.atlassian.crowd.embedded.api.User loggedInUser,
String username,
String password,
String confirmPassword,
String email,
String fullname)
Validates creating a user for the admin section.
|
UserService.CreateUserValidationResult |
validateCreateUserForAdmin(com.atlassian.crowd.embedded.api.User loggedInUser,
String username,
String password,
String confirmPassword,
String email,
String fullname,
Long directoryId)
Validates creating a user for the admin section.
|
UserService.CreateUserValidationResult |
validateCreateUserForAdminPasswordRequired(com.atlassian.crowd.embedded.api.User loggedInUser,
String username,
String password,
String confirmPassword,
String email,
String fullname)
Validates creating a user for RPC calls.
|
UserService.CreateUserValidationResult |
validateCreateUserForSetup(com.atlassian.crowd.embedded.api.User loggedInUser,
String username,
String password,
String confirmPassword,
String email,
String fullname)
Validates creating a user during setup of JIRA.
|
UserService.CreateUserValidationResult |
validateCreateUserForSignup(com.atlassian.crowd.embedded.api.User loggedInUser,
String username,
String password,
String confirmPassword,
String email,
String fullname)
Validates creating a user during public signup.
|
UserService.CreateUserValidationResult |
validateCreateUserForSignupOrSetup(com.atlassian.crowd.embedded.api.User loggedInUser,
String username,
String password,
String confirmPassword,
String email,
String fullname)
Validates creating a user during setup of JIRA or during public signup.
|
UserService.CreateUsernameValidationResult |
validateCreateUsername(com.atlassian.crowd.embedded.api.User loggedInUser,
String username)
Validates the username for a new user.
|
UserService.CreateUsernameValidationResult |
validateCreateUsername(com.atlassian.crowd.embedded.api.User loggedInUser,
String username,
Long directoryId)
Validates the username for a new user.
|
UserService.DeleteUserValidationResult |
validateDeleteUser(ApplicationUser loggedInUser,
ApplicationUser userForDelete)
Validates removing a user for the admin section.
|
UserService.DeleteUserValidationResult |
validateDeleteUser(ApplicationUser loggedInUser,
String username)
Validates removing a user for the admin section.
|
UserService.DeleteUserValidationResult |
validateDeleteUser(com.atlassian.crowd.embedded.api.User loggedInUser,
String username)
Validates removing a user for the admin section.
|
UserService.UpdateUserValidationResult |
validateUpdateUser(ApplicationUser user)
Validates updating a user's details.
|
UserService.UpdateUserValidationResult |
validateUpdateUser(com.atlassian.crowd.embedded.api.User user)
Validates updating a user's details.
|
public DefaultUserService(UserUtil userUtil, UserDeleteVeto userDeleteVeto, PermissionManager permissionManager, UserManager userManager, JiraContactHelper jiraContactHelper, I18nHelper.BeanFactory i18nFactory, JiraAuthenticationContext jiraAuthenticationContext, com.atlassian.event.api.EventPublisher eventPublisher, PreDeleteUserErrorsManager preDeleteUserErrorsManager, PasswordPolicyManager passwordPolicyManager)
public UserService.CreateUserValidationResult validateCreateUserForSignup(com.atlassian.crowd.embedded.api.User loggedInUser, String username, String password, String confirmPassword, String email, String fullname)
UserService
validateCreateUserForSignup
in interface UserService
loggedInUser
- The remote user trying to add a new userusername
- The username of the new user. Needs to be lowercase and unique.password
- The password for the new user.confirmPassword
- The password confirmation. Needs to match password.email
- The email for the new user. Needs to be a valid email address.fullname
- The full name for the new userpublic UserService.CreateUserValidationResult validateCreateUserForSetup(com.atlassian.crowd.embedded.api.User loggedInUser, String username, String password, String confirmPassword, String email, String fullname)
UserService
validateCreateUserForSetup
in interface UserService
loggedInUser
- The remote user trying to add a new userusername
- The username of the new user. Needs to be lowercase and unique.password
- The password for the new user.confirmPassword
- The password confirmation. Needs to match password.email
- The email for the new user. Needs to be a valid email address.fullname
- The full name for the new userpublic UserService.CreateUserValidationResult validateCreateUserForSignupOrSetup(com.atlassian.crowd.embedded.api.User loggedInUser, String username, String password, String confirmPassword, String email, String fullname)
UserService
validateCreateUserForSignupOrSetup
in interface UserService
loggedInUser
- The remote user trying to add a new userusername
- The username of the new user. Needs to be lowercase and unique.password
- The password for the new user.confirmPassword
- The password confirmation. Needs to match password.email
- The email for the new user. Needs to be a valid email address.fullname
- The full name for the new userpublic UserService.CreateUserValidationResult validateCreateUserForAdminPasswordRequired(com.atlassian.crowd.embedded.api.User loggedInUser, String username, String password, String confirmPassword, String email, String fullname)
UserService
validateCreateUserForAdminPasswordRequired
in interface UserService
loggedInUser
- The remote user trying to add a new userusername
- The username of the new user. Needs to be lowercase and unique.password
- The password for the new user.confirmPassword
- The password confirmation. Needs to match password.email
- The email for the new user. Needs to be a valid email address.fullname
- The full name for the new userpublic UserService.CreateUserValidationResult validateCreateUserForAdmin(com.atlassian.crowd.embedded.api.User loggedInUser, String username, String password, String confirmPassword, String email, String fullname)
UserService
validateCreateUserForAdmin
in interface UserService
loggedInUser
- The remote user trying to add a new userusername
- The username of the new user. Needs to be lowercase and unique.password
- The password for the new user.confirmPassword
- The password confirmation. Needs to match password.email
- The email for the new user. Needs to be a valid email address.fullname
- The full name for the new userpublic UserService.CreateUserValidationResult validateCreateUserForAdmin(com.atlassian.crowd.embedded.api.User loggedInUser, String username, String password, String confirmPassword, String email, String fullname, @Nullable Long directoryId)
UserService
validateCreateUserForAdmin
in interface UserService
loggedInUser
- The remote user trying to add a new userusername
- The username of the new user. Needs to be lowercase and unique.password
- The password for the new user.confirmPassword
- The password confirmation. Needs to match password.email
- The email for the new user. Needs to be a valid email address.fullname
- The full name for the new userdirectoryId
- The User Directorypublic UserService.CreateUsernameValidationResult validateCreateUsername(com.atlassian.crowd.embedded.api.User loggedInUser, String username)
UserService
validateCreateUsername
in interface UserService
loggedInUser
- The remote user trying to add a new userusername
- The username of the new user. Needs to be lowercase and unique.public UserService.CreateUsernameValidationResult validateCreateUsername(com.atlassian.crowd.embedded.api.User loggedInUser, String username, Long directoryId)
UserService
validateCreateUsername
in interface UserService
loggedInUser
- The remote user trying to add a new userusername
- The username of the new user. Needs to be lowercase and unique.directoryId
- The directory which the new user is intended to be created in.public com.atlassian.crowd.embedded.api.User createUserNoNotification(UserService.CreateUserValidationResult result) throws PermissionException, CreateException
UserService
createUserNoNotification
in interface UserService
result
- The validation resultPermissionException
- If you cannot create users in this directory (it is read-only).CreateException
- if the user could not be created, eg username already existspublic com.atlassian.crowd.embedded.api.User createUserFromSignup(UserService.CreateUserValidationResult result) throws PermissionException, CreateException
UserService
createUserFromSignup
in interface UserService
result
- The validation resultPermissionException
- If you cannot create users in this directory (it is read-only).CreateException
- if the user could not be created, eg username already existspublic com.atlassian.crowd.embedded.api.User createUserWithNotification(UserService.CreateUserValidationResult result) throws PermissionException, CreateException
UserService
createUserWithNotification
in interface UserService
result
- The validation resultPermissionException
- If you cannot create users in this directory (it is read-only).CreateException
- if the user could not be created, eg username already existspublic UserService.UpdateUserValidationResult validateUpdateUser(com.atlassian.crowd.embedded.api.User user)
UserService
validateUpdateUser
in interface UserService
user
- The user details to updatepublic UserService.UpdateUserValidationResult validateUpdateUser(ApplicationUser user)
UserService
validateUpdateUser
in interface UserService
user
- The user details to updatepublic void updateUser(UserService.UpdateUserValidationResult updateUserValidationResult)
UserService
UserService.validateUpdateUser(User)
.updateUser
in interface UserService
updateUserValidationResult
- Result from the validation, which also contains all the user's details.public UserService.DeleteUserValidationResult validateDeleteUser(com.atlassian.crowd.embedded.api.User loggedInUser, String username)
UserService
UserService.validateDeleteUser(ApplicationUser, ApplicationUser)
for restrictions.validateDeleteUser
in interface UserService
loggedInUser
- The remote user trying to remove a userusername
- The username of the user to remove. Needs to be validpublic UserService.DeleteUserValidationResult validateDeleteUser(ApplicationUser loggedInUser, String username)
UserService
UserService.validateDeleteUser(ApplicationUser, ApplicationUser)
for restrictions.validateDeleteUser
in interface UserService
loggedInUser
- The remote user trying to remove a userusername
- The username of the user to remove. Needs to be validpublic UserService.DeleteUserValidationResult validateDeleteUser(ApplicationUser loggedInUser, ApplicationUser userForDelete)
UserService
PreDeleteUserErrors
rejects the requestvalidateDeleteUser
in interface UserService
loggedInUser
- The remote user trying to remove a useruserForDelete
- The user to remove. Needs to be validpublic void removeUser(com.atlassian.crowd.embedded.api.User loggedInUser, UserService.DeleteUserValidationResult result)
UserService
removeUser
in interface UserService
loggedInUser
- the user performing operationresult
- The validation resultpublic void removeUser(ApplicationUser loggedInUser, UserService.DeleteUserValidationResult result)
UserService
removeUser
in interface UserService
loggedInUser
- the user performing operationresult
- The validation resultCopyright © 2002-2015 Atlassian. All Rights Reserved.