Interface ExtendedUserDao

All Superinterfaces:
com.atlassian.crowd.embedded.spi.UserDao
All Known Implementing Classes:
IndexedUserDao, OfBizUserDao, SwitchingUserDao

public interface ExtendedUserDao extends com.atlassian.crowd.embedded.spi.UserDao
User DAO with legacy JIRA customizations.
  • Method Summary

    Modifier and Type
    Method
    Description
    findAllByNameOrNull(long directoryId, Collection<String> userNames)
     
    findById(long internalUserId)
    Finds a user by internal user ID.
    findByNameOrNull(long directoryId, String userName)
    Tries to find the user by name and returns null if not found.
    Returns the lower-cased names of all users in the specified groups.
    findOfBizUser(long directoryId, String userName)
     
    void
    Invoked by OfBizCacheFlushingManager to ensure caches are being flushed in the right order on XMLRestoreFinishedEvent
     
    long
    getUniqueUserCount(Set<Long> directoryIds)
     
    boolean
    isDeletedExternally(long internalUserId)
    Checks if user (identified by internal user ID) has been deleted from external user directory.
    boolean
    isDeletedExternally(long directoryId, String userName)
    Checks if user (identified by directory ID and user name) has been deleted from external user directory.
    void
    processUsers(Consumer<? super com.atlassian.crowd.model.user.User> userProcessor)
    Performs an operation on every user in the system.
    com.atlassian.crowd.model.user.User
    update(com.atlassian.crowd.model.user.User user, boolean useJiraExtensions)
    Updates user, for detailed description see UserDao.update(com.atlassian.crowd.model.user.User).
    boolean
     
    boolean
     

    Methods inherited from interface com.atlassian.crowd.embedded.spi.UserDao

    add, addAll, findByExternalId, findByExternalIds, findByName, findByNameWithAttributes, findDirectoryIdsContainingUserName, getAllExternalIds, getCredential, getCredentialHistory, getUserCount, remove, removeAllUsers, removeAttribute, rename, search, setAttributeForAllInDirectory, storeAttributes, update, updateCredential
  • Method Details

    • useFullCache

      boolean useFullCache()
    • useInternedUserValues

      boolean useInternedUserValues()
    • getUniqueUserCount

      long getUniqueUserCount(Set<Long> directoryIds) throws com.atlassian.crowd.exception.DirectoryNotFoundException
      Throws:
      com.atlassian.crowd.exception.DirectoryNotFoundException
    • findNamesOfUsersInGroups

      Collection<String> findNamesOfUsersInGroups(Collection<String> groupNames)
      Returns the lower-cased names of all users in the specified groups. Only searches directly in these groups, if a recursive group search is required the caller will need to pre-expand the groups.
      Parameters:
      groupNames - the names of the groups to search.
      Returns:
      set of all user names in these groups, in lower case.
    • findOfBizUser

      OfBizUser findOfBizUser(long directoryId, String userName) throws UserNotFoundException
      Throws:
      UserNotFoundException
    • findAllByNameOrNull

      List<OfBizUser> findAllByNameOrNull(long directoryId, @Nonnull Collection<String> userNames)
    • findByNameOrNull

      @Nullable OfBizUser findByNameOrNull(long directoryId, @Nonnull String userName)
      Tries to find the user by name and returns null if not found. Just like the public method should have done in the first place!
      Parameters:
      directoryId - Directory ID
      userName - the username
      Returns:
      the user, or null if the user does not exist
    • getAllAttributeKeys

      Collection<String> getAllAttributeKeys()
    • processUsers

      void processUsers(Consumer<? super com.atlassian.crowd.model.user.User> userProcessor)
      Performs an operation on every user in the system.

      This can be a time-consuming operation on JIRA instances that contain many users. It is recommended to use one of the search methods where possible.

      This method performs a live iteration over a database result set. Care must be taken if additional database operations are performed within the userProcessor consumer.

      Parameters:
      userProcessor - the operation to perform on each user.
      Since:
      v7.0
    • flushCache

      void flushCache()
      Invoked by OfBizCacheFlushingManager to ensure caches are being flushed in the right order on XMLRestoreFinishedEvent
    • findById

      @Nullable OfBizUser findById(long internalUserId)
      Finds a user by internal user ID.
      Parameters:
      internalUserId - the user ID.
      Returns:
      the found user, or null if not found.
    • isDeletedExternally

      boolean isDeletedExternally(long internalUserId)
      Checks if user (identified by internal user ID) has been deleted from external user directory.
      Parameters:
      internalUserId - the user ID.
      Returns:
      true if user has been deleted from external directory, false otherwise.
    • isDeletedExternally

      boolean isDeletedExternally(long directoryId, @Nonnull String userName)
      Checks if user (identified by directory ID and user name) has been deleted from external user directory.
      Parameters:
      directoryId - Directory ID
      userName - the username
      Returns:
      true if user has been deleted from external directory, false otherwise.
    • update

      com.atlassian.crowd.model.user.User update(com.atlassian.crowd.model.user.User user, boolean useJiraExtensions) throws UserNotFoundException
      Updates user, for detailed description see UserDao.update(com.atlassian.crowd.model.user.User).
      Parameters:
      user - the user details, which should have the same name as the user to modify
      useJiraExtensions - Whether jira extensions should be run. Currently only extension is that when externally deleted user is updated (inactive and flagged) "externally deleted" flag is cleared and user is made active.
      Returns:
      the updated user
      Throws:
      UserNotFoundException - if there is no user with the same name (case-insensitive) and directory as the user provided
      See Also:
      • UserDao.update(com.atlassian.crowd.model.user.User)