public class

CachedCrowdUserDao

extends Object
implements InternalUserDao InitializingBean
java.lang.Object
   ↳ com.atlassian.confluence.user.crowd.CachedCrowdUserDao

Class Overview

A caching decorator for an InternalUserDao.

Summary

Public Constructors
CachedCrowdUserDao(InternalUserDao delegate, CacheFactory cacheFactory)
Public Methods
User add(User user, PasswordCredential credential)
BatchResult<User> addAll(Set<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()
TimestampedUser findByName(long directoryId, String userName)
UserWithAttributes findByNameWithAttributes(long directoryId, String userName)
Collection<InternalUser> findByNames(long directoryId, Collection<String> userNames)
PasswordCredential getCredential(long directoryId, String userName)
List<PasswordCredential> getCredentialHistory(long directoryId, String userName)
InternalUser internalFindByName(long directoryId, String userName)
InternalUser internalFindByUser(User user)
void remove(User user)
void removeAllUsers(long directoryId, Set<String> userNames)
void removeAllUsers(long directoryId)
void removeAttribute(User user, String attributeName)
User rename(User user, String newName)
<T> List<T> search(long directoryId, EntityQuery<T> query)
void storeAttributes(User user, Map<StringSet<String>> attributes)
User update(User user)
void updateCredential(User user, PasswordCredential credential, int maxCredentialHistory)
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.atlassian.crowd.embedded.hibernate2.InternalUserDao
From interface com.atlassian.crowd.embedded.spi.UserDao
From interface org.springframework.beans.factory.InitializingBean

Public Constructors

public CachedCrowdUserDao (InternalUserDao delegate, CacheFactory cacheFactory)

Public Methods

public User add (User user, PasswordCredential credential)

Throws
UserAlreadyExistsException
IllegalArgumentException
DirectoryNotFoundException

public BatchResult<User> addAll (Set<UserTemplateWithCredentialAndAttributes> users)

Removes all the adding users from the cache if they exist and delegates to the addAll method of the delegate DAO. This method will not try and update the cache like add(User, PasswordCredential) because:

  • We want to delegate to the "addAll" method on the delegate as its the fastest way to add a large number of users, we can't just delegate to add method
  • Unlike the add method, we don't get a reference to the added user so we can't reliably update the cache, so we just remove it.
Parameters
users the users to add
Returns
  • a BatchResult describing the result

public void afterPropertiesSet ()

Throws
Exception

public TimestampedUser findByName (long directoryId, String userName)

public UserWithAttributes findByNameWithAttributes (long directoryId, String userName)

public Collection<InternalUser> findByNames (long directoryId, Collection<String> userNames)

public PasswordCredential getCredential (long directoryId, String userName)

public List<PasswordCredential> getCredentialHistory (long directoryId, String userName)

public InternalUser internalFindByName (long directoryId, String userName)

public InternalUser internalFindByUser (User user)

public void remove (User user)

public void removeAllUsers (long directoryId, Set<String> userNames)

public void removeAllUsers (long directoryId)

public void removeAttribute (User user, String attributeName)

public User rename (User user, String newName)

Throws
UserNotFoundException
UserAlreadyExistsException
IllegalArgumentException

public List<T> search (long directoryId, EntityQuery<T> query)

public void storeAttributes (User user, Map<StringSet<String>> attributes)

public User update (User user)

public void updateCredential (User user, PasswordCredential credential, int maxCredentialHistory)