Class HibernateMembershipDao

  • All Implemented Interfaces:
    com.atlassian.crowd.embedded.spi.MembershipDao

    public class HibernateMembershipDao
    extends Object
    implements com.atlassian.crowd.embedded.spi.MembershipDao
    Implementation of MembershipDao
    Since:
    7.20.0
    • Constructor Detail

      • HibernateMembershipDao

        public HibernateMembershipDao​(org.hibernate.SessionFactory sessionFactory,
                                      InternalUserDao userDao,
                                      InternalGroupDao groupDao,
                                      com.atlassian.crowd.util.persistence.hibernate.batch.BatchProcessor batchProcessor)
    • Method Detail

      • addAllUsersToGroup

        public com.atlassian.crowd.util.BatchResult<String> addAllUsersToGroup​(long directoryId,
                                                                               Collection<String> userNames,
                                                                               String groupName)
                                                                        throws com.atlassian.crowd.exception.GroupNotFoundException
        Specified by:
        addAllUsersToGroup in interface com.atlassian.crowd.embedded.spi.MembershipDao
        Throws:
        com.atlassian.crowd.exception.GroupNotFoundException
      • isUserDirectMember

        public boolean isUserDirectMember​(long directoryId,
                                          String userName,
                                          String groupName)
        Specified by:
        isUserDirectMember in interface com.atlassian.crowd.embedded.spi.MembershipDao
      • isGroupDirectMember

        public boolean isGroupDirectMember​(long directoryId,
                                           String childGroupName,
                                           String parentGroupName)
        Specified by:
        isGroupDirectMember in interface com.atlassian.crowd.embedded.spi.MembershipDao
      • addUserToGroup

        public void addUserToGroup​(long directoryId,
                                   String userName,
                                   String groupName)
                            throws com.atlassian.crowd.exception.UserNotFoundException,
                                   com.atlassian.crowd.exception.GroupNotFoundException,
                                   com.atlassian.crowd.exception.MembershipAlreadyExistsException
        Specified by:
        addUserToGroup in interface com.atlassian.crowd.embedded.spi.MembershipDao
        Throws:
        com.atlassian.crowd.exception.UserNotFoundException
        com.atlassian.crowd.exception.GroupNotFoundException
        com.atlassian.crowd.exception.MembershipAlreadyExistsException
      • addUserToGroups

        public com.atlassian.crowd.util.BatchResult<String> addUserToGroups​(long directoryId,
                                                                            String username,
                                                                            Set<String> groupNames)
                                                                     throws com.atlassian.crowd.exception.UserNotFoundException
        Specified by:
        addUserToGroups in interface com.atlassian.crowd.embedded.spi.MembershipDao
        Throws:
        com.atlassian.crowd.exception.UserNotFoundException
        Since:
        7.20
      • addGroupToGroup

        public void addGroupToGroup​(long directoryId,
                                    String childGroup,
                                    String parentGroup)
                             throws com.atlassian.crowd.exception.GroupNotFoundException,
                                    com.atlassian.crowd.exception.MembershipAlreadyExistsException
        Specified by:
        addGroupToGroup in interface com.atlassian.crowd.embedded.spi.MembershipDao
        Throws:
        com.atlassian.crowd.exception.GroupNotFoundException
        com.atlassian.crowd.exception.MembershipAlreadyExistsException
      • removeUserFromGroup

        public void removeUserFromGroup​(long directoryId,
                                        String userName,
                                        String groupName)
                                 throws com.atlassian.crowd.exception.UserNotFoundException,
                                        com.atlassian.crowd.exception.GroupNotFoundException,
                                        com.atlassian.crowd.exception.MembershipNotFoundException
        Specified by:
        removeUserFromGroup in interface com.atlassian.crowd.embedded.spi.MembershipDao
        Throws:
        com.atlassian.crowd.exception.UserNotFoundException
        com.atlassian.crowd.exception.GroupNotFoundException
        com.atlassian.crowd.exception.MembershipNotFoundException
      • removeGroupFromGroup

        public void removeGroupFromGroup​(long directoryId,
                                         String childGroupName,
                                         String parentGroupName)
                                  throws com.atlassian.crowd.exception.GroupNotFoundException,
                                         com.atlassian.crowd.exception.MembershipNotFoundException
        Specified by:
        removeGroupFromGroup in interface com.atlassian.crowd.embedded.spi.MembershipDao
        Throws:
        com.atlassian.crowd.exception.GroupNotFoundException
        com.atlassian.crowd.exception.MembershipNotFoundException
      • countDirectMembersOfGroup

        public com.atlassian.crowd.util.BoundedCount countDirectMembersOfGroup​(long directoryId,
                                                                               String groupName,
                                                                               int potentialMaxCount)
        Specified by:
        countDirectMembersOfGroup in interface com.atlassian.crowd.embedded.spi.MembershipDao
      • search

        public <T> List<T> search​(long directoryId,
                                  com.atlassian.crowd.search.query.membership.MembershipQuery<T> query)
        Specified by:
        search in interface com.atlassian.crowd.embedded.spi.MembershipDao
      • searchGroupedByName

        public <T> com.google.common.collect.ListMultimap<String,​T> searchGroupedByName​(long directoryId,
                                                                                              com.atlassian.crowd.search.query.membership.MembershipQuery<T> membershipQuery)
        Specified by:
        searchGroupedByName in interface com.atlassian.crowd.embedded.spi.MembershipDao