com.atlassian.jira.bc.user
Interface UserService


public interface UserService

UserService provides User manipulation methods exposed for remote API and actions.

Since:
v4.0

Nested Class Summary
static class UserService.CreateUserValidationResult
           
static class UserService.DeleteUserValidationResult
           
static class UserService.FieldName
           
 
Method Summary
 User createUser(UserService.CreateUserValidationResult result)
          Deprecated. Please use createUserWithNotification(com.atlassian.jira.bc.user.UserService.CreateUserValidationResult) instead. Since v4.3
 User createUserForSignup(UserService.CreateUserValidationResult result)
          Deprecated. Please use createUserFromSignup(com.atlassian.jira.bc.user.UserService.CreateUserValidationResult) instead. Since v4.3
 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.
 User createUserNoEvent(UserService.CreateUserValidationResult result)
          Deprecated. Please use createUserNoNotification(com.atlassian.jira.bc.user.UserService.CreateUserValidationResult) instead. Since v4.3
 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(com.atlassian.crowd.embedded.api.User user, UserService.DeleteUserValidationResult result)
          Given a valid validation result, this will remove the user and removes the user from all the groups.
 void removeUser(User user, UserService.DeleteUserValidationResult result)
          Given a valid validation result, this will remove the user and removes the user from all the groups.
 UserService.CreateUserValidationResult validateCreateUserForAdmin(com.atlassian.crowd.embedded.api.User user, String username, String password, String confirmPassword, String email, String fullname)
          Validates creating a user for the admin section.
 UserService.CreateUserValidationResult validateCreateUserForAdmin(User user, 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 user, 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 user, String username, String password, String confirmPassword, String email, String fullname)
          Validates creating a user for RPC calls.
 UserService.CreateUserValidationResult validateCreateUserForAdminPasswordRequired(User user, String username, String password, String confirmPassword, String email, String fullname)
          Validates creating a user for RPC calls.
 UserService.CreateUserValidationResult validateCreateUserForSignupOrSetup(com.atlassian.crowd.embedded.api.User user, String username, String password, String confirmPassword, String email, String fullname)
          Validates creating a user during setup of JIRA or during public signup.
 UserService.CreateUserValidationResult validateCreateUserForSignupOrSetup(User user, String username, String password, String confirmPassword, String email, String fullname)
          Validates creating a user during setup of JIRA or during public signup.
 UserService.DeleteUserValidationResult validateDeleteUser(com.atlassian.crowd.embedded.api.User loggedInUser, String username)
          Validates removing a user for the admin section.
 UserService.DeleteUserValidationResult validateDeleteUser(User loggedInUser, String username)
          Validates removing a user for the admin section.
 

Method Detail

validateCreateUserForSignupOrSetup

UserService.CreateUserValidationResult validateCreateUserForSignupOrSetup(com.atlassian.crowd.embedded.api.User user,
                                                                          String username,
                                                                          String password,
                                                                          String confirmPassword,
                                                                          String email,
                                                                          String fullname)
Validates creating a user during setup of JIRA or during public signup. This method checks that external user management is disabled. It also validates that all parameters (username, email, fullname, password) have been provided. Email is also checked to ensure that it is a valid email address. The username is required to be lowercase characters only and unique. The confirmPassword has to match the password provided.

This validation differs from the 'ForAdminPasswordRequired' and 'ForAdmin' validations as follows:


validateCreateUserForSignupOrSetup

UserService.CreateUserValidationResult validateCreateUserForSignupOrSetup(User user,
                                                                          String username,
                                                                          String password,
                                                                          String confirmPassword,
                                                                          String email,
                                                                          String fullname)
Validates creating a user during setup of JIRA or during public signup. This method checks that external user management is disabled. It also validates that all parameters (username, email, fullname, password) have been provided. Email is also checked to ensure that it is a valid email address. The username is required to be lowercase characters only and unique. The confirmPassword has to match the password provided.

This validation differs from the 'ForAdminPasswordRequired' and 'ForAdmin' validations as follows:


validateCreateUserForAdminPasswordRequired

UserService.CreateUserValidationResult validateCreateUserForAdminPasswordRequired(com.atlassian.crowd.embedded.api.User user,
                                                                                  String username,
                                                                                  String password,
                                                                                  String confirmPassword,
                                                                                  String email,
                                                                                  String fullname)
Validates creating a user for RPC calls. This method checks that external user management is disabled and that the user performing the operation has global admin rights. It also validates that all parameters (username, email, fullname, password) have been provided. Email is also checked to ensure that it is a valid email address. The username is required to be lowercase characters only and unique. The confirmPassword has to match the password provided.

This validation differs from the 'ForSetup' and 'ForAdmin' validations as follows:


validateCreateUserForAdminPasswordRequired

UserService.CreateUserValidationResult validateCreateUserForAdminPasswordRequired(User user,
                                                                                  String username,
                                                                                  String password,
                                                                                  String confirmPassword,
                                                                                  String email,
                                                                                  String fullname)
Validates creating a user for RPC calls. This method checks that external user management is disabled and that the user performing the operation has global admin rights. It also validates that all parameters (username, email, fullname, password) have been provided. Email is also checked to ensure that it is a valid email address. The username is required to be lowercase characters only and unique. The confirmPassword has to match the password provided.

This validation differs from the 'ForSetup' and 'ForAdmin' validations as follows:


validateCreateUserForAdmin

UserService.CreateUserValidationResult validateCreateUserForAdmin(com.atlassian.crowd.embedded.api.User user,
                                                                  String username,
                                                                  String password,
                                                                  String confirmPassword,
                                                                  String email,
                                                                  String fullname)
Validates creating a user for the admin section. This method checks that external user management is disabled and that the user performing the operation has global admin rights. It also validates that all parameters (username, email, fullname) except for the password have been provided. Email is also checked to ensure that it is a valid email address. The username is required to be lowercase characters only and unique. The confirmPassword has to match the password provided.

This validation differs from the 'ForSetup' and 'ForAdminPasswordRequired' validations as follows:

Parameters:
user - The remote user trying to add a new user
username - 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 user
Returns:
a validation result containing appropriate errors or the new user's details
Since:
4.3

validateCreateUserForAdmin

UserService.CreateUserValidationResult validateCreateUserForAdmin(User user,
                                                                  String username,
                                                                  String password,
                                                                  String confirmPassword,
                                                                  String email,
                                                                  String fullname)
Validates creating a user for the admin section. This method checks that external user management is disabled and that the user performing the operation has global admin rights. It also validates that all parameters (username, email, fullname) except for the password have been provided. Email is also checked to ensure that it is a valid email address. The username is required to be lowercase characters only and unique. The confirmPassword has to match the password provided.

This validation differs from the 'ForSetup' and 'ForAdminPasswordRequired' validations as follows:

Parameters:
user - The remote user trying to add a new user
username - 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 user
Returns:
a validation result containing appropriate errors or the new user's details
Since:
4.0

validateCreateUserForAdmin

UserService.CreateUserValidationResult validateCreateUserForAdmin(com.atlassian.crowd.embedded.api.User user,
                                                                  String username,
                                                                  String password,
                                                                  String confirmPassword,
                                                                  String email,
                                                                  String fullname,
                                                                  Long directoryId)
Validates creating a user for the admin section. This method checks that external user management is disabled and that the user performing the operation has global admin rights. It also validates that all parameters (username, email, fullname) except for the password have been provided. Email is also checked to ensure that it is a valid email address. The username is required to be lowercase characters only and unique. The confirmPassword has to match the password provided.

This method allows the caller to name a directory to create the user in and the directoryId must be valid and represent a Directory with "create user" permission.

This validation differs from the 'ForSetup' and 'ForAdminPasswordRequired' validations as follows:

Parameters:
user - The remote user trying to add a new user
username - 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 user
Returns:
a validation result containing appropriate errors or the new user's details
Since:
4.3.2

createUserForSignup

User createUserForSignup(UserService.CreateUserValidationResult result)
                         throws ImmutableException
Deprecated. Please use createUserFromSignup(com.atlassian.jira.bc.user.UserService.CreateUserValidationResult) instead. Since v4.3

Given a valid validation result, this will create the user using the details provided in the validation result. Email notification will be send to created user - via UserEventType.USER_SIGNUP event.

Parameters:
result - The validation result
Returns:
The new user object that was created
Throws:
ImmutableException
Since:
4.0

createUserFromSignup

com.atlassian.crowd.embedded.api.User createUserFromSignup(UserService.CreateUserValidationResult result)
                                                           throws PermissionException,
                                                                  CreateException
Given a valid validation result, this will create the user using the details provided in the validation result. Email notification will be send to created user - via UserEventType.USER_SIGNUP event.

Parameters:
result - The validation result
Returns:
The new user object that was created
Throws:
PermissionException
CreateException
Since:
4.3

createUser

User createUser(UserService.CreateUserValidationResult result)
                throws ImmutableException
Deprecated. Please use createUserWithNotification(com.atlassian.jira.bc.user.UserService.CreateUserValidationResult) instead. Since v4.3

Given a valid validation result, this will create the user using the details provided in the validation result. Email notification will be send to created user - via UserEventType.USER_CREATED event.

Parameters:
result - The validation result
Returns:
The new user object that was created
Throws:
ImmutableException
Since:
4.0

createUserWithNotification

com.atlassian.crowd.embedded.api.User createUserWithNotification(UserService.CreateUserValidationResult result)
                                                                 throws PermissionException,
                                                                        CreateException
Given a valid validation result, this will create the user using the details provided in the validation result. Email notification will be send to created user - via UserEventType.USER_CREATED event.

Parameters:
result - The validation result
Returns:
The new user object that was created
Throws:
PermissionException
CreateException
Since:
4.3

createUserNoEvent

User createUserNoEvent(UserService.CreateUserValidationResult result)
                       throws ImmutableException
Deprecated. Please use createUserNoNotification(com.atlassian.jira.bc.user.UserService.CreateUserValidationResult) instead. Since v4.3

Given a valid validation result, this will create the user using the details provided in the validation result. No email notification will be send to created user.

Parameters:
result - The validation result
Returns:
The new user object that was created
Throws:
ImmutableException
Since:
4.0

createUserNoNotification

com.atlassian.crowd.embedded.api.User createUserNoNotification(UserService.CreateUserValidationResult result)
                                                               throws PermissionException,
                                                                      CreateException
Given a valid validation result, this will create the user using the details provided in the validation result. No email notification will be send to created user.

Parameters:
result - The validation result
Returns:
The new user object that was created
Throws:
PermissionException
CreateException
Since:
4.3

validateDeleteUser

UserService.DeleteUserValidationResult validateDeleteUser(com.atlassian.crowd.embedded.api.User loggedInUser,
                                                          String username)
Validates removing a user for the admin section. This method checks that external user management is disabled and that the user performing the operation has global admin rights. It also validates that username have been provided. Removing the user is not allowed if:

Parameters:
loggedInUser - The remote user trying to remove an user
username - The username of the user to remove. Needs to be valid
Returns:
a validation result containing appropriate errors or the user object for delete
Since:
4.0

validateDeleteUser

UserService.DeleteUserValidationResult validateDeleteUser(User loggedInUser,
                                                          String username)
Validates removing a user for the admin section. This method checks that external user management is disabled and that the user performing the operation has global admin rights. It also validates that username have been provided. Removing the user is not allowed if:

Parameters:
loggedInUser - The remote user trying to remove an user
username - The username of the user to remove. Needs to be valid
Returns:
a validation result containing appropriate errors or the user object for delete
Since:
4.0

removeUser

void removeUser(com.atlassian.crowd.embedded.api.User user,
                UserService.DeleteUserValidationResult result)
Given a valid validation result, this will remove the user and removes the user from all the groups. All components lead by user will have lead cleared.

Parameters:
user - the user to delete
result - The validation result

removeUser

void removeUser(User user,
                UserService.DeleteUserValidationResult result)
Given a valid validation result, this will remove the user and removes the user from all the groups. All components lead by user will have lead cleared.

Parameters:
user - the user to delete
result - The validation result


Copyright © 2002-2011 Atlassian. All Rights Reserved.