com.atlassian.jira.bc.project.component
Interface ProjectComponentManager

All Known Implementing Classes:
DefaultProjectComponentManager

public interface ProjectComponentManager

Implement this interface to validate project component values and to provide methods for accessing and persisting project components.


Method Summary
 boolean containsName(String name, Long projectId)
          Implement this method in order to check whether component with specified name is stored.
 org.ofbiz.core.entity.GenericValue convertToGenericValue(ProjectComponent projectComponent)
          Deprecated. don't use GenericValue use the ProjectComponent instead.
 Collection convertToGenericValues(Collection projectComponents)
          Deprecated. don't use GenericValue use the ProjectComponent instead.
 ProjectComponent create(String name, String description, String lead, long assigneeType, Long projectId)
          Implement this method to create a new ProjectComponent object associated with the project with the ID specified and with the values given.
 void delete(Long componentId)
          Implement this method to delete the component.
 ProjectComponent find(Long id)
          Implement this method to find the component with the specified ID.
 Collection findAllForProject(Long projectId)
          Implement this method to 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 findComponentsByLead(String userName)
          Retrieve a collection of ProjectComponents - where the lead of each component is the specified user.
 Long findProjectIdForComponent(Long componentId)
          Implement this method to look up the project ID for the given component ID.
 ProjectComponent update(MutableProjectComponent component)
          Implement this method to update the component specified with the values given.
 

Method Detail

create

ProjectComponent create(String name,
                        String description,
                        String lead,
                        long assigneeType,
                        Long projectId)
                        throws IllegalArgumentException
Implement this method to create a new ProjectComponent object associated with the project with the ID specified and with the values given. It should also validate the values - store and return the ProjectComponent if validation succeeds. Otherwise, throw ValidationErrorsException.

Parameters:
name - name of component
description - description of component
lead - user name associated with component
projectId - ID of project that component is associated with
Returns:
new instance of ProjectComponent with the values specified
Throws:
IllegalArgumentException - if one or more arguments have invalid values

find

ProjectComponent find(Long id)
                      throws EntityNotFoundException
Implement this method to find the component with the specified ID.

Parameters:
id - component ID to search for
Returns:
ProjectComponent with the specified ID
Throws:
EntityNotFoundException - if the component is not found

findAllForProject

Collection findAllForProject(Long projectId)
Implement this method to find all components associated with the project with the ID specified.

Parameters:
projectId - ID of project to search for
Returns:
collection of ProjectComponent objects associated with the project with the ID specified

update

ProjectComponent update(MutableProjectComponent component)
                        throws EntityNotFoundException
Implement this method to update the component specified with the values given.

Parameters:
component - component to be updated
Returns:
ProjectComponent with updated values as specified
Throws:
EntityNotFoundException - if component is not found

delete

void delete(Long componentId)
            throws EntityNotFoundException
Implement this method to delete the component.

Parameters:
componentId -
Throws:
EntityNotFoundException - if the component is not found

containsName

boolean containsName(String name,
                     Long projectId)
Implement this method in order to check whether component with specified name is stored.

Parameters:
name - component name, null will cause IllegalArgumentException
projectId - project ID
Returns:
true if new name is stored

findProjectIdForComponent

Long findProjectIdForComponent(Long componentId)
                               throws EntityNotFoundException
Implement this method to look up the project ID for the given component ID. If project is not found, throws EntityNotFoundException.

Parameters:
componentId - component ID
Returns:
project ID
Throws:
EntityNotFoundException - if component with the specified id cannot be found

convertToGenericValue

org.ofbiz.core.entity.GenericValue convertToGenericValue(ProjectComponent projectComponent)
Deprecated. don't use GenericValue use the ProjectComponent instead.

Converts the ProjectComponent to GenericValue form, provided as a transitional measure until GenericValue is eradicated from the front end.

Parameters:
projectComponent -
Returns:
the ProjectComponent as a GenericValue.

convertToGenericValues

Collection convertToGenericValues(Collection projectComponents)
Deprecated. don't use GenericValue use the ProjectComponent instead.

Temporary method to allow conversion of a collection of ProjectComponent objects to a collection of GenericValues representing a project component.

Parameters:
projectComponents -
Returns:
Collection of GenericValues representing the collection of ProjectComponent objects passed in

findByComponentName

ProjectComponent findByComponentName(Long projectId,
                                     String componentName)
Finds the ProjectComponent with the given name in the project with the given id.

Parameters:
projectId - id of the project.
componentName - name of the component.
Returns:
the ProjectComponent or null if there is no such ProjectComponent.

findComponentsByLead

Collection findComponentsByLead(String userName)
Retrieve a collection of ProjectComponents - where the lead of each component is the specified user.

Parameters:
userName - the lead user name
Returns:
collection of components - where the lead of each component is the specified user


Copyright © 2002-2009 Atlassian. All Rights Reserved.