com.atlassian.crowd.manager.directory
Class DirectoryManagerGeneric

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

public class DirectoryManagerGeneric
extends java.lang.Object
implements DirectoryManager


Constructor Summary
DirectoryManagerGeneric(DirectoryDao directoryDao, ApplicationDAO applicationDAO, com.atlassian.event.api.EventPublisher eventPublisher, PermissionManager permissionManager, PasswordHelper passwordHelper, DirectoryInstanceLoader directoryInstanceLoader, DirectorySynchroniser directorySynchroniser, DirectoryPollerManager directoryPollerManager, DirectoryLockManager directoryLockManager, SynchronisationStatusManager synchronisationStatusManager)
           
 
Method Summary
 BulkAddResult<Group> addAllGroups(long directoryId, java.util.Collection<GroupTemplate> groups, boolean overwrite)
           
 BulkAddResult<User> addAllUsers(long directoryId, java.util.Collection<UserTemplateWithCredentialAndAttributes> users, boolean overwrite)
           
 BulkAddResult<java.lang.String> addAllUsersToGroup(long directoryId, java.util.Collection<java.lang.String> userNames, java.lang.String groupName)
           
 Directory addDirectory(Directory directory)
           
 Group addGroup(long directoryId, GroupTemplate group)
           
 void addGroupToGroup(long directoryId, java.lang.String childGroup, java.lang.String parentGroup)
           
 User addUser(long directoryId, UserTemplate user, PasswordCredential credential)
           
 void addUserToGroup(long directoryId, java.lang.String username, java.lang.String groupName)
           
 User authenticateUser(long directoryId, java.lang.String username, PasswordCredential passwordCredential)
           
 java.util.List<Directory> findAllDirectories()
           
 Directory findDirectoryById(long directoryId)
           
 Directory findDirectoryByName(java.lang.String name)
           
 Group findGroupByName(long directoryId, java.lang.String groupName)
           
 GroupWithAttributes findGroupWithAttributesByName(long directoryId, java.lang.String groupName)
           
 User findUserByName(long directoryId, java.lang.String username)
           
 UserWithAttributes findUserWithAttributesByName(long directoryId, java.lang.String username)
           
 DirectorySynchronisationInformation getDirectorySynchronisationInformation(long directoryId)
           
 boolean isGroupDirectGroupMember(long directoryId, java.lang.String childGroup, java.lang.String parentGroup)
           
 boolean isGroupNestedGroupMember(long directoryId, java.lang.String childGroup, java.lang.String parentGroup)
           
 boolean isSynchronisable(long directoryId)
           
 boolean isSynchronising(long directoryId)
           
 boolean isUserDirectGroupMember(long directoryId, java.lang.String username, java.lang.String groupName)
           
 boolean isUserNestedGroupMember(long directoryId, java.lang.String username, java.lang.String groupName)
           
 void removeDirectory(Directory directory)
           
 void removeGroup(long directoryId, java.lang.String groupName)
           
 void removeGroupAttributes(long directoryId, java.lang.String groupName, java.lang.String attributeName)
           
 void removeGroupFromGroup(long directoryId, java.lang.String childGroup, java.lang.String parentGroup)
           
 void removeUser(long directoryId, java.lang.String username)
           
 void removeUserAttributes(long directoryId, java.lang.String username, java.lang.String attributeName)
           
 void removeUserFromGroup(long directoryId, java.lang.String username, java.lang.String groupName)
           
 Group renameGroup(long directoryId, java.lang.String oldGroupname, java.lang.String newGroupname)
           
 User renameUser(long directoryId, java.lang.String oldUsername, java.lang.String newUsername)
           
 void resetPassword(long directoryId, java.lang.String username)
           
<T> java.util.List<T>
searchDirectGroupRelationships(long directoryId, MembershipQuery<T> query)
           
 java.util.List<Directory> searchDirectories(EntityQuery<Directory> query)
           
<T> java.util.List<T>
searchGroups(long directoryId, EntityQuery<T> query)
           
<T> java.util.List<T>
searchNestedGroupRelationships(long directoryId, MembershipQuery<T> query)
           
<T> java.util.List<T>
searchUsers(long directoryId, EntityQuery<T> query)
           
 void storeGroupAttributes(long directoryId, java.lang.String groupName, java.util.Map<java.lang.String,java.util.Set<java.lang.String>> attributes)
           
 void storeUserAttributes(long directoryId, java.lang.String username, java.util.Map<java.lang.String,java.util.Set<java.lang.String>> attributes)
           
 boolean supportsNestedGroups(long directoryId)
           
 void synchroniseCache(long directoryId, SynchronisationMode mode)
           
 void synchroniseCache(long directoryId, SynchronisationMode mode, boolean runInBackground)
           
 Directory updateDirectory(Directory directory)
           
 Group updateGroup(long directoryId, GroupTemplate group)
           
 User updateUser(long directoryId, UserTemplate user)
           
 void updateUserCredential(long directoryId, java.lang.String username, PasswordCredential credential)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DirectoryManagerGeneric

public DirectoryManagerGeneric(DirectoryDao directoryDao,
                               ApplicationDAO applicationDAO,
                               com.atlassian.event.api.EventPublisher eventPublisher,
                               PermissionManager permissionManager,
                               PasswordHelper passwordHelper,
                               DirectoryInstanceLoader directoryInstanceLoader,
                               DirectorySynchroniser directorySynchroniser,
                               DirectoryPollerManager directoryPollerManager,
                               DirectoryLockManager directoryLockManager,
                               SynchronisationStatusManager synchronisationStatusManager)
Method Detail

addDirectory

public Directory addDirectory(Directory directory)
                       throws DirectoryInstantiationException
Specified by:
addDirectory in interface DirectoryManager
Throws:
DirectoryInstantiationException

findDirectoryById

public Directory findDirectoryById(long directoryId)
                            throws DirectoryNotFoundException
Specified by:
findDirectoryById in interface DirectoryManager
Throws:
DirectoryNotFoundException

findAllDirectories

public java.util.List<Directory> findAllDirectories()
Specified by:
findAllDirectories in interface DirectoryManager

searchDirectories

public java.util.List<Directory> searchDirectories(EntityQuery<Directory> query)
Specified by:
searchDirectories in interface DirectoryManager

findDirectoryByName

public Directory findDirectoryByName(java.lang.String name)
                              throws DirectoryNotFoundException
Specified by:
findDirectoryByName in interface DirectoryManager
Throws:
DirectoryNotFoundException

updateDirectory

public Directory updateDirectory(Directory directory)
                          throws DirectoryNotFoundException
Specified by:
updateDirectory in interface DirectoryManager
Throws:
DirectoryNotFoundException

removeDirectory

public void removeDirectory(Directory directory)
                     throws DirectoryNotFoundException,
                            DirectoryCurrentlySynchronisingException
Specified by:
removeDirectory in interface DirectoryManager
Throws:
DirectoryNotFoundException
DirectoryCurrentlySynchronisingException

supportsNestedGroups

public boolean supportsNestedGroups(long directoryId)
                             throws DirectoryInstantiationException,
                                    DirectoryNotFoundException
Specified by:
supportsNestedGroups in interface DirectoryManager
Throws:
DirectoryInstantiationException
DirectoryNotFoundException

isSynchronisable

public boolean isSynchronisable(long directoryId)
                         throws DirectoryInstantiationException,
                                DirectoryNotFoundException
Specified by:
isSynchronisable in interface DirectoryManager
Throws:
DirectoryInstantiationException
DirectoryNotFoundException

synchroniseCache

public void synchroniseCache(long directoryId,
                             SynchronisationMode mode)
                      throws OperationFailedException,
                             DirectoryNotFoundException
Specified by:
synchroniseCache in interface DirectoryManager
Throws:
OperationFailedException
DirectoryNotFoundException

synchroniseCache

public void synchroniseCache(long directoryId,
                             SynchronisationMode mode,
                             boolean runInBackground)
                      throws OperationFailedException,
                             DirectoryNotFoundException
Specified by:
synchroniseCache in interface DirectoryManager
Throws:
OperationFailedException
DirectoryNotFoundException

isSynchronising

public boolean isSynchronising(long directoryId)
                        throws DirectoryInstantiationException,
                               DirectoryNotFoundException
Specified by:
isSynchronising in interface DirectoryManager
Throws:
DirectoryInstantiationException
DirectoryNotFoundException

getDirectorySynchronisationInformation

public DirectorySynchronisationInformation getDirectorySynchronisationInformation(long directoryId)
                                                                           throws DirectoryInstantiationException,
                                                                                  DirectoryNotFoundException
Specified by:
getDirectorySynchronisationInformation in interface DirectoryManager
Throws:
DirectoryInstantiationException
DirectoryNotFoundException

authenticateUser

public User authenticateUser(long directoryId,
                             java.lang.String username,
                             PasswordCredential passwordCredential)
                      throws OperationFailedException,
                             InactiveAccountException,
                             InvalidAuthenticationException,
                             ExpiredCredentialException,
                             DirectoryNotFoundException,
                             UserNotFoundException
Specified by:
authenticateUser in interface DirectoryManager
Throws:
OperationFailedException
InactiveAccountException
InvalidAuthenticationException
ExpiredCredentialException
DirectoryNotFoundException
UserNotFoundException

findUserByName

public User findUserByName(long directoryId,
                           java.lang.String username)
                    throws OperationFailedException,
                           DirectoryNotFoundException,
                           UserNotFoundException
Specified by:
findUserByName in interface DirectoryManager
Throws:
OperationFailedException
DirectoryNotFoundException
UserNotFoundException

findUserWithAttributesByName

public UserWithAttributes findUserWithAttributesByName(long directoryId,
                                                       java.lang.String username)
                                                throws OperationFailedException,
                                                       DirectoryNotFoundException,
                                                       UserNotFoundException
Specified by:
findUserWithAttributesByName in interface DirectoryManager
Throws:
OperationFailedException
DirectoryNotFoundException
UserNotFoundException

searchUsers

public <T> java.util.List<T> searchUsers(long directoryId,
                                         EntityQuery<T> query)
                              throws OperationFailedException,
                                     DirectoryNotFoundException
Specified by:
searchUsers in interface DirectoryManager
Throws:
OperationFailedException
DirectoryNotFoundException

addUser

public User addUser(long directoryId,
                    UserTemplate user,
                    PasswordCredential credential)
             throws InvalidCredentialException,
                    InvalidUserException,
                    OperationFailedException,
                    DirectoryPermissionException,
                    DirectoryNotFoundException,
                    UserAlreadyExistsException
Specified by:
addUser in interface DirectoryManager
Throws:
InvalidCredentialException
InvalidUserException
OperationFailedException
DirectoryPermissionException
DirectoryNotFoundException
UserAlreadyExistsException

updateUser

public User updateUser(long directoryId,
                       UserTemplate user)
                throws OperationFailedException,
                       DirectoryPermissionException,
                       InvalidUserException,
                       DirectoryNotFoundException,
                       UserNotFoundException
Specified by:
updateUser in interface DirectoryManager
Throws:
OperationFailedException
DirectoryPermissionException
InvalidUserException
DirectoryNotFoundException
UserNotFoundException

renameUser

public User renameUser(long directoryId,
                       java.lang.String oldUsername,
                       java.lang.String newUsername)
                throws OperationFailedException,
                       DirectoryPermissionException,
                       InvalidUserException,
                       DirectoryNotFoundException,
                       UserNotFoundException,
                       UserAlreadyExistsException
Specified by:
renameUser in interface DirectoryManager
Throws:
OperationFailedException
DirectoryPermissionException
InvalidUserException
DirectoryNotFoundException
UserNotFoundException
UserAlreadyExistsException

storeUserAttributes

public void storeUserAttributes(long directoryId,
                                java.lang.String username,
                                java.util.Map<java.lang.String,java.util.Set<java.lang.String>> attributes)
                         throws OperationFailedException,
                                DirectoryPermissionException,
                                DirectoryNotFoundException,
                                UserNotFoundException
Specified by:
storeUserAttributes in interface DirectoryManager
Throws:
OperationFailedException
DirectoryPermissionException
DirectoryNotFoundException
UserNotFoundException

removeUserAttributes

public void removeUserAttributes(long directoryId,
                                 java.lang.String username,
                                 java.lang.String attributeName)
                          throws OperationFailedException,
                                 DirectoryPermissionException,
                                 DirectoryNotFoundException,
                                 UserNotFoundException
Specified by:
removeUserAttributes in interface DirectoryManager
Throws:
OperationFailedException
DirectoryPermissionException
DirectoryNotFoundException
UserNotFoundException

updateUserCredential

public void updateUserCredential(long directoryId,
                                 java.lang.String username,
                                 PasswordCredential credential)
                          throws OperationFailedException,
                                 DirectoryPermissionException,
                                 InvalidCredentialException,
                                 DirectoryNotFoundException,
                                 UserNotFoundException
Specified by:
updateUserCredential in interface DirectoryManager
Throws:
OperationFailedException
DirectoryPermissionException
InvalidCredentialException
DirectoryNotFoundException
UserNotFoundException

resetPassword

public void resetPassword(long directoryId,
                          java.lang.String username)
                   throws OperationFailedException,
                          InvalidEmailAddressException,
                          DirectoryPermissionException,
                          InvalidCredentialException,
                          DirectoryNotFoundException,
                          UserNotFoundException
Specified by:
resetPassword in interface DirectoryManager
Throws:
OperationFailedException
InvalidEmailAddressException
DirectoryPermissionException
InvalidCredentialException
DirectoryNotFoundException
UserNotFoundException

removeUser

public void removeUser(long directoryId,
                       java.lang.String username)
                throws DirectoryPermissionException,
                       OperationFailedException,
                       DirectoryNotFoundException,
                       UserNotFoundException
Specified by:
removeUser in interface DirectoryManager
Throws:
DirectoryPermissionException
OperationFailedException
DirectoryNotFoundException
UserNotFoundException

findGroupByName

public Group findGroupByName(long directoryId,
                             java.lang.String groupName)
                      throws OperationFailedException,
                             GroupNotFoundException,
                             DirectoryNotFoundException
Specified by:
findGroupByName in interface DirectoryManager
Throws:
OperationFailedException
GroupNotFoundException
DirectoryNotFoundException

findGroupWithAttributesByName

public GroupWithAttributes findGroupWithAttributesByName(long directoryId,
                                                         java.lang.String groupName)
                                                  throws OperationFailedException,
                                                         GroupNotFoundException,
                                                         DirectoryNotFoundException
Specified by:
findGroupWithAttributesByName in interface DirectoryManager
Throws:
OperationFailedException
GroupNotFoundException
DirectoryNotFoundException

searchGroups

public <T> java.util.List<T> searchGroups(long directoryId,
                                          EntityQuery<T> query)
                               throws OperationFailedException,
                                      DirectoryNotFoundException
Specified by:
searchGroups in interface DirectoryManager
Throws:
OperationFailedException
DirectoryNotFoundException

addGroup

public Group addGroup(long directoryId,
                      GroupTemplate group)
               throws InvalidGroupException,
                      OperationFailedException,
                      DirectoryPermissionException,
                      DirectoryNotFoundException
Specified by:
addGroup in interface DirectoryManager
Throws:
InvalidGroupException
OperationFailedException
DirectoryPermissionException
DirectoryNotFoundException

updateGroup

public Group updateGroup(long directoryId,
                         GroupTemplate group)
                  throws OperationFailedException,
                         DirectoryPermissionException,
                         InvalidGroupException,
                         DirectoryNotFoundException,
                         GroupNotFoundException,
                         ReadOnlyGroupException
Specified by:
updateGroup in interface DirectoryManager
Throws:
OperationFailedException
DirectoryPermissionException
InvalidGroupException
DirectoryNotFoundException
GroupNotFoundException
ReadOnlyGroupException

renameGroup

public Group renameGroup(long directoryId,
                         java.lang.String oldGroupname,
                         java.lang.String newGroupname)
                  throws OperationFailedException,
                         DirectoryPermissionException,
                         InvalidGroupException,
                         DirectoryNotFoundException,
                         GroupNotFoundException
Specified by:
renameGroup in interface DirectoryManager
Throws:
OperationFailedException
DirectoryPermissionException
InvalidGroupException
DirectoryNotFoundException
GroupNotFoundException

storeGroupAttributes

public void storeGroupAttributes(long directoryId,
                                 java.lang.String groupName,
                                 java.util.Map<java.lang.String,java.util.Set<java.lang.String>> attributes)
                          throws OperationFailedException,
                                 DirectoryPermissionException,
                                 DirectoryNotFoundException,
                                 GroupNotFoundException
Specified by:
storeGroupAttributes in interface DirectoryManager
Throws:
OperationFailedException
DirectoryPermissionException
DirectoryNotFoundException
GroupNotFoundException

removeGroupAttributes

public void removeGroupAttributes(long directoryId,
                                  java.lang.String groupName,
                                  java.lang.String attributeName)
                           throws OperationFailedException,
                                  DirectoryPermissionException,
                                  DirectoryNotFoundException,
                                  GroupNotFoundException
Specified by:
removeGroupAttributes in interface DirectoryManager
Throws:
OperationFailedException
DirectoryPermissionException
DirectoryNotFoundException
GroupNotFoundException

removeGroup

public void removeGroup(long directoryId,
                        java.lang.String groupName)
                 throws DirectoryPermissionException,
                        OperationFailedException,
                        DirectoryNotFoundException,
                        GroupNotFoundException,
                        ReadOnlyGroupException
Specified by:
removeGroup in interface DirectoryManager
Throws:
DirectoryPermissionException
OperationFailedException
DirectoryNotFoundException
GroupNotFoundException
ReadOnlyGroupException

isUserDirectGroupMember

public boolean isUserDirectGroupMember(long directoryId,
                                       java.lang.String username,
                                       java.lang.String groupName)
                                throws OperationFailedException,
                                       DirectoryNotFoundException
Specified by:
isUserDirectGroupMember in interface DirectoryManager
Throws:
OperationFailedException
DirectoryNotFoundException

isGroupDirectGroupMember

public boolean isGroupDirectGroupMember(long directoryId,
                                        java.lang.String childGroup,
                                        java.lang.String parentGroup)
                                 throws OperationFailedException,
                                        DirectoryNotFoundException
Specified by:
isGroupDirectGroupMember in interface DirectoryManager
Throws:
OperationFailedException
DirectoryNotFoundException

addUserToGroup

public void addUserToGroup(long directoryId,
                           java.lang.String username,
                           java.lang.String groupName)
                    throws DirectoryPermissionException,
                           OperationFailedException,
                           DirectoryNotFoundException,
                           GroupNotFoundException,
                           UserNotFoundException,
                           ReadOnlyGroupException
Specified by:
addUserToGroup in interface DirectoryManager
Throws:
DirectoryPermissionException
OperationFailedException
DirectoryNotFoundException
GroupNotFoundException
UserNotFoundException
ReadOnlyGroupException

addGroupToGroup

public void addGroupToGroup(long directoryId,
                            java.lang.String childGroup,
                            java.lang.String parentGroup)
                     throws DirectoryPermissionException,
                            OperationFailedException,
                            InvalidMembershipException,
                            NestedGroupsNotSupportedException,
                            DirectoryNotFoundException,
                            GroupNotFoundException,
                            ReadOnlyGroupException
Specified by:
addGroupToGroup in interface DirectoryManager
Throws:
DirectoryPermissionException
OperationFailedException
InvalidMembershipException
NestedGroupsNotSupportedException
DirectoryNotFoundException
GroupNotFoundException
ReadOnlyGroupException

removeUserFromGroup

public void removeUserFromGroup(long directoryId,
                                java.lang.String username,
                                java.lang.String groupName)
                         throws DirectoryPermissionException,
                                OperationFailedException,
                                MembershipNotFoundException,
                                DirectoryNotFoundException,
                                GroupNotFoundException,
                                UserNotFoundException,
                                ReadOnlyGroupException
Specified by:
removeUserFromGroup in interface DirectoryManager
Throws:
DirectoryPermissionException
OperationFailedException
MembershipNotFoundException
DirectoryNotFoundException
GroupNotFoundException
UserNotFoundException
ReadOnlyGroupException

removeGroupFromGroup

public void removeGroupFromGroup(long directoryId,
                                 java.lang.String childGroup,
                                 java.lang.String parentGroup)
                          throws DirectoryPermissionException,
                                 OperationFailedException,
                                 InvalidMembershipException,
                                 MembershipNotFoundException,
                                 DirectoryNotFoundException,
                                 GroupNotFoundException,
                                 ReadOnlyGroupException
Specified by:
removeGroupFromGroup in interface DirectoryManager
Throws:
DirectoryPermissionException
OperationFailedException
InvalidMembershipException
MembershipNotFoundException
DirectoryNotFoundException
GroupNotFoundException
ReadOnlyGroupException

searchDirectGroupRelationships

public <T> java.util.List<T> searchDirectGroupRelationships(long directoryId,
                                                            MembershipQuery<T> query)
                                                 throws OperationFailedException,
                                                        DirectoryNotFoundException
Specified by:
searchDirectGroupRelationships in interface DirectoryManager
Throws:
OperationFailedException
DirectoryNotFoundException

isUserNestedGroupMember

public boolean isUserNestedGroupMember(long directoryId,
                                       java.lang.String username,
                                       java.lang.String groupName)
                                throws OperationFailedException,
                                       DirectoryNotFoundException
Specified by:
isUserNestedGroupMember in interface DirectoryManager
Throws:
OperationFailedException
DirectoryNotFoundException

isGroupNestedGroupMember

public boolean isGroupNestedGroupMember(long directoryId,
                                        java.lang.String childGroup,
                                        java.lang.String parentGroup)
                                 throws OperationFailedException,
                                        DirectoryNotFoundException
Specified by:
isGroupNestedGroupMember in interface DirectoryManager
Throws:
OperationFailedException
DirectoryNotFoundException

searchNestedGroupRelationships

public <T> java.util.List<T> searchNestedGroupRelationships(long directoryId,
                                                            MembershipQuery<T> query)
                                                 throws OperationFailedException,
                                                        DirectoryNotFoundException
Specified by:
searchNestedGroupRelationships in interface DirectoryManager
Throws:
OperationFailedException
DirectoryNotFoundException

addAllUsers

public BulkAddResult<User> addAllUsers(long directoryId,
                                       java.util.Collection<UserTemplateWithCredentialAndAttributes> users,
                                       boolean overwrite)
                                throws DirectoryPermissionException,
                                       OperationFailedException,
                                       DirectoryNotFoundException
Specified by:
addAllUsers in interface DirectoryManager
Throws:
DirectoryPermissionException
OperationFailedException
DirectoryNotFoundException

addAllGroups

public BulkAddResult<Group> addAllGroups(long directoryId,
                                         java.util.Collection<GroupTemplate> groups,
                                         boolean overwrite)
                                  throws DirectoryPermissionException,
                                         OperationFailedException,
                                         DirectoryNotFoundException,
                                         InvalidGroupException
Specified by:
addAllGroups in interface DirectoryManager
Throws:
DirectoryPermissionException
OperationFailedException
DirectoryNotFoundException
InvalidGroupException

addAllUsersToGroup

public BulkAddResult<java.lang.String> addAllUsersToGroup(long directoryId,
                                                          java.util.Collection<java.lang.String> userNames,
                                                          java.lang.String groupName)
                                                   throws DirectoryPermissionException,
                                                          OperationFailedException,
                                                          DirectoryNotFoundException,
                                                          GroupNotFoundException,
                                                          UserNotFoundException
Specified by:
addAllUsersToGroup in interface DirectoryManager
Throws:
DirectoryPermissionException
OperationFailedException
DirectoryNotFoundException
GroupNotFoundException
UserNotFoundException


Copyright © 2012 Atlassian. All Rights Reserved.