public class OfBizProjectComponentStore extends Object implements ProjectComponentStore
ProjectComponentStore
. CachingProjectComponentStore
Modifier and Type | Field and Description |
---|---|
static org.apache.log4j.Logger |
log |
Constructor and Description |
---|
OfBizProjectComponentStore(OfBizDelegator delegator,
DbConnectionManager dbConnectionManager) |
Modifier and Type | Method and Description |
---|---|
boolean |
containsName(String name,
Long projectId)
Check whether component with specified name is stored.
|
void |
delete(Long componentId)
Remove the given component from the persistent storage.
|
void |
deleteAllComponents(Long projectId)
Deletes all components in given project.
|
MutableProjectComponent |
find(Long id)
Retrieve the MutableProjectComponent with the specified ID.
|
Collection |
findAll()
Retrieve all ProjectComponent objects stored and sort by name.
|
Collection<MutableProjectComponent> |
findAllForProject(Long projectId)
Retrieve all components that are related to the project with given ID and sort by name.
|
MutableProjectComponent |
findByComponentName(Long projectId,
String componentName)
Finds the ProjectComponent with the given name (case sensitive) in the project with the
given Id.
|
Collection<MutableProjectComponent> |
findByComponentNameCaseInSensitive(String componentName)
Finds the ProjectComponents with the given name (case insensitive) in all projects.
|
Collection |
findComponentsBylead(String userKey)
Retrieve a collection of components - where the lead of each component is the specified user.
|
Long |
findProjectIdForComponent(Long componentId)
Retrieve the project ID for the given component ID.
|
protected ComponentConverter |
getComponentConverter() |
ProjectComponent |
getProjectComponent(Long projectComponentId)
Returns the ProjectComponent for the given ID, or null.
|
MutableProjectComponent |
store(MutableProjectComponent component)
Persists the component.
|
public OfBizProjectComponentStore(OfBizDelegator delegator, DbConnectionManager dbConnectionManager)
public MutableProjectComponent find(Long id) throws EntityNotFoundException
find
in interface ProjectComponentStore
id
- component ID to search forEntityNotFoundException
- if the component is not foundpublic ProjectComponent getProjectComponent(Long projectComponentId)
ProjectComponentStore
getProjectComponent
in interface ProjectComponentStore
projectComponentId
- the IDpublic Collection<MutableProjectComponent> findAllForProject(Long projectId)
findAllForProject
in interface ProjectComponentStore
projectId
- project IDprotected ComponentConverter getComponentConverter()
public MutableProjectComponent findByComponentName(Long projectId, String componentName) throws IllegalArgumentException
ProjectComponentStore
findByComponentName
in interface ProjectComponentStore
projectId
- the id of the component's project.componentName
- the name of the component to find.IllegalArgumentException
public Collection<MutableProjectComponent> findByComponentNameCaseInSensitive(String componentName)
ProjectComponentStore
findByComponentNameCaseInSensitive
in interface ProjectComponentStore
componentName
- the name of the component to find.public Long findProjectIdForComponent(Long componentId) throws EntityNotFoundException
findProjectIdForComponent
in interface ProjectComponentStore
componentId
- component IDEntityNotFoundException
- if component not found for the given component IDpublic MutableProjectComponent store(MutableProjectComponent component) throws EntityNotFoundException, DataAccessException
store
in interface ProjectComponentStore
component
- component to persistEntityNotFoundException
- 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
ProjectComponentStore
delete
in interface ProjectComponentStore
componentId
- ID of the component.EntityNotFoundException
- if component does not exist (maybe was removed previously).public void deleteAllComponents(@Nonnull Long projectId)
ProjectComponentStore
deleteAllComponents
in interface ProjectComponentStore
projectId
- id of the project in which components will be deleted.public boolean containsName(String name, Long projectId)
containsName
in interface ProjectComponentStore
name
- component name, null will cause IllegalArgumentExceptionprojectId
- project IDIllegalArgumentException
- if name or projectId is nullpublic Collection findComponentsBylead(String userKey)
findComponentsBylead
in interface ProjectComponentStore
userKey
- the lead user's keypublic Collection findAll()
findAll
in interface ProjectComponentStore
Copyright © 2002-2021 Atlassian. All Rights Reserved.