Class OfBizUserDao
java.lang.Object
com.atlassian.jira.crowd.embedded.ofbiz.OfBizUserDao
- All Implemented Interfaces:
- com.atlassian.crowd.embedded.spi.UserDao,- ExtendedUserDao
Implementation of the user DAO that works with OfBiz
- 
Constructor SummaryConstructorsConstructorDescriptionOfBizUserDao(OfBizDelegator ofBizDelegator, com.atlassian.crowd.embedded.spi.DirectoryDao directoryDao, InternalMembershipDao membershipDao, UserKeyStore userKeyStore, UserDeleteVeto userDeleteVeto, com.atlassian.cache.CacheManager cacheManager, com.atlassian.beehive.ClusterLockService clusterLockService, ApplicationProperties applicationProperties, OfBizTransactionManager ofBizTransactionManager, DatabaseConfigurationManager databaseConfigurationManager, com.atlassian.event.api.EventPublisher eventPublisher, OfBizServiceAccountDao serviceAccountDao, boolean primaryUserDao) 
- 
Method SummaryModifier and TypeMethodDescriptioncom.atlassian.crowd.model.user.Useradd(com.atlassian.crowd.model.user.User user, com.atlassian.crowd.embedded.api.PasswordCredential credential) com.atlassian.crowd.util.BatchResult<com.atlassian.crowd.model.user.User> findAllByNameOrNull(long directoryId, Collection<String> userNames) findByExternalId(long directoryId, String externalId) findByExternalIds(long directoryId, Set<String> externalIds) findById(long internalUserId) Finds a user by internal user ID.findByLoginInDb(String username) com.atlassian.crowd.model.user.TimestampedUserfindByName(long directoryId, String userName) findByNameOrNull(long directoryId, String userName) Tries to find the user by name and returns null if not found.com.atlassian.crowd.model.user.UserWithAttributesfindByNameWithAttributes(long directoryId, String userName) findDirectoryIdsContainingUserName(String username) 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 onXMLRestoreFinishedEventgetAllExternalIds(long directoryId) com.atlassian.crowd.embedded.api.PasswordCredentialgetCredential(long directoryId, String userName) List<com.atlassian.crowd.embedded.api.PasswordCredential> getCredentialHistory(long directoryId, String userName) longgetUniqueUserCount(Set<Long> directoryIds) longgetUserCount(long directoryId) 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.voidonBeforeUserAuthenticate(BeforeUserAuthenticate beforeUserAuthenticate) voidprocessUsers(Consumer<? super com.atlassian.crowd.model.user.User> userProcessor) Performs an operation on every user in the system.voidremove(com.atlassian.crowd.model.user.User user) com.atlassian.crowd.util.BatchResult<String> removeAllUsers(long directoryId, Set<String> userNames) voidremoveAttribute(com.atlassian.crowd.model.user.User user, String attributeName) com.atlassian.crowd.model.user.User<T> List<T> search(long directoryId, com.atlassian.crowd.search.query.entity.EntityQuery<T> query) voidsetAttributeForAllInDirectory(long directoryId, String attrName, String attrValue) voidstoreAttributes(com.atlassian.crowd.model.user.User user, Map<String, Set<String>> attributes, boolean updateTimestamp) com.atlassian.crowd.model.user.Userupdate(com.atlassian.crowd.model.user.User user) 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).voidupdateCredential(com.atlassian.crowd.model.user.User user, com.atlassian.crowd.embedded.api.PasswordCredential credential, int credentialHistory) protected voidupdateGroupMembership(long directoryId, String oldName, String newName) booleanboolean
- 
Constructor Details- 
OfBizUserDaopublic OfBizUserDao(OfBizDelegator ofBizDelegator, com.atlassian.crowd.embedded.spi.DirectoryDao directoryDao, InternalMembershipDao membershipDao, UserKeyStore userKeyStore, UserDeleteVeto userDeleteVeto, com.atlassian.cache.CacheManager cacheManager, com.atlassian.beehive.ClusterLockService clusterLockService, ApplicationProperties applicationProperties, OfBizTransactionManager ofBizTransactionManager, DatabaseConfigurationManager databaseConfigurationManager, com.atlassian.event.api.EventPublisher eventPublisher, OfBizServiceAccountDao serviceAccountDao, boolean primaryUserDao) 
 
- 
- 
Method Details- 
onBeforeUserAuthenticate
- 
findByLoginInDb
- 
useFullCachepublic boolean useFullCache()- Specified by:
- useFullCachein interface- ExtendedUserDao
 
- 
useInternedUserValuespublic boolean useInternedUserValues()- Specified by:
- useInternedUserValuesin interface- ExtendedUserDao
 
- 
findByName@Nonnull public com.atlassian.crowd.model.user.TimestampedUser findByName(long directoryId, String userName) throws UserNotFoundException - Specified by:
- findByNamein interface- com.atlassian.crowd.embedded.spi.UserDao
- Throws:
- UserNotFoundException
 
- 
findOfBizUser@Nonnull public OfBizUser findOfBizUser(long directoryId, String userName) throws UserNotFoundException - Specified by:
- findOfBizUserin interface- ExtendedUserDao
- Throws:
- UserNotFoundException
 
- 
findByNameOrNullTries to find the user by name and returns null if not found. Just like the public method should have done in the first place!- Specified by:
- findByNameOrNullin interface- ExtendedUserDao
- Parameters:
- directoryId- Directory ID
- userName- the username
- Returns:
- the user, or nullif the user does not exist
 
- 
findAllByNameOrNull@Nonnull public List<OfBizUser> findAllByNameOrNull(long directoryId, @Nonnull Collection<String> userNames) - Specified by:
- findAllByNameOrNullin interface- ExtendedUserDao
 
- 
findDirectoryIdsContainingUserName- Specified by:
- findDirectoryIdsContainingUserNamein interface- com.atlassian.crowd.embedded.spi.UserDao
 
- 
findByExternalIds- Specified by:
- findByExternalIdsin interface- com.atlassian.crowd.embedded.spi.UserDao
 
- 
findByExternalId@Nonnull public OfBizUser findByExternalId(long directoryId, String externalId) throws UserNotFoundException - Specified by:
- findByExternalIdin interface- com.atlassian.crowd.embedded.spi.UserDao
- Throws:
- UserNotFoundException
 
- 
findByIdDescription copied from interface:ExtendedUserDaoFinds a user by internal user ID.- Specified by:
- findByIdin interface- ExtendedUserDao
- Parameters:
- internalUserId- the user ID.
- Returns:
- the found user, or null if not found.
 
- 
findByNameWithAttributes@Nonnull public com.atlassian.crowd.model.user.UserWithAttributes findByNameWithAttributes(long directoryId, String userName) throws UserNotFoundException - Specified by:
- findByNameWithAttributesin interface- com.atlassian.crowd.embedded.spi.UserDao
- Throws:
- UserNotFoundException
 
- 
getCredential@Nullable public com.atlassian.crowd.embedded.api.PasswordCredential getCredential(long directoryId, String userName) throws UserNotFoundException - Specified by:
- getCredentialin interface- com.atlassian.crowd.embedded.spi.UserDao
- Throws:
- UserNotFoundException
 
- 
getCredentialHistorypublic List<com.atlassian.crowd.embedded.api.PasswordCredential> getCredentialHistory(long directoryId, String userName) throws UserNotFoundException - Specified by:
- getCredentialHistoryin interface- com.atlassian.crowd.embedded.spi.UserDao
- Throws:
- UserNotFoundException
 
- 
addpublic com.atlassian.crowd.model.user.User add(com.atlassian.crowd.model.user.User user, com.atlassian.crowd.embedded.api.PasswordCredential credential) throws com.atlassian.crowd.exception.UserAlreadyExistsException - Specified by:
- addin interface- com.atlassian.crowd.embedded.spi.UserDao
- Throws:
- com.atlassian.crowd.exception.UserAlreadyExistsException
 
- 
addAll@Nonnull public com.atlassian.crowd.util.BatchResult<com.atlassian.crowd.model.user.User> addAll(Set<com.atlassian.crowd.model.user.UserTemplateWithCredentialAndAttributes> users) - Specified by:
- addAllin interface- com.atlassian.crowd.embedded.spi.UserDao
 
- 
storeAttributespublic void storeAttributes(com.atlassian.crowd.model.user.User user, Map<String, Set<String>> attributes, boolean updateTimestamp) throws UserNotFoundException- Specified by:
- storeAttributesin interface- com.atlassian.crowd.embedded.spi.UserDao
- Throws:
- UserNotFoundException
 
- 
setAttributeForAllInDirectory- Specified by:
- setAttributeForAllInDirectoryin interface- com.atlassian.crowd.embedded.spi.UserDao
 
- 
updatepublic com.atlassian.crowd.model.user.User update(com.atlassian.crowd.model.user.User user) throws UserNotFoundException - Specified by:
- updatein interface- com.atlassian.crowd.embedded.spi.UserDao
- Throws:
- UserNotFoundException
 
- 
updatepublic com.atlassian.crowd.model.user.User update(com.atlassian.crowd.model.user.User user, boolean useJiraExtensions) throws UserNotFoundException Description copied from interface:ExtendedUserDaoUpdates user, for detailed description seeUserDao.update(com.atlassian.crowd.model.user.User).- Specified by:
- updatein interface- ExtendedUserDao
- Parameters:
- user- the user details, which should have the same name as the user to modify
- useJiraExtensions- 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:
 
- 
updateCredentialpublic void updateCredential(com.atlassian.crowd.model.user.User user, com.atlassian.crowd.embedded.api.PasswordCredential credential, int credentialHistory) throws UserNotFoundException - Specified by:
- updateCredentialin interface- com.atlassian.crowd.embedded.spi.UserDao
- Throws:
- UserNotFoundException
 
- 
renamepublic com.atlassian.crowd.model.user.User rename(com.atlassian.crowd.model.user.User oldUser, String newName) throws UserNotFoundException - Specified by:
- renamein interface- com.atlassian.crowd.embedded.spi.UserDao
- Throws:
- UserNotFoundException
 
- 
updateGroupMembership
- 
removeAllUserspublic com.atlassian.crowd.util.BatchResult<String> removeAllUsers(long directoryId, Set<String> userNames) - Specified by:
- removeAllUsersin interface- com.atlassian.crowd.embedded.spi.UserDao
 
- 
getAllExternalIdspublic Set<String> getAllExternalIds(long directoryId) throws com.atlassian.crowd.exception.DirectoryNotFoundException - Specified by:
- getAllExternalIdsin interface- com.atlassian.crowd.embedded.spi.UserDao
- Throws:
- com.atlassian.crowd.exception.DirectoryNotFoundException
 
- 
getUserCountpublic long getUserCount(long directoryId) throws com.atlassian.crowd.exception.DirectoryNotFoundException - Specified by:
- getUserCountin interface- com.atlassian.crowd.embedded.spi.UserDao
- Throws:
- com.atlassian.crowd.exception.DirectoryNotFoundException
 
- 
getUniqueUserCountpublic long getUniqueUserCount(Set<Long> directoryIds) throws com.atlassian.crowd.exception.DirectoryNotFoundException - Specified by:
- getUniqueUserCountin interface- ExtendedUserDao
- Throws:
- com.atlassian.crowd.exception.DirectoryNotFoundException
 
- 
removeAttributepublic void removeAttribute(com.atlassian.crowd.model.user.User user, String attributeName) throws UserNotFoundException - Specified by:
- removeAttributein interface- com.atlassian.crowd.embedded.spi.UserDao
- Throws:
- UserNotFoundException
 
- 
remove- Specified by:
- removein interface- com.atlassian.crowd.embedded.spi.UserDao
- Throws:
- UserNotFoundException
 
- 
searchpublic <T> List<T> search(long directoryId, com.atlassian.crowd.search.query.entity.EntityQuery<T> query) - Specified by:
- searchin interface- com.atlassian.crowd.embedded.spi.UserDao
 
- 
findNamesOfUsersInGroupsDescription copied from interface:ExtendedUserDaoReturns 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.- Specified by:
- findNamesOfUsersInGroupsin interface- ExtendedUserDao
- Parameters:
- groupNames- the names of the groups to search.
- Returns:
- set of all user names in these groups, in lower case.
 
- 
getAllAttributeKeys- Specified by:
- getAllAttributeKeysin interface- ExtendedUserDao
 
- 
processUsersDescription copied from interface:ExtendedUserDaoPerforms 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.- Specified by:
- processUsersin interface- ExtendedUserDao
- Parameters:
- userProcessor- the operation to perform on each user.
 
- 
isDeletedExternallypublic boolean isDeletedExternally(long internalUserId) Description copied from interface:ExtendedUserDaoChecks if user (identified by internal user ID) has been deleted from external user directory.- Specified by:
- isDeletedExternallyin interface- ExtendedUserDao
- Parameters:
- internalUserId- the user ID.
- Returns:
- true if user has been deleted from external directory, false otherwise.
 
- 
isDeletedExternallyDescription copied from interface:ExtendedUserDaoChecks if user (identified by directory ID and user name) has been deleted from external user directory.- Specified by:
- isDeletedExternallyin interface- ExtendedUserDao
- Parameters:
- directoryId- Directory ID
- userName- the username
- Returns:
- true if user has been deleted from external directory, false otherwise.
 
- 
flushCachepublic void flushCache()Description copied from interface:ExtendedUserDaoInvoked byOfBizCacheFlushingManagerto ensure caches are being flushed in the right order onXMLRestoreFinishedEvent- Specified by:
- flushCachein interface- ExtendedUserDao
 
 
-