com.atlassian.crowd.embedded.spi
Interface DirectoryDao


public interface DirectoryDao

Stores and retrieves directories. Directories are used for identifying a collection of users, groups and memberships.


Method Summary
 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> findAll()
          Returns the list of all directories in the data store, or empty list if there are no directories.
 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 findByName(String name)
          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 Detail

findById

com.atlassian.crowd.embedded.api.Directory findById(long directoryId)
                                                    throws com.atlassian.crowd.exception.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:
com.atlassian.crowd.exception.DirectoryNotFoundException - if there is no directory with the specified ID

findByName

com.atlassian.crowd.embedded.api.Directory findByName(String name)
                                                      throws com.atlassian.crowd.exception.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:
com.atlassian.crowd.exception.DirectoryNotFoundException - if there is no directory with the specified name

findAll

List<com.atlassian.crowd.embedded.api.Directory> findAll()
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 com.atlassian.crowd.exception.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:
com.atlassian.crowd.exception.DirectoryNotFoundException - if the directory is not found in the data store

remove

void remove(com.atlassian.crowd.embedded.api.Directory directory)
            throws com.atlassian.crowd.exception.DirectoryNotFoundException
Removes the specified directory from the data store.

Parameters:
directory - the directory to remove
Throws:
com.atlassian.crowd.exception.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:
QueryBuilder


Copyright © 2014 Atlassian. All Rights Reserved.