public class BambooUserManagerImpl extends bucket.user.DefaultUserAccessor implements BambooUserManager
JABBER_ADDRESS_KEY, USER_IDE_PORT, USER_NOTIFICATION_PREFERENCE, USER_NOTIFICATION_TRANSPORT_PREFERENCE
Constructor and Description |
---|
BambooUserManagerImpl() |
Modifier and Type | Method and Description |
---|---|
boolean |
addMembershipWithConfirmation(com.atlassian.user.Group group,
com.atlassian.user.User user) |
BambooUser |
addUser(String username,
String password,
boolean enabled,
String email,
String fullName,
String jabberAddress,
List<String> groups,
List<Long> authors) |
BambooUser |
addUser(String username,
String password,
String email,
String fullName,
String jabberAddress,
List<String> groups)
Method that extends the standard addUser methods to also add Bamboo specific params
|
BambooUser |
addUser(String username,
String password,
String email,
String fullName,
String jabberAddress,
List<String> groups,
ExtendedAuthor author)
Method that extends the standard addUser methods to also add Bamboo specific params
|
BambooUser |
addUser(String username,
String password,
String email,
String fullName,
String jabberAddress,
List<String> groups,
List<Long> authors) |
void |
alterPassword(com.atlassian.user.User user,
String plainTextPassword) |
boolean |
canCreateGroups()
Whether creation of new groups is allowed.
|
boolean |
canCreateUsers()
Whether creation of new users is allowed.
|
void |
cleanupRemovedGroupReferences(String groupName)
Cleanup all Bamboo-stored data related to a group that is being deleted or has been deleted.
|
void |
cleanupRemovedUserReferences(String username)
Cleanup all Bamboo-stored data related to a user that is being deleted or has been deleted.
|
PasswordResetToken |
createPasswordResetToken(String username)
Request new one-time token for a user.
|
void |
deletePasswordResetToken(String username)
Deletes existing user token.
|
BambooUser |
findUserWithJabberAddress(String jabberAddress)
Searches for user using specified jabberAddress.
|
BambooUser |
getBambooUser(String username)
Returns a
BambooUser of the given username |
BambooUser |
getBambooUser(com.atlassian.user.User user)
Returns a
BambooUser given a User |
List<String> |
getGroupNamesAsList(com.atlassian.user.User user)
Returns groups for the
User |
com.atlassian.user.search.page.Pager<com.atlassian.user.Group> |
getGroups() |
String |
getJiraIssueDefaults(com.atlassian.user.User user) |
List<String> |
getMemberNamesAsList(com.atlassian.user.Group group) |
PasswordResetToken |
getPasswordResetToken(String username)
Retrieves existing user token.
|
com.atlassian.user.User |
getUser(String name) |
BambooUser |
injectUser(BambooUser user)
A variation of addUser which inserts the encryptedPassword instead - used for importing
|
boolean |
isDeletable(com.atlassian.user.Group group)
Returns true if the given group can be deleted.
|
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(String username)
Currently should NOT be called during setup/upgrade.
|
void |
onExternalUserRename(String oldUserName,
String newUserName) |
void |
postConstruct() |
void |
removeGroup(com.atlassian.user.Group group) |
boolean |
removeMembership(com.atlassian.user.Group group,
com.atlassian.user.User user) |
void |
removeUser(com.atlassian.user.User user) |
void |
renameUser(String oldUserName,
String newUserName) |
void |
saveJiraIssueDefaults(com.atlassian.user.User user,
String jiraIssueDefaults)
Saves default data use in JIRA issue creation dialog
|
void |
saveNotificationPreferences(String username,
String notificationPreference,
String notificationTransportPref)
Save just the notification preferences for the given user
|
void |
saveUser(String username,
String password,
boolean enabled,
String email,
String fullName,
String jabberAddress,
String notificationPreference,
String notificationTransportPreference,
List<String> selectedGroups,
List<Long> authors) |
void |
saveUser(String username,
String password,
boolean enabled,
String email,
String fullName,
String jabberAddress,
String notificationPreference,
String notificationTransportPreference,
List<String> selectedGroups,
List<Long> authors,
String idePort) |
void |
saveUser(String username,
String password,
String email,
String fullName,
String jabberAddress,
List<String> selectedGroups)
Saves the properties for the given user
|
void |
saveUser(String username,
String password,
String email,
String fullName,
String jabberAddress,
List<String> selectedGroups,
ExtendedAuthor author)
Saves the properties for the given user
|
void |
saveUser(String username,
String password,
String email,
String fullName,
String jabberAddress,
List<String> selectedGroups,
ExtendedAuthor author,
String idePort)
Saves the properties for the given user
|
void |
saveUser(String username,
String password,
String email,
String fullName,
String jabberAddress,
String notificationPreference,
String notificationTransportPreference,
List<String> selectedGroups,
ExtendedAuthor author,
String idePort)
Saves the properties for the given user
|
void |
saveUser(String username,
String password,
String email,
String fullName,
String jabberAddress,
String notificationPreference,
String notificationTransportPreference,
List<String> selectedGroups,
List<Long> authors,
String idePort) |
void |
setAclAuthorizationStrategy(org.acegisecurity.acls.domain.AclAuthorizationStrategy aclAuthorizationStrategy) |
void |
setAclService(HibernateMutableAclService aclService) |
void |
setAuthorDao(AuthorDao authorDao) |
void |
setCommentDao(CommentDao commentDao) |
void |
setFeatureManager(FeatureManager featureManager) |
void |
setFilteredGroupsProvider(FilteredGroupsProvider filteredGroupsProvider) |
void |
setLabelDao(LabelDao labelDao) |
void |
setLoginInformationManager(LoginInformationManager loginInformationManager) |
void |
setMembership(com.atlassian.user.Group group,
List<String> members)
Sets a group's members as the passed list
|
void |
setPropertySetDao(BambooPropertySetDao propertySetDao) |
void |
setRecoveryModeService(com.atlassian.crowd.manager.recovery.RecoveryModeService recoveryModeService) |
void |
setRememberMeTokenDao(com.atlassian.seraph.spi.rememberme.RememberMeTokenDao rememberMeTokenDao) |
void |
setTokenDao(PasswordResetTokenDao tokenDao) |
void |
setupInitialAdminUser(String username,
String password,
String email,
String fullName)
Setup the initial admin user for the Bamboo instance.
|
static String[] |
stringListToArray(Collection<String> strings)
Converts a
Collection of Strings to an array of Strings |
static <T> Collection<T> |
subtractNewList(Collection<T> oldList,
Collection<T> newList)
Works like
CollectionUtils.removeAll(Collection, Collection) only that it's null safe |
addGroup, addMembership, addMembership, addUser, addUser, authenticate, checkConfiguration, createGroup, createUser, deactivateUser, findGroups, findGroups, findUsers, findUsers, getAuthenticator, getDefaultGroup, getDelegatingRepositories, getEntityQueryParser, getExternallMembers, getGroup, getGroupCreateIfNecessary, getGroupManager, getGroups, getLocalMembers, getMemberNames, getPropertySet, getPropertySetFactory, getRepository, getUserManager, getUserNames, getUsers, getUsersByEmail, getUsersWithConfluenceAccess, hasMembership, hasMembership, isDeactivated, isDeactivated, isLicensedToAddMoreUsers, isUserRemovable, reactivateUser, removeMembership, removeUserFromAllGroups, saveUser, setAtlassianUserConfiguration
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addGroup, addMembership, addMembership, addUser, addUser, authenticate, createGroup, createUser, deactivateUser, findUsers, getDefaultGroup, getDelegatingRepositories, getExternallMembers, getGroup, getGroupCreateIfNecessary, getGroups, getLocalMembers, getMemberNames, getPropertySet, getRepository, getUserNames, getUsers, getUsersByEmail, getUsersWithConfluenceAccess, hasMembership, hasMembership, isDeactivated, isDeactivated, isLicensedToAddMoreUsers, isUserRemovable, reactivateUser, removeMembership, saveUser, setAtlassianUserConfiguration
@PostConstruct public void postConstruct()
@Nullable public BambooUser getBambooUser(String username)
BambooUserManager
BambooUser
of the given usernamegetBambooUser
in interface BambooUserManager
@Nullable public BambooUser getBambooUser(@Nullable com.atlassian.user.User user)
BambooUserManager
BambooUser
given a User
getBambooUser
in interface BambooUserManager
@Nullable public com.atlassian.user.User getUser(String name)
getUser
in interface bucket.user.UserAccessor
getUser
in class bucket.user.DefaultUserAccessor
public BambooUser addUser(String username, String password, String email, String fullName, String jabberAddress, List<String> groups)
BambooUserManager
addUser
in interface BambooUserManager
groups
- - List
of Strings as the group names. May be null.BambooUser
object with the created propertiespublic BambooUser addUser(String username, String password, String email, String fullName, String jabberAddress, List<String> groups, ExtendedAuthor author)
BambooUserManager
addUser
in interface BambooUserManager
BambooUser
object with the created propertiespublic BambooUser addUser(String username, String password, String email, String fullName, String jabberAddress, List<String> groups, @NotNull List<Long> authors)
addUser
in interface BambooUserManager
public BambooUser addUser(String username, String password, boolean enabled, String email, String fullName, String jabberAddress, List<String> groups, @NotNull List<Long> authors)
addUser
in interface BambooUserManager
public void renameUser(@NotNull String oldUserName, @NotNull String newUserName)
renameUser
in interface BambooUserManager
public void onExternalUserRename(@NotNull String oldUserName, @NotNull String newUserName)
onExternalUserRename
in interface BambooUserManager
public void saveUser(String username, String password, String email, String fullName, String jabberAddress, List<String> selectedGroups) throws IllegalArgumentException
BambooUserManager
saveUser
in interface BambooUserManager
IllegalArgumentException
- if username
does not match a user, or if the password cannot be
altered by the local user management facility.public void saveUser(String username, String password, String email, String fullName, String jabberAddress, List<String> selectedGroups, ExtendedAuthor author) throws IllegalArgumentException
BambooUserManager
saveUser
in interface BambooUserManager
IllegalArgumentException
- if username
does not match a user, or if the password cannot be
altered by the local user management facility.public void saveUser(String username, String password, String email, String fullName, String jabberAddress, List<String> selectedGroups, ExtendedAuthor author, String idePort) throws IllegalArgumentException
BambooUserManager
saveUser
in interface BambooUserManager
IllegalArgumentException
- if username
does not match a user, or if the password cannot be
altered by the local user management facility.public void saveUser(String username, String password, String email, String fullName, String jabberAddress, String notificationPreference, String notificationTransportPreference, List<String> selectedGroups, ExtendedAuthor author, String idePort) throws IllegalArgumentException
BambooUserManager
saveUser
in interface BambooUserManager
IllegalArgumentException
- if username
does not match a user, or if the password cannot be
altered by the local user management facility.public void saveUser(String username, @Nullable String password, String email, String fullName, String jabberAddress, String notificationPreference, String notificationTransportPreference, List<String> selectedGroups, @NotNull List<Long> authors, String idePort) throws IllegalArgumentException
saveUser
in interface BambooUserManager
IllegalArgumentException
public void saveUser(String username, @Nullable String password, boolean enabled, String email, String fullName, String jabberAddress, String notificationPreference, String notificationTransportPreference, List<String> selectedGroups, @NotNull List<Long> authors, String idePort) throws IllegalArgumentException
saveUser
in interface BambooUserManager
IllegalArgumentException
public void saveUser(String username, @Nullable String password, boolean enabled, String email, String fullName, String jabberAddress, String notificationPreference, String notificationTransportPreference, List<String> selectedGroups, @NotNull List<Long> authors) throws IllegalArgumentException
saveUser
in interface BambooUserManager
IllegalArgumentException
public void alterPassword(com.atlassian.user.User user, String plainTextPassword) throws com.atlassian.user.EntityException
alterPassword
in interface bucket.user.UserAccessor
alterPassword
in class bucket.user.DefaultUserAccessor
com.atlassian.user.EntityException
public void saveNotificationPreferences(String username, String notificationPreference, String notificationTransportPref)
BambooUserManager
saveNotificationPreferences
in interface BambooUserManager
public void removeUser(com.atlassian.user.User user)
removeUser
in interface bucket.user.UserAccessor
removeUser
in class bucket.user.DefaultUserAccessor
public void cleanupRemovedUserReferences(@NotNull String username)
BambooUserManager
cleanupRemovedUserReferences
in interface BambooUserManager
public void removeGroup(com.atlassian.user.Group group)
removeGroup
in interface bucket.user.UserAccessor
removeGroup
in class bucket.user.DefaultUserAccessor
public void cleanupRemovedGroupReferences(@NotNull String groupName)
BambooUserManager
cleanupRemovedGroupReferences
in interface BambooUserManager
public List<String> getGroupNamesAsList(com.atlassian.user.User user)
BambooUserManager
User
getGroupNamesAsList
in interface BambooUserManager
user
- - Must not be nullList
of String
representing group names. Collections.emptyList()
if none existspublic void setMembership(com.atlassian.user.Group group, List<String> members)
BambooUserManager
setMembership
in interface BambooUserManager
group
- - The group to modify the user list. Cannot be null.members
- - List
of username String
s. Can be null@NotNull public List<String> getMemberNamesAsList(com.atlassian.user.Group group)
getMemberNamesAsList
in interface BambooUserManager
public boolean isUserAutocompleteAllowed()
BambooUserManager
isUserAutocompleteAllowed
in interface BambooUserManager
public static <T> Collection<T> subtractNewList(Collection<T> oldList, Collection<T> newList)
CollectionUtils.removeAll(Collection, Collection)
only that it's null safeoldList
- - can be nullnewList
- - can be nullCollectionUtils.removeAll(Collection, Collection)
. Null lists count as empty lists.public static String[] stringListToArray(Collection<String> strings)
Collection
of Strings to an array of Stringsstrings
- - Collection
of String
s. May be nukkpublic BambooUser injectUser(@NotNull BambooUser user)
BambooUserManager
injectUser
in interface BambooUserManager
user
- user dataBambooUser
object with the created propertiespublic boolean isDeletable(com.atlassian.user.User user)
BambooUserManager
isDeletable
in interface BambooUserManager
boolean
whether user deletablepublic boolean isDeletable(com.atlassian.user.Group group)
BambooUserManager
isDeletable
in interface BambooUserManager
public boolean isReadOnly(com.atlassian.user.User user)
BambooUserManager
isReadOnly
in interface BambooUserManager
public boolean isReadOnly(com.atlassian.user.Group group)
BambooUserManager
isReadOnly
in interface BambooUserManager
public boolean canCreateUsers()
BambooUserManager
canCreateUsers
in interface BambooUserManager
public boolean canCreateGroups()
BambooUserManager
canCreateGroups
in interface BambooUserManager
public void setupInitialAdminUser(String username, String password, String email, String fullName)
BambooUserManager
setupInitialAdminUser
in interface BambooUserManager
@NotNull public PasswordResetToken createPasswordResetToken(String username)
BambooUserManager
createPasswordResetToken
in interface BambooUserManager
username
- user login name@Nullable public PasswordResetToken getPasswordResetToken(String username)
BambooUserManager
getPasswordResetToken
in interface BambooUserManager
username
- user login namepublic void deletePasswordResetToken(String username)
BambooUserManager
deletePasswordResetToken
in interface BambooUserManager
username
- user login namepublic BambooUser findUserWithJabberAddress(@NotNull String jabberAddress)
BambooUserManager
findUserWithJabberAddress
in interface BambooUserManager
jabberAddress
- address to be matchedBambooUser
or null if none foundpublic BambooUser loadUserByUsername(String username) throws org.acegisecurity.userdetails.UsernameNotFoundException, org.springframework.dao.DataAccessException
BambooUserManager
loadUserByUsername
in interface BambooUserManager
loadUserByUsername
in interface org.acegisecurity.userdetails.UserDetailsService
org.acegisecurity.userdetails.UsernameNotFoundException
org.springframework.dao.DataAccessException
public String getJiraIssueDefaults(@NotNull com.atlassian.user.User user)
getJiraIssueDefaults
in interface BambooUserManager
public void saveJiraIssueDefaults(@NotNull com.atlassian.user.User user, @NotNull String jiraIssueDefaults)
BambooUserManager
saveJiraIssueDefaults
in interface BambooUserManager
user
- userjiraIssueDefaults
- default data formatted as JSON stringpublic boolean removeMembership(com.atlassian.user.Group group, com.atlassian.user.User user)
removeMembership
in interface bucket.user.UserAccessor
removeMembership
in class bucket.user.DefaultUserAccessor
public boolean addMembershipWithConfirmation(com.atlassian.user.Group group, com.atlassian.user.User user)
addMembershipWithConfirmation
in interface BambooUserManager
public void setAuthorDao(AuthorDao authorDao)
public void setCommentDao(CommentDao commentDao)
public void setLabelDao(LabelDao labelDao)
public void setTokenDao(PasswordResetTokenDao tokenDao)
public void setAclService(HibernateMutableAclService aclService)
public void setAclAuthorizationStrategy(org.acegisecurity.acls.domain.AclAuthorizationStrategy aclAuthorizationStrategy)
public void setLoginInformationManager(LoginInformationManager loginInformationManager)
public void setRememberMeTokenDao(com.atlassian.seraph.spi.rememberme.RememberMeTokenDao rememberMeTokenDao)
public void setPropertySetDao(BambooPropertySetDao propertySetDao)
public void setFilteredGroupsProvider(FilteredGroupsProvider filteredGroupsProvider)
public void setFeatureManager(FeatureManager featureManager)
public void setRecoveryModeService(com.atlassian.crowd.manager.recovery.RecoveryModeService recoveryModeService)
public com.atlassian.user.search.page.Pager<com.atlassian.user.Group> getGroups()
getGroups
in interface bucket.user.UserAccessor
getGroups
in class bucket.user.DefaultUserAccessor
Copyright © 2019 Atlassian Software Systems Pty Ltd. All rights reserved.