com.atlassian.crowd.dao.directory
Class DirectoryDAOFile

java.lang.Object
  extended by com.atlassian.crowd.dao.directory.DirectoryDAOFile
All Implemented Interfaces:
DaoDiscriminator, RefreshableDao, DirectoryDao

public class DirectoryDAOFile
extends Object
implements DirectoryDao, DaoDiscriminator, RefreshableDao

Read-only Directory DAO that reads the data from a file. Update operations are not supported. Search operation is not supported.


Constructor Summary
DirectoryDAOFile(DatabaseFileLocator databaseFileLocator, DirectoryPropertiesMapper directoryPropertiesMapper)
           
 
Method Summary
 Directory add(Directory directory)
          Store a new directory in the data store.
 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(String name)
          Returns the directory with the specified name, throwing DirectoryNotFoundException if it cannot be found.
 Properties getProperties()
           
 boolean isActive()
           
 void refresh()
          Flush all the caches, reload everything from the backend storage.
 void remove(Directory directory)
          Removes the specified directory from the data store.
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DirectoryDAOFile

public DirectoryDAOFile(DatabaseFileLocator databaseFileLocator,
                        DirectoryPropertiesMapper directoryPropertiesMapper)
Method Detail

refresh

public void refresh()
Description copied from interface: RefreshableDao
Flush all the caches, reload everything from the backend storage.

Specified by:
refresh in interface RefreshableDao

findById

public Directory findById(long directoryId)
                   throws DirectoryNotFoundException
Description copied from interface: DirectoryDao
Returns the directory with the specified ID, throwing DirectoryNotFoundException if it cannot be found.

Specified by:
findById in interface DirectoryDao
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

public Directory findByName(String name)
                     throws DirectoryNotFoundException
Description copied from interface: DirectoryDao
Returns the directory with the specified name, throwing DirectoryNotFoundException if it cannot be found.

Specified by:
findByName in interface DirectoryDao
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

public List<Directory> findAll()
Description copied from interface: DirectoryDao
Returns the list of all directories in the data store, or empty list if there are no directories.

Specified by:
findAll in interface DirectoryDao

add

public Directory add(Directory directory)
Description copied from interface: DirectoryDao
Store a new directory in the data store.

Specified by:
add in interface DirectoryDao
Parameters:
directory - the directory to persist
Returns:
the newly-persisted directory, which should be used for subsequent operations

update

public Directory update(Directory directory)
                 throws DirectoryNotFoundException
Description copied from interface: DirectoryDao
Persists any changes made to the provided directory.

Specified by:
update in interface DirectoryDao
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

public void remove(Directory directory)
            throws DirectoryNotFoundException
Description copied from interface: DirectoryDao
Removes the specified directory from the data store.

Specified by:
remove in interface DirectoryDao
Parameters:
directory - the directory to remove
Throws:
DirectoryNotFoundException - if the directory does not exist

search

public List<Directory> search(EntityQuery<Directory> entityQuery)
Description copied from interface: DirectoryDao
Search for directories matching the specified query.

Specified by:
search in interface DirectoryDao
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)

isActive

public boolean isActive()
Specified by:
isActive in interface DaoDiscriminator
Returns:
true if the DAO is ready to handle data access operations.

getProperties

public Properties getProperties()


Copyright © 2013 Atlassian. All Rights Reserved.