com.atlassian.crowd.directory.loader
Class RemoteCrowdDirectoryInstanceLoaderImpl

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

public class RemoteCrowdDirectoryInstanceLoaderImpl
extends CachingDirectoryInstanceLoader
implements RemoteCrowdDirectoryInstanceLoader

Loads an implementation of a RemoteDirectory for use at runtime by the Crowd security server.

The CachingDirectoryInstanceLoader.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.


Constructor Summary
RemoteCrowdDirectoryInstanceLoaderImpl(InstanceFactory instanceFactory, com.atlassian.event.api.EventPublisher eventPublisher)
           
 
Method Summary
 boolean canLoad(String className)
           
protected  RemoteDirectory getNewDirectory(Directory directory)
          Always returns a new instance of a RemoteDirectory.
 RemoteCrowdDirectory getRawDirectory(Long id, String className, Map<String,String> directoryAttributes)
          Loads a guaranteed un-cached directory implementation for a specific configuration.
 
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

RemoteCrowdDirectoryInstanceLoaderImpl

public RemoteCrowdDirectoryInstanceLoaderImpl(InstanceFactory instanceFactory,
                                              com.atlassian.event.api.EventPublisher eventPublisher)
Method Detail

getRawDirectory

public RemoteCrowdDirectory getRawDirectory(Long id,
                                            String className,
                                            Map<String,String> directoryAttributes)
                                     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.
directoryAttributes - 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.

getNewDirectory

protected RemoteDirectory getNewDirectory(Directory directory)
                                   throws DirectoryInstantiationException
Description copied from class: CachingDirectoryInstanceLoader
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.


Copyright © 2012 Atlassian. All Rights Reserved.