|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.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.event.api.EventPublisher eventPublisher)
Creates a new instance of this class backed by given delegateStore. |
Method Summary | |
---|---|
boolean |
containsName(java.lang.String name,
java.lang.Long projectId)
Checks whether component with specified name is stored. |
void |
delete(java.lang.Long componentId)
Removes the component from the persistent storage and a cache. |
MutableProjectComponent |
find(java.lang.Long id)
Looks up the project component by the given ID and returns it. |
java.util.Collection |
findAll()
Retrieve all ProjectComponent objects stored. |
java.util.Collection |
findAllForProject(java.lang.Long projectId)
Looks up all components that are related to the project with given ID. |
MutableProjectComponent |
findByComponentName(java.lang.Long projectId,
java.lang.String componentName)
Looks up the component with the given name in the project with the given id. |
java.util.Collection<MutableProjectComponent> |
findByComponentNameCaseInSensitive(java.lang.String componentName)
Finds one or more ProjectComponent with a given name. |
java.util.Collection |
findComponentsBylead(java.lang.String userName)
Retrieves all ProjectComponents that have the given user as their lead. |
java.lang.Long |
findProjectIdForComponent(java.lang.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.event.api.EventPublisher eventPublisher)
delegateStore
- underlying persistence storeeventPublisher
- used to register ourselves for a clear cache event.Method Detail |
---|
public void start() throws java.lang.Exception
Startable
start
in interface Startable
java.lang.Exception
- Allows implementations to throw an Exception.@EventListener public void onClearCache(ClearCacheEvent event)
public MutableProjectComponent find(java.lang.Long id) throws EntityNotFoundException
find
in interface ProjectComponentStore
id
- project component ID
EntityNotFoundException
- if the component not foundpublic java.util.Collection findAllForProject(java.lang.Long projectId)
findAllForProject
in interface ProjectComponentStore
projectId
- project ID
public MutableProjectComponent findByComponentName(java.lang.Long projectId, java.lang.String componentName) throws EntityNotFoundException
findByComponentName
in interface ProjectComponentStore
projectId
- id of the project.componentName
- name of the component.
EntityNotFoundException
- if no such component can be found.public java.util.Collection<MutableProjectComponent> findByComponentNameCaseInSensitive(java.lang.String componentName)
findByComponentNameCaseInSensitive
in interface ProjectComponentStore
componentName
- the name of the component to find.
EntityNotFoundException
public java.lang.Long findProjectIdForComponent(java.lang.Long componentId) throws EntityNotFoundException
findProjectIdForComponent
in interface ProjectComponentStore
componentId
- component ID
EntityNotFoundException
- if project not found for the given component IDpublic boolean containsName(java.lang.String name, java.lang.Long projectId)
containsName
in interface ProjectComponentStore
name
- component name, null will cause IllegalArgumentException
java.lang.IllegalArgumentException
- if name or projectId is nullpublic MutableProjectComponent store(MutableProjectComponent component) throws EntityNotFoundException, DataAccessException
store
in interface ProjectComponentStore
component
- component to persist
EntityNotFoundException
- in case of update if the component does not exist (maybe was deleted :-)
DataAccessException
- if cannot persist the componentpublic void delete(java.lang.Long componentId) throws EntityNotFoundException
delete
in interface ProjectComponentStore
componentId
- the id of the component to delete
EntityNotFoundException
- if component does not exist (maybe was removed previously :-)public java.util.Collection findComponentsBylead(java.lang.String userName)
findComponentsBylead
in interface ProjectComponentStore
userName
- user name
public java.util.Collection findAll()
findAll
in interface ProjectComponentStore
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |