public class CachedCrowdUserDao extends Object implements InternalUserDao, org.springframework.beans.factory.InitializingBean
| Constructor and Description |
|---|
CachedCrowdUserDao(InternalUserDao delegate,
com.atlassian.cache.CacheFactory cacheFactory,
com.atlassian.event.api.EventPublisher eventPublisher) |
| 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)
Removes all the adding users from the cache if they exist and delegates to the addAll method of the delegate DAO.
|
void |
afterPropertiesSet() |
com.atlassian.crowd.model.user.TimestampedUser |
findByExternalId(long directoryId,
String externalId) |
com.atlassian.crowd.model.user.TimestampedUser |
findByName(long directoryId,
String userName) |
Collection<com.atlassian.crowd.model.user.InternalUser> |
findByNames(long directoryId,
Collection<String> userNames)
Find all users from the list of user names
|
com.atlassian.crowd.model.user.UserWithAttributes |
findByNameWithAttributes(long directoryId,
String userName) |
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 |
getUserCount(long directoryId) |
com.atlassian.crowd.model.user.InternalUser |
internalFindByName(long directoryId,
String userName)
Find a persistent user object from a given directory and user name
|
com.atlassian.crowd.model.user.InternalUser |
internalFindByUser(com.atlassian.crowd.model.user.User user)
Find the persistent user object that corresponds to the provided user.
|
void |
remove(com.atlassian.crowd.model.user.User user) |
void |
removeAllUsers(long directoryId)
Remove all users from a particular directory (used when deleting an internal directory)
|
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 user,
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 maxCredentialHistory) |
public CachedCrowdUserDao(InternalUserDao delegate, com.atlassian.cache.CacheFactory cacheFactory, com.atlassian.event.api.EventPublisher eventPublisher)
public void afterPropertiesSet()
throws Exception
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBeanExceptionpublic com.atlassian.crowd.model.user.TimestampedUser findByName(long directoryId,
String userName)
throws com.atlassian.crowd.exception.UserNotFoundException
findByName in interface com.atlassian.crowd.embedded.spi.UserDaocom.atlassian.crowd.exception.UserNotFoundExceptionpublic com.atlassian.crowd.model.user.TimestampedUser findByExternalId(long directoryId,
String externalId)
throws com.atlassian.crowd.exception.UserNotFoundException
findByExternalId in interface com.atlassian.crowd.embedded.spi.UserDaocom.atlassian.crowd.exception.UserNotFoundExceptionpublic com.atlassian.crowd.model.user.UserWithAttributes findByNameWithAttributes(long directoryId,
String userName)
throws com.atlassian.crowd.exception.UserNotFoundException
findByNameWithAttributes in interface com.atlassian.crowd.embedded.spi.UserDaocom.atlassian.crowd.exception.UserNotFoundExceptionpublic com.atlassian.crowd.embedded.api.PasswordCredential getCredential(long directoryId,
String userName)
throws com.atlassian.crowd.exception.UserNotFoundException
getCredential in interface com.atlassian.crowd.embedded.spi.UserDaocom.atlassian.crowd.exception.UserNotFoundExceptionpublic List<com.atlassian.crowd.embedded.api.PasswordCredential> getCredentialHistory(long directoryId, String userName) throws com.atlassian.crowd.exception.UserNotFoundException
getCredentialHistory in interface com.atlassian.crowd.embedded.spi.UserDaocom.atlassian.crowd.exception.UserNotFoundExceptionpublic com.atlassian.crowd.util.BatchResult<com.atlassian.crowd.model.user.User> addAll(Set<com.atlassian.crowd.model.user.UserTemplateWithCredentialAndAttributes> users)
This method will not try and update the cache like add(User, PasswordCredential) because:
addAll in interface com.atlassian.crowd.embedded.spi.UserDaousers - the users to 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,
IllegalArgumentException,
com.atlassian.crowd.exception.DirectoryNotFoundException
add in interface com.atlassian.crowd.embedded.spi.UserDaocom.atlassian.crowd.exception.UserAlreadyExistsExceptionIllegalArgumentExceptioncom.atlassian.crowd.exception.DirectoryNotFoundExceptionpublic void storeAttributes(com.atlassian.crowd.model.user.User user,
Map<String,Set<String>> attributes)
throws com.atlassian.crowd.exception.UserNotFoundException
storeAttributes in interface com.atlassian.crowd.embedded.spi.UserDaocom.atlassian.crowd.exception.UserNotFoundExceptionpublic com.atlassian.crowd.model.user.User update(com.atlassian.crowd.model.user.User user)
throws com.atlassian.crowd.exception.UserNotFoundException,
IllegalArgumentException
update in interface com.atlassian.crowd.embedded.spi.UserDaocom.atlassian.crowd.exception.UserNotFoundExceptionIllegalArgumentExceptionpublic void updateCredential(com.atlassian.crowd.model.user.User user,
com.atlassian.crowd.embedded.api.PasswordCredential credential,
int maxCredentialHistory)
throws com.atlassian.crowd.exception.UserNotFoundException,
IllegalArgumentException
updateCredential in interface com.atlassian.crowd.embedded.spi.UserDaocom.atlassian.crowd.exception.UserNotFoundExceptionIllegalArgumentExceptionpublic com.atlassian.crowd.model.user.User rename(com.atlassian.crowd.model.user.User user,
String newName)
throws com.atlassian.crowd.exception.UserNotFoundException,
com.atlassian.crowd.exception.UserAlreadyExistsException,
IllegalArgumentException
rename in interface com.atlassian.crowd.embedded.spi.UserDaocom.atlassian.crowd.exception.UserNotFoundExceptioncom.atlassian.crowd.exception.UserAlreadyExistsExceptionIllegalArgumentExceptionpublic void removeAttribute(com.atlassian.crowd.model.user.User user,
String attributeName)
throws com.atlassian.crowd.exception.UserNotFoundException
removeAttribute in interface com.atlassian.crowd.embedded.spi.UserDaocom.atlassian.crowd.exception.UserNotFoundExceptionpublic void remove(com.atlassian.crowd.model.user.User user)
throws com.atlassian.crowd.exception.UserNotFoundException
remove in interface com.atlassian.crowd.embedded.spi.UserDaocom.atlassian.crowd.exception.UserNotFoundExceptionpublic <T> List<T> search(long directoryId, com.atlassian.crowd.search.query.entity.EntityQuery<T> query)
search in interface com.atlassian.crowd.embedded.spi.UserDaopublic com.atlassian.crowd.model.user.InternalUser internalFindByName(long directoryId,
String userName)
throws com.atlassian.crowd.exception.UserNotFoundException
InternalUserDaointernalFindByName in interface InternalUserDaocom.atlassian.crowd.exception.UserNotFoundExceptionpublic com.atlassian.crowd.model.user.InternalUser internalFindByUser(com.atlassian.crowd.model.user.User user)
throws com.atlassian.crowd.exception.UserNotFoundException
InternalUserDaointernalFindByUser in interface InternalUserDaocom.atlassian.crowd.exception.UserNotFoundExceptionpublic void removeAllUsers(long directoryId)
InternalUserDaoremoveAllUsers in interface InternalUserDaopublic Collection<com.atlassian.crowd.model.user.InternalUser> findByNames(long directoryId, Collection<String> userNames)
InternalUserDaofindByNames in interface InternalUserDaopublic com.atlassian.crowd.util.BatchResult<String> removeAllUsers(long directoryId, Set<String> userNames)
removeAllUsers in interface com.atlassian.crowd.embedded.spi.UserDaopublic void setAttributeForAllInDirectory(long directoryId,
String attrName,
String attrValue)
setAttributeForAllInDirectory 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.DirectoryNotFoundExceptionCopyright © 2003–2021 Atlassian. All rights reserved.