com.atlassian.crowd.acceptance.tests.directory
Class MockDirectoryManager

java.lang.Object
  extended by com.atlassian.crowd.manager.directory.DirectoryManagerGeneric
      extended by com.atlassian.crowd.acceptance.tests.directory.MockDirectoryManager
All Implemented Interfaces:
DirectoryManager

public class MockDirectoryManager
extends DirectoryManagerGeneric
implements DirectoryManager


Constructor Summary
MockDirectoryManager(PermissionManager permissionManager, com.atlassian.event.api.EventPublisher eventPublisher, DirectoryInstanceLoader directoryInstanceLoader, DirectorySynchroniser directorySynchroniser, DirectoryPollerManager directoryPollerManager, DirectoryLockManager directoryLockManager)
           
 
Method Summary
 Directory addDirectory(Directory directory)
          Adds the given directory.
 java.util.List<Directory> findAllDirectories()
          Returns a List of all directories in the system.
 Directory findDirectoryById(long directoryID)
          This is the only implemented method.
 Directory findDirectoryByName(java.lang.String name)
          Finds a directory given the supplied name.
 User findUserByToken(java.lang.String key)
           
 void invalidateToken(java.lang.String token)
           
 void removeDirectory(Directory directory)
          Removes a given directory and all its associated entities and mappings.
 void removeExpiredTokens()
           
 java.util.List<Directory> searchDirectories(EntityQuery query)
          Returns a List of Directories matching the search query.
 java.util.List<Token> searchTokens(EntityQuery query)
           
 void setDirectory(Directory directory)
           
 Directory updateDirectory(Directory directory)
          Updates the passed in directory.
 
Methods inherited from class com.atlassian.crowd.manager.directory.DirectoryManagerGeneric
addAllGroups, addAllUsers, addAllUsersToGroup, addGroup, addGroupToGroup, addUser, addUserToGroup, authenticateUser, findGroupByName, findGroupWithAttributesByName, findUserByName, findUserWithAttributesByName, getDirectorySynchronisationInformation, isGroupDirectGroupMember, isGroupNestedGroupMember, isSynchronisable, isSynchronising, isUserDirectGroupMember, isUserNestedGroupMember, removeGroup, removeGroupAttributes, removeGroupFromGroup, removeUser, removeUserAttributes, removeUserFromGroup, renameGroup, renameUser, resetPassword, searchDirectGroupRelationships, searchGroups, searchNestedGroupRelationships, searchUsers, storeGroupAttributes, storeUserAttributes, synchroniseCache, updateGroup, updateUser, updateUserCredential
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.atlassian.crowd.manager.directory.DirectoryManager
addAllGroups, addAllUsers, addAllUsersToGroup, addGroup, addGroupToGroup, addUser, addUserToGroup, authenticateUser, findGroupByName, findGroupWithAttributesByName, findUserByName, findUserWithAttributesByName, getDirectorySynchronisationInformation, isGroupDirectGroupMember, isGroupNestedGroupMember, isSynchronisable, isSynchronising, isUserDirectGroupMember, isUserNestedGroupMember, removeGroup, removeGroupAttributes, removeGroupFromGroup, removeUser, removeUserAttributes, removeUserFromGroup, renameGroup, renameUser, resetPassword, searchDirectGroupRelationships, searchGroups, searchNestedGroupRelationships, searchUsers, storeGroupAttributes, storeUserAttributes, synchroniseCache, updateGroup, updateUser, updateUserCredential
 

Constructor Detail

MockDirectoryManager

public MockDirectoryManager(PermissionManager permissionManager,
                            com.atlassian.event.api.EventPublisher eventPublisher,
                            DirectoryInstanceLoader directoryInstanceLoader,
                            DirectorySynchroniser directorySynchroniser,
                            DirectoryPollerManager directoryPollerManager,
                            DirectoryLockManager directoryLockManager)
Method Detail

setDirectory

public void setDirectory(Directory directory)

addDirectory

public Directory addDirectory(Directory directory)
                       throws DirectoryInstantiationException
Description copied from interface: DirectoryManager
Adds the given directory.

Specified by:
addDirectory in interface DirectoryManager
Overrides:
addDirectory in class DirectoryManagerGeneric
Parameters:
directory - the Directory to add
Returns:
the added Directory
Throws:
DirectoryInstantiationException - if there was an error instantiating the directory

findDirectoryById

public Directory findDirectoryById(long directoryID)
                            throws DirectoryNotFoundException
This is the only implemented method. Will always return directory.

Specified by:
findDirectoryById in interface DirectoryManager
Overrides:
findDirectoryById in class DirectoryManagerGeneric
Parameters:
directoryID -
Returns:
Throws:
DirectoryNotFoundException - is thrown if the Directory cannot be found.

findAllDirectories

public java.util.List<Directory> findAllDirectories()
Description copied from interface: DirectoryManager
Returns a List of all directories in the system.

Specified by:
findAllDirectories in interface DirectoryManager
Overrides:
findAllDirectories in class DirectoryManagerGeneric
Returns:
List of all Directories.

searchDirectories

public java.util.List<Directory> searchDirectories(EntityQuery query)
Description copied from interface: DirectoryManager
Returns a List of Directories matching the search query.

Specified by:
searchDirectories in interface DirectoryManager
Overrides:
searchDirectories in class DirectoryManagerGeneric
Parameters:
query - the context to search on
Returns:
a List of directories, or an Empty List of none are found

findDirectoryByName

public Directory findDirectoryByName(java.lang.String name)
                              throws DirectoryNotFoundException
Description copied from interface: DirectoryManager
Finds a directory given the supplied name.

Specified by:
findDirectoryByName in interface DirectoryManager
Overrides:
findDirectoryByName in class DirectoryManagerGeneric
Parameters:
name - the name of the directory
Returns:
the directory with the given name
Throws:
DirectoryNotFoundException - if no Directory is found

updateDirectory

public Directory updateDirectory(Directory directory)
                          throws DirectoryNotFoundException
Description copied from interface: DirectoryManager
Updates the passed in directory.

Specified by:
updateDirectory in interface DirectoryManager
Overrides:
updateDirectory in class DirectoryManagerGeneric
Parameters:
directory - the directory with updated attributes
Returns:
the updated directory
Throws:
DirectoryNotFoundException - if no Directory is found

removeDirectory

public void removeDirectory(Directory directory)
                     throws DirectoryNotFoundException,
                            DirectoryCurrentlySynchronisingException
Description copied from interface: DirectoryManager
Removes a given directory and all its associated entities and mappings.

Specified by:
removeDirectory in interface DirectoryManager
Overrides:
removeDirectory in class DirectoryManagerGeneric
Parameters:
directory - the directory to remove
Throws:
DirectoryNotFoundException - if the directory cannot be found
DirectoryCurrentlySynchronisingException - if the directory is currently synchronising

invalidateToken

public void invalidateToken(java.lang.String token)

searchTokens

public java.util.List<Token> searchTokens(EntityQuery query)

removeExpiredTokens

public void removeExpiredTokens()

findUserByToken

public User findUserByToken(java.lang.String key)
                     throws InvalidTokenException,
                            OperationFailedException
Throws:
InvalidTokenException
OperationFailedException


Copyright © 2010 Atlassian. All Rights Reserved.