public class CacheableDirectoryInstanceLoader extends Object implements com.atlassian.crowd.directory.loader.DirectoryInstanceLoader
Note, this caching refers to holding the RemoteDirectory
instances in memory, not the
db caching which may occur in underlying implementations.
The problem with this approach is that every DC node is going to have it's own directory instance.
Constructor and Description |
---|
CacheableDirectoryInstanceLoader(com.atlassian.crowd.directory.loader.DelegatingDirectoryInstanceLoader delegate,
com.atlassian.event.api.EventListenerRegistrar eventListenerRegistrar,
com.atlassian.cache.CacheFactory cacheFactory) |
Modifier and Type | Method and Description |
---|---|
boolean |
canLoad(String className) |
com.atlassian.crowd.directory.RemoteDirectory |
getDirectory(com.atlassian.crowd.embedded.api.Directory directory)
Create a directory instance from configuration
|
com.atlassian.crowd.directory.RemoteDirectory |
getRawDirectory(Long id,
String className,
Map<String,String> attributes) |
void |
handleEvent(com.atlassian.crowd.event.directory.DirectoryDeletedEvent event) |
void |
handleEvent(com.atlassian.crowd.event.directory.DirectoryUpdatedEvent event) |
void |
registerForEvents() |
void |
unregisterForEvents() |
public CacheableDirectoryInstanceLoader(com.atlassian.crowd.directory.loader.DelegatingDirectoryInstanceLoader delegate, com.atlassian.event.api.EventListenerRegistrar eventListenerRegistrar, com.atlassian.cache.CacheFactory cacheFactory)
@PostConstruct public void registerForEvents()
@PreDestroy public void unregisterForEvents()
public com.atlassian.crowd.directory.RemoteDirectory getDirectory(com.atlassian.crowd.embedded.api.Directory directory) throws com.atlassian.crowd.exception.DirectoryInstantiationException
We MUST only serve a single instance of DbCachingRemoteDirectory
per directory ID because of concurrency controls on the DbCachingRemoteDirectory
sync refresh. This is achieved by atomically creating RemoteDirectory
only if it hasn't exist yet
getDirectory
in interface com.atlassian.crowd.directory.loader.DirectoryInstanceLoader
directory
- directory configurationcom.atlassian.crowd.exception.DirectoryInstantiationException
- if directory creation failed for whatever reasonpublic com.atlassian.crowd.directory.RemoteDirectory getRawDirectory(Long id, String className, Map<String,String> attributes) throws com.atlassian.crowd.exception.DirectoryInstantiationException
getRawDirectory
in interface com.atlassian.crowd.directory.loader.DirectoryInstanceLoader
com.atlassian.crowd.exception.DirectoryInstantiationException
public boolean canLoad(String className)
canLoad
in interface com.atlassian.crowd.directory.loader.DirectoryInstanceLoader
@EventListener public void handleEvent(com.atlassian.crowd.event.directory.DirectoryUpdatedEvent event)
@EventListener public void handleEvent(com.atlassian.crowd.event.directory.DirectoryDeletedEvent event)
Copyright © 2003–2020 Atlassian. All rights reserved.