Class CachingConfluenceUserDao
java.lang.Object
com.atlassian.confluence.impl.user.persistence.dao.CachingConfluenceUserDao
- All Implemented Interfaces:
- ConfluenceUserDao
This class is responsible for caching user keys by username.
- Since:
- 5.8
- 
Method SummaryModifier and TypeMethodDescriptionintGet a count of all unsynced users in Confluence.voidcreate(ConfluenceUser user) Create a new ConfluenceUser.static CachingConfluenceUserDaocreate(ConfluenceUserDao delegate, com.atlassian.cache.CacheFactory cacheFactory) voiddeactivateUser(String username) Deactivates user.@Nullable ConfluenceUserfindByKey(@Nullable com.atlassian.sal.api.user.UserKey key) Retrieve a ConfluenceUser by the user key.Map<com.atlassian.sal.api.user.UserKey, Optional<ConfluenceUser>> findByKeys(Set<com.atlassian.sal.api.user.UserKey> userkeys) Performs a bulk lookup of multipleConfluenceUsers.@Nullable ConfluenceUserfindByUsername(@Nullable String username) Find the ConfluenceUser with the given user name.findConfluenceUsersByLowerNames(Iterable<String> lowerNames) Find allConfluenceUserwhich have the given lowerNames.findLowerNamesByKeys(Iterable<com.atlassian.sal.api.user.UserKey> keys) Bulk operation to find lowercase name corresponding to user key.findUserKeysByLowerNames(Iterable<String> names) Bulk operation to find user key corresponding to lowercase name.getAll()List<com.atlassian.sal.api.user.UserKey> Currently for testing purpose onlybooleanisDeletedUser(ConfluenceUser user) Check whether or not a user has been deleted completely from the application.booleanisUnsyncedUser(ConfluenceUser user) Check whether or not a user exists in the application as unsynced.voidremove(ConfluenceUser user) Remove the supplied ConfluenceUser from persistence.rename(ConfluenceUser userToRename, String newUsername, boolean overrideExisting) Renames a userRenames a usersearchUnsyncedUsers(String searchParam) Search all unsynced users, whose account has been disconnected from an external directory, i.e.voidupdate(ConfluenceUser user) Change a property of an existing ConfluenceUser.
- 
Method Details- 
createpublic static CachingConfluenceUserDao create(ConfluenceUserDao delegate, com.atlassian.cache.CacheFactory cacheFactory) - Since:
- 7.5
 
- 
createDescription copied from interface:ConfluenceUserDaoCreate a new ConfluenceUser.- Specified by:
- createin interface- ConfluenceUserDao
 
- 
updateDescription copied from interface:ConfluenceUserDaoChange a property of an existing ConfluenceUser.- Specified by:
- updatein interface- ConfluenceUserDao
 
- 
removeDescription copied from interface:ConfluenceUserDaoRemove the supplied ConfluenceUser from persistence.- Specified by:
- removein interface- ConfluenceUserDao
 
- 
renameDescription copied from interface:ConfluenceUserDaoRenames a user- Specified by:
- renamein interface- ConfluenceUserDao
- Parameters:
- oldUsername- old username for the user
- newUsername- new username for the user
- overrideExisting- True if possible existing mapping should make way for the renamed one. False for opposite behaviour.
- Returns:
- renamed user
 
- 
renamepublic ConfluenceUser rename(ConfluenceUser userToRename, String newUsername, boolean overrideExisting) Description copied from interface:ConfluenceUserDaoRenames a user- Specified by:
- renamein interface- ConfluenceUserDao
- Parameters:
- userToRename- ConfluenceUser object representing user to rename
- newUsername- new username for the user
- overrideExisting- True if possible existing mapping should make way for the renamed one. False for opposite behaviour.
- Returns:
- renamed user
 
- 
deactivateUserDescription copied from interface:ConfluenceUserDaoDeactivates user. Record will stay in user_mapping table, but it will have null in lowerUsername- Specified by:
- deactivateUserin interface- ConfluenceUserDao
- Parameters:
- username- name of the user that should be deactivated
 
- 
findByKeyDescription copied from interface:ConfluenceUserDaoRetrieve a ConfluenceUser by the user key.- Specified by:
- findByKeyin interface- ConfluenceUserDao
- Returns:
- a ConfluenceUser with the supplied key
 
- 
findByUsernameDescription copied from interface:ConfluenceUserDaoFind the ConfluenceUser with the given user name.Note that username lookups are case-insensitive, so the user you get back may not have exactly the same name as the name passed to this method. - Specified by:
- findByUsernamein interface- ConfluenceUserDao
- Returns:
- a ConfluenceUser with the supplied username.
 
- 
getAll- Specified by:
- getAllin interface- ConfluenceUserDao
- Returns:
- all the ConfluenceUser
 
- 
findUserKeysByLowerNamespublic Map<String,com.atlassian.sal.api.user.UserKey> findUserKeysByLowerNames(Iterable<String> names) Description copied from interface:ConfluenceUserDaoBulk operation to find user key corresponding to lowercase name.- Specified by:
- findUserKeysByLowerNamesin interface- ConfluenceUserDao
- Returns:
- map of lowercase name by user key
 
- 
findLowerNamesByKeyspublic Map<com.atlassian.sal.api.user.UserKey,String> findLowerNamesByKeys(Iterable<com.atlassian.sal.api.user.UserKey> keys) Description copied from interface:ConfluenceUserDaoBulk operation to find lowercase name corresponding to user key.- Specified by:
- findLowerNamesByKeysin interface- ConfluenceUserDao
- Returns:
- map of user key by lowercase name
 
- 
isDeletedUserDescription copied from interface:ConfluenceUserDaoCheck whether or not a user has been deleted completely from the application. This means the user has a known mapping and no backing user and they have been remapped such that their username is equal to their user key.- Specified by:
- isDeletedUserin interface- ConfluenceUserDao
- Returns:
- true if the user has a known mapping, no backing user, and a username equal to their user key, false otherwise (even if the user doesn't exist)
 
- 
isUnsyncedUserDescription copied from interface:ConfluenceUserDaoCheck whether or not a user exists in the application as unsynced. This means that the user's account might have been disconnected from one or more user directories. The user has a known mapping and no backing user, but has not been fully deleted (per the definition ofConfluenceUserDao.isDeletedUser(ConfluenceUser)). This may include users who have technically been removed through Confluence prior to 6.13.0.- Specified by:
- isUnsyncedUserin interface- ConfluenceUserDao
- Returns:
- true if the user hasn't been deleted but has a known mapping and no backing user, false otherwise (even if the user doesn't exist)
 
- 
searchUnsyncedUsersDescription copied from interface:ConfluenceUserDaoSearch all unsynced users, whose account has been disconnected from an external directory, i.e. a user who has a known mapping but no backing user, but who has not yet been deleted from the application.- Specified by:
- searchUnsyncedUsersin interface- ConfluenceUserDao
- Parameters:
- searchParam- the username parameter to search by
- Returns:
- a list of lowercase usernames
 
- 
countUnsyncedUserspublic int countUnsyncedUsers()Description copied from interface:ConfluenceUserDaoGet a count of all unsynced users in Confluence. An unsynced user is a user that was managed in an external directory but has since been removed from the directory without being deleted in Confluence.- Specified by:
- countUnsyncedUsersin interface- ConfluenceUserDao
- Returns:
- the total number of all unsynced users.
 
- 
findByKeyspublic Map<com.atlassian.sal.api.user.UserKey,Optional<ConfluenceUser>> findByKeys(Set<com.atlassian.sal.api.user.UserKey> userkeys) Description copied from interface:ConfluenceUserDaoPerforms a bulk lookup of multipleConfluenceUsers.- Specified by:
- findByKeysin interface- ConfluenceUserDao
- Parameters:
- userkeys- The set of- UserKeys
- Returns:
- A MapofUserKeys toOptionalConfluenceUsers. EveryUserKeypresent in the userkeys parameter will have an entry in this map.
 
- 
findConfluenceUsersByLowerNamesDescription copied from interface:ConfluenceUserDaoFind allConfluenceUserwhich have the given lowerNames.- Specified by:
- findConfluenceUsersByLowerNamesin interface- ConfluenceUserDao
- Parameters:
- lowerNames- the lower names to match against a ConfluenceUser.
- Returns:
- a list of confluence users which have the given lowerNames.
 
- 
getAllUserKeysDescription copied from interface:ConfluenceUserDaoCurrently for testing purpose only- Specified by:
- getAllUserKeysin interface- ConfluenceUserDao
- Returns:
- all user keys
 
 
-