Class HibernateGroupDao
- java.lang.Object
-
- com.atlassian.confluence.impl.user.crowd.hibernate.HibernateGroupDao
-
- All Implemented Interfaces:
InternalGroupDao<com.atlassian.crowd.model.group.InternalGroup>,com.atlassian.crowd.embedded.spi.GroupDao
public class HibernateGroupDao extends Object implements InternalGroupDao<com.atlassian.crowd.model.group.InternalGroup>
Hibernate 5/Spring implementation of group persistence- Since:
- 7.20.0
-
-
Constructor Summary
Constructors Constructor Description HibernateGroupDao(org.hibernate.SessionFactory sessionFactory, Supplier<com.atlassian.crowd.embedded.spi.DirectoryDao> directoryDao, InternalMembershipDao membershipDao, com.atlassian.crowd.util.persistence.hibernate.batch.BatchProcessor<org.hibernate.Session> batchProcessor, com.atlassian.crowd.util.persistence.hibernate.batch.BatchFinder batchFinder)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description com.atlassian.crowd.model.group.InternalGroupadd(com.atlassian.crowd.model.group.Group group)com.atlassian.crowd.util.BatchResult<com.atlassian.crowd.model.group.Group>addAll(Set<? extends com.atlassian.crowd.model.group.Group> groups)com.atlassian.crowd.model.group.InternalGroupaddLocal(com.atlassian.crowd.model.group.Group group)Map<String,String>findByExternalIds(long directoryId, Set<String> externalIds)com.atlassian.crowd.model.group.InternalDirectoryGroupfindByName(long directoryId, String name)com.atlassian.crowd.model.group.GroupWithAttributesfindByNameWithAttributes(long directoryId, String name)Map<String,String>findExternalIdsByNames(long directoryId, Set<String> groupNames)Set<String>getAllExternalIds(long directoryId)longgetExternalGroupCount(long directoryId)longgetGroupCount(long directoryId)Set<String>getLocalGroupNames(long directoryId)com.atlassian.crowd.model.group.InternalGroupinternalFindByGroup(com.atlassian.crowd.model.group.Group group)Find the persistent group object that corresponds to the provided group.com.atlassian.crowd.model.group.InternalGroupinternalFindByName(long directoryId, String name)Find a persistent group object from a given directory and group namevoidremove(com.atlassian.crowd.model.group.Group group)voidremoveAllGroups(long directoryId)Remove all groups from a particular directory (used when deleting an internal directory)com.atlassian.crowd.util.BatchResult<String>removeAllGroups(long directoryId, Set<String> groupNames)voidremoveAttribute(com.atlassian.crowd.model.group.Group group, String attributeName)com.atlassian.crowd.model.group.Grouprename(com.atlassian.crowd.model.group.Group group, String newName)<T> List<T>search(long directoryId, com.atlassian.crowd.search.query.entity.EntityQuery<T> query)voidstoreAttributes(com.atlassian.crowd.model.group.Group group, Map<String,Set<String>> attributes)com.atlassian.crowd.model.group.Groupupdate(com.atlassian.crowd.model.group.Group group)
-
-
-
Constructor Detail
-
HibernateGroupDao
public HibernateGroupDao(org.hibernate.SessionFactory sessionFactory, Supplier<com.atlassian.crowd.embedded.spi.DirectoryDao> directoryDao, InternalMembershipDao membershipDao, com.atlassian.crowd.util.persistence.hibernate.batch.BatchProcessor<org.hibernate.Session> batchProcessor, com.atlassian.crowd.util.persistence.hibernate.batch.BatchFinder batchFinder)
-
-
Method Detail
-
findByName
public com.atlassian.crowd.model.group.InternalDirectoryGroup findByName(long directoryId, String name) throws com.atlassian.crowd.exception.GroupNotFoundException- Specified by:
findByNamein interfacecom.atlassian.crowd.embedded.spi.GroupDao- Throws:
com.atlassian.crowd.exception.GroupNotFoundException
-
removeAllGroups
public com.atlassian.crowd.util.BatchResult<String> removeAllGroups(long directoryId, Set<String> groupNames)
- Specified by:
removeAllGroupsin interfacecom.atlassian.crowd.embedded.spi.GroupDao
-
getAllExternalIds
public Set<String> getAllExternalIds(long directoryId) throws com.atlassian.crowd.exception.DirectoryNotFoundException
- Specified by:
getAllExternalIdsin interfacecom.atlassian.crowd.embedded.spi.GroupDao- Throws:
com.atlassian.crowd.exception.DirectoryNotFoundException
-
getGroupCount
public long getGroupCount(long directoryId) throws com.atlassian.crowd.exception.DirectoryNotFoundException- Specified by:
getGroupCountin interfacecom.atlassian.crowd.embedded.spi.GroupDao- Throws:
com.atlassian.crowd.exception.DirectoryNotFoundException
-
getLocalGroupNames
public Set<String> getLocalGroupNames(long directoryId) throws com.atlassian.crowd.exception.DirectoryNotFoundException
- Specified by:
getLocalGroupNamesin interfacecom.atlassian.crowd.embedded.spi.GroupDao- Throws:
com.atlassian.crowd.exception.DirectoryNotFoundException
-
findByExternalIds
public Map<String,String> findByExternalIds(long directoryId, Set<String> externalIds)
- Specified by:
findByExternalIdsin interfacecom.atlassian.crowd.embedded.spi.GroupDao
-
findExternalIdsByNames
public Map<String,String> findExternalIdsByNames(long directoryId, Set<String> groupNames)
- Specified by:
findExternalIdsByNamesin interfacecom.atlassian.crowd.embedded.spi.GroupDao
-
getExternalGroupCount
public long getExternalGroupCount(long directoryId) throws com.atlassian.crowd.exception.DirectoryNotFoundException- Specified by:
getExternalGroupCountin interfacecom.atlassian.crowd.embedded.spi.GroupDao- Throws:
com.atlassian.crowd.exception.DirectoryNotFoundException
-
findByNameWithAttributes
public com.atlassian.crowd.model.group.GroupWithAttributes findByNameWithAttributes(long directoryId, String name) throws com.atlassian.crowd.exception.GroupNotFoundException- Specified by:
findByNameWithAttributesin interfacecom.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(Set<? extends com.atlassian.crowd.model.group.Group> groups) throws com.atlassian.crowd.exception.DirectoryNotFoundException
- Specified by:
addAllin interfacecom.atlassian.crowd.embedded.spi.GroupDao- Throws:
com.atlassian.crowd.exception.DirectoryNotFoundException
-
add
public com.atlassian.crowd.model.group.InternalGroup add(com.atlassian.crowd.model.group.Group group) throws com.atlassian.crowd.exception.DirectoryNotFoundException- Specified by:
addin interfacecom.atlassian.crowd.embedded.spi.GroupDao- Specified by:
addin interfaceInternalGroupDao<com.atlassian.crowd.model.group.InternalGroup>- Throws:
com.atlassian.crowd.exception.DirectoryNotFoundException
-
addLocal
public com.atlassian.crowd.model.group.InternalGroup addLocal(com.atlassian.crowd.model.group.Group group) throws com.atlassian.crowd.exception.DirectoryNotFoundException- Specified by:
addLocalin interfacecom.atlassian.crowd.embedded.spi.GroupDao- Specified by:
addLocalin interfaceInternalGroupDao<com.atlassian.crowd.model.group.InternalGroup>- Throws:
com.atlassian.crowd.exception.DirectoryNotFoundException
-
update
public com.atlassian.crowd.model.group.Group update(com.atlassian.crowd.model.group.Group group) throws com.atlassian.crowd.exception.GroupNotFoundException- Specified by:
updatein interfacecom.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, String newName) throws com.atlassian.crowd.exception.GroupNotFoundException- Specified by:
renamein interfacecom.atlassian.crowd.embedded.spi.GroupDao- 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.GroupNotFoundExceptionDescription copied from interface:InternalGroupDaoFind the persistent group object that corresponds to the provided group.- Specified by:
internalFindByGroupin interfaceInternalGroupDao<com.atlassian.crowd.model.group.InternalGroup>- Throws:
com.atlassian.crowd.exception.GroupNotFoundException
-
removeAllGroups
public void removeAllGroups(long directoryId)
Description copied from interface:InternalGroupDaoRemove all groups from a particular directory (used when deleting an internal directory)- Specified by:
removeAllGroupsin interfaceInternalGroupDao<com.atlassian.crowd.model.group.InternalGroup>
-
storeAttributes
public void storeAttributes(com.atlassian.crowd.model.group.Group group, Map<String,Set<String>> attributes) throws com.atlassian.crowd.exception.GroupNotFoundException- Specified by:
storeAttributesin interfacecom.atlassian.crowd.embedded.spi.GroupDao- Throws:
com.atlassian.crowd.exception.GroupNotFoundException
-
removeAttribute
public void removeAttribute(com.atlassian.crowd.model.group.Group group, String attributeName) throws com.atlassian.crowd.exception.GroupNotFoundException- Specified by:
removeAttributein interfacecom.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:
removein interfacecom.atlassian.crowd.embedded.spi.GroupDao- Throws:
com.atlassian.crowd.exception.GroupNotFoundException
-
search
public <T> List<T> search(long directoryId, com.atlassian.crowd.search.query.entity.EntityQuery<T> query)
- Specified by:
searchin interfacecom.atlassian.crowd.embedded.spi.GroupDao
-
internalFindByName
public com.atlassian.crowd.model.group.InternalGroup internalFindByName(long directoryId, String name) throws com.atlassian.crowd.exception.GroupNotFoundExceptionDescription copied from interface:InternalGroupDaoFind a persistent group object from a given directory and group name- Specified by:
internalFindByNamein interfaceInternalGroupDao<com.atlassian.crowd.model.group.InternalGroup>- Throws:
com.atlassian.crowd.exception.GroupNotFoundException
-
-