com.atlassian.jira.project
Class ProjectCache

java.lang.Object
  |
  +--com.atlassian.jira.project.ProjectCache

public class ProjectCache
extends java.lang.Object

This is a very basic cache that stores projects, versions and components When constructed, or when you call refresh() - it will find and cache all projects, components and versions


Constructor Summary
protected ProjectCache()
          Create a new project cache.
protected ProjectCache(boolean refresh)
          For testing purposes, we may not want to load the cache at the start.
 
Method Summary
static ProjectCache getCache()
           
 org.ofbiz.core.entity.GenericValue getComponent(java.lang.Long id)
           
 java.util.Collection getComponents(org.ofbiz.core.entity.GenericValue project)
           
 org.ofbiz.core.entity.GenericValue getProject(java.lang.Long id)
           
 org.ofbiz.core.entity.GenericValue getProjectByKey(java.lang.String key)
           
 org.ofbiz.core.entity.GenericValue getProjectByName(java.lang.String name)
           
 java.util.Collection getProjectCategories()
           
 org.ofbiz.core.entity.GenericValue getProjectCategory(java.lang.Long id)
           
 org.ofbiz.core.entity.GenericValue getProjectCategoryFromProject(org.ofbiz.core.entity.GenericValue project1)
           
 java.util.Collection getProjects()
           
 java.util.Collection getProjectsFromProjectCategory(org.ofbiz.core.entity.GenericValue projectCat)
           
 org.ofbiz.core.entity.GenericValue getVersion(java.lang.Long id)
           
 java.util.Collection getVersions(org.ofbiz.core.entity.GenericValue project)
           
 java.util.Collection getVersionsArchived(org.ofbiz.core.entity.GenericValue project)
           
 java.util.Collection getVersionsReleased(org.ofbiz.core.entity.GenericValue project, boolean includeArchived)
           
 java.util.Collection getVersionsUnarchived(org.ofbiz.core.entity.GenericValue project)
           
 java.util.Collection getVersionsUnreleased(org.ofbiz.core.entity.GenericValue project, boolean includeArchived)
           
 void refresh()
           
 void refresh(org.ofbiz.core.entity.GenericValue project)
          Refresh a single project - called when a single project has been updated (ie counter incremented) but you don't want to refresh the whole cache IMPACT: 3 SQL statements (1 + 2)
protected  void refreshProject(org.ofbiz.core.entity.GenericValue project)
          Get all the components and versions for a project - only called internally IMPACT: Should perform only 2 SQL select statements
protected  void refreshProjectCategories()
           
protected  void refreshProjectCategoriesToProjects()
           
protected  void refreshProjectToProjectCategories()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProjectCache

protected ProjectCache()
Create a new project cache.


ProjectCache

protected ProjectCache(boolean refresh)
For testing purposes, we may not want to load the cache at the start.

It is recommended that you use ProjectCache() instead.

Parameters:
refresh -
Method Detail

getCache

public static ProjectCache getCache()

refresh

public void refresh()

refresh

public void refresh(org.ofbiz.core.entity.GenericValue project)
             throws org.ofbiz.core.entity.GenericEntityException
Refresh a single project - called when a single project has been updated (ie counter incremented) but you don't want to refresh the whole cache IMPACT: 3 SQL statements (1 + 2)

org.ofbiz.core.entity.GenericEntityException

refreshProjectCategories

protected void refreshProjectCategories()
                                 throws org.ofbiz.core.entity.GenericEntityException
org.ofbiz.core.entity.GenericEntityException

refreshProject

protected void refreshProject(org.ofbiz.core.entity.GenericValue project)
                       throws org.ofbiz.core.entity.GenericEntityException
Get all the components and versions for a project - only called internally IMPACT: Should perform only 2 SQL select statements

org.ofbiz.core.entity.GenericEntityException

getProject

public org.ofbiz.core.entity.GenericValue getProject(java.lang.Long id)

getComponent

public org.ofbiz.core.entity.GenericValue getComponent(java.lang.Long id)

getVersion

public org.ofbiz.core.entity.GenericValue getVersion(java.lang.Long id)

getProjectByName

public org.ofbiz.core.entity.GenericValue getProjectByName(java.lang.String name)

getProjectByKey

public org.ofbiz.core.entity.GenericValue getProjectByKey(java.lang.String key)

getComponents

public java.util.Collection getComponents(org.ofbiz.core.entity.GenericValue project)

getVersions

public java.util.Collection getVersions(org.ofbiz.core.entity.GenericValue project)

getVersionsReleased

public java.util.Collection getVersionsReleased(org.ofbiz.core.entity.GenericValue project,
                                                boolean includeArchived)

getVersionsUnreleased

public java.util.Collection getVersionsUnreleased(org.ofbiz.core.entity.GenericValue project,
                                                  boolean includeArchived)

getVersionsArchived

public java.util.Collection getVersionsArchived(org.ofbiz.core.entity.GenericValue project)

getVersionsUnarchived

public java.util.Collection getVersionsUnarchived(org.ofbiz.core.entity.GenericValue project)

getProjects

public java.util.Collection getProjects()

getProjectCategories

public java.util.Collection getProjectCategories()

getProjectCategory

public org.ofbiz.core.entity.GenericValue getProjectCategory(java.lang.Long id)

refreshProjectCategoriesToProjects

protected void refreshProjectCategoriesToProjects()

getProjectsFromProjectCategory

public java.util.Collection getProjectsFromProjectCategory(org.ofbiz.core.entity.GenericValue projectCat)

refreshProjectToProjectCategories

protected void refreshProjectToProjectCategories()

getProjectCategoryFromProject

public org.ofbiz.core.entity.GenericValue getProjectCategoryFromProject(org.ofbiz.core.entity.GenericValue project1)


Copyright © 2002-2003 Atlassian. All Rights Reserved.