|
||||||||||
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 implmentation is delegated so this class is a Composite and also a Decorator.
Constructor Summary | |
---|---|
CachingProjectComponentStore(ProjectComponentStore delegateStore)
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 |
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 |
findComponentsBylead(String userName)
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. |
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)
delegateStore
- underlying persistence storeMethod Detail |
---|
public MutableProjectComponent find(Long id) throws EntityNotFoundException
find
in interface ProjectComponentStore
id
- project component ID
EntityNotFoundException
- if the component not foundpublic Collection findAllForProject(Long projectId)
findAllForProject
in interface ProjectComponentStore
projectId
- project ID
public MutableProjectComponent findByComponentName(Long projectId, 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 Long findProjectIdForComponent(Long componentId) throws EntityNotFoundException
findProjectIdForComponent
in interface ProjectComponentStore
componentId
- component ID
EntityNotFoundException
- if project not found for the given component IDpublic boolean containsName(String name, Long projectId)
containsName
in interface ProjectComponentStore
name
- component name, null will cause IllegalArgumentException
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(Long componentId) throws EntityNotFoundException
delete
in interface ProjectComponentStore
componentId
-
EntityNotFoundException
- if component does not exist (maybe was removed previously :-)public Collection findComponentsBylead(String userName)
findComponentsBylead
in interface ProjectComponentStore
userName
-
public Collection findAll()
findAll
in interface ProjectComponentStore
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |