com.atlassian.bamboo.user
Interface BambooUserManager

All Superinterfaces:
com.atlassian.user.search.query.EntityQueryParser, bucket.user.UserAccessor, org.acegisecurity.userdetails.UserDetailsService
All Known Implementing Classes:
BambooUserManagerImpl

public interface BambooUserManager
extends bucket.user.UserAccessor, org.acegisecurity.userdetails.UserDetailsService

Service class to manage interactions with the user.


Field Summary
static java.lang.String JABBER_ADDRESS_KEY
           
static java.lang.String USER_IDE_PORT
           
static java.lang.String USER_NOTIFICATION_PREFERENCE
           
static java.lang.String USER_NOTIFICATION_TRANSPORT_PREFERENCE
           
 
Method Summary
 BambooUser addUser(java.lang.String username, java.lang.String password, java.lang.String email, java.lang.String fullName, java.lang.String jabberAddress, java.util.List<java.lang.String> groupNames)
          Method that extends the standard addUser methods to also add Bamboo specific params
 BambooUser addUser(java.lang.String username, java.lang.String password, java.lang.String email, java.lang.String fullName, java.lang.String jabberAddress, java.util.List<java.lang.String> groupNames, ExtendedAuthor author)
          Method that extends the standard addUser methods to also add Bamboo specific params
 BambooUser addUser(java.lang.String username, java.lang.String password, java.lang.String email, java.lang.String fullName, java.lang.String jabberAddress, java.util.List<java.lang.String> groupNames, java.util.List<java.lang.Long> authors)
           
 PasswordResetToken createPasswordResetToken(java.lang.String username)
          Request new one-time token for a user.
 void deletePasswordResetToken(java.lang.String username)
          Deletes existing user token.
 BambooUser findUserWithJabberAddress(java.lang.String jabberAddress)
          Searches for user using specified jabberAddress.
 BambooUser getBambooUser(java.lang.String username)
          Returns a BambooUser of the given username
 BambooUser getBambooUser(com.atlassian.user.User user)
          Returns a BambooUser given a User
 java.util.List<java.lang.String> getGroupNamesAsList(com.atlassian.user.User user)
          Returns groups for the User
 java.lang.String getJiraIssueDefaults(com.atlassian.user.User user)
           
 java.util.List<java.lang.String> getMemberNamesAsList(com.atlassian.user.Group group)
           
 PasswordResetToken getPasswordResetToken(java.lang.String username)
          Retrieves existing user token.
 BambooUser injectUser(BambooUser user)
          A variation of addUser which inserts the encryptedPassword instead - used for importing
 boolean isDeletable(com.atlassian.user.User user)
          Is this user deletable? A user may not be deletable because: 1) They are read-only (i.e.
 boolean isReadOnly(com.atlassian.user.Group group)
          Is this group read only?
 boolean isReadOnly(com.atlassian.user.User user)
          Is this user read only?
 boolean isUserAutocompleteAllowed()
          Determines whether or not we are allowed to do autocompletion for users.
 BambooUser loadUserByUsername(java.lang.String username)
          Currently should NOT be called during setup/upgrade.
 void saveJiraIssueDefaults(com.atlassian.user.User user, java.lang.String jiraIssueDefaultsJson)
          Saves default data use in JIRA issue creation dialog
 void saveNotificationPreferences(java.lang.String username, java.lang.String notificationPreference, java.lang.String notificationTransportPref)
          Save just the notification preferences for the given user
 void saveUser(java.lang.String username, java.lang.String password, java.lang.String email, java.lang.String fullName, java.lang.String jabberAddress, java.util.List<java.lang.String> groupNames)
          Saves the properties for the given user
 void saveUser(java.lang.String username, java.lang.String password, java.lang.String email, java.lang.String fullName, java.lang.String jabberAddress, java.util.List<java.lang.String> groupNames, ExtendedAuthor author)
          Saves the properties for the given user
 void saveUser(java.lang.String username, java.lang.String password, java.lang.String email, java.lang.String fullName, java.lang.String jabberAddress, java.util.List<java.lang.String> selectedGroups, ExtendedAuthor author, java.lang.String idePort)
          Saves the properties for the given user
 void saveUser(java.lang.String username, java.lang.String password, java.lang.String email, java.lang.String fullName, java.lang.String jabberAddress, java.lang.String notificationPreference, java.lang.String notificationTransportPreference, java.util.List<java.lang.String> selectedGroups, ExtendedAuthor author, java.lang.String idePort)
          Saves the properties for the given user
 void saveUser(java.lang.String username, java.lang.String password, java.lang.String email, java.lang.String fullName, java.lang.String jabberAddress, java.lang.String notificationPreference, java.lang.String notificationTransportPreference, java.util.List<java.lang.String> selectedGroups, java.util.List<java.lang.Long> authors, java.lang.String idePort)
           
 void setMembership(com.atlassian.user.Group group, java.util.List<java.lang.String> members)
          Sets a group's members as the passed list
 void setupInitialAdminUser(java.lang.String username, java.lang.String password, java.lang.String email, java.lang.String fullName)
          Setup the initial admin user for the Bamboo instance.
 
Methods inherited from interface bucket.user.UserAccessor
addGroup, addMembership, addMembership, addUser, addUser, alterPassword, authenticate, createGroup, createUser, deactivateUser, findUsers, getDefaultGroup, getDelegatingRepositories, getExternallMembers, getGroup, getGroupCreateIfNecessary, getGroups, getGroups, getLocalMembers, getMemberNames, getPropertySet, getRepository, getUser, getUserNames, getUserPreferences, getUsers, getUsersByEmail, getUsersWithConfluenceAccess, hasMembership, hasMembership, isDeactivated, isDeactivated, isLicensedToAddMoreUsers, isUserRemovable, reactivateUser, removeGroup, removeMembership, removeMembership, removeUser, saveUser, setAtlassianUserConfiguration
 
Methods inherited from interface com.atlassian.user.search.query.EntityQueryParser
findGroups, findGroups, findUsers
 

Field Detail

JABBER_ADDRESS_KEY

static final java.lang.String JABBER_ADDRESS_KEY
See Also:
Constant Field Values

USER_NOTIFICATION_PREFERENCE

static final java.lang.String USER_NOTIFICATION_PREFERENCE
See Also:
Constant Field Values

USER_NOTIFICATION_TRANSPORT_PREFERENCE

static final java.lang.String USER_NOTIFICATION_TRANSPORT_PREFERENCE
See Also:
Constant Field Values

USER_IDE_PORT

static final java.lang.String USER_IDE_PORT
See Also:
Constant Field Values
Method Detail

getBambooUser

@Nullable
BambooUser getBambooUser(java.lang.String username)
Returns a BambooUser of the given username

Parameters:
username -
Returns:
The matching user, null if does not exist

getBambooUser

@Nullable
BambooUser getBambooUser(com.atlassian.user.User user)
Returns a BambooUser given a User

Parameters:
user -
Returns:
The wrapped user.

addUser

BambooUser addUser(java.lang.String username,
                   java.lang.String password,
                   java.lang.String email,
                   java.lang.String fullName,
                   java.lang.String jabberAddress,
                   java.util.List<java.lang.String> groupNames)
Method that extends the standard addUser methods to also add Bamboo specific params

Parameters:
username -
password -
email -
fullName -
jabberAddress -
groupNames - - List of Strings as the group names. May be null.
Returns:
the created BambooUser object with the created properties

addUser

BambooUser addUser(java.lang.String username,
                   java.lang.String password,
                   java.lang.String email,
                   java.lang.String fullName,
                   java.lang.String jabberAddress,
                   java.util.List<java.lang.String> groupNames,
                   ExtendedAuthor author)
Method that extends the standard addUser methods to also add Bamboo specific params

Parameters:
username -
password -
email -
fullName -
jabberAddress -
groupNames - - List of Strings as the group names. May be null.
author -
Returns:
the created BambooUser object with the created properties

addUser

BambooUser addUser(java.lang.String username,
                   java.lang.String password,
                   java.lang.String email,
                   java.lang.String fullName,
                   java.lang.String jabberAddress,
                   java.util.List<java.lang.String> groupNames,
                   @NotNull
                   java.util.List<java.lang.Long> authors)

saveUser

void saveUser(java.lang.String username,
              java.lang.String password,
              java.lang.String email,
              java.lang.String fullName,
              java.lang.String jabberAddress,
              java.util.List<java.lang.String> groupNames)
              throws java.lang.IllegalArgumentException
Saves the properties for the given user

Parameters:
username -
password -
email -
fullName -
jabberAddress -
groupNames - - List of Strings as the group names. May be null.
Throws:
java.lang.IllegalArgumentException - if username does not match a user, or if the password cannot be altered by the local user management facility.

saveUser

void saveUser(java.lang.String username,
              java.lang.String password,
              java.lang.String email,
              java.lang.String fullName,
              java.lang.String jabberAddress,
              java.util.List<java.lang.String> groupNames,
              ExtendedAuthor author)
              throws java.lang.IllegalArgumentException
Saves the properties for the given user

Parameters:
username -
password -
email -
fullName -
jabberAddress -
groupNames - - List of Strings as the group names. May be null.
author -
Throws:
java.lang.IllegalArgumentException - if username does not match a user, or if the password cannot be altered by the local user management facility.

saveUser

void saveUser(java.lang.String username,
              java.lang.String password,
              java.lang.String email,
              java.lang.String fullName,
              java.lang.String jabberAddress,
              java.util.List<java.lang.String> selectedGroups,
              ExtendedAuthor author,
              java.lang.String idePort)
Saves the properties for the given user

Parameters:
username -
password -
email -
fullName -
jabberAddress -
selectedGroups -
author -
idePort -
Throws:
java.lang.IllegalArgumentException - if username does not match a user, or if the password cannot be altered by the local user management facility.

saveUser

void saveUser(java.lang.String username,
              java.lang.String password,
              java.lang.String email,
              java.lang.String fullName,
              java.lang.String jabberAddress,
              java.lang.String notificationPreference,
              java.lang.String notificationTransportPreference,
              java.util.List<java.lang.String> selectedGroups,
              ExtendedAuthor author,
              java.lang.String idePort)
              throws java.lang.IllegalArgumentException
Saves the properties for the given user

Parameters:
username -
password -
email -
fullName -
jabberAddress -
notificationPreference -
selectedGroups -
author -
idePort -
Throws:
java.lang.IllegalArgumentException - if username does not match a user, or if the password cannot be altered by the local user management facility.

saveUser

void saveUser(java.lang.String username,
              @Nullable
              java.lang.String password,
              java.lang.String email,
              java.lang.String fullName,
              java.lang.String jabberAddress,
              java.lang.String notificationPreference,
              java.lang.String notificationTransportPreference,
              java.util.List<java.lang.String> selectedGroups,
              @NotNull
              java.util.List<java.lang.Long> authors,
              java.lang.String idePort)
              throws java.lang.IllegalArgumentException
Throws:
java.lang.IllegalArgumentException

getGroupNamesAsList

java.util.List<java.lang.String> getGroupNamesAsList(com.atlassian.user.User user)
Returns groups for the User

Parameters:
user - - Must not be null
Returns:
List of String representing group names. Collections.emptyList() if none exists

setMembership

void setMembership(com.atlassian.user.Group group,
                   java.util.List<java.lang.String> members)
Sets a group's members as the passed list

Parameters:
group - - The group to modify the user list. Cannot be null.
members - - List of username Strings. Can be null

getMemberNamesAsList

@NotNull
java.util.List<java.lang.String> getMemberNamesAsList(com.atlassian.user.Group group)

injectUser

BambooUser injectUser(@NotNull
                      BambooUser user)
A variation of addUser which inserts the encryptedPassword instead - used for importing

Parameters:
user - user data
Returns:
the created BambooUser object with the created properties

isDeletable

boolean isDeletable(com.atlassian.user.User user)
Is this user deletable? A user may not be deletable because: 1) They are read-only (i.e. the user is externally sourced) 2) They have comments/labels linked to them

Parameters:
user -
Returns:
booleanwhether user deletable

isReadOnly

boolean isReadOnly(com.atlassian.user.User user)
Is this user read only?

Parameters:
user -

isReadOnly

boolean isReadOnly(com.atlassian.user.Group group)
Is this group read only?

Parameters:
group -

saveNotificationPreferences

void saveNotificationPreferences(java.lang.String username,
                                 java.lang.String notificationPreference,
                                 java.lang.String notificationTransportPref)
Save just the notification preferences for the given user

Parameters:
username -
notificationPreference -

setupInitialAdminUser

void setupInitialAdminUser(java.lang.String username,
                           java.lang.String password,
                           java.lang.String email,
                           java.lang.String fullName)
Setup the initial admin user for the Bamboo instance.

Parameters:
username -
password -
email -
fullName -

createPasswordResetToken

@NotNull
PasswordResetToken createPasswordResetToken(java.lang.String username)
Request new one-time token for a user. Replaces the old one if it exists.

Parameters:
username - user login name
Returns:
freshly created one-time token

getPasswordResetToken

@Nullable
PasswordResetToken getPasswordResetToken(java.lang.String username)
Retrieves existing user token. Returns null if there is none.

Parameters:
username - user login name
Returns:
user token object or null

deletePasswordResetToken

void deletePasswordResetToken(java.lang.String username)
Deletes existing user token. Does nothing if there is no token.

Parameters:
username - user login name

findUserWithJabberAddress

@Nullable
BambooUser findUserWithJabberAddress(@NotNull
                                              java.lang.String jabberAddress)
Searches for user using specified jabberAddress.

Parameters:
jabberAddress - address to be matched
Returns:
BambooUser or null if none found

getJiraIssueDefaults

@Nullable
java.lang.String getJiraIssueDefaults(@NotNull
                                               com.atlassian.user.User user)
Returns:
json string containing default JIRA server applink id, project id and issue type id
Since:
4.1

saveJiraIssueDefaults

void saveJiraIssueDefaults(@NotNull
                           com.atlassian.user.User user,
                           @NotNull
                           java.lang.String jiraIssueDefaultsJson)
Saves default data use in JIRA issue creation dialog

Parameters:
user - user
jiraIssueDefaultsJson - default data formatted as JSON string
Since:
4.1

isUserAutocompleteAllowed

boolean isUserAutocompleteAllowed()
Determines whether or not we are allowed to do autocompletion for users. Currently this will return false if using LDAP, otherwise true

Returns:
true if we are allowed to do automcomplete for users.

loadUserByUsername

BambooUser loadUserByUsername(java.lang.String username)
                              throws org.acegisecurity.userdetails.UsernameNotFoundException,
                                     org.springframework.dao.DataAccessException
Currently should NOT be called during setup/upgrade. We need a better way of handling bamboo-users vs bamboo-user for OD and BTF https://jira.atlassian.com/browse/ROTP-1557

Specified by:
loadUserByUsername in interface org.acegisecurity.userdetails.UserDetailsService
Throws:
org.acegisecurity.userdetails.UsernameNotFoundException
org.springframework.dao.DataAccessException


Copyright © 2014 Atlassian Software Systems Pty Ltd. All Rights Reserved.