|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.atlassian.jira.bc.project.component.CachingProjectComponentStore
public class CachingProjectComponentStore
Decorates an implementation of the project component delegateStore with caching. The actual delegateStore implementation is delegated so this class is a Composite and also a Decorator.
| Constructor Summary | |
|---|---|
CachingProjectComponentStore(ProjectComponentStore delegateStore,
com.atlassian.cache.CacheManager cacheManager,
com.atlassian.beehive.ClusterLockService clusterLockService)
Creates a new instance of this class backed by given delegateStore. |
|
| Method Summary | |
|---|---|
boolean |
containsName(String name,
Long projectId)
Checks whether component with specified name is stored. |
void |
delete(Long componentId)
Removes the component from the persistent storage and a cache. |
MutableProjectComponent |
find(Long id)
Looks up the project component by the given ID and returns it. |
Collection |
findAll()
Retrieve all ProjectComponent objects stored. |
Collection<MutableProjectComponent> |
findAllForProject(Long projectId)
Looks up all components that are related to the project with given ID. |
MutableProjectComponent |
findByComponentName(Long projectId,
String componentName)
Looks up the component with the given name in the project with the given id. |
Collection<MutableProjectComponent> |
findByComponentNameCaseInSensitive(String componentName)
Finds one or more ProjectComponent with a given name. |
Collection |
findComponentsBylead(String userKey)
Retrieves all ProjectComponents that have the given user as their lead. |
Long |
findProjectIdForComponent(Long componentId)
Looks up the project ID for the given component ID. |
void |
onClearCache(ClearCacheEvent event)
|
void |
start()
This method wil be called after the plugin system is fully initialised and all components added to the dependency injection framework. |
MutableProjectComponent |
store(MutableProjectComponent component)
Persist the component. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public CachingProjectComponentStore(ProjectComponentStore delegateStore,
com.atlassian.cache.CacheManager cacheManager,
com.atlassian.beehive.ClusterLockService clusterLockService)
delegateStore - underlying persistence storeclusterLockService - | Method Detail |
|---|
@EventListener public void onClearCache(ClearCacheEvent event)
public void start()
Startable
start in interface Startable
public MutableProjectComponent find(Long id)
throws EntityNotFoundException
find in interface ProjectComponentStoreid - project component ID
EntityNotFoundException - if the component not foundpublic Collection<MutableProjectComponent> findAllForProject(Long projectId)
findAllForProject in interface ProjectComponentStoreprojectId - project ID
public MutableProjectComponent findByComponentName(Long projectId,
String componentName)
throws EntityNotFoundException
findByComponentName in interface ProjectComponentStoreprojectId - id of the project.componentName - name of the component.
EntityNotFoundException - if no such component can be found.public Collection<MutableProjectComponent> findByComponentNameCaseInSensitive(String componentName)
findByComponentNameCaseInSensitive in interface ProjectComponentStorecomponentName - the name of the component to find.
EntityNotFoundException
public Long findProjectIdForComponent(Long componentId)
throws EntityNotFoundException
findProjectIdForComponent in interface ProjectComponentStorecomponentId - component ID
EntityNotFoundException - if project not found for the given component ID
public boolean containsName(String name,
Long projectId)
containsName in interface ProjectComponentStorename - component name, null will cause IllegalArgumentException
IllegalArgumentException - if name or projectId is null
public MutableProjectComponent store(MutableProjectComponent component)
throws EntityNotFoundException,
DataAccessException
store in interface ProjectComponentStorecomponent - component to persist
EntityNotFoundException - in case of update if the component does not exist (maybe was deleted :-)
DataAccessException - if cannot persist the component
public void delete(Long componentId)
throws EntityNotFoundException
delete in interface ProjectComponentStorecomponentId - the id of the component to delete
EntityNotFoundException - if component does not exist (maybe was removed previously :-)public Collection findComponentsBylead(String userKey)
findComponentsBylead in interface ProjectComponentStoreuserKey - key of the lead user
public Collection findAll()
findAll in interface ProjectComponentStore
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||