com.atlassian.jira.project
Class CachingProjectManager

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

public class CachingProjectManager
extends AbstractProjectManager


Constructor Summary
  CachingProjectManager(ProjectManager decoratedProjectManager)
          Normal constructor.
protected CachingProjectManager(ProjectManager decoratedProjectManager, boolean updateCache)
          This constructor is to allow test cases to fire up a caching project manager without instantiating the internal project cache.
 
Method Summary
 void decreaseVersionSequence(GenericValue version)
          .
 GenericValue getComponent(GenericValue project, java.lang.String name)
           
 GenericValue getComponent(java.lang.Long id)
           
 java.util.Collection getComponents(GenericValue project)
           
 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)
           
 java.util.Collection getProjects()
          Return all projects
 java.util.Collection getProjectsFromProjectCategory(GenericValue projectCategory)
           
 java.util.Collection getProjectsWithNoCategory()
           
 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 version)
          Move a version 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
protected  java.util.Collection noNull(java.util.Collection col)
           
 void refresh()
           
 void refresh(GenericValue project)
           
 void releaseVersions(java.util.Collection versions, boolean release)
           
 void setProjectCategory(GenericValue project, GenericValue category)
           
 void updateCache()
           
 void updateProject(GenericValue updatedProject)
           
 void updateProjectCategory(GenericValue projectCat)
           
 
Methods inherited from class com.atlassian.jira.project.AbstractProjectManager
getDefaultAssignee, getProject, getVersionsReleasedDesc, isDefaultAssignee, isDefaultAssignee
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CachingProjectManager

public CachingProjectManager(ProjectManager decoratedProjectManager)
Normal constructor.

Parameters:
decoratedProjectManager - The ProjectManager to delegate to.

CachingProjectManager

protected CachingProjectManager(ProjectManager decoratedProjectManager,
                                boolean updateCache)
This constructor is to allow test cases to fire up a caching project manager without instantiating the internal project cache.

Parameters:
decoratedProjectManager - The ProjectManager to delegate actions to.
updateCache - Whether to instantiate a ProjectCache.
Method Detail

updateCache

public void updateCache()

getNextId

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

Throws:
GenericEntityException

refresh

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

refresh

public void refresh()

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

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

getVersionsUnarchived

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

getVersionsArchived

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

getProjects

public java.util.Collection getProjects()
                                 throws GenericEntityException
Description copied from interface: ProjectManager
Return all projects

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

noNull

protected java.util.Collection noNull(java.util.Collection col)

updateProject

public void updateProject(GenericValue updatedProject)
                   throws GenericEntityException
Specified by:
updateProject in interface ProjectManager
Specified by:
updateProject 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

increaseVersionSequence

public void increaseVersionSequence(GenericValue version)
                             throws GenericEntityException
Description copied from interface: ProjectManager
Move a version 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 version)
                             throws GenericEntityException
Description copied from interface: ProjectManager
. 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

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
Specified by:
getProjectsFromProjectCategory in interface ProjectManager
Specified by:
getProjectsFromProjectCategory in class AbstractProjectManager
Throws:
GenericEntityException

getProjectCategoryFromProject

public GenericValue getProjectCategoryFromProject(GenericValue project)
                                           throws GenericEntityException
Specified by:
getProjectCategoryFromProject in interface ProjectManager
Specified by:
getProjectCategoryFromProject in class AbstractProjectManager
Throws:
GenericEntityException

getProjectsWithNoCategory

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

setProjectCategory

public void setProjectCategory(GenericValue project,
                               GenericValue category)
                        throws GenericEntityException
Specified by:
setProjectCategory in interface ProjectManager
Specified by:
setProjectCategory in class AbstractProjectManager
Throws:
GenericEntityException

releaseVersions

public void releaseVersions(java.util.Collection versions,
                            boolean release)
                     throws GenericEntityException
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