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

All Known Implementing Classes:
CachingProjectComponentStore, OfBizProjectComponentStore

public interface ProjectComponentStore


Method Summary
 boolean containsName(String name, Long projectId)
          Implement this method to check whether component with specified name is stored.
 void delete(Long componentId)
          Remove the given component from the persistent storage.
 MutableProjectComponent find(Long id)
          Implement this method to look up the project component by the given ID and return it.
 Collection findAll()
          Retrieve all ProjectComponent objects stored.
 Collection findAllForProject(Long projectId)
          Implement this method to look up all components that are related to the project with given ID.
 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 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.
 MutableProjectComponent store(MutableProjectComponent component)
          Implement this method to persist the component.
 

Method Detail

find

MutableProjectComponent find(Long id)
                             throws EntityNotFoundException
Implement this method to look up the project component by the given ID and return it. If not found, throw the EntityNotFoundException. Do not return null!

Parameters:
id - project component ID
Returns:
project component found by a given ID
Throws:
EntityNotFoundException - if the component not found

findAllForProject

Collection findAllForProject(Long projectId)
Implement this method to look up all components that are related to the project with given ID.

Parameters:
projectId - project ID
Returns:
a collection of ProjectComponent objects that are related to the project with given ID

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 throw EntityNotFoundException, never return null!

Parameters:
componentId - component ID
Returns:
project ID
Throws:
EntityNotFoundException - if component not found for the given component ID

store

MutableProjectComponent store(MutableProjectComponent component)
                              throws EntityNotFoundException
Implement this method to persist the component. If component has no ID (null), insert it to the store, otherwise perform an update operation on the store.

Parameters:
component - component to persist
Throws:
EntityNotFoundException - in case of update if the component does not exist (maybe was deleted :-)

delete

void delete(Long componentId)
            throws EntityNotFoundException
Remove the given component from the persistent storage.

Parameters:
componentId - ID of the component.
Throws:
EntityNotFoundException - if component does not exist (maybe was removed previously).

containsName

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

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

findByComponentName

MutableProjectComponent findByComponentName(Long projectId,
                                            String componentName)
                                            throws EntityNotFoundException
Finds the ProjectComponent with the given name (case sensitive) in the project with the given Id.

Parameters:
projectId - the id of the component's project.
componentName - the name of the component to find.
Returns:
a MutableProjectComponent or null if none found.
Throws:
EntityNotFoundException

findByComponentNameCaseInSensitive

Collection<MutableProjectComponent> findByComponentNameCaseInSensitive(String componentName)
Finds the ProjectComponents with the given name (case insensitive) in all projects.

Parameters:
componentName - the name of the component to find.
Returns:
All MutableProjectComponents with the given name or an empty list if none found.

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

findAll

Collection findAll()
Retrieve all ProjectComponent objects stored.

Returns:
all ProjectComponent objects stored


Copyright © 2002-2012 Atlassian. All Rights Reserved.