public class InternalDirectoryInstanceLoaderImpl extends AbstractDirectoryInstanceLoader implements InternalDirectoryInstanceLoader
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 and Description |
---|
InternalDirectoryInstanceLoaderImpl(InstanceFactory instanceFactory) |
Modifier and Type | Method and Description |
---|---|
boolean |
canLoad(String className) |
InternalRemoteDirectory |
getDirectory(Directory directory)
Loads the
RemoteDirectory implementation class for a specific (already saved)
Directory configuration. |
InternalRemoteDirectory |
getRawDirectory(Long id,
String className,
Map<String,String> directoryAttributes)
Loads a guaranteed un-cached directory implementation for a specific configuration.
|
public InternalDirectoryInstanceLoaderImpl(InstanceFactory instanceFactory)
public InternalRemoteDirectory getRawDirectory(Long id, String className, Map<String,String> directoryAttributes) throws DirectoryInstantiationException
DirectoryInstanceLoader
getRawDirectory
in interface DirectoryInstanceLoader
getRawDirectory
in interface InternalDirectoryInstanceLoader
id
- Directory IDclassName
- class name of directory.directoryAttributes
- the configuration attributes to pass to the RemoteDirectoryInternalRemoteDirectory
.DirectoryInstantiationException
- if a RemoteDirectory implementation can not be loaded.DirectoryInstanceLoader
public boolean canLoad(String className)
canLoad
in interface DirectoryInstanceLoader
className
- class name of directory.true
iff the directory can load the directory of the specified class.public InternalRemoteDirectory getDirectory(Directory directory) throws DirectoryInstantiationException
DirectoryInstanceLoader
RemoteDirectory
implementation class for a specific (already saved)
Directory
configuration.
Implementations of this method may choose to cache the RemoteDirectory, so this must only be called for Directories that have been successfully saved.
getDirectory
in interface DirectoryInstanceLoader
getDirectory
in interface InternalDirectoryInstanceLoader
getDirectory
in class AbstractDirectoryInstanceLoader
directory
- The directory to load the RemoteDirectory
implementation from.RemoteDirectory
loaded implementation.DirectoryInstantiationException
- If the RemoteDirectory
implementation could not be loaded.DirectoryInstanceLoader
Copyright © 2020 Atlassian. All rights reserved.