Interface ProjectCache

  • All Known Implementing Classes:
    ProjectCacheImpl

    public interface ProjectCache
    Cache of project information, including access rights.
    • Method Detail

      • getAllProjects

        ProjectState getAllProjects()
        Returns:
        the parent state for all projects on this server.
      • getAllUsers

        ProjectState getAllUsers()
        Returns:
        the project state of the project storing meta data for all users.
      • get

        Optional<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 Optional wrapping the the cached data; absent if no such project exists or the projectName is null
        Throws:
        com.google.gerrit.exceptions.StorageException - when there was an error.
      • evict

        void evict​(Project p)
        Invalidate the cached information about the given project, and triggers reindexing for it
        Parameters:
        p - project that is being evicted
      • evict

        void evict​(Project.NameKey p)
        Invalidate the cached information about the given project, and triggers reindexing for it
        Parameters:
        p - the NameKey of the project that is being evicted
      • remove

        void remove​(Project p)
        Remove information about the given project from the cache. It will no longer be returned from all().
      • remove

        void remove​(Project.NameKey name)
        Remove information about the given project from the cache. It will no longer be returned from all().
      • all

        com.google.common.collect.ImmutableSortedSet<Project.NameKey> all()
        Returns:
        sorted iteration of projects.
      • guessRelevantGroupUUIDs

        Set<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.
      • byName

        com.google.common.collect.ImmutableSortedSet<Project.NameKey> byName​(String prefix)
        Filter the set of registered project names by common prefix.
        Parameters:
        prefix - common prefix.
        Returns:
        sorted iteration of projects sharing the same prefix.