|
||||||||||
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.DefaultProjectComponentManager
public class DefaultProjectComponentManager
Validates project component values and provides methods for accessing and persisting project components.
Field Summary | |
---|---|
protected static String |
FIELD_LEAD
lead field name |
protected static String |
FIELD_NAME
name field name |
protected static String |
FIELD_PROJECT_ID
project ID field name |
Constructor Summary | |
---|---|
DefaultProjectComponentManager(ProjectComponentStore store,
IssueManager issueManager)
Creates a new instance of this class and sets the store that will be used for persistence. |
Method Summary | |
---|---|
boolean |
containsName(String name,
Long projectId)
Check whether component with specified name is stored. |
org.ofbiz.core.entity.GenericValue |
convertToGenericValue(ProjectComponent projectComponent)
Converts the ProjectComponent to GenericValue form, provided as a transitional measure until GenericValue is eradicated from the front end. |
Collection<org.ofbiz.core.entity.GenericValue> |
convertToGenericValues(Collection<ProjectComponent> projectComponents)
Temporary method to allow conversion of a collection of ProjectComponent objects to a collection of GenericValues representing a project component. |
protected MutableProjectComponent |
convertToMutableProjectComponent(ProjectComponent value)
Convert the specified ProjectComponent to a MutableProjectComponent object and sets its project ID with the given value. |
protected ProjectComponent |
convertToProjectComponent(MutableProjectComponent value)
Convert the specified MutableProjectComponent to a ProjectComponent object. |
ProjectComponent |
create(String name,
String description,
String lead,
long assigneeType,
Long projectId)
Create a new ProjectComponent object associated with the project with the ID specified and with the values given. |
void |
delete(Long componentId)
Delete the component. |
ProjectComponent |
find(Long id)
Find the component with the specified ID |
Collection<ProjectComponent> |
findAll()
Implement this method to find all components. |
Collection<ProjectComponent> |
findAllForProject(Long projectId)
Find all components associated with the project with the ID specified |
ProjectComponent |
findByComponentName(Long projectId,
String componentName)
Finds the ProjectComponent with the given name in the project with the given id. |
Collection<ProjectComponent> |
findByComponentNameCaseInSensitive(String componentName)
Finds all ProjectComponents with the given name with comparisons case insenstive. |
Collection<ProjectComponent> |
findComponentsByIssue(Issue issue)
|
Collection<org.ofbiz.core.entity.GenericValue> |
findComponentsByIssueGV(Issue issue)
This code used to live directly in the IssueImpl but it has been refactored into the ProjectComponentManager to make things a little cleaner. |
Collection<ProjectComponent> |
findComponentsByLead(String userName)
Retrieve a collection of components - where the lead of each component is the specified user. |
Long |
findProjectIdForComponent(Long id)
Implement this method to look up the project ID for the given component ID. |
protected ComponentConverter |
getComponentConverter()
|
List<ProjectComponent> |
getComponents(List<Long> ids)
Creates a list of ProjectComponent objects from the given list of IDs. |
ProjectComponent |
update(MutableProjectComponent component)
Update the component specified with the values given. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final String FIELD_PROJECT_ID
protected static final String FIELD_NAME
protected static final String FIELD_LEAD
Constructor Detail |
---|
public DefaultProjectComponentManager(ProjectComponentStore store, IssueManager issueManager)
store
- persistent storeissueManager
- Method Detail |
---|
public ProjectComponent create(String name, String description, String lead, long assigneeType, Long projectId) throws IllegalArgumentException
create
in interface ProjectComponentManager
name
- name of componentdescription
- description of componentlead
- user name associated with componentprojectId
- ID of project that component is associated withassigneeType
- assignee type
IllegalArgumentException
- if one or more arguments have invalid valuespublic ProjectComponent find(Long id) throws EntityNotFoundException
find
in interface ProjectComponentManager
id
- component ID to search for
EntityNotFoundException
- if the component is not foundpublic Collection<ProjectComponent> findAllForProject(Long projectId)
findAllForProject
in interface ProjectComponentManager
projectId
- ID of project to search for
public Collection<ProjectComponent> findAll()
ProjectComponentManager
findAll
in interface ProjectComponentManager
public List<ProjectComponent> getComponents(List<Long> ids) throws EntityNotFoundException
ProjectComponentManager
getComponents
in interface ProjectComponentManager
ids
- The List of ProjectComponent IDs.
EntityNotFoundException
- if no ProjectComponent exists for any of the given IDs.public ProjectComponent update(MutableProjectComponent component) throws EntityNotFoundException
update
in interface ProjectComponentManager
component
- component to be updated
EntityNotFoundException
- if component is not foundpublic void delete(Long componentId) throws EntityNotFoundException
delete
in interface ProjectComponentManager
componentId
- component id
EntityNotFoundException
- if the component is not foundpublic boolean containsName(String name, Long projectId)
containsName
in interface ProjectComponentManager
name
- component name, null will cause IllegalArgumentExceptionprojectId
- project ID
public Long findProjectIdForComponent(Long id) throws EntityNotFoundException
ProjectComponentManager
findProjectIdForComponent
in interface ProjectComponentManager
id
- component ID
EntityNotFoundException
- if component with the specified id cannot be foundprotected ProjectComponent convertToProjectComponent(MutableProjectComponent value)
value
- MutableProjectComponent to be converted into a ProjectComponent.
protected MutableProjectComponent convertToMutableProjectComponent(ProjectComponent value)
value
- ProjectComponent to be converted into a MutableProjectComponent.
public org.ofbiz.core.entity.GenericValue convertToGenericValue(ProjectComponent projectComponent)
ProjectComponentManager
convertToGenericValue
in interface ProjectComponentManager
projectComponent
- project component
public Collection<org.ofbiz.core.entity.GenericValue> convertToGenericValues(Collection<ProjectComponent> projectComponents)
convertToGenericValues
in interface ProjectComponentManager
projectComponents
- a collection of project components
public ProjectComponent findByComponentName(Long projectId, String componentName)
ProjectComponentManager
findByComponentName
in interface ProjectComponentManager
projectId
- id of the project.componentName
- name of the component.
public Collection<ProjectComponent> findByComponentNameCaseInSensitive(String componentName)
ProjectComponentManager
findByComponentNameCaseInSensitive
in interface ProjectComponentManager
componentName
- name of the component.
public Collection<ProjectComponent> findComponentsByLead(String userName)
findComponentsByLead
in interface ProjectComponentManager
userName
- the lead user name
public Collection<ProjectComponent> findComponentsByIssue(Issue issue)
findComponentsByIssue
in interface ProjectComponentManager
issue
- find components on this issue
public Collection<org.ofbiz.core.entity.GenericValue> findComponentsByIssueGV(Issue issue)
ProjectComponentManager
findComponentsByIssueGV
in interface ProjectComponentManager
issue
- find components for this issue
protected ComponentConverter getComponentConverter()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |