public class DefaultProjectComponentManager extends Object implements ProjectComponentManager
| Modifier and Type | Field and Description |
|---|---|
protected com.atlassian.event.api.EventPublisher |
eventPublisher |
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
|
NO_COMPONENTS| Constructor and Description |
|---|
DefaultProjectComponentManager(ProjectComponentStore store,
IssueManager issueManager,
com.atlassian.event.api.EventPublisher eventPublisher,
UserManager userManager,
NodeAssociationStore nodeAssociationStore,
DbConnectionManager dbConnectionManager)
Creates a new instance of this class and sets the store that will be used for persistence.
|
| Modifier and Type | Method and Description |
|---|---|
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.
|
void |
deleteAllComponents(Long projectId)
Deletes all components in given project.
|
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
|
Collection<String> |
findAllUniqueNamesForProjectObjects(Collection<Project> projects)
Returns all unique names of the components that belong to the passed projects.
|
Collection<String> |
findAllUniqueNamesForProjects(Collection<Long> projectIds)
Returns all unique names of components associated with all the projects with the ID-s 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.
|
Collection<Long> |
getIssueIdsWithComponent(ProjectComponent component)
Returns a list of all Issue IDs with the given component.
|
ProjectComponent |
getProjectComponent(Long projectComponentId)
Returns the component with the given ID or null if not found.
|
ProjectComponent |
update(MutableProjectComponent component)
Update the component specified with the values given.
|
List<ChangeItemBean> |
updateIssueProjectComponents(Issue issue,
Collection<ProjectComponent> newValue)
Updates the list of components in issue
|
protected static final String FIELD_PROJECT_ID
protected static final String FIELD_NAME
protected static final String FIELD_LEAD
protected final com.atlassian.event.api.EventPublisher eventPublisher
public DefaultProjectComponentManager(ProjectComponentStore store, IssueManager issueManager, com.atlassian.event.api.EventPublisher eventPublisher, UserManager userManager, NodeAssociationStore nodeAssociationStore, DbConnectionManager dbConnectionManager)
store - persistent storeissueManager - eventPublisher - dbConnectionManager - public ProjectComponent create(String name, String description, String lead, long assigneeType, Long projectId) throws IllegalArgumentException
create in interface ProjectComponentManagername - name of componentdescription - description of componentlead - user name associated with componentprojectId - ID of project that component is associated withassigneeType - assignee typeIllegalArgumentException - if one or more arguments have invalid valuespublic ProjectComponent find(Long id) throws EntityNotFoundException
find in interface ProjectComponentManagerid - component ID to search forEntityNotFoundException - if the component is not foundpublic ProjectComponent getProjectComponent(Long projectComponentId)
ProjectComponentManagergetProjectComponent in interface ProjectComponentManagerprojectComponentId - component IDpublic Collection<ProjectComponent> findAllForProject(Long projectId)
findAllForProject in interface ProjectComponentManagerprojectId - ID of project to search forpublic Collection<String> findAllUniqueNamesForProjects(Collection<Long> projectIds)
ProjectComponentManagerfindAllUniqueNamesForProjects in interface ProjectComponentManagerprojectIds - ID-s of project to search forpublic Collection<ProjectComponent> findAll()
ProjectComponentManagerfindAll in interface ProjectComponentManagerpublic Collection<String> findAllUniqueNamesForProjectObjects(Collection<Project> projects)
ProjectComponentManagerfindAllUniqueNamesForProjectObjects in interface ProjectComponentManagerprojects - projects to search inpublic List<ProjectComponent> getComponents(List<Long> ids) throws EntityNotFoundException
ProjectComponentManagergetComponents in interface ProjectComponentManagerids - 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 ProjectComponentManagercomponent - component to be updatedEntityNotFoundException - if component is not foundpublic List<ChangeItemBean> updateIssueProjectComponents(Issue issue, Collection<ProjectComponent> newValue)
ProjectComponentManagerupdateIssueProjectComponents in interface ProjectComponentManagerissue - updated issuenewValue - list of componentspublic void delete(Long componentId) throws EntityNotFoundException
delete in interface ProjectComponentManagercomponentId - component idEntityNotFoundException - if the component is not foundpublic void deleteAllComponents(@Nonnull Long projectId)
ProjectComponentManagerdeleteAllComponents in interface ProjectComponentManagerprojectId - id of the project in which components will be deleted.public boolean containsName(String name, Long projectId)
containsName in interface ProjectComponentManagername - component name, null will cause IllegalArgumentExceptionprojectId - project IDpublic Long findProjectIdForComponent(Long id) throws EntityNotFoundException
ProjectComponentManagerfindProjectIdForComponent in interface ProjectComponentManagerid - component IDEntityNotFoundException - 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)
ProjectComponentManagerconvertToGenericValue in interface ProjectComponentManagerprojectComponent - project componentpublic Collection<org.ofbiz.core.entity.GenericValue> convertToGenericValues(Collection<ProjectComponent> projectComponents)
convertToGenericValues in interface ProjectComponentManagerprojectComponents - a collection of project componentspublic ProjectComponent findByComponentName(Long projectId, String componentName)
ProjectComponentManagerfindByComponentName in interface ProjectComponentManagerprojectId - id of the project.componentName - name of the component.public Collection<ProjectComponent> findByComponentNameCaseInSensitive(String componentName)
ProjectComponentManagerfindByComponentNameCaseInSensitive in interface ProjectComponentManagercomponentName - name of the component.public Collection<ProjectComponent> findComponentsByLead(String userName)
findComponentsByLead in interface ProjectComponentManageruserName - the lead user namepublic Collection<ProjectComponent> findComponentsByIssue(Issue issue)
findComponentsByIssue in interface ProjectComponentManagerissue - find components on this issue@Nonnull public Collection<Long> getIssueIdsWithComponent(@Nonnull ProjectComponent component)
ProjectComponentManagergetIssueIdsWithComponent in interface ProjectComponentManagercomponent - the componentpublic Collection<org.ofbiz.core.entity.GenericValue> findComponentsByIssueGV(Issue issue)
ProjectComponentManagerfindComponentsByIssueGV in interface ProjectComponentManagerissue - find components for this issueprotected ComponentConverter getComponentConverter()
Copyright © 2002-2017 Atlassian. All Rights Reserved.