Package com.google.gerrit.server.project
Class ProjectCacheImpl
- java.lang.Object
- 
- com.google.gerrit.server.project.ProjectCacheImpl
 
- 
- All Implemented Interfaces:
- ProjectCache
 
 public class ProjectCacheImpl extends Object implements ProjectCache Cache of project information, including access rights.
- 
- 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description SortedSet<Project.NameKey>all()Iterable<Project.NameKey>byName(String pfx)Filter the set of registered project names by common prefix.ProjectStatecheckedGet(Project.NameKey projectName)Get the cached data for a project by its unique name.ProjectStatecheckedGet(Project.NameKey projectName, boolean strict)Get the cached data for a project by its unique name.voidevict(Project p)Invalidate the cached information about the given project.voidevict(Project.NameKey p)Invalidate the cached information about the given project.voidevictAllByName()ProjectStateget(Project.NameKey projectName)Get the cached data for a project by its unique name.ProjectStategetAllProjects()ProjectStategetAllUsers()Set<AccountGroup.UUID>guessRelevantGroupUUIDs()static com.google.inject.Modulemodule()voidonCreateProject(Project.NameKey newProjectName)Notify the cache that a new project was constructed.voidremove(Project p)Remove information about the given project from the cache.voidremove(Project.NameKey name)Remove information about the given project from the cache.longsizeAllByName()
 
- 
- 
- 
Method Detail- 
modulepublic static com.google.inject.Module module() 
 - 
getAllProjectspublic ProjectState getAllProjects() - Specified by:
- getAllProjectsin interface- ProjectCache
- Returns:
- the parent state for all projects on this server.
 
 - 
getAllUserspublic ProjectState getAllUsers() - Specified by:
- getAllUsersin interface- ProjectCache
- Returns:
- the project state of the project storing meta data for all users.
 
 - 
getpublic ProjectState get(Project.NameKey projectName) Description copied from interface:ProjectCacheGet the cached data for a project by its unique name.- Specified by:
- getin interface- ProjectCache
- Parameters:
- projectName- name of the project.
- Returns:
- the cached data; null if no such project exists, projectName is null or an error occurred.
- See Also:
- ProjectCache.checkedGet(com.google.gerrit.reviewdb.client.Project.NameKey)
 
 - 
checkedGetpublic ProjectState checkedGet(Project.NameKey projectName) throws IOException Description copied from interface:ProjectCacheGet the cached data for a project by its unique name.- Specified by:
- checkedGetin interface- ProjectCache
- Parameters:
- projectName- name of the project.
- Returns:
- the cached data; null if no such project exists or projectName is null.
- Throws:
- IOException- when there was an error.
 
 - 
checkedGetpublic ProjectState checkedGet(Project.NameKey projectName, boolean strict) throws Exception Description copied from interface:ProjectCacheGet the cached data for a project by its unique name.- Specified by:
- checkedGetin interface- ProjectCache
- Parameters:
- projectName- name of the project.
- strict- true when any error generates an exception
- Returns:
- the cached data or null when strict = false
- Throws:
- Exception- in case of any error (strict = true) or only for I/O or other internal errors.
 
 - 
evictpublic void evict(Project p) Description copied from interface:ProjectCacheInvalidate the cached information about the given project.- Specified by:
- evictin interface- ProjectCache
 
 - 
evictpublic void evict(Project.NameKey p) Invalidate the cached information about the given project.- Specified by:
- evictin interface- ProjectCache
 
 - 
removepublic void remove(Project p) Description copied from interface:ProjectCacheRemove information about the given project from the cache. It will no longer be returned fromProjectCache.all().- Specified by:
- removein interface- ProjectCache
 
 - 
removepublic void remove(Project.NameKey name) Description copied from interface:ProjectCacheRemove information about the given project from the cache. It will no longer be returned fromProjectCache.all().- Specified by:
- removein interface- ProjectCache
 
 - 
onCreateProjectpublic void onCreateProject(Project.NameKey newProjectName) Description copied from interface:ProjectCacheNotify the cache that a new project was constructed.- Specified by:
- onCreateProjectin interface- ProjectCache
 
 - 
allpublic SortedSet<Project.NameKey> all() - Specified by:
- allin interface- ProjectCache
- Returns:
- sorted iteration of projects.
 
 - 
guessRelevantGroupUUIDspublic Set<AccountGroup.UUID> guessRelevantGroupUUIDs() - Specified by:
- guessRelevantGroupUUIDsin interface- ProjectCache
- Returns:
- estimated set of relevant groups extracted from hot project access rules. If the cache is cold or too small for the entire project set of the server, this set may be incomplete.
 
 - 
byNamepublic Iterable<Project.NameKey> byName(String pfx) Description copied from interface:ProjectCacheFilter the set of registered project names by common prefix.- Specified by:
- byNamein interface- ProjectCache
- Parameters:
- pfx- common prefix.
- Returns:
- sorted iteration of projects sharing the same prefix.
 
 - 
evictAllByNamepublic void evictAllByName() 
 - 
sizeAllByNamepublic long sizeAllByName() 
 
- 
 
-