Package com.google.gerrit.server.project
Interface ProjectCache
- All Known Implementing Classes:
- NullProjectCache,- ProjectCacheImpl
public interface ProjectCache
Cache of project information, including access rights.
- 
Method SummaryModifier and TypeMethodDescriptioncom.google.common.collect.ImmutableSortedSet<Project.NameKey> all()Returns sorted iteration of projects.com.google.common.collect.ImmutableSortedSet<Project.NameKey> Filter the set of registered project names by common prefix.voidInvalidate the cached information about the given project.voidInvalidate the cached information about the given project, and triggers reindexing for itvoidInvalidate the cached information about the given project, and triggers reindexing for itget(Project.NameKey projectName) Get the cached data for a project by its unique name.Returns the parent state for all projects on this server.Returns the project state of the project storing meta data for all users.Returns estimated set of relevant groups extracted from hot project access rules.static Supplier<IllegalStateException> illegalState(Project.NameKey nameKey) Returns a supplier to be used as a short-hand when unwrapping anOptionalreturned from this cache.static Supplier<NoSuchProjectException> noSuchProject(Project.NameKey nameKey) Returns a supplier to be used as a short-hand when unwrapping anOptionalreturned from this cache.voidonCreateProject(Project.NameKey newProjectName) Notify the cache that a new project was constructed.voidRefreshes project list cachevoidRemove information about the given project from the cache.voidremove(Project.NameKey name) Remove information about the given project from the cache.
- 
Method Details- 
illegalStateReturns a supplier to be used as a short-hand when unwrapping anOptionalreturned from this cache.
- 
noSuchProjectReturns a supplier to be used as a short-hand when unwrapping anOptionalreturned from this cache.
- 
getAllProjectsProjectState getAllProjects()Returns the parent state for all projects on this server.
- 
getAllUsersProjectState getAllUsers()Returns the project state of the project storing meta data for all users.
- 
getOptional<ProjectState> get(Project.NameKey projectName) throws com.google.gerrit.exceptions.StorageException Get the cached data for a project by its unique name.- Parameters:
- projectName- name of the project.
- Returns:
- an Optionalwrapping the cached data;absentif no such project exists or the projectName is null
- Throws:
- com.google.gerrit.exceptions.StorageException- when there was an error.
 
- 
evictInvalidate the cached information about the given project.- Parameters:
- p- the NameKey of the project that is being evicted
 
- 
evictAndReindexInvalidate the cached information about the given project, and triggers reindexing for it- Parameters:
- p- project that is being evicted
 
- 
evictAndReindexInvalidate the cached information about the given project, and triggers reindexing for it- Parameters:
- p- the NameKey of the project that is being evicted
 
- 
removeRemove information about the given project from the cache. It will no longer be returned fromall().
- 
removeRemove information about the given project from the cache. It will no longer be returned fromall().
- 
allcom.google.common.collect.ImmutableSortedSet<Project.NameKey> all()Returns sorted iteration of projects.
- 
refreshProjectListvoid refreshProjectList()Refreshes project list cache
- 
guessRelevantGroupUUIDsSet<AccountGroup.UUID> guessRelevantGroupUUIDs()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.
- 
byNameFilter the set of registered project names by common prefix.- Parameters:
- prefix- common prefix.
- Returns:
- sorted iteration of projects sharing the same prefix.
 
- 
onCreateProjectNotify the cache that a new project was constructed.- Throws:
- IOException
 
 
-