public interface CrowdDirectoryService
NullPointerException
or IllegalArgumentException
.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
|
Directory addDirectory(Directory directory) throws OperationFailedException
Directory
into the local database.directory
- The directory to be savedDirectory
OperationFailedException
- if the operation failed for any reasonList<ValidationError> validateDirectoryConfiguration(Directory directory, EnumSet<DirectoryValidationContext> validationContexts)
directory
- 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 Directory findDirectoryByName(String name)
Directory
based on the given name
name
- the name of the directoryDirectory
or null
if no directory exists with given namevoid testConnection(Directory directory) throws OperationFailedException
directory
- Directory to testOperationFailedException
- underlying directory implementation failed to execute the operation.List<Directory> findAllDirectories()
List<Directory>
ordered by the order specified by the application.List<Directory>
or if there are no directories, an empty list (this should never happen)Directory findDirectoryById(long directoryId)
Directory
based on the given directoryId
directoryId
- the id of the directorynull
if the directory is not foundDirectory updateDirectory(Directory directory) throws OperationFailedException
Directory
. The Directory must have at the bare minimum an Directory.getId()
, Directory.getName()
, Directory.getType()
and Directory.getImplementationClass()
}directory
- the directory to updateOperationFailedException
- if the directory does not exist or the operation failed for any other reason.void setDirectoryPosition(long directoryId, int position) throws OperationFailedException
directoryId
and the passed in position
in the current list of directories configured for an application.directoryId
- 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 reasonboolean removeDirectory(long directoryId) throws DirectoryCurrentlySynchronisingException, OperationFailedException
directoryId
- 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 reasonboolean supportsNestedGroups(long directoryId) throws OperationFailedException
directoryId
- ID of directory.OperationFailedException
- if the operation failed for any reasonboolean isDirectorySynchronisable(long directoryId) throws OperationFailedException
directoryId
- ID of directory.OperationFailedException
- if the operation failed for any reasonvoid synchroniseDirectory(long directoryId) throws OperationFailedException
If a synchronisation is currently in progress when this method is called, then this method does nothing.
directoryId
- ID of directory.OperationFailedException
- if the operation failed for any reasonvoid synchroniseDirectory(long directoryId, boolean runInBackground) throws OperationFailedException
If 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.
directoryId
- ID of directory.runInBackground
- If True the synchronise will happen asynchronously.OperationFailedException
- if the operation failed for any reasonboolean isDirectorySynchronising(long directoryId) throws OperationFailedException
directoryId
- ID of directory.OperationFailedException
- if the operation failed for any reasonDirectorySynchronisationInformation getDirectorySynchronisationInformation(long directoryId) throws OperationFailedException
directoryId
- ID of directoryOperationFailedException
- if the operation failed for any reasonvoid setConnectionPoolProperties(ConnectionPoolProperties poolProperties)
poolProperties
- the LDAP connection pool properties to be stored and applied on the next restartgetStoredConnectionPoolProperties()
,
getSystemConnectionPoolProperties()
ConnectionPoolProperties getStoredConnectionPoolProperties()
to retrieve the currently active settings
ConnectionPoolProperties getSystemConnectionPoolProperties()
to retrieve the stored configuration which will be applied
when the system next restarts
boolean isMembershipAggregationEnabled()
void setMembershipAggregationEnabled(boolean enabled)
enabled
- true if membership aggregation should be enabled, false to disableCopyright © 2021 Atlassian. All rights reserved.