Class ProjectCacheImpl

  • All Implemented Interfaces:
    ProjectCache

    public class ProjectCacheImpl
    extends Object
    implements ProjectCache
    Cache of project information, including access rights.
    • Method Detail

      • module

        public static com.google.inject.Module module()
      • getAllUsers

        public ProjectState getAllUsers()
        Specified by:
        getAllUsers in interface ProjectCache
        Returns:
        the project state of the project storing meta data for all users.
      • get

        public Optional<ProjectState> get​(Project.NameKey projectName)
        Description copied from interface: ProjectCache
        Get the cached data for a project by its unique name.
        Specified by:
        get in interface ProjectCache
        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
      • evict

        public void evict​(Project p)
        Description copied from interface: ProjectCache
        Invalidate the cached information about the given project, and triggers reindexing for it
        Specified by:
        evict in interface ProjectCache
        Parameters:
        p - project that is being evicted
      • evict

        public void evict​(Project.NameKey p)
        Description copied from interface: ProjectCache
        Invalidate the cached information about the given project, and triggers reindexing for it
        Specified by:
        evict in interface ProjectCache
        Parameters:
        p - the NameKey of the project that is being evicted
      • all

        public com.google.common.collect.ImmutableSortedSet<Project.NameKey> all()
        Specified by:
        all in interface ProjectCache
        Returns:
        sorted iteration of projects.
      • guessRelevantGroupUUIDs

        public Set<AccountGroup.UUID> guessRelevantGroupUUIDs()
        Specified by:
        guessRelevantGroupUUIDs in 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.
      • byName

        public com.google.common.collect.ImmutableSortedSet<Project.NameKey> byName​(String pfx)
        Description copied from interface: ProjectCache
        Filter the set of registered project names by common prefix.
        Specified by:
        byName in interface ProjectCache
        Parameters:
        pfx - common prefix.
        Returns:
        sorted iteration of projects sharing the same prefix.
      • evictAllByName

        public void evictAllByName()
      • sizeAllByName

        public long sizeAllByName()