Package com.atlassian.crowd.dao.user
Interface InternalUserDao
- All Superinterfaces:
UserDao
- All Known Implementing Classes:
UserDAOHibernate
Manages persistence of
User
.-
Method Summary
Modifier and TypeMethodDescriptionfindByExternalIds
(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 usernamefindByIds
(Collection<Long> userIds) Bulk find of users with the specified database identifiers.findByName
(long directoryId, String userName) Finds and return the user with given name and director ID.findByNames
(long directoryID, Collection<String> usernames) Bulk find of users using SQL disjunction.findByNumericAttributeRange
(String attributeName, long min, long max) Returns users with the given numeric attribute in the specified range.findMinimalUsersByNames
(long directoryId, Collection<String> usernames) Bulk find of users using SQL disjunction.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 expiregetAllUsernames
(long directoryId) Get all usernames for users belonging to a given directoryvoid
removeAll
(long directoryId) 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.Methods inherited from interface com.atlassian.crowd.embedded.spi.UserDao
add, addAll, findByExternalId, findByNameWithAttributes, findDirectoryIdsContainingUserName, getAllExternalIds, getCredential, getCredentialHistory, getUserCount, remove, removeAllUsers, removeAttribute, rename, search, setAttributeForAllInDirectory, storeAttributes, update, updateCredential
-
Method Details
-
addAll
-
removeAll
- Throws:
DirectoryNotFoundException
-
getAllUsernames
Get all usernames for users belonging to a given directory- Parameters:
directoryId
-- Returns:
- list of usernames
-
findByName
Finds and return the user with given name and director ID.- Specified by:
findByName
in interfaceUserDao
- Throws:
UserNotFoundException
- if the user could not be found
-
findByNames
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 thenfindMinimalUsersByNames(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
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
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
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 interfaceUserDao
- Parameters:
directoryId
- the directory to search for the usersexternalIds
- 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 timepasswordMaxChangeTime
- 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
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 updateattributeName
- name of attribute to updateattributeValue
- value of attribute to update
-
findByNumericAttributeRange
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 matchmin
- minimum numeric value of the attribute to matchmax
- maximum numeric value of the attribute to match- Returns:
- matching users, in ascending order by the attribute value
-