com.atlassian.crowd.directory.loader
Class DbCachingRemoteDirectoryInstanceLoader

java.lang.Object
  extended by com.atlassian.crowd.directory.loader.AbstractDirectoryInstanceLoader
      extended by com.atlassian.crowd.directory.loader.DbCachingRemoteDirectoryInstanceLoader
All Implemented Interfaces:
DirectoryInstanceLoader, InternalHybridDirectoryInstanceLoader
Direct Known Subclasses:
ConfigurableDbCachingRemoteDirectoryInstanceLoader

public class DbCachingRemoteDirectoryInstanceLoader
extends AbstractDirectoryInstanceLoader
implements InternalHybridDirectoryInstanceLoader

Loader that allows for proxying of a remote directory through a local cache/mirror. To enable proxying for a remote directory you should not expose its loader directly to the Crowd service, but instead delegate through this loader.


Constructor Summary
DbCachingRemoteDirectoryInstanceLoader(DirectoryInstanceLoader remoteDirectoryInstanceLoader, InternalDirectoryInstanceLoader internalDirectoryInstanceLoader, DirectoryMonitorManager directoryMonitorManager, DirectoryCacheFactory directoryCacheFactory, CqlQueryParser cqlQueryParser)
          Spring-friendly constructor.
DbCachingRemoteDirectoryInstanceLoader(LDAPDirectoryInstanceLoader ldapDirectoryInstanceLoader, RemoteCrowdDirectoryInstanceLoader remoteCrowdDirectoryInstanceLoader, InternalDirectoryInstanceLoader internalDirectoryInstanceLoader, DirectoryMonitorManager directoryMonitorManager, DirectoryCacheFactory directoryCacheFactory, CqlQueryParser cqlQueryParser)
          Pico-friendly constructor.
 
Method Summary
 boolean canLoad(String className)
           
 RemoteDirectory getDirectory(Directory directory)
          
 RemoteDirectory getRawDirectory(Long id, String className, Map<String,String> attributes)
          This method will NOT wire up the internal backed directory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DbCachingRemoteDirectoryInstanceLoader

public DbCachingRemoteDirectoryInstanceLoader(DirectoryInstanceLoader remoteDirectoryInstanceLoader,
                                              InternalDirectoryInstanceLoader internalDirectoryInstanceLoader,
                                              DirectoryMonitorManager directoryMonitorManager,
                                              DirectoryCacheFactory directoryCacheFactory,
                                              CqlQueryParser cqlQueryParser)
Spring-friendly constructor.

Parameters:
remoteDirectoryInstanceLoader - the remote directory instance loader.
internalDirectoryInstanceLoader - the internal directory in which to do the caching
directoryMonitorManager - system directory monitor manager

DbCachingRemoteDirectoryInstanceLoader

public DbCachingRemoteDirectoryInstanceLoader(LDAPDirectoryInstanceLoader ldapDirectoryInstanceLoader,
                                              RemoteCrowdDirectoryInstanceLoader remoteCrowdDirectoryInstanceLoader,
                                              InternalDirectoryInstanceLoader internalDirectoryInstanceLoader,
                                              DirectoryMonitorManager directoryMonitorManager,
                                              DirectoryCacheFactory directoryCacheFactory,
                                              CqlQueryParser cqlQueryParser)
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:
ldapDirectoryInstanceLoader - the delegate LDAP directory loader
remoteCrowdDirectoryInstanceLoader - the delegate remote Crowd directory loader
internalDirectoryInstanceLoader - the internal directory in which to do the caching
directoryMonitorManager - system directory monitor manager
Method Detail

getDirectory

public RemoteDirectory getDirectory(Directory directory)
                             throws DirectoryInstantiationException

Specified by:
getDirectory in interface DirectoryInstanceLoader
Overrides:
getDirectory in class AbstractDirectoryInstanceLoader
Throws:
DirectoryInstantiationException

getRawDirectory

public RemoteDirectory getRawDirectory(Long id,
                                       String className,
                                       Map<String,String> attributes)
                                throws DirectoryInstantiationException
This method will NOT wire up the internal backed directory.

So no local groups or custom attributes.

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:
directory without monitoring/caching and without backing internal directory.
Throws:
DirectoryInstantiationException

canLoad

public boolean canLoad(String className)
Specified by:
canLoad in interface DirectoryInstanceLoader


Copyright © 2016 Atlassian. All Rights Reserved.