com.atlassian.confluence.user.crowd
Class CachedCrowdGroupDao

java.lang.Object
  extended by com.atlassian.confluence.user.crowd.CachedCrowdGroupDao
All Implemented Interfaces:
InternalGroupDao, com.atlassian.crowd.embedded.spi.GroupDao, org.springframework.beans.factory.InitializingBean

public class CachedCrowdGroupDao
extends java.lang.Object
implements InternalGroupDao, org.springframework.beans.factory.InitializingBean

A caching decorator for an InternalUserDao.


Constructor Summary
CachedCrowdGroupDao(InternalGroupDao delegate, com.atlassian.cache.CacheFactory cacheFactory)
           
 
Method Summary
 com.atlassian.crowd.model.group.Group add(com.atlassian.crowd.model.group.Group group)
          Adds the passed in group by calling the delegate dao's add method.
 com.atlassian.crowd.util.BatchResult<com.atlassian.crowd.model.group.Group> addAll(java.util.Set<? extends com.atlassian.crowd.model.group.Group> groups)
          Removes all the adding groups from the cache and delegates to the addAll method of the delegate DAO.
 com.atlassian.crowd.model.group.Group addLocal(com.atlassian.crowd.model.group.Group group)
           
 void afterPropertiesSet()
           
 com.atlassian.crowd.model.group.InternalDirectoryGroup findByName(long directoryId, java.lang.String name)
           
 com.atlassian.crowd.model.group.GroupWithAttributes findByNameWithAttributes(long directoryId, java.lang.String name)
           
 com.atlassian.crowd.model.group.InternalGroup internalFindByGroup(com.atlassian.crowd.model.group.Group group)
          Find the persistent group object that corresponds to the provided group.
 com.atlassian.crowd.model.group.InternalGroup internalFindByName(long directoryId, java.lang.String groupName)
          Find a persistent group object from a given directory and group name
 void remove(com.atlassian.crowd.model.group.Group group)
           
 void removeAllGroups(long directoryId)
          Remove all groups from a particular directory (used when deleting an internal directory)
 com.atlassian.crowd.util.BatchResult<java.lang.String> removeAllGroups(long directoryId, java.util.Set<java.lang.String> groupNames)
           
 void removeAttribute(com.atlassian.crowd.model.group.Group group, java.lang.String attributeName)
           
 com.atlassian.crowd.model.group.Group rename(com.atlassian.crowd.model.group.Group group, java.lang.String newName)
           
<T> java.util.List<T>
search(long directoryId, com.atlassian.crowd.search.query.entity.EntityQuery<T> query)
           
 void storeAttributes(com.atlassian.crowd.model.group.Group group, java.util.Map<java.lang.String,java.util.Set<java.lang.String>> attributes)
           
 com.atlassian.crowd.model.group.Group update(com.atlassian.crowd.model.group.Group group)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CachedCrowdGroupDao

public CachedCrowdGroupDao(InternalGroupDao delegate,
                           com.atlassian.cache.CacheFactory cacheFactory)
Method Detail

afterPropertiesSet

public void afterPropertiesSet()
                        throws java.lang.Exception
Specified by:
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
Throws:
java.lang.Exception

findByName

public com.atlassian.crowd.model.group.InternalDirectoryGroup findByName(long directoryId,
                                                                         java.lang.String name)
                                                                  throws com.atlassian.crowd.exception.GroupNotFoundException
Specified by:
findByName in interface com.atlassian.crowd.embedded.spi.GroupDao
Throws:
com.atlassian.crowd.exception.GroupNotFoundException

findByNameWithAttributes

public com.atlassian.crowd.model.group.GroupWithAttributes findByNameWithAttributes(long directoryId,
                                                                                    java.lang.String name)
                                                                             throws com.atlassian.crowd.exception.GroupNotFoundException
Specified by:
findByNameWithAttributes in interface com.atlassian.crowd.embedded.spi.GroupDao
Throws:
com.atlassian.crowd.exception.GroupNotFoundException

addAll

public com.atlassian.crowd.util.BatchResult<com.atlassian.crowd.model.group.Group> addAll(java.util.Set<? extends com.atlassian.crowd.model.group.Group> groups)
                                                                                   throws com.atlassian.crowd.exception.DirectoryNotFoundException
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:

Specified by:
addAll in interface com.atlassian.crowd.embedded.spi.GroupDao
Parameters:
groups - the groups to add
Returns:
a BatchResult describing the result
Throws:
com.atlassian.crowd.exception.DirectoryNotFoundException - if the directory for any of the groups is not found

add

public com.atlassian.crowd.model.group.Group add(com.atlassian.crowd.model.group.Group group)
                                          throws com.atlassian.crowd.exception.DirectoryNotFoundException,
                                                 com.atlassian.crowd.exception.InvalidGroupException
Adds the passed in group by calling the delegate dao's add method. Updates the cache to match the newly created group.

Specified by:
add in interface com.atlassian.crowd.embedded.spi.GroupDao
Parameters:
group - the group to add
Returns:
the added group
Throws:
com.atlassian.crowd.exception.DirectoryNotFoundException
com.atlassian.crowd.exception.InvalidGroupException

addLocal

public com.atlassian.crowd.model.group.Group addLocal(com.atlassian.crowd.model.group.Group group)
                                               throws com.atlassian.crowd.exception.DirectoryNotFoundException,
                                                      com.atlassian.crowd.exception.InvalidGroupException
Specified by:
addLocal in interface com.atlassian.crowd.embedded.spi.GroupDao
Throws:
com.atlassian.crowd.exception.DirectoryNotFoundException
com.atlassian.crowd.exception.InvalidGroupException

update

public com.atlassian.crowd.model.group.Group update(com.atlassian.crowd.model.group.Group group)
                                             throws com.atlassian.crowd.exception.GroupNotFoundException
Specified by:
update in interface com.atlassian.crowd.embedded.spi.GroupDao
Throws:
com.atlassian.crowd.exception.GroupNotFoundException

rename

public com.atlassian.crowd.model.group.Group rename(com.atlassian.crowd.model.group.Group group,
                                                    java.lang.String newName)
                                             throws com.atlassian.crowd.exception.GroupNotFoundException,
                                                    com.atlassian.crowd.exception.InvalidGroupException
Specified by:
rename in interface com.atlassian.crowd.embedded.spi.GroupDao
Throws:
com.atlassian.crowd.exception.GroupNotFoundException
com.atlassian.crowd.exception.InvalidGroupException

storeAttributes

public void storeAttributes(com.atlassian.crowd.model.group.Group group,
                            java.util.Map<java.lang.String,java.util.Set<java.lang.String>> attributes)
                     throws com.atlassian.crowd.exception.GroupNotFoundException
Specified by:
storeAttributes in interface com.atlassian.crowd.embedded.spi.GroupDao
Throws:
com.atlassian.crowd.exception.GroupNotFoundException

removeAttribute

public void removeAttribute(com.atlassian.crowd.model.group.Group group,
                            java.lang.String attributeName)
                     throws com.atlassian.crowd.exception.GroupNotFoundException
Specified by:
removeAttribute in interface com.atlassian.crowd.embedded.spi.GroupDao
Throws:
com.atlassian.crowd.exception.GroupNotFoundException

remove

public void remove(com.atlassian.crowd.model.group.Group group)
            throws com.atlassian.crowd.exception.GroupNotFoundException
Specified by:
remove in interface com.atlassian.crowd.embedded.spi.GroupDao
Throws:
com.atlassian.crowd.exception.GroupNotFoundException

search

public <T> java.util.List<T> search(long directoryId,
                                    com.atlassian.crowd.search.query.entity.EntityQuery<T> query)
Specified by:
search in interface com.atlassian.crowd.embedded.spi.GroupDao

internalFindByName

public com.atlassian.crowd.model.group.InternalGroup internalFindByName(long directoryId,
                                                                        java.lang.String groupName)
                                                                 throws com.atlassian.crowd.exception.GroupNotFoundException
Description copied from interface: InternalGroupDao
Find a persistent group object from a given directory and group name

Specified by:
internalFindByName in interface InternalGroupDao
Throws:
com.atlassian.crowd.exception.GroupNotFoundException

internalFindByGroup

public com.atlassian.crowd.model.group.InternalGroup internalFindByGroup(com.atlassian.crowd.model.group.Group group)
                                                                  throws com.atlassian.crowd.exception.GroupNotFoundException
Description copied from interface: InternalGroupDao
Find the persistent group object that corresponds to the provided group.

Specified by:
internalFindByGroup in interface InternalGroupDao
Throws:
com.atlassian.crowd.exception.GroupNotFoundException

removeAllGroups

public void removeAllGroups(long directoryId)
Description copied from interface: InternalGroupDao
Remove all groups from a particular directory (used when deleting an internal directory)

Specified by:
removeAllGroups in interface InternalGroupDao

removeAllGroups

public com.atlassian.crowd.util.BatchResult<java.lang.String> removeAllGroups(long directoryId,
                                                                              java.util.Set<java.lang.String> groupNames)
Specified by:
removeAllGroups in interface com.atlassian.crowd.embedded.spi.GroupDao


Copyright © 2003-2014 Atlassian. All Rights Reserved.