com.atlassian.jira.project
Class CachingProjectManager

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

public class CachingProjectManager
extends AbstractProjectManager


Constructor Summary
protected CachingProjectManager(ProjectManager delegateProjectManager, ProjectComponentManager projectComponentManager, boolean updateCache)
          This constructor is to allow test cases to fire up a caching project manager without instantiating the internal project cache.
  CachingProjectManager(ProjectManager delegateProjectManager, ProjectComponentManager projectComponentManager, ProjectFactory projectFactory)
          Normal constructor.
 
Method Summary
 ProjectCache getCache()
           
 org.ofbiz.core.entity.GenericValue getComponent(org.ofbiz.core.entity.GenericValue project, String name)
          Deprecated. use ProjectComponentManager and ProjectComponent
 org.ofbiz.core.entity.GenericValue getComponent(Long id)
          Deprecated. use ProjectComponentManager and ProjectComponent
 Collection getComponents(org.ofbiz.core.entity.GenericValue project)
          Deprecated. use ProjectComponentManager and ProjectComponent
 long getNextId(org.ofbiz.core.entity.GenericValue project)
          Get the next issue ID from this project (transactional).
 org.ofbiz.core.entity.GenericValue getProject(Long id)
          Retrieve a single project by it's id.
 org.ofbiz.core.entity.GenericValue getProjectByKey(String key)
          Retrieve a single project by it's project key.
 org.ofbiz.core.entity.GenericValue getProjectByName(String name)
          Retrieve a single project by it's project name.
 Collection getProjectCategories()
          Get all ProjectCategories.
 org.ofbiz.core.entity.GenericValue getProjectCategory(Long id)
          Returns a single project category by id.
 org.ofbiz.core.entity.GenericValue getProjectCategoryFromProject(org.ofbiz.core.entity.GenericValue project)
          Returns a project's category.
 Project getProjectObj(Long id)
          Retrieves a single Project by its id.
 Project getProjectObjByKey(String projectKey)
          Returns a Project object based on the passed in project key.
 Project getProjectObjByName(String projectName)
          Returns a Project object based on the passed in project name.
 Collection getProjects()
          Return all project GenericValues.
 Collection getProjectsByLead(User leadUser)
          Returns all the projects that leadUser is the project lead for.
 Collection getProjectsFromProjectCategory(org.ofbiz.core.entity.GenericValue projectCategory)
          Returns a list of projects in a particular category.
 Collection getProjectsWithNoCategory()
          Returns a list of projects without project category, sorted by project name
protected  Collection noNull(Collection col)
           
 void refresh()
          Causes a full refresh of the project cache.
 void refreshProjectDependencies(org.ofbiz.core.entity.GenericValue project)
          This will refresh the dependencies of a project.
 void setProjectCategory(org.ofbiz.core.entity.GenericValue project, org.ofbiz.core.entity.GenericValue category)
          Sets a projects category.
 void updateCache()
           
 void updateProject(org.ofbiz.core.entity.GenericValue updatedProject)
          Persists a project GenericValue to the database.
 void updateProjectCategory(org.ofbiz.core.entity.GenericValue projectCat)
          Persist an updated project category.
 
Methods inherited from class com.atlassian.jira.project.AbstractProjectManager
convertToProjects, getComponents, getDefaultAssignee, getProject, getProjectCategoryByName, 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 delegateProjectManager,
                             ProjectComponentManager projectComponentManager,
                             ProjectFactory projectFactory)
Normal constructor.

Parameters:
delegateProjectManager - The ProjectManager to delegate to.

CachingProjectManager

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

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

updateCache

public void updateCache()

getNextId

public long getNextId(org.ofbiz.core.entity.GenericValue project)
Description copied from interface: ProjectManager
Get the next issue ID from this project (transactional). Each project maintains an internal counter for the number of issues. This method may be used to construct a new issue key.

Returns:
A long value representing a new issue id for the project.

refreshProjectDependencies

public void refreshProjectDependencies(org.ofbiz.core.entity.GenericValue project)
Description copied from interface: ProjectManager
This will refresh the dependencies of a project. Please do not use this to refresh the passed in project in the project cache. use ProjectManager.refresh()


refresh

public void refresh()
Description copied from interface: ProjectManager
Causes a full refresh of the project cache.


getProject

public org.ofbiz.core.entity.GenericValue getProject(Long id)
Description copied from interface: ProjectManager
Retrieve a single project by it's id.

Specified by:
getProject in interface ProjectManager
Specified by:
getProject in class AbstractProjectManager

getProjectObj

public Project getProjectObj(Long id)
Description copied from interface: ProjectManager
Retrieves a single Project by its id.

Specified by:
getProjectObj in interface ProjectManager
Specified by:
getProjectObj in class AbstractProjectManager
Returns:
project object or null if project with that id doesn't exist

getProjectByName

public org.ofbiz.core.entity.GenericValue getProjectByName(String name)
Description copied from interface: ProjectManager
Retrieve a single project by it's project name.

Specified by:
getProjectByName in interface ProjectManager
Specified by:
getProjectByName in class AbstractProjectManager

getProjectByKey

public org.ofbiz.core.entity.GenericValue getProjectByKey(String key)
Description copied from interface: ProjectManager
Retrieve a single project by it's project key.

Specified by:
getProjectByKey in interface ProjectManager
Specified by:
getProjectByKey in class AbstractProjectManager

getProjectObjByKey

public Project getProjectObjByKey(String projectKey)
Description copied from interface: ProjectManager
Returns a Project object based on the passed in project key.

Specified by:
getProjectObjByKey in interface ProjectManager
Specified by:
getProjectObjByKey in class AbstractProjectManager
Returns:
the Project object specified by the key or null

getProjectObjByName

public Project getProjectObjByName(String projectName)
Description copied from interface: ProjectManager
Returns a Project object based on the passed in project name.

Parameters:
projectName - the name of the project
Returns:
the Project object specified by the supplied name or null

getComponent

public org.ofbiz.core.entity.GenericValue getComponent(org.ofbiz.core.entity.GenericValue project,
                                                       String name)
Deprecated. use ProjectComponentManager and ProjectComponent

Retrieves the Component with the given name in the given Project or null if none match.

Specified by:
getComponent in interface ProjectManager
Specified by:
getComponent in class AbstractProjectManager
Parameters:
project - the Project.
name - the Component name.
Returns:
the Component as a GenericValue or null if there is no match.

getComponent

public org.ofbiz.core.entity.GenericValue getComponent(Long id)
Deprecated. use ProjectComponentManager and ProjectComponent

Retrieves the Component (as a GenericValue) with the given id or null if none match.

Specified by:
getComponent in interface ProjectManager
Specified by:
getComponent in class AbstractProjectManager
Parameters:
id - the id of the component to retrieve
Returns:
the Component as a GenericValue or null if there is no match.

getComponents

public Collection getComponents(org.ofbiz.core.entity.GenericValue project)
Deprecated. use ProjectComponentManager and ProjectComponent

Retrieve the collection of Components (as GenericValues) associated with the specified project.

Specified by:
getComponents in interface ProjectManager
Specified by:
getComponents in class AbstractProjectManager
Parameters:
project - the project (as a GenericValue) used to search on
Returns:
collection of components (as GenericValues) or null if there is no match.

getProjects

public Collection getProjects()
Description copied from interface: ProjectManager
Return all project GenericValues.

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

noNull

protected Collection noNull(Collection col)

updateProject

public void updateProject(org.ofbiz.core.entity.GenericValue updatedProject)
Description copied from interface: ProjectManager
Persists a project GenericValue to the database.

Specified by:
updateProject in interface ProjectManager
Specified by:
updateProject in class AbstractProjectManager

getProjectCategories

public Collection getProjectCategories()
Description copied from interface: ProjectManager
Get all ProjectCategories.

Specified by:
getProjectCategories in interface ProjectManager
Specified by:
getProjectCategories in class AbstractProjectManager
Returns:
A collection of category GenericValues

getProjectCategory

public org.ofbiz.core.entity.GenericValue getProjectCategory(Long id)
Description copied from interface: ProjectManager
Returns a single project category by id.

Specified by:
getProjectCategory in interface ProjectManager
Specified by:
getProjectCategory in class AbstractProjectManager
Returns:
A category GenericValue

updateProjectCategory

public void updateProjectCategory(org.ofbiz.core.entity.GenericValue projectCat)
Description copied from interface: ProjectManager
Persist an updated project category.

Specified by:
updateProjectCategory in interface ProjectManager
Specified by:
updateProjectCategory in class AbstractProjectManager

getProjectsFromProjectCategory

public Collection getProjectsFromProjectCategory(org.ofbiz.core.entity.GenericValue projectCategory)
Description copied from interface: ProjectManager
Returns a list of projects in a particular category.

Specified by:
getProjectsFromProjectCategory in interface ProjectManager
Specified by:
getProjectsFromProjectCategory in class AbstractProjectManager
Returns:
A collection of project GenericValues sorted by name. Returns null if the projectCategory param is null

getProjectCategoryFromProject

public org.ofbiz.core.entity.GenericValue getProjectCategoryFromProject(org.ofbiz.core.entity.GenericValue project)
Description copied from interface: ProjectManager
Returns a project's category.

Specified by:
getProjectCategoryFromProject in interface ProjectManager
Specified by:
getProjectCategoryFromProject in class AbstractProjectManager
Returns:
A category GenericValue or null if no category exists.

getProjectsWithNoCategory

public Collection getProjectsWithNoCategory()
Description copied from interface: ProjectManager
Returns a list of projects without project category, sorted by project name

Specified by:
getProjectsWithNoCategory in interface ProjectManager
Specified by:
getProjectsWithNoCategory in class AbstractProjectManager
Returns:
A collection of project GenericValues sorted by name

setProjectCategory

public void setProjectCategory(org.ofbiz.core.entity.GenericValue project,
                               org.ofbiz.core.entity.GenericValue category)
Description copied from interface: ProjectManager
Sets a projects category.

Specified by:
setProjectCategory in interface ProjectManager
Specified by:
setProjectCategory in class AbstractProjectManager

getProjectsByLead

public Collection getProjectsByLead(User leadUser)
Description copied from interface: ProjectManager
Returns all the projects that leadUser is the project lead for.

Returns:
A collection of project GenericValues

getCache

public ProjectCache getCache()


Copyright © 2002-2007 Atlassian. All Rights Reserved.