public class OfBizUserDao extends Object implements com.atlassian.crowd.embedded.spi.UserDao
| Constructor and Description |
|---|
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) |
| Modifier and Type | Method and Description |
|---|---|
com.atlassian.crowd.model.user.User |
add(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> |
addAll(Set<com.atlassian.crowd.model.user.UserTemplateWithCredentialAndAttributes> users) |
com.atlassian.jira.crowd.embedded.ofbiz.OfBizUser |
findByExternalId(long directoryId,
String externalId) |
com.atlassian.crowd.model.user.TimestampedUser |
findByName(long directoryId,
String userName) |
com.atlassian.crowd.model.user.UserWithAttributes |
findByNameWithAttributes(long directoryId,
String userName) |
Collection<String> |
findNamesOfUsersInGroups(Collection<String> groupNames)
Returns the lower-cased names of all users in the specified groups.
|
void |
flushCache()
Invoked by
OfBizCacheFlushingManager to ensure caches are being flushed in the right order on XMLRestoreFinishedEvent |
Collection<String> |
getAllAttributeKeys() |
Set<String> |
getAllExternalIds(long directoryId) |
com.atlassian.crowd.embedded.api.PasswordCredential |
getCredential(long directoryId,
String userName) |
List<com.atlassian.crowd.embedded.api.PasswordCredential> |
getCredentialHistory(long directoryId,
String userName) |
long |
getUniqueUserCount(Set<Long> directoryIds) |
long |
getUserCount(long directoryId) |
boolean |
isCacheInitialized()
We check if the cache is initialized or not.
|
void |
processUsers(java.util.function.Consumer<? super com.atlassian.crowd.model.user.User> userProcessor)
Performs an operation on every user in the system.
|
void |
remove(com.atlassian.crowd.model.user.User user) |
com.atlassian.crowd.util.BatchResult<String> |
removeAllUsers(long directoryId,
Set<String> userNames) |
void |
removeAttribute(com.atlassian.crowd.model.user.User user,
String attributeName) |
com.atlassian.crowd.model.user.User |
rename(com.atlassian.crowd.model.user.User oldUser,
String newName) |
<T> List<T> |
search(long directoryId,
com.atlassian.crowd.search.query.entity.EntityQuery<T> query) |
void |
setAttributeForAllInDirectory(long directoryId,
String attrName,
String attrValue) |
void |
storeAttributes(com.atlassian.crowd.model.user.User user,
Map<String,Set<String>> attributes) |
com.atlassian.crowd.model.user.User |
update(com.atlassian.crowd.model.user.User user) |
void |
updateCredential(com.atlassian.crowd.model.user.User user,
com.atlassian.crowd.embedded.api.PasswordCredential credential,
int credentialHistory) |
protected void |
updateGroupMembership(long directoryId,
String oldName,
String newName) |
boolean |
useFullCache() |
public 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)
public boolean useFullCache()
@Nonnull public com.atlassian.crowd.model.user.TimestampedUser findByName(long directoryId, String userName) throws UserNotFoundException
findByName in interface com.atlassian.crowd.embedded.spi.UserDaoUserNotFoundException@Nonnull public com.atlassian.jira.crowd.embedded.ofbiz.OfBizUser findByExternalId(long directoryId, String externalId) throws UserNotFoundException
findByExternalId in interface com.atlassian.crowd.embedded.spi.UserDaoUserNotFoundException@Nonnull public com.atlassian.crowd.model.user.UserWithAttributes findByNameWithAttributes(long directoryId, String userName) throws UserNotFoundException
findByNameWithAttributes in interface com.atlassian.crowd.embedded.spi.UserDaoUserNotFoundException@Nullable public com.atlassian.crowd.embedded.api.PasswordCredential getCredential(long directoryId, String userName) throws UserNotFoundException
getCredential in interface com.atlassian.crowd.embedded.spi.UserDaoUserNotFoundExceptionpublic List<com.atlassian.crowd.embedded.api.PasswordCredential> getCredentialHistory(long directoryId, String userName) throws UserNotFoundException
getCredentialHistory in interface com.atlassian.crowd.embedded.spi.UserDaoUserNotFoundExceptionpublic 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
add in interface com.atlassian.crowd.embedded.spi.UserDaocom.atlassian.crowd.exception.UserAlreadyExistsException@Nonnull public com.atlassian.crowd.util.BatchResult<com.atlassian.crowd.model.user.User> addAll(Set<com.atlassian.crowd.model.user.UserTemplateWithCredentialAndAttributes> users)
addAll in interface com.atlassian.crowd.embedded.spi.UserDaopublic void storeAttributes(com.atlassian.crowd.model.user.User user,
Map<String,Set<String>> attributes)
throws UserNotFoundException
storeAttributes in interface com.atlassian.crowd.embedded.spi.UserDaoUserNotFoundExceptionpublic void setAttributeForAllInDirectory(long directoryId,
String attrName,
String attrValue)
setAttributeForAllInDirectory in interface com.atlassian.crowd.embedded.spi.UserDaopublic com.atlassian.crowd.model.user.User update(com.atlassian.crowd.model.user.User user)
throws UserNotFoundException
update in interface com.atlassian.crowd.embedded.spi.UserDaoUserNotFoundExceptionpublic void updateCredential(com.atlassian.crowd.model.user.User user,
com.atlassian.crowd.embedded.api.PasswordCredential credential,
int credentialHistory)
throws UserNotFoundException
updateCredential in interface com.atlassian.crowd.embedded.spi.UserDaoUserNotFoundExceptionpublic com.atlassian.crowd.model.user.User rename(com.atlassian.crowd.model.user.User oldUser,
String newName)
throws UserNotFoundException
rename in interface com.atlassian.crowd.embedded.spi.UserDaoUserNotFoundExceptionpublic boolean isCacheInitialized()
protected void updateGroupMembership(long directoryId,
String oldName,
String newName)
public com.atlassian.crowd.util.BatchResult<String> removeAllUsers(long directoryId, Set<String> userNames)
removeAllUsers in interface com.atlassian.crowd.embedded.spi.UserDaopublic Set<String> getAllExternalIds(long directoryId) throws com.atlassian.crowd.exception.DirectoryNotFoundException
getAllExternalIds in interface com.atlassian.crowd.embedded.spi.UserDaocom.atlassian.crowd.exception.DirectoryNotFoundExceptionpublic long getUserCount(long directoryId)
throws com.atlassian.crowd.exception.DirectoryNotFoundException
getUserCount in interface com.atlassian.crowd.embedded.spi.UserDaocom.atlassian.crowd.exception.DirectoryNotFoundExceptionpublic long getUniqueUserCount(Set<Long> directoryIds) throws com.atlassian.crowd.exception.DirectoryNotFoundException
com.atlassian.crowd.exception.DirectoryNotFoundExceptionpublic void removeAttribute(com.atlassian.crowd.model.user.User user,
String attributeName)
throws UserNotFoundException
removeAttribute in interface com.atlassian.crowd.embedded.spi.UserDaoUserNotFoundExceptionpublic void remove(com.atlassian.crowd.model.user.User user)
throws UserNotFoundException
remove in interface com.atlassian.crowd.embedded.spi.UserDaoUserNotFoundExceptionpublic <T> List<T> search(long directoryId, com.atlassian.crowd.search.query.entity.EntityQuery<T> query)
search in interface com.atlassian.crowd.embedded.spi.UserDaopublic Collection<String> findNamesOfUsersInGroups(Collection<String> groupNames)
groupNames - the names of the groups to search.public Collection<String> getAllAttributeKeys()
public void processUsers(java.util.function.Consumer<? super com.atlassian.crowd.model.user.User> userProcessor)
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 userProcessor consumer.
userProcessor - the operation to perform on each user.public void flushCache()
OfBizCacheFlushingManager to ensure caches are being flushed in the right order on XMLRestoreFinishedEventCopyright © 2002-2015 Atlassian. All Rights Reserved.