com.atlassian.crowd.directory.loader
Class CachingDirectoryInstanceLoader

java.lang.Object
  extended by com.atlassian.crowd.directory.loader.CachingDirectoryInstanceLoader
All Implemented Interfaces:
DirectoryInstanceLoader
Direct Known Subclasses:
CustomDirectoryInstanceLoader, DbCachingRemoteDirectoryInstanceLoaderImpl, DelegatedAuthenticationDirectoryInstanceLoaderImpl, InternalDirectoryInstanceLoaderImpl, LDAPDirectoryInstanceLoaderImpl, RemoteCrowdDirectoryInstanceLoaderImpl

public abstract class CachingDirectoryInstanceLoader
extends Object
implements DirectoryInstanceLoader

Implements a DirectoryInstanceLoader. Provides caching for RemoteDirectory instances.

Since:
v2.1

Constructor Summary
CachingDirectoryInstanceLoader(com.atlassian.event.api.EventPublisher eventPublisher)
           
 
Method Summary
 RemoteDirectory getDirectory(Directory directory)
          Loads the RemoteDirectory implementation class for a specific (already saved) Directory configuration.
protected  com.atlassian.event.api.EventPublisher getEventPublisher()
           
protected abstract  RemoteDirectory getNewDirectory(Directory directory)
          Always returns a new instance of a RemoteDirectory.
 void handleEvent(DirectoryDeletedEvent event)
           
 void handleEvent(DirectoryUpdatedEvent event)
           
 void handleEvent(XMLRestoreFinishedEvent event)
           
 
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
canLoad, getRawDirectory
 

Constructor Detail

CachingDirectoryInstanceLoader

public CachingDirectoryInstanceLoader(com.atlassian.event.api.EventPublisher eventPublisher)
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.

getEventPublisher

protected com.atlassian.event.api.EventPublisher getEventPublisher()

getNewDirectory

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

Parameters:
directory - directory configuration
Returns:
new instance of a RemoteDirectory
Throws:
DirectoryInstantiationException - if the directory could not be instantiated.

handleEvent

@EventListener
public void handleEvent(DirectoryUpdatedEvent event)

handleEvent

@EventListener
public void handleEvent(DirectoryDeletedEvent event)

handleEvent

@EventListener
public void handleEvent(XMLRestoreFinishedEvent event)


Copyright © 2012 Atlassian. All Rights Reserved.