public class ProjectCacheImpl extends java.lang.Object implements ProjectCache
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
CACHE_NAME |
| Modifier and Type | Method and Description |
|---|---|
com.google.common.collect.ImmutableSortedSet<Project.NameKey> |
all() |
com.google.common.collect.ImmutableSortedSet<Project.NameKey> |
byName(java.lang.String pfx)
Filter the set of registered project names by common prefix.
|
ProjectState |
checkedGet(Project.NameKey projectName)
Get the cached data for a project by its unique name.
|
ProjectState |
checkedGet(Project.NameKey projectName,
boolean strict)
Get the cached data for a project by its unique name.
|
void |
evict(Project.NameKey p)
Invalidate the cached information about the given project, and triggers reindexing for it
|
void |
evict(Project p)
Invalidate the cached information about the given project, and triggers reindexing for it
|
void |
evictAllByName() |
ProjectState |
get(Project.NameKey projectName)
Get the cached data for a project by its unique name.
|
ProjectState |
getAllProjects() |
ProjectState |
getAllUsers() |
java.util.Set<AccountGroup.UUID> |
guessRelevantGroupUUIDs() |
static com.google.inject.Module |
module() |
void |
onCreateProject(Project.NameKey newProjectName)
Notify the cache that a new project was constructed.
|
void |
remove(Project.NameKey name)
Remove information about the given project from the cache.
|
void |
remove(Project p)
Remove information about the given project from the cache.
|
long |
sizeAllByName() |
public static final java.lang.String CACHE_NAME
public static com.google.inject.Module module()
public ProjectState getAllProjects()
getAllProjects in interface ProjectCachepublic ProjectState getAllUsers()
getAllUsers in interface ProjectCachepublic ProjectState get(Project.NameKey projectName)
ProjectCacheget in interface ProjectCacheprojectName - name of the project.ProjectCache.checkedGet(com.google.gerrit.reviewdb.client.Project.NameKey)public ProjectState checkedGet(Project.NameKey projectName) throws java.io.IOException
ProjectCachecheckedGet in interface ProjectCacheprojectName - name of the project.java.io.IOException - when there was an error.public ProjectState checkedGet(Project.NameKey projectName, boolean strict) throws java.lang.Exception
ProjectCachecheckedGet in interface ProjectCacheprojectName - name of the project.strict - true when any error generates an exceptionjava.lang.Exception - in case of any error (strict = true) or only for I/O or other internal
errors.public void evict(Project p) throws java.io.IOException
ProjectCacheevict in interface ProjectCachep - project that is being evictedjava.io.IOException - thrown if the reindexing failspublic void evict(Project.NameKey p) throws java.io.IOException
ProjectCacheevict in interface ProjectCachep - the NameKey of the project that is being evictedjava.io.IOException - thrown if the reindexing failspublic void remove(Project p) throws java.io.IOException
ProjectCacheProjectCache.all().remove in interface ProjectCachejava.io.IOExceptionpublic void remove(Project.NameKey name) throws java.io.IOException
ProjectCacheProjectCache.all().remove in interface ProjectCachejava.io.IOExceptionpublic void onCreateProject(Project.NameKey newProjectName) throws java.io.IOException
ProjectCacheonCreateProject in interface ProjectCachejava.io.IOExceptionpublic com.google.common.collect.ImmutableSortedSet<Project.NameKey> all()
all in interface ProjectCachepublic java.util.Set<AccountGroup.UUID> guessRelevantGroupUUIDs()
guessRelevantGroupUUIDs in interface ProjectCachepublic com.google.common.collect.ImmutableSortedSet<Project.NameKey> byName(java.lang.String pfx)
ProjectCachebyName in interface ProjectCachepfx - common prefix.public void evictAllByName()
public long sizeAllByName()