com.atlassian.crowd.embedded.spi
Interface DirectoryDao

All Known Implementing Classes:
DirectoryDAOHibernate

public interface DirectoryDao

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


Method Summary
 Directory add(Directory directory)
          Store a new directory in the data store.
 java.util.List<Directory> findAll()
          Returns the list of all directories in the data store, or empty list if there are no directories.
 Directory findById(long directoryId)
          Returns the directory with the specified ID, throwing DirectoryNotFoundException if it cannot be found.
 Directory findByName(java.lang.String name)
          Returns the directory with the specified name, throwing DirectoryNotFoundException if it cannot be found.
 void remove(Directory directory)
          Removes the specified directory from the data store.
 java.util.List<Directory> search(EntityQuery<Directory> entityQuery)
          Search for directories matching the specified query.
 Directory update(Directory directory)
          Persists any changes made to the provided directory.
 

Method Detail

findById

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

Directory findByName(java.lang.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

java.util.List<Directory> findAll()
Returns the list of all directories in the data store, or empty list if there are no directories.


add

Directory add(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

Directory update(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(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

java.util.List<Directory> search(EntityQuery<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.queryFor(java.lang.Class, com.atlassian.crowd.search.EntityDescriptor)


Copyright © 2010 Atlassian. All Rights Reserved.