com.atlassian.crowd.directory.loader
Class DelegatingDirectoryInstanceLoader

java.lang.Object
  extended by com.atlassian.crowd.directory.loader.DelegatingDirectoryInstanceLoader
All Implemented Interfaces:
DirectoryInstanceLoader

public class DelegatingDirectoryInstanceLoader
extends Object
implements DirectoryInstanceLoader

Iterative directory instance loader.


Constructor Summary
DelegatingDirectoryInstanceLoader(InternalDirectoryInstanceLoader internalDirectoryInstanceLoader, InternalHybridDirectoryInstanceLoader ldapInternalHybridDirectoryInstanceLoader)
          Pico-friendly constructor.
DelegatingDirectoryInstanceLoader(InternalDirectoryInstanceLoader internalDirectoryInstanceLoader, InternalHybridDirectoryInstanceLoader ldapInternalHybridDirectoryInstanceLoader, DelegatedAuthenticationDirectoryInstanceLoader delegatedAuthenticationDirectoryInstanceLoader)
          Pico-friendly constructor.
DelegatingDirectoryInstanceLoader(List<DirectoryInstanceLoader> loaders)
          Creates a new instance of DelegatingDirectoryInstanceLoader.
 
Method Summary
 boolean canLoad(String className)
           
 RemoteDirectory getDirectory(Directory directory)
          Loads the RemoteDirectory implementation class for a specific (already saved) Directory configuration.
 RemoteDirectory getRawDirectory(Long id, String className, Map<String,String> attributes)
          Loads a guaranteed un-cached directory implementation for a specific configuration.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DelegatingDirectoryInstanceLoader

public DelegatingDirectoryInstanceLoader(List<DirectoryInstanceLoader> loaders)
Creates a new instance of DelegatingDirectoryInstanceLoader. Spring-friendly.

Parameters:
loaders - list of delegate directory instance loaders.

DelegatingDirectoryInstanceLoader

public DelegatingDirectoryInstanceLoader(InternalDirectoryInstanceLoader internalDirectoryInstanceLoader,
                                         InternalHybridDirectoryInstanceLoader ldapInternalHybridDirectoryInstanceLoader,
                                         DelegatedAuthenticationDirectoryInstanceLoader delegatedAuthenticationDirectoryInstanceLoader)
Pico-friendly constructor. Because Pico can not accept list arguments in its constructor it instead hard-codes the two delegate loaders that JIRA needs. This constructor must have more arguments than the spring-friendly constructor for Pico to find it.

Parameters:
internalDirectoryInstanceLoader - loads an internal directory instance
ldapInternalHybridDirectoryInstanceLoader - loads a directory with caching capabilities (using an internal directory)
delegatedAuthenticationDirectoryInstanceLoader - loads a DelegatedAuthenticationDirectory instance

DelegatingDirectoryInstanceLoader

public DelegatingDirectoryInstanceLoader(InternalDirectoryInstanceLoader internalDirectoryInstanceLoader,
                                         InternalHybridDirectoryInstanceLoader ldapInternalHybridDirectoryInstanceLoader)
Pico-friendly constructor. Because Pico can not accept list arguments in its constructor it instead hard-codes the two delegate loaders that JIRA needs. This constructor must have more arguments than the spring-friendly constructor for Pico to find it.

Parameters:
internalDirectoryInstanceLoader - the internal directory in which to do the caching
ldapInternalHybridDirectoryInstanceLoader - loads a directory with caching capabilities (using an internal directory)
Method Detail

getDirectory

public RemoteDirectory getDirectory(Directory directory)
                             throws DirectoryInstantiationException
Description copied from interface: DirectoryInstanceLoader
Loads the 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.

Specified by:
getDirectory in interface DirectoryInstanceLoader
Parameters:
directory - The directory to load the RemoteDirectory implementation from.
Returns:
The RemoteDirectory loaded implementation.
Throws:
DirectoryInstantiationException - If the RemoteDirectory implementation could not be loaded.

getRawDirectory

public RemoteDirectory getRawDirectory(Long id,
                                       String className,
                                       Map<String,String> attributes)
                                throws DirectoryInstantiationException
Description copied from interface: DirectoryInstanceLoader
Loads a guaranteed un-cached directory implementation for a specific configuration.

Specified by:
getRawDirectory in interface DirectoryInstanceLoader
Parameters:
id - Directory ID
className - class name of directory.
attributes - the configuration attributes to pass to the RemoteDirectory
Returns:
The loaded RemoteDirectory implementation.
Throws:
DirectoryInstantiationException - if a RemoteDirectory implementation can not be loaded.

canLoad

public boolean canLoad(String className)
Specified by:
canLoad in interface DirectoryInstanceLoader
Parameters:
className - class name of directory.
Returns:
true iff the directory can load the directory of the specified class.


Copyright © 2013 Atlassian. All Rights Reserved.