Class InternalDirectoryInstanceLoaderImpl
java.lang.Object
com.atlassian.crowd.directory.loader.AbstractDirectoryInstanceLoader
com.atlassian.crowd.directory.loader.InternalDirectoryInstanceLoaderImpl
- All Implemented Interfaces:
DirectoryInstanceLoader,InternalDirectoryInstanceLoader
public class InternalDirectoryInstanceLoaderImpl
extends AbstractDirectoryInstanceLoader
implements InternalDirectoryInstanceLoader
Loads an implementation of a
RemoteDirectory for use at runtime
by the Crowd security server.
The getDirectory(com.atlassian.crowd.embedded.api.Directory) method caches instances of RemoteDirectory as
allowed in the spec of the interface, but getRawDirectory(Long, String, java.util.Map) returns a new instance
every time as required.
This class listens for update events on EventPublisher to know when to refresh the cache.
This loads both AbstractInternalDirectory and
DelegatedAuthenticationDirectory instances.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleangetDirectory(Directory directory) Loads theRemoteDirectoryimplementation class for a specific (already saved)Directoryconfiguration.Loads a guaranteed un-cached directory implementation for a specific configuration.
-
Constructor Details
-
InternalDirectoryInstanceLoaderImpl
-
-
Method Details
-
getRawDirectory
public InternalRemoteDirectory getRawDirectory(Long id, String className, Map<String, String> directoryAttributes) throws DirectoryInstantiationExceptionDescription copied from interface:DirectoryInstanceLoaderLoads a guaranteed un-cached directory implementation for a specific configuration.- Specified by:
getRawDirectoryin interfaceDirectoryInstanceLoader- Specified by:
getRawDirectoryin interfaceInternalDirectoryInstanceLoader- Parameters:
id- Directory IDclassName- class name of directory.directoryAttributes- the configuration attributes to pass to the RemoteDirectory- Returns:
- instance of
InternalRemoteDirectory. - Throws:
DirectoryInstantiationException- if a RemoteDirectory implementation can not be loaded.- See Also:
-
canLoad
- Specified by:
canLoadin interfaceDirectoryInstanceLoader- Parameters:
className- class name of directory.- Returns:
trueiff the directory can load the directory of the specified class.
-
getDirectory
public InternalRemoteDirectory getDirectory(Directory directory) throws DirectoryInstantiationException Description copied from interface:DirectoryInstanceLoaderLoads theRemoteDirectoryimplementation class for a specific (already saved)Directoryconfiguration.Implementations of this method may choose to cache the RemoteDirectory, so this must only be called for Directories that have been successfully saved.
- Specified by:
getDirectoryin interfaceDirectoryInstanceLoader- Specified by:
getDirectoryin interfaceInternalDirectoryInstanceLoader- Overrides:
getDirectoryin classAbstractDirectoryInstanceLoader- Parameters:
directory- The directory to load theRemoteDirectoryimplementation from.- Returns:
- The
RemoteDirectoryloaded implementation. - Throws:
DirectoryInstantiationException- If theRemoteDirectoryimplementation could not be loaded.- See Also:
-