Class ProjectState


  • public class ProjectState
    extends Object
    Cached information on a project. Must not contain any data derived from parents other than it's immediate parent's Project.NameKey.
    • Method Detail

      • hasPrologRules

        public boolean hasPrologRules()
        Returns true if the Prolog engine is expected to run for this project, that is if this project or a parent possesses a rules.pl file.
      • getProject

        public Project getProject()
      • getName

        public String getName()
      • getMaxObjectSizeLimit

        public long getMaxObjectSizeLimit()
      • statePermitsRead

        public boolean statePermitsRead()
      • statePermitsWrite

        public boolean statePermitsWrite()
      • getAllSections

        public List<SectionMatcher> getAllSections()
        Obtain all local and inherited sections. This collection is looked up dynamically and is not cached. Callers should try to cache this result per-request as much as possible.
      • getOwners

        public Set<AccountGroup.UUID> getOwners()
        Returns:
        all AccountGroup's to which the owner privilege for 'refs/*' is assigned for this project (the local owners), if there are no local owners the local owners of the nearest parent project that has local owners are returned
      • getAllOwners

        public Set<AccountGroup.UUID> getAllOwners()
        Returns:
        all AccountGroup's that are allowed to administrate the complete project. This includes all groups to which the owner privilege for 'refs/*' is assigned for this project (the local owners) and all groups to which the owner privilege for 'refs/*' is assigned for one of the parent projects (the inherited owners).
      • tree

        public Iterable<ProjectState> tree()
        Returns:
        an iterable that walks through this project and then the parents of this project. Starts from this project and progresses up the hierarchy to All-Projects.
      • treeInOrder

        public Iterable<ProjectState> treeInOrder()
        Returns:
        an iterable that walks in-order from All-Projects through the project hierarchy to this project.
      • parents

        public com.google.common.collect.FluentIterable<ProjectState> parents()
        Returns:
        an iterable that walks through the parents of this project. Starts from the immediate parent of this project and progresses up the hierarchy to All-Projects.
      • isAllProjects

        public boolean isAllProjects()
      • isAllUsers

        public boolean isAllUsers()
      • getLabelTypes

        public LabelTypes getLabelTypes()
        All available label types.
      • getLabelTypes

        public LabelTypes getLabelTypes​(ChangeNotes notes)
        All available label types for this change.
      • getLabelTypes

        public LabelTypes getLabelTypes​(Branch.NameKey destination)
        All available label types for this branch.
      • getSubmitType

        public SubmitType getSubmitType()
      • toProjectData

        public com.google.gerrit.index.project.ProjectData toProjectData()