public final class DefaultApplicationCache extends Object implements ApplicationCache
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
.ApplicationCache.Loader
Constructor and Description |
---|
DefaultApplicationCache(com.atlassian.cache.CacheFactory cacheFactory,
com.atlassian.event.api.EventPublisher eventPublisher)
Deprecated.
|
DefaultApplicationCache(TransactionAwareCacheFactory cacheFactory,
com.atlassian.event.api.EventPublisher eventPublisher) |
Modifier and Type | Method and Description |
---|---|
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.
|
com.atlassian.crowd.model.application.Application |
getApplication(String name,
ApplicationCache.Loader loader)
Returns the cached application with the given name, or null if the application isn't cached.
|
void |
init() |
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.
|
static <T extends Exception> |
unwrapOrRethrow(RuntimeException ex,
Class<T> expectedType)
Look throw the causal chain until we find an exception that is of the expected type, or just rethrow the full chain if not.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
removeApplication
public DefaultApplicationCache(TransactionAwareCacheFactory cacheFactory, com.atlassian.event.api.EventPublisher eventPublisher)
@Deprecated public DefaultApplicationCache(com.atlassian.cache.CacheFactory cacheFactory, com.atlassian.event.api.EventPublisher eventPublisher)
DefaultApplicationCache(TransactionAwareCacheFactory, EventPublisher)
@PostConstruct public void init()
@EventListener public void directoryUpdated(com.atlassian.crowd.event.directory.DirectoryUpdatedEvent directoryUpdatedEvent)
public com.atlassian.crowd.model.application.Application getApplication(String name)
ApplicationCache
getApplication
in interface ApplicationCache
public com.atlassian.crowd.model.application.Application getApplication(String name, ApplicationCache.Loader loader) throws com.atlassian.crowd.exception.ApplicationNotFoundException
ApplicationCache
getApplication
in interface ApplicationCache
com.atlassian.crowd.exception.ApplicationNotFoundException
public static <T extends Exception> T unwrapOrRethrow(RuntimeException ex, Class<T> expectedType)
public void putApplication(com.atlassian.crowd.model.application.Application application)
ApplicationCache
Application.getName()
.putApplication
in interface ApplicationCache
public void removeApplication(String name)
ApplicationCache
removeApplication
in interface ApplicationCache
public void removeAll()
ApplicationCache
removeAll
in interface ApplicationCache
Copyright © 2003–2023 Atlassian. All rights reserved.
View cookie preferences