Interface DirectoryDao


public interface DirectoryDao
Stores and retrieves directories. Directories are used for identifying a collection of users, groups and memberships.
  • Method Summary

    Modifier and Type
    Method
    Description
    com.atlassian.crowd.embedded.api.Directory
    add(com.atlassian.crowd.embedded.api.Directory directory)
    Store a new directory in the data store.
    List<com.atlassian.crowd.embedded.api.Directory>
    Deprecated.
    Use search(EntityQuery) instead.
    com.atlassian.crowd.embedded.api.Directory
    findById(long directoryId)
    Returns the directory with the specified ID, throwing DirectoryNotFoundException if it cannot be found.
    com.atlassian.crowd.embedded.api.Directory
    Returns the directory with the specified name, throwing DirectoryNotFoundException if it cannot be found.
    void
    remove(com.atlassian.crowd.embedded.api.Directory directory)
    Removes the specified directory from the data store.
    List<com.atlassian.crowd.embedded.api.Directory>
    search(EntityQuery<com.atlassian.crowd.embedded.api.Directory> entityQuery)
    Search for directories matching the specified query.
    com.atlassian.crowd.embedded.api.Directory
    update(com.atlassian.crowd.embedded.api.Directory directory)
    Persists any changes made to the provided directory.
  • Method Details

    • findById

      com.atlassian.crowd.embedded.api.Directory findById(long directoryId) throws DirectoryNotFoundException
      Returns the directory with the specified ID, throwing DirectoryNotFoundException if it cannot be found.
      Parameters:
      directoryId - the ID of the directory to find
      Returns:
      the directory with the specified ID
      Throws:
      DirectoryNotFoundException - if there is no directory with the specified ID
    • findByName

      com.atlassian.crowd.embedded.api.Directory findByName(String name) throws DirectoryNotFoundException
      Returns the directory with the specified name, throwing DirectoryNotFoundException if it cannot be found.
      Parameters:
      name - the name of the directory to find
      Returns:
      the directory with the specified name
      Throws:
      DirectoryNotFoundException - if there is no directory with the specified name
    • findAll

      @Deprecated List<com.atlassian.crowd.embedded.api.Directory> findAll()
      Deprecated.
      Use search(EntityQuery) instead. Since v3.2.0
      Returns the list of all directories in the data store, or empty list if there are no directories.
    • add

      com.atlassian.crowd.embedded.api.Directory add(com.atlassian.crowd.embedded.api.Directory directory)
      Store a new directory in the data store.
      Parameters:
      directory - the directory to persist
      Returns:
      the newly-persisted directory, which should be used for subsequent operations
    • update

      com.atlassian.crowd.embedded.api.Directory update(com.atlassian.crowd.embedded.api.Directory directory) throws DirectoryNotFoundException
      Persists any changes made to the provided directory.
      Parameters:
      directory - the directory which has changes to persist
      Returns:
      the updated directory after it has been persisted, which should be used for subsequent operations
      Throws:
      DirectoryNotFoundException - if the directory is not found in the data store
    • remove

      void remove(com.atlassian.crowd.embedded.api.Directory directory) throws DirectoryNotFoundException
      Removes the specified directory from the data store.
      Parameters:
      directory - the directory to remove
      Throws:
      DirectoryNotFoundException - if the directory does not exist
    • search

      List<com.atlassian.crowd.embedded.api.Directory> search(EntityQuery<com.atlassian.crowd.embedded.api.Directory> entityQuery)
      Search for directories matching the specified query.
      Parameters:
      entityQuery - the search query to run against the directory data store
      Returns:
      a list of directories matching the query
      See Also: