com.atlassian.jira.project
Class DefaultProjectManager

java.lang.Object
  extended bycom.atlassian.jira.project.AbstractProjectManager
      extended bycom.atlassian.jira.project.DefaultProjectManager
All Implemented Interfaces:
ProjectManager

public class DefaultProjectManager
extends AbstractProjectManager

A class to manage interactions with projects


Constructor Summary
DefaultProjectManager()
          Don't use this constructor.
 
Method Summary
 void decreaseVersionSequence(GenericValue pVersion)
          .
 GenericValue getComponent(GenericValue project, java.lang.String name)
           
 GenericValue getComponent(java.lang.Long id)
           
 java.util.Collection getComponents(GenericValue project)
           
protected  GenericDelegator getDelegator()
           
 long getNextId(GenericValue project)
          Get the next ID from this project (transactional)
 GenericValue getProject(java.lang.Long id)
           
 GenericValue getProjectByKey(java.lang.String key)
           
 GenericValue getProjectByName(java.lang.String name)
           
 java.util.Collection getProjectCategories()
          Get all ProjectCategories.
 GenericValue getProjectCategory(java.lang.Long id)
           
 GenericValue getProjectCategoryFromProject(GenericValue project)
          Get the Project Category given a Project.
 java.util.Collection getProjects()
          Return all projects
 java.util.Collection getProjectsFromProjectCategory(GenericValue projectCategory)
          Gather a list of projects that are in a project category.
 GenericValue getVersion(GenericValue project, java.lang.String name)
           
 GenericValue getVersion(java.lang.Long id)
           
 java.util.Collection getVersions(GenericValue project)
           
 java.util.Collection getVersionsArchived(GenericValue project)
           
 java.util.Collection getVersionsReleased(GenericValue project)
           
 java.util.Collection getVersionsReleased(GenericValue project, boolean includeArchived)
           
 java.util.Collection getVersionsReleasedDesc(GenericValue project)
           
 java.util.Collection getVersionsUnarchived(GenericValue project)
           
 java.util.Collection getVersionsUnreleased(GenericValue project)
           
 java.util.Collection getVersionsUnreleased(GenericValue project, boolean includeArchived)
           
 void increaseVersionSequence(GenericValue pVersion)
          Move a pVersion to have a lower sequence number - ie make it earlier
 void moveToEndVersionSequence(GenericValue version)
          .
 void moveToStartVersionSequence(GenericValue version)
          Move a version to the start of the version list
 void refresh()
           
 void refresh(GenericValue project)
           
 void releaseVersions(java.util.Collection versions, boolean release)
          Release / unrelease a collection of versions and update the appropriate issue caches.
 void setProjectCategory(GenericValue project, GenericValue category)
          If category is non-null, set project's Project Category to category.
 void updateProject(GenericValue updatedProject)
           
 void updateProjectCategory(GenericValue projectCat)
           
 
Methods inherited from class com.atlassian.jira.project.AbstractProjectManager
getProject, getVersionsReleasedDesc
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultProjectManager

public DefaultProjectManager()
Don't use this constructor. Use ManagerFactory.getProjectManager() instead.

Method Detail

getNextId

public long getNextId(GenericValue project)
               throws GenericEntityException
Description copied from interface: ProjectManager
Get the next ID from this project (transactional)

Throws:
GenericEntityException

updateProject

public void updateProject(GenericValue updatedProject)
                   throws GenericEntityException
Specified by:
updateProject in interface ProjectManager
Specified by:
updateProject in class AbstractProjectManager
Throws:
GenericEntityException

getProject

public GenericValue getProject(java.lang.Long id)
                        throws GenericEntityException
Overrides:
getProject in class AbstractProjectManager
Throws:
GenericEntityException

getProjectByName

public GenericValue getProjectByName(java.lang.String name)
                              throws GenericEntityException
Specified by:
getProjectByName in interface ProjectManager
Specified by:
getProjectByName in class AbstractProjectManager
Throws:
GenericEntityException

getProjectByKey

public GenericValue getProjectByKey(java.lang.String key)
                             throws GenericEntityException
Specified by:
getProjectByKey in interface ProjectManager
Specified by:
getProjectByKey in class AbstractProjectManager
Throws:
GenericEntityException

getComponent

public GenericValue getComponent(java.lang.Long id)
                          throws GenericEntityException
Specified by:
getComponent in interface ProjectManager
Specified by:
getComponent in class AbstractProjectManager
Throws:
GenericEntityException

getComponent

public GenericValue getComponent(GenericValue project,
                                 java.lang.String name)
                          throws GenericEntityException
Specified by:
getComponent in interface ProjectManager
Specified by:
getComponent in class AbstractProjectManager
Throws:
GenericEntityException

getComponents

public java.util.Collection getComponents(GenericValue project)
                                   throws GenericEntityException
Specified by:
getComponents in interface ProjectManager
Specified by:
getComponents in class AbstractProjectManager
Throws:
GenericEntityException

getVersion

public GenericValue getVersion(java.lang.Long id)
                        throws GenericEntityException
Specified by:
getVersion in interface ProjectManager
Specified by:
getVersion in class AbstractProjectManager
Throws:
GenericEntityException

getVersion

public GenericValue getVersion(GenericValue project,
                               java.lang.String name)
                        throws GenericEntityException
Specified by:
getVersion in interface ProjectManager
Specified by:
getVersion in class AbstractProjectManager
Throws:
GenericEntityException

getVersions

public java.util.Collection getVersions(GenericValue project)
                                 throws GenericEntityException
Specified by:
getVersions in interface ProjectManager
Specified by:
getVersions in class AbstractProjectManager
Throws:
GenericEntityException

getVersionsReleased

public java.util.Collection getVersionsReleased(GenericValue project,
                                                boolean includeArchived)
                                         throws GenericEntityException
Specified by:
getVersionsReleased in interface ProjectManager
Specified by:
getVersionsReleased in class AbstractProjectManager
Throws:
GenericEntityException

getVersionsReleased

public java.util.Collection getVersionsReleased(GenericValue project)
                                         throws GenericEntityException
Throws:
GenericEntityException

getVersionsReleasedDesc

public java.util.Collection getVersionsReleasedDesc(GenericValue project)
                                             throws GenericEntityException
Throws:
GenericEntityException

getVersionsUnreleased

public java.util.Collection getVersionsUnreleased(GenericValue project,
                                                  boolean includeArchived)
                                           throws GenericEntityException
Specified by:
getVersionsUnreleased in interface ProjectManager
Specified by:
getVersionsUnreleased in class AbstractProjectManager
Throws:
GenericEntityException

getVersionsUnreleased

public java.util.Collection getVersionsUnreleased(GenericValue project)
                                           throws GenericEntityException
Throws:
GenericEntityException

getVersionsArchived

public java.util.Collection getVersionsArchived(GenericValue project)
                                         throws GenericEntityException
Throws:
GenericEntityException

getVersionsUnarchived

public java.util.Collection getVersionsUnarchived(GenericValue project)
                                           throws GenericEntityException
Throws:
GenericEntityException

getProjects

public java.util.Collection getProjects()
                                 throws GenericEntityException
Return all projects

Specified by:
getProjects in interface ProjectManager
Specified by:
getProjects in class AbstractProjectManager
Throws:
GenericEntityException

moveToStartVersionSequence

public void moveToStartVersionSequence(GenericValue version)
                                throws GenericEntityException
Description copied from interface: ProjectManager
Move a version to the start of the version list

Specified by:
moveToStartVersionSequence in interface ProjectManager
Specified by:
moveToStartVersionSequence in class AbstractProjectManager
Throws:
GenericEntityException

releaseVersions

public void releaseVersions(java.util.Collection versions,
                            boolean release)
                     throws GenericEntityException
Release / unrelease a collection of versions and update the appropriate issue caches.

Throws:
GenericEntityException

increaseVersionSequence

public void increaseVersionSequence(GenericValue pVersion)
                             throws GenericEntityException
Move a pVersion to have a lower sequence number - ie make it earlier

Specified by:
increaseVersionSequence in interface ProjectManager
Specified by:
increaseVersionSequence in class AbstractProjectManager
Throws:
GenericEntityException

decreaseVersionSequence

public void decreaseVersionSequence(GenericValue pVersion)
                             throws GenericEntityException
. Move a version to have a higher sequence number - ie make it later

Specified by:
decreaseVersionSequence in interface ProjectManager
Specified by:
decreaseVersionSequence in class AbstractProjectManager
Throws:
GenericEntityException

moveToEndVersionSequence

public void moveToEndVersionSequence(GenericValue version)
                              throws GenericEntityException
Description copied from interface: ProjectManager
. Move a version to to the end of the version sequence

Specified by:
moveToEndVersionSequence in interface ProjectManager
Specified by:
moveToEndVersionSequence in class AbstractProjectManager
Throws:
GenericEntityException

getDelegator

protected GenericDelegator getDelegator()

getProjectCategories

public java.util.Collection getProjectCategories()
                                          throws GenericEntityException
Description copied from interface: ProjectManager
Get all ProjectCategories.

Specified by:
getProjectCategories in interface ProjectManager
Specified by:
getProjectCategories in class AbstractProjectManager
Throws:
GenericEntityException

getProjectCategory

public GenericValue getProjectCategory(java.lang.Long id)
                                throws GenericEntityException
Specified by:
getProjectCategory in interface ProjectManager
Specified by:
getProjectCategory in class AbstractProjectManager
Throws:
GenericEntityException

updateProjectCategory

public void updateProjectCategory(GenericValue projectCat)
                           throws GenericEntityException
Specified by:
updateProjectCategory in interface ProjectManager
Specified by:
updateProjectCategory in class AbstractProjectManager
Throws:
GenericEntityException

getProjectsFromProjectCategory

public java.util.Collection getProjectsFromProjectCategory(GenericValue projectCategory)
                                                    throws GenericEntityException
Gather a list of projects that are in a project category.

Specified by:
getProjectsFromProjectCategory in interface ProjectManager
Specified by:
getProjectsFromProjectCategory in class AbstractProjectManager
Parameters:
projectCategory - Project to look up against
Returns:
Collection of Projects
Throws:
GenericEntityException

getProjectCategoryFromProject

public GenericValue getProjectCategoryFromProject(GenericValue project)
                                           throws GenericEntityException
Get the Project Category given a Project.

Specified by:
getProjectCategoryFromProject in interface ProjectManager
Specified by:
getProjectCategoryFromProject in class AbstractProjectManager
Parameters:
project - Project
Returns:
Project Category
Throws:
GenericEntityException

setProjectCategory

public void setProjectCategory(GenericValue project,
                               GenericValue category)
                        throws GenericEntityException
If category is non-null, set project's Project Category to category. If category is null, remove project's Project Category association, if one exists.

Specified by:
setProjectCategory in interface ProjectManager
Specified by:
setProjectCategory in class AbstractProjectManager
Parameters:
project -
category -
Throws:
GenericEntityException

refresh

public void refresh(GenericValue project)
             throws GenericEntityException
Throws:
GenericEntityException

refresh

public void refresh()