Class UserDao

    • Constructor Detail

      • UserDao

        public UserDao()
    • Method Detail

      • getDefaultRights

        public static Set<User.Right> getDefaultRights()
      • getNewUserInstance

        public static User getNewUserInstance​(User currentUser)
        Get a new instance of the User entity, with all default values set
        Parameters:
        currentUser - - the user to copy time zone from
        Returns:
        new User instance
      • get

        public List<User> get​(long first,
                              long count)
        Description copied from interface: IDataProviderDao
        Get a list of instances of IDataProviderDao
        Specified by:
        get in interface IDataProviderDao<User>
        Parameters:
        first - - the start to range to retrieve
        count - - maximum instance count to retrieve
        Returns:
        list of instances in the range specified
      • get

        public List<User> get​(String search,
                              boolean excludeContacts,
                              long first,
                              long count)
      • get

        public List<User> get​(String search,
                              long start,
                              long count,
                              String sort,
                              boolean filterContacts,
                              Long currentUserId)
      • adminGet

        public List<User> adminGet​(String search,
                                   Long adminId,
                                   long start,
                                   long count,
                                   String order)
        Description copied from interface: IGroupAdminDataProviderDao
        Get a list of instances of IGroupAdminDataProviderDao
        Specified by:
        adminGet in interface IGroupAdminDataProviderDao<User>
        Parameters:
        search - - string search criteria to filter entities
        adminId - - id of group admin user
        start - - the start to range to retrieve
        count - - maximum instance count to retrieve
        order - - column and sort order
        Returns:
        list of instances in the range specified
      • count

        public long count​(String search)
        Description copied from interface: IDataProviderDao
        Count the number of instances of IDataProviderDao
        Specified by:
        count in interface IDataProviderDao<User>
        Parameters:
        search - - string search criteria to filter entities
        Returns:
        count of instances satisfying given search criteria
      • countUsers

        public long countUsers​(String search,
                               Long currentUserId)
      • count

        public long count​(String search,
                          boolean filterContacts,
                          Long currentUserId)
      • purge

        public void purge​(User u,
                          Long userId)
      • getAllUsers

        public List<User> getAllUsers()
      • getAllBackupUsers

        public List<User> getAllBackupUsers()
      • checkLogin

        public boolean checkLogin​(String login,
                                  User.Type type,
                                  Long domainId,
                                  Long id)
        check for duplicates
        Parameters:
        login - - login to check
        type - - user User.Type to check
        domainId - - domain to check
        id - - id of current user to allow self update
        Returns:
        true in case login is allowed
      • checkEmail

        public boolean checkEmail​(String email,
                                  User.Type type,
                                  Long domainId,
                                  Long id)
        Checks if a mail is already taken by someone else
        Parameters:
        email - - email to check
        type - - user User.Type to check
        domainId - - domain to check
        id - - id of current user to allow self update
        Returns:
        true in case email is allowed
      • validLogin

        public boolean validLogin​(String login)
      • getByEmail

        public User getByEmail​(String email)
      • getUserByHash

        public User getUserByHash​(String hash)
      • selectMaxFromUsersWithSearch

        public Long selectMaxFromUsersWithSearch​(String search)
        Parameters:
        search - - term to search
        Returns:
        - number of matching user
      • verifyPassword

        public boolean verifyPassword​(Long userId,
                                      String password)
        Returns true if the password is correct
        Parameters:
        userId - - id of the user to check
        password - - password to check
        Returns:
        true if entered password is correct
      • getContact

        public User getContact​(String email,
                               Long ownerId)
      • getByActivationHash

        public User getByActivationHash​(String hash)
        Parameters:
        hash - - activation hash
        Returns:
        user with this hash
      • getExternalUser

        public User getExternalUser​(String extId,
                                    String extType)
      • get

        public List<User> get​(String search,
                              long start,
                              long count,
                              String order)
        Description copied from interface: IDataProviderDao
        Get a list of instances of IDataProviderDao
        Specified by:
        get in interface IDataProviderDao<User>
        Parameters:
        search - - string search criteria to filter entities
        start - - the start to range to retrieve
        count - - maximum instance count to retrieve
        order - - column and sort order
        Returns:
        list of instances in the range specified
      • login

        public User login​(String userOrEmail,
                          String userpass)
                   throws org.apache.openmeetings.util.OmException
        login logic
        Parameters:
        userOrEmail - - login or email of the user being tested
        userpass - - password of the user being tested
        Returns:
        User object in case of successful login
        Throws:
        org.apache.openmeetings.util.OmException - in case of any issue
      • getByExpiredHash

        public List<User> getByExpiredHash​(long ttl)