Interface InternalUserDao

All Superinterfaces:
UserDao
All Known Implementing Classes:
UserDAOHibernate

public interface InternalUserDao extends UserDao
Manages persistence of User.
  • Method Details

    • addAll

    • removeAll

      void removeAll(long directoryId) throws DirectoryNotFoundException
      Throws:
      DirectoryNotFoundException
    • getAllUsernames

      List<String> getAllUsernames(long directoryId)
      Get all usernames for users belonging to a given directory
      Parameters:
      directoryId -
      Returns:
      list of usernames
    • findByName

      InternalUser findByName(long directoryId, String userName) throws UserNotFoundException
      Finds and return the user with given name and director ID.
      Specified by:
      findByName in interface UserDao
      Throws:
      UserNotFoundException - if the user could not be found
    • findByNames

      Collection<InternalUser> findByNames(long directoryID, Collection<String> usernames)
      Bulk find of users using SQL disjunction. This will return fully populated InternalUser instances with names, E-mail, Password credential records and so on. If those aren't needed then findMinimalUsersByNames(long, Collection) should be used instead due to performance reasons.
      Parameters:
      directoryID - the directory to search for the users.
      usernames - names of users to find
      Returns:
      collection of found users as InternalUsers.
    • findMinimalUsersByNames

      Collection<MinimalUser> findMinimalUsersByNames(long directoryId, Collection<String> usernames)
      Bulk find of users using SQL disjunction. This will return a set of minimal DTOs with just the username, id and directory id.
      Parameters:
      directoryId - the directory to search for the users.
      usernames - names of users to find
      Returns:
      collection of found users as MinimalUsers.
    • findByIds

      Collection<InternalUser> findByIds(Collection<Long> userIds)
      Bulk find of users with the specified database identifiers. The result collection may be smaller than the input if ids that did not match with any users were supplied
      Parameters:
      userIds - identifiers of users that will be found
      Returns:
      the matching users
    • findByExternalIds

      Map<String,String> findByExternalIds(long directoryId, Set<String> externalIds)
      Searches the specified directory for usernames of users with the specified external ids, returns a map from external id to username
      Specified by:
      findByExternalIds in interface UserDao
      Parameters:
      directoryId - the directory to search for the users
      externalIds - the external ids of the users to search for
    • findUsersForPasswordExpiryNotification

      Collection<InternalUserWithPasswordLastChanged> findUsersForPasswordExpiryNotification(Instant currentTime, Duration passwordMaxChangeTime, Duration remindPeriod, long directoryId, int maxResults)
      Searches the specified directory for Internal Users who will be notified, that their passwords will soon expire
      Parameters:
      currentTime - timestamp of current time
      passwordMaxChangeTime - time until password will expire after updating (in days)
      remindPeriod - duration of remind period - user will be notified if time until his password will expire will be lower than that time (in days)
      directoryId - the directory to search for the users
      Returns:
      the matching users
    • setAttribute

      void setAttribute(Collection<InternalUser> users, String attributeName, String attributeValue)
      Sets the specified attribute for all specified users and after executing this, every user will have exactly one attribute with that name.
      Parameters:
      users - users to update
      attributeName - name of attribute to update
      attributeValue - value of attribute to update
    • findByNumericAttributeRange

      List<InternalUser> findByNumericAttributeRange(String attributeName, long min, long max)
      Returns users with the given numeric attribute in the specified range. The results are returned in ascending order by the attribute value.
      Parameters:
      attributeName - name of the attribute to match
      min - minimum numeric value of the attribute to match
      max - maximum numeric value of the attribute to match
      Returns:
      matching users, in ascending order by the attribute value