com.atlassian.crowd.directory.loader
Class DbCachingRemoteDirectoryInstanceLoaderImpl

java.lang.Object
  extended by com.atlassian.crowd.directory.loader.CachingDirectoryInstanceLoader
      extended by com.atlassian.crowd.directory.loader.DbCachingRemoteDirectoryInstanceLoaderImpl
All Implemented Interfaces:
DirectoryInstanceLoader, InternalHybridDirectoryInstanceLoader

public class DbCachingRemoteDirectoryInstanceLoaderImpl
extends CachingDirectoryInstanceLoader
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
DbCachingRemoteDirectoryInstanceLoaderImpl(DirectoryInstanceLoader remoteDirectoryInstanceLoader, InternalDirectoryInstanceLoader internalDirectoryInstanceLoader, DirectoryMonitorManager directoryMonitorManager, com.atlassian.event.api.EventPublisher eventPublisher)
          Spring-friendly constructor.
DbCachingRemoteDirectoryInstanceLoaderImpl(LDAPDirectoryInstanceLoader ldapDirectoryInstanceLoader, RemoteCrowdDirectoryInstanceLoader remoteCrowdDirectoryInstanceLoader, InternalDirectoryInstanceLoader internalDirectoryInstanceLoader, DirectoryMonitorManager directoryMonitorManager, com.atlassian.event.api.EventPublisher eventPublisher)
          Pico-friendly constructor.
 
Method Summary
 boolean canLoad(java.lang.String className)
           
protected  RemoteDirectory getNewDirectory(Directory directory)
          Always returns a new instance of a RemoteDirectory.
 RemoteDirectory getRawDirectory(java.lang.Long id, java.lang.String className, java.util.Map<java.lang.String,java.lang.String> attributes)
          This method will NOT wire up the internal backed directory.
 
Methods inherited from class com.atlassian.crowd.directory.loader.CachingDirectoryInstanceLoader
getDirectory, getEventPublisher, handleEvent, handleEvent, handleEvent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.atlassian.crowd.directory.loader.DirectoryInstanceLoader
getDirectory
 

Constructor Detail

DbCachingRemoteDirectoryInstanceLoaderImpl

public DbCachingRemoteDirectoryInstanceLoaderImpl(DirectoryInstanceLoader remoteDirectoryInstanceLoader,
                                                  InternalDirectoryInstanceLoader internalDirectoryInstanceLoader,
                                                  DirectoryMonitorManager directoryMonitorManager,
                                                  com.atlassian.event.api.EventPublisher eventPublisher)
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
eventPublisher - system event publisher

DbCachingRemoteDirectoryInstanceLoaderImpl

public DbCachingRemoteDirectoryInstanceLoaderImpl(LDAPDirectoryInstanceLoader ldapDirectoryInstanceLoader,
                                                  RemoteCrowdDirectoryInstanceLoader remoteCrowdDirectoryInstanceLoader,
                                                  InternalDirectoryInstanceLoader internalDirectoryInstanceLoader,
                                                  DirectoryMonitorManager directoryMonitorManager,
                                                  com.atlassian.event.api.EventPublisher eventPublisher)
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
eventPublisher - system event publisher
Method Detail

getNewDirectory

protected RemoteDirectory getNewDirectory(Directory directory)
                                   throws DirectoryInstantiationException
Always returns a new instance of a RemoteDirectory.

Specified by:
getNewDirectory in class CachingDirectoryInstanceLoader
Parameters:
directory - directory configuration
Returns:
new instance of a RemoteDirectory
Throws:
DirectoryInstantiationException - if the directory could not be instantiated.

getRawDirectory

public RemoteDirectory getRawDirectory(java.lang.Long id,
                                       java.lang.String className,
                                       java.util.Map<java.lang.String,java.lang.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(java.lang.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 © 2011 Atlassian. All Rights Reserved.