public class CrowdDirectoryServiceImpl extends Object implements CrowdDirectoryService
| Constructor and Description |
|---|
CrowdDirectoryServiceImpl(ApplicationFactory applicationFactory,
DirectoryInstanceLoader directoryInstanceLoader,
DirectoryManager directoryManager,
ApplicationManager applicationManager,
DirectoryValidatorFactory directoryValidatorFactory) |
| Modifier and Type | Method and Description |
|---|---|
Directory |
addDirectory(Directory directory)
Will add a new
Directory into the local database. |
List<Directory> |
findAllDirectories()
Will return a
List<Directory> ordered by the order specified by the application. |
Directory |
findDirectoryById(long directoryId)
Will return a
Directory based on the given directoryId |
Directory |
findDirectoryByName(String name)
Will return a
Directory based on the given name |
DirectorySynchronisationInformation |
getDirectorySynchronisationInformation(long directoryId)
Returns the synchronisation information for the directory.
|
ConnectionPoolProperties |
getStoredConnectionPoolProperties()
Retrieves the stored LDAP connection pool properties which will be applied when the system restarts.
|
ConnectionPoolProperties |
getSystemConnectionPoolProperties()
Retrieves the system LDAP connection pool properties (i.e.
|
boolean |
isDirectorySynchronisable(long directoryId)
Returns true if the underlying directory implementation supports manual synchronisation of the directory's local cache.
|
boolean |
isDirectorySynchronising(long directoryId)
Returns true if the given Directory is currently synchronising.
|
boolean |
isMembershipAggregationEnabled() |
boolean |
removeDirectory(long directoryId)
Will remove a directory from the Application, this will also remove all associated entities (users/groups/memberships).
|
void |
setConnectionPoolProperties(ConnectionPoolProperties poolProperties)
Stores the provided LDAP connection pool properties so they can be applied when the system next restarts.
|
void |
setDirectoryPosition(long directoryId,
int position)
Will place the directory with the given
directoryId and the passed in position in the current list of directories configured for an application. |
void |
setMembershipAggregationEnabled(boolean enabled)
Store the membership aggregation semantic to use across the directories.
|
boolean |
supportsNestedGroups(long directoryId)
Returns true if the underlying directory implementation supports nested groups.
|
void |
synchroniseDirectory(long directoryId)
Requests that this directory should update its cache by synchronising with the remote server.
|
void |
synchroniseDirectory(long directoryId,
boolean runInBackground)
Requests that this directory should update its cache by synchronising with the remote server.
|
void |
testConnection(Directory directory)
Test if a connection to the directory server can be established.
|
Directory |
updateDirectory(Directory directory)
Will update the
Directory. |
List<ValidationError> |
validateDirectoryConfiguration(Directory directory,
EnumSet<DirectoryValidationContext> validationContexts)
Will validate the attributes of the given directory, depending upon the directory type
|
public CrowdDirectoryServiceImpl(ApplicationFactory applicationFactory, DirectoryInstanceLoader directoryInstanceLoader, DirectoryManager directoryManager, ApplicationManager applicationManager, DirectoryValidatorFactory directoryValidatorFactory)
public Directory addDirectory(Directory directory) throws OperationFailedException
CrowdDirectoryServiceDirectory into the local database.addDirectory in interface CrowdDirectoryServicedirectory - The directory to be savedDirectoryOperationFailedException - if the operation failed for any reasonpublic List<ValidationError> validateDirectoryConfiguration(Directory directory, EnumSet<DirectoryValidationContext> validationContexts)
CrowdDirectoryServicevalidateDirectoryConfiguration in interface CrowdDirectoryServicedirectory - directory to be validatedvalidationContexts - List of DirectoryValidationContext that are required to be validatedList, which are errors generated during validation, or an empty list if no error was generated@Nullable public Directory findDirectoryByName(String name)
CrowdDirectoryServiceDirectory based on the given namefindDirectoryByName in interface CrowdDirectoryServicename - the name of the directoryDirectory or null if no directory exists with given namepublic void testConnection(Directory directory) throws OperationFailedException
CrowdDirectoryServicetestConnection in interface CrowdDirectoryServicedirectory - Directory to testOperationFailedException - underlying directory implementation failed to execute the operation.public List<Directory> findAllDirectories()
CrowdDirectoryServiceList<Directory> ordered by the order specified by the application.findAllDirectories in interface CrowdDirectoryServiceList<Directory> or if there are no directories, an empty list (this should never happen)public Directory findDirectoryById(long directoryId)
CrowdDirectoryServiceDirectory based on the given directoryIdfindDirectoryById in interface CrowdDirectoryServicedirectoryId - the id of the directorynull if the directory is not foundpublic Directory updateDirectory(Directory directory) throws OperationFailedException
CrowdDirectoryServiceDirectory. The Directory must have at the bare minimum an Directory.getId(), Directory.getName(), Directory.getType() and Directory.getImplementationClass()}updateDirectory in interface CrowdDirectoryServicedirectory - the directory to updateOperationFailedException - if the directory does not exist or the operation failed for any other reason.public void setDirectoryPosition(long directoryId,
int position)
throws OperationFailedException
CrowdDirectoryServicedirectoryId and the passed in position in the current list of directories configured for an application.setDirectoryPosition in interface CrowdDirectoryServicedirectoryId - the id of the directoryposition - the position in the list of directories where you would like this one to beOperationFailedException - if the directory does not exist or the operation failed for any other reasonpublic boolean removeDirectory(long directoryId)
throws DirectoryCurrentlySynchronisingException,
OperationFailedException
CrowdDirectoryServiceremoveDirectory in interface CrowdDirectoryServicedirectoryId - the directory id of the Directory to remove.true if the directory and associated entities were removed, or false otherwiseDirectoryCurrentlySynchronisingException - if the Directory is currently synchronising.OperationFailedException - if the directory does not exist or the operation failed for any other reasonpublic boolean supportsNestedGroups(long directoryId)
throws OperationFailedException
CrowdDirectoryServicesupportsNestedGroups in interface CrowdDirectoryServicedirectoryId - ID of directory.OperationFailedException - if the operation failed for any reasonpublic boolean isDirectorySynchronisable(long directoryId)
throws OperationFailedException
CrowdDirectoryServiceisDirectorySynchronisable in interface CrowdDirectoryServicedirectoryId - ID of directory.OperationFailedException - if the operation failed for any reasonpublic void synchroniseDirectory(long directoryId)
throws OperationFailedException
CrowdDirectoryServiceIf a synchronisation is currently in progress when this method is called, then this method does nothing.
synchroniseDirectory in interface CrowdDirectoryServicedirectoryId - ID of directory.OperationFailedException - if the operation failed for any reasonpublic void synchroniseDirectory(long directoryId,
boolean runInBackground)
throws OperationFailedException
CrowdDirectoryServiceIf a synchronisation is currently in progress when this method is called, then this method does nothing if runInBackGround is true, otherwise it will throw OperationFailedException.
synchroniseDirectory in interface CrowdDirectoryServicedirectoryId - ID of directory.runInBackground - If True the synchronise will happen asynchronously.OperationFailedException - if the operation failed for any reasonpublic boolean isDirectorySynchronising(long directoryId)
throws OperationFailedException
CrowdDirectoryServiceisDirectorySynchronising in interface CrowdDirectoryServicedirectoryId - ID of directory.OperationFailedException - if the operation failed for any reasonpublic DirectorySynchronisationInformation getDirectorySynchronisationInformation(long directoryId) throws OperationFailedException
CrowdDirectoryServicegetDirectorySynchronisationInformation in interface CrowdDirectoryServicedirectoryId - ID of directoryOperationFailedException - if the operation failed for any reasonpublic void setConnectionPoolProperties(ConnectionPoolProperties poolProperties)
CrowdDirectoryServicesetConnectionPoolProperties in interface CrowdDirectoryServicepoolProperties - the LDAP connection pool properties to be stored and applied on the next restartCrowdDirectoryService.getStoredConnectionPoolProperties(),
CrowdDirectoryService.getSystemConnectionPoolProperties()public ConnectionPoolProperties getStoredConnectionPoolProperties()
CrowdDirectoryServicegetStoredConnectionPoolProperties in interface CrowdDirectoryServiceto retrieve the currently active settingspublic ConnectionPoolProperties getSystemConnectionPoolProperties()
CrowdDirectoryServicegetSystemConnectionPoolProperties in interface CrowdDirectoryServiceto retrieve the stored configuration which will be applied
when the system next restartspublic boolean isMembershipAggregationEnabled()
isMembershipAggregationEnabled in interface CrowdDirectoryServicepublic void setMembershipAggregationEnabled(boolean enabled)
CrowdDirectoryServicesetMembershipAggregationEnabled in interface CrowdDirectoryServiceenabled - true if membership aggregation should be enabled, false to disableCopyright © 2020 Atlassian. All rights reserved.