com.atlassian.confluence.user.crowd
Class DefaultApplicationCache

java.lang.Object
  extended by com.atlassian.confluence.user.crowd.DefaultApplicationCache
All Implemented Interfaces:
ApplicationCache

public final class DefaultApplicationCache
extends Object
implements ApplicationCache

Implementation of ApplicationCache that delegates to CacheFactory for caching. The key for each entry is a lower-case version of the name and the value is an immutable copy of the Application.


Constructor Summary
DefaultApplicationCache(com.atlassian.cache.CacheFactory cacheFactory, com.atlassian.event.api.EventPublisher eventPublisher)
           
 
Method Summary
 void directoryUpdated(com.atlassian.crowd.event.directory.DirectoryUpdatedEvent directoryUpdatedEvent)
           
 com.atlassian.crowd.model.application.Application getApplication(String name)
          Returns the cached application with the given name, or null if the application isn't cached.
 void putApplication(com.atlassian.crowd.model.application.Application application)
          Caches the application against its name, as returned by Application.getName().
 void removeAll()
          Removes all entries from the cache.
 void removeApplication(String name)
          Removes the application with the given name from the cache.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultApplicationCache

public DefaultApplicationCache(com.atlassian.cache.CacheFactory cacheFactory,
                               com.atlassian.event.api.EventPublisher eventPublisher)
Method Detail

directoryUpdated

@EventListener
public void directoryUpdated(com.atlassian.crowd.event.directory.DirectoryUpdatedEvent directoryUpdatedEvent)

getApplication

public com.atlassian.crowd.model.application.Application getApplication(String name)
Description copied from interface: ApplicationCache
Returns the cached application with the given name, or null if the application isn't cached.

Specified by:
getApplication in interface ApplicationCache

putApplication

public void putApplication(com.atlassian.crowd.model.application.Application application)
Description copied from interface: ApplicationCache
Caches the application against its name, as returned by Application.getName().

Specified by:
putApplication in interface ApplicationCache

removeApplication

public void removeApplication(String name)
Description copied from interface: ApplicationCache
Removes the application with the given name from the cache. Does nothing if the name is not in the cache.

Specified by:
removeApplication in interface ApplicationCache

removeAll

public void removeAll()
Description copied from interface: ApplicationCache
Removes all entries from the cache. Can be used when the cache is stale, but it's not possible to determine which applications should be removed.

Specified by:
removeAll in interface ApplicationCache


Copyright © 2003-2011 Atlassian. All Rights Reserved.