@PublicApi public static final class

UserService.CreateUserRequest

extends Object
java.lang.Object
   ↳ com.atlassian.jira.bc.user.UserService.CreateUserRequest

@PublicApi

This class is designed for plugins to consume (call its methods).

Clients of @PublicApi can expect that programs compiled against a given version will remain binary compatible with later versions of the @PublicApi as per each product's API policy as long as the client does not implement/extend @PublicApi interfaces or classes (refer to each product's API policy for the exact guarantee---usually binary compatibility is guaranteed at least across minor versions).

Note: since @PublicApi interfaces and classes are not designed to be implemented or extended by clients, we may perform certain types of binary-incompatible changes to these classes and interfaces, but these will not affect well-behaved clients that do not extend/implement these types (in general, only classes and interfaces annotated with @PublicSpi are safe to extend/implement).

Class Overview

This request contains all the instructions and user details that should be used during user validation and user creation.

Summary

Public Methods
UserService.CreateUserRequest confirmPassword(String confirmPassword)
Confirm that the provided password matches the confirm password provided.
boolean defaultDirectory()
Determine whether the default user directory should be used for the new user.
Set<ApplicationKey> getApplicationKeys()
Return the application keys that are used to specify what application access the new user requires.
String getConfirmPassword()
Return the confirmation password that should be compared against the getPassword().
Long getDirectoryId()
Return the directory id (representing the user directory), that the new user should be created in.
String getDisplayName()
Return the display name (also known as full name) for the new user.
String getEmailAddress()
Return the email address for the new user.
ApplicationUser getLoggedInUser()
Return the logged in user that would be performing the user creation.
String getPassword()
Return the password for the new user.
String getUsername()
Return the user name that is used to identify the new user.
UserService.CreateUserRequest inDirectory(Long directoryId)
Specify what user directory should be used for new user.
UserService.CreateUserRequest passwordRequired()
Specify that the user password is required.
UserService.CreateUserRequest performPermissionCheck(boolean performPermissionCheck)
Indicate that the permission check should not be performed on the logged in user to determine whether the logged in user has permission to create the new user.
boolean requireDefaultApplicationAccess()
Determine whether the new user requires default application access.
boolean requirePassword()
Determine whether the user password is required.
UserService.CreateUserRequest sendNotification(boolean sendNotification)
Specify whether a notification should be sent when the new user has successfully been created.
UserService.CreateUserRequest sendUserSignupEvent()
Specify that a user signup event should be sent after user creation.
boolean shouldConfirmPassword()
Determine whether the confirmation password should be validation or whether the confirmation password has been set.
boolean shouldPerformPermissionCheck()
boolean shouldSendNotification()
Determine whether a notification should be sent after user creation.
boolean shouldSendUserSignupEvent()
Determine whether a signup event should be sent after user has been created.
@Internal UserService.CreateUserRequest skipValidation()
Specify that all validations should be skipped.
UserService.CreateUserRequest withApplicationAccess(Set<ApplicationKey> applicationKeys)
Specify the applications that this user required access to.
@Internal UserService.CreateUserRequest withEventUserEvent(int userEventType)
This method is deprecated. Since v7.0.
UserService.CreateUserRequest withNoApplicationAccess()
Indicate that no application access is required for the new user.
static UserService.CreateUserRequest withUserDetails(ApplicationUser loggedInUser, String username, String password, String emailAddress, String displayName)
Create a new user creation request as the provided user for the specified user details.
[Expand]
Inherited Methods
From class java.lang.Object

Public Methods

public UserService.CreateUserRequest confirmPassword (String confirmPassword)

Confirm that the provided password matches the confirm password provided.

Parameters
confirmPassword the confirm password that should match the provided password.

public boolean defaultDirectory ()

Determine whether the default user directory should be used for the new user.

public Set<ApplicationKey> getApplicationKeys ()

Return the application keys that are used to specify what application access the new user requires.

Returns
  • the application keys that are used to specify what application access the new user requires.

public String getConfirmPassword ()

Return the confirmation password that should be compared against the getPassword(). This is typically set by confirmPassword(String) to indicate that the confirm password should be validated against the getPassword().

Returns
  • the confirmation password that should be compared against the getPassword().

public Long getDirectoryId ()

Return the directory id (representing the user directory), that the new user should be created in. This is typically left unset null indicating default.

Returns
  • the directory id (representing the user directory), that the new user should be created in.

public String getDisplayName ()

Return the display name (also known as full name) for the new user.

Returns
  • the display name (also known as full name) for the new user.

public String getEmailAddress ()

Return the email address for the new user.

Returns
  • the email address for the new user.

public ApplicationUser getLoggedInUser ()

Return the logged in user that would be performing the user creation.

Returns
  • the application user performing the user creation.

public String getPassword ()

Return the password for the new user.

Returns
  • the password for the new user.

public String getUsername ()

Return the user name that is used to identify the new user.

Returns
  • the user name that is used to identify the new user.

public UserService.CreateUserRequest inDirectory (Long directoryId)

Specify what user directory should be used for new user.

Parameters
directoryId The directory which the new user is intended to be created in. null indicates that the default directory should be used.

public UserService.CreateUserRequest passwordRequired ()

Specify that the user password is required.

public UserService.CreateUserRequest performPermissionCheck (boolean performPermissionCheck)

Indicate that the permission check should not be performed on the logged in user to determine whether the logged in user has permission to create the new user.

Parameters
performPermissionCheck true if the permission check should be performed else false to skip the permission check.

public boolean requireDefaultApplicationAccess ()

Determine whether the new user requires default application access. Default application access is the configuration that indicates what applications a new user should be added to.

Returns
  • true if the new user should be granted access to the default applications else false.

public boolean requirePassword ()

Determine whether the user password is required.

Returns
  • true is user password is required else faslse.

public UserService.CreateUserRequest sendNotification (boolean sendNotification)

Specify whether a notification should be sent when the new user has successfully been created.

Parameters
sendNotification true if notification should be sent after a new user has successfully been created. false if no notification should be sent.

public UserService.CreateUserRequest sendUserSignupEvent ()

Specify that a user signup event should be sent after user creation. Typically when the new user is being created during signup.

public boolean shouldConfirmPassword ()

Determine whether the confirmation password should be validation or whether the confirmation password has been set.

Returns

public boolean shouldPerformPermissionCheck ()

public boolean shouldSendNotification ()

Determine whether a notification should be sent after user creation.

Returns
  • true if a notification should be sent after user creation. false if a notification should not be sent after user creation.

public boolean shouldSendUserSignupEvent ()

Determine whether a signup event should be sent after user has been created. This is typically true when the user is being created via signup.

Returns
  • true if a signup event should be sent after user has been created.

@Internal public UserService.CreateUserRequest skipValidation ()

@Internal

This method is an internal implementation detail and will change without notice.

Clients that depend on @Internal classes and interfaces can not expect to be compatible with any version other than the version they were compiled against (even minor version and milestone releases may break binary compatibility with respect to @Internal elements).

Specify that all validations should be skipped. This should only be used when it does not matter that user gets created or added.

public UserService.CreateUserRequest withApplicationAccess (Set<ApplicationKey> applicationKeys)

Specify the applications that this user required access to.

Parameters
applicationKeys applications that user should be granted access to, an empty Set indicates that the user does not require access to any applications.

@Internal public UserService.CreateUserRequest withEventUserEvent (int userEventType)

@Internal

This method is an internal implementation detail and will change without notice.

Clients that depend on @Internal classes and interfaces can not expect to be compatible with any version other than the version they were compiled against (even minor version and milestone releases may break binary compatibility with respect to @Internal elements).

This method is deprecated.
Since v7.0.

This method has been made public only to allow temporary backwards compatibility and will be removed in 7.0.

Set the event type to be dispatch after user creation. This has been added for compatibility reasons please avoid using this.

Parameters
userEventType the event type that should be sent after user has been created.
See Also

public UserService.CreateUserRequest withNoApplicationAccess ()

Indicate that no application access is required for the new user.

public static UserService.CreateUserRequest withUserDetails (ApplicationUser loggedInUser, String username, String password, String emailAddress, String displayName)

Create a new user creation request as the provided user for the specified user details. This request indicates that the new users should be created in the default user directory and have access to the default applications. A Notification would be sent after user creation.

Parameters
loggedInUser application user performing the create. If null the user creation is being performed during setup or signup.
username The username of the new user. Needs to be lowercase and unique. Required.
password The password for the new user. If empty a random password will be generated.
emailAddress The email address for the new user. Required.
displayName The display name for the new user. Required.