public class

CachedCrowdGroupDao

extends Object
implements InternalGroupDao InitializingBean
java.lang.Object
   ↳ com.atlassian.confluence.user.crowd.CachedCrowdGroupDao

Class Overview

A caching decorator for an InternalUserDao.

Summary

Public Constructors
CachedCrowdGroupDao(InternalGroupDao delegate, CacheFactory cacheFactory)
Public Methods
Group add(Group group)
Adds the passed in group by calling the delegate dao's add method.
BatchResult<Group> addAll(Set<? extends Group> groups)
Removes all the adding groups from the cache and delegates to the addAll method of the delegate DAO.
Group addLocal(Group group)
void afterPropertiesSet()
InternalDirectoryGroup findByName(long directoryId, String name)
GroupWithAttributes findByNameWithAttributes(long directoryId, String name)
InternalGroup internalFindByGroup(Group group)
InternalGroup internalFindByName(long directoryId, String groupName)
void remove(Group group)
void removeAllGroups(long directoryId, Set<String> groupNames)
void removeAllGroups(long directoryId)
void removeAttribute(Group group, String attributeName)
Group rename(Group group, String newName)
<T> List<T> search(long directoryId, EntityQuery<T> query)
void storeAttributes(Group group, Map<StringSet<String>> attributes)
Group update(Group group)
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.atlassian.crowd.embedded.hibernate2.InternalGroupDao
From interface com.atlassian.crowd.embedded.spi.GroupDao
From interface org.springframework.beans.factory.InitializingBean

Public Constructors

public CachedCrowdGroupDao (InternalGroupDao delegate, CacheFactory cacheFactory)

Public Methods

public Group add (Group group)

Adds the passed in group by calling the delegate dao's add method. Updates the cache to match the newly created group.

Parameters
group the group to add
Returns
  • the added group

public BatchResult<Group> addAll (Set<? extends Group> groups)

Removes all the adding groups from the cache and delegates to the addAll method of the delegate DAO. This method will not try and update the cache like add(Group) because:

  • We want to delegate to the "addAll" method on the delegate as its the fastest way to add a large number of groups, we can't just delegate to add method
  • Unlike the add method, we don't get a reference to the added group so we can't reliably update the cache, so we just remove it.
Parameters
groups the groups to add
Returns
  • a BatchResult describing the result
Throws
DirectoryNotFoundException if the directory for any of the groups is not found

public Group addLocal (Group group)

public void afterPropertiesSet ()

Throws
Exception

public InternalDirectoryGroup findByName (long directoryId, String name)

public GroupWithAttributes findByNameWithAttributes (long directoryId, String name)

public InternalGroup internalFindByGroup (Group group)

public InternalGroup internalFindByName (long directoryId, String groupName)

public void remove (Group group)

public void removeAllGroups (long directoryId, Set<String> groupNames)

public void removeAllGroups (long directoryId)

public void removeAttribute (Group group, String attributeName)

public Group rename (Group group, String newName)

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

public void storeAttributes (Group group, Map<StringSet<String>> attributes)

public Group update (Group group)