Package 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
Modifier and TypeMethodDescriptioncom.atlassian.crowd.embedded.api.Directoryadd(com.atlassian.crowd.embedded.api.Directory directory) Store a new directory in the data store.List<com.atlassian.crowd.embedded.api.Directory>findAll()Deprecated.com.atlassian.crowd.embedded.api.DirectoryfindById(long directoryId) Returns the directory with the specified ID, throwingDirectoryNotFoundExceptionif it cannot be found.com.atlassian.crowd.embedded.api.DirectoryfindByName(String name) Returns the directory with the specified name, throwingDirectoryNotFoundExceptionif it cannot be found.voidremove(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.Directoryupdate(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, throwingDirectoryNotFoundExceptionif 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, throwingDirectoryNotFoundExceptionif 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.Usesearch(EntityQuery)instead. Since v3.2.0Returns 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
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:
-
search(EntityQuery)instead.