public class

OfBizProjectComponentStore

extends Object
implements ProjectComponentStore
java.lang.Object
   ↳ com.atlassian.jira.bc.project.component.OfBizProjectComponentStore

Class Overview

Ofbiz non-caching implementation of ProjectComponentStore.

Summary

Fields
public static final Logger log
Public Constructors
OfBizProjectComponentStore(OfBizDelegator delegator, DbConnectionManager dbConnectionManager)
Public Methods
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.
ProjectComponent getProjectComponent(Long projectComponentId)
Returns the ProjectComponent for the given ID, or null.
MutableProjectComponent store(MutableProjectComponent component)
Persists the component.
Protected Methods
ComponentConverter getComponentConverter()
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.atlassian.jira.bc.project.component.ProjectComponentStore

Fields

public static final Logger log

Public Constructors

public OfBizProjectComponentStore (OfBizDelegator delegator, DbConnectionManager dbConnectionManager)

Public Methods

public boolean containsName (String name, Long projectId)

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
Throws
IllegalArgumentException if name or projectId is null

public void delete (Long componentId)

Remove the given component from the persistent storage.

Parameters
componentId ID of the component.

public void deleteAllComponents (Long projectId)

Deletes all components in given project.

Parameters
projectId id of the project in which components will be deleted.

public MutableProjectComponent find (Long id)

Retrieve the MutableProjectComponent with the specified ID. An EntityNotFoundException is thrown if the component is not found.

Parameters
id component ID to search for
Returns
  • MutableProjectComponent component with the specified ID
Throws
EntityNotFoundException if the component is not found

public Collection findAll ()

Retrieve all ProjectComponent objects stored and sort by name.

Returns
  • all ProjectComponent objects stored

public Collection<MutableProjectComponent> findAllForProject (Long projectId)

Retrieve all components that are related to the project with given ID and sort by name.

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

public MutableProjectComponent findByComponentName (Long projectId, String componentName)

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.

public 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.

public Collection findComponentsBylead (String userKey)

Retrieve a collection of components - where the lead of each component is the specified user.

Parameters
userKey the lead user's key
Returns
  • collection of components - where the lead of each component is the specified user

public Long findProjectIdForComponent (Long componentId)

Retrieve the project ID for the given component ID. If project is not found, a EntityNotFoundException is thrown.

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

public ProjectComponent getProjectComponent (Long projectComponentId)

Returns the ProjectComponent for the given ID, or null.

Parameters
projectComponentId the ID
Returns
  • the ProjectComponent for the given ID, or null.

public MutableProjectComponent store (MutableProjectComponent component)

Persists the component. If component has no ID (null), it is inserted in the store, otherwise an update operation is performed on the store.

Parameters
component component to persist
Returns
  • persisted project component
Throws
EntityNotFoundException in case of update if the component does not exist (maybe was deleted :-)
DataAccessException if cannot persist the component

Protected Methods

protected ComponentConverter getComponentConverter ()