Interface ExtendedUserDao
- All Superinterfaces:
com.atlassian.crowd.embedded.spi.UserDao
- All Known Implementing Classes:
IndexedUserDao,OfBizUserDao,SwitchingUserDao
public interface ExtendedUserDao
extends com.atlassian.crowd.embedded.spi.UserDao
User DAO with legacy JIRA customizations.
-
Method Summary
Modifier and TypeMethodDescriptionfindAllByNameOrNull(long directoryId, Collection<String> userNames) findById(long internalUserId) Finds a user by internal user ID.findByNameOrNull(long directoryId, String userName) Tries to find the user by name and returns null if not found.findNamesOfUsersInGroups(Collection<String> groupNames) Returns the lower-cased names of all users in the specified groups.findOfBizUser(long directoryId, String userName) voidInvoked byOfBizCacheFlushingManagerto ensure caches are being flushed in the right order onXMLRestoreFinishedEventlonggetUniqueUserCount(Set<Long> directoryIds) booleanisDeletedExternally(long internalUserId) Checks if user (identified by internal user ID) has been deleted from external user directory.booleanisDeletedExternally(long directoryId, String userName) Checks if user (identified by directory ID and user name) has been deleted from external user directory.voidprocessUsers(Consumer<? super com.atlassian.crowd.model.user.User> userProcessor) Performs an operation on every user in the system.com.atlassian.crowd.model.user.Userupdate(com.atlassian.crowd.model.user.User user, boolean useJiraExtensions) Updates user, for detailed description seeUserDao.update(com.atlassian.crowd.model.user.User).booleanbooleanMethods inherited from interface com.atlassian.crowd.embedded.spi.UserDao
add, addAll, findByExternalId, findByExternalIds, findByName, findByNameWithAttributes, findDirectoryIdsContainingUserName, getAllExternalIds, getCredential, getCredentialHistory, getUserCount, remove, removeAllUsers, removeAttribute, rename, search, setAttributeForAllInDirectory, storeAttributes, update, updateCredential
-
Method Details
-
useFullCache
boolean useFullCache() -
useInternedUserValues
boolean useInternedUserValues() -
getUniqueUserCount
long getUniqueUserCount(Set<Long> directoryIds) throws com.atlassian.crowd.exception.DirectoryNotFoundException - Throws:
com.atlassian.crowd.exception.DirectoryNotFoundException
-
findNamesOfUsersInGroups
Returns the lower-cased names of all users in the specified groups. Only searches directly in these groups, if a recursive group search is required the caller will need to pre-expand the groups.- Parameters:
groupNames- the names of the groups to search.- Returns:
- set of all user names in these groups, in lower case.
-
findOfBizUser
- Throws:
UserNotFoundException
-
findAllByNameOrNull
-
findByNameOrNull
Tries to find the user by name and returns null if not found. Just like the public method should have done in the first place!- Parameters:
directoryId- Directory IDuserName- the username- Returns:
- the user, or
nullif the user does not exist
-
getAllAttributeKeys
Collection<String> getAllAttributeKeys() -
processUsers
Performs an operation on every user in the system.This can be a time-consuming operation on JIRA instances that contain many users. It is recommended to use one of the search methods where possible.
This method performs a live iteration over a database result set. Care must be taken if additional database operations are performed within the
userProcessorconsumer.- Parameters:
userProcessor- the operation to perform on each user.- Since:
- v7.0
-
flushCache
void flushCache()Invoked byOfBizCacheFlushingManagerto ensure caches are being flushed in the right order onXMLRestoreFinishedEvent -
findById
Finds a user by internal user ID.- Parameters:
internalUserId- the user ID.- Returns:
- the found user, or null if not found.
-
isDeletedExternally
boolean isDeletedExternally(long internalUserId) Checks if user (identified by internal user ID) has been deleted from external user directory.- Parameters:
internalUserId- the user ID.- Returns:
- true if user has been deleted from external directory, false otherwise.
-
isDeletedExternally
Checks if user (identified by directory ID and user name) has been deleted from external user directory.- Parameters:
directoryId- Directory IDuserName- the username- Returns:
- true if user has been deleted from external directory, false otherwise.
-
update
com.atlassian.crowd.model.user.User update(com.atlassian.crowd.model.user.User user, boolean useJiraExtensions) throws UserNotFoundException Updates user, for detailed description seeUserDao.update(com.atlassian.crowd.model.user.User).- Parameters:
user- the user details, which should have the same name as the user to modifyuseJiraExtensions- Whether jira extensions should be run. Currently only extension is that when externally deleted user is updated (inactive and flagged) "externally deleted" flag is cleared and user is made active.- Returns:
- the updated user
- Throws:
UserNotFoundException- if there is no user with the same name (case-insensitive) and directory as the user provided- See Also:
-