Package com.google.gerrit.server.project
Class ProjectState
- java.lang.Object
-
- com.google.gerrit.server.project.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'sProject.NameKey
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ProjectState.EffectiveMaxObjectSizeLimit
static interface
ProjectState.Factory
-
Field Summary
Fields Modifier and Type Field Description static String
INHERITED_FROM_GLOBAL
static String
INHERITED_FROM_PARENT
static String
OVERRIDDEN_BY_GLOBAL
static String
OVERRIDDEN_BY_PARENT
-
Constructor Summary
Constructors Constructor Description ProjectState(SitePaths sitePaths, ProjectCache projectCache, AllProjectsName allProjectsName, AllUsersName allUsersName, ProjectControl.AssistedFactory projectControlFactory, PrologEnvironment.Factory envFactory, GitRepositoryManager gitMgr, RulesCache rulesCache, List<CommentLinkInfo> commentLinks, CapabilityCollection.Factory limitsFactory, TransferConfig transferConfig, ProjectConfig config)
-
Method Summary
-
-
-
Field Detail
-
INHERITED_FROM_PARENT
public static final String INHERITED_FROM_PARENT
- See Also:
- Constant Field Values
-
OVERRIDDEN_BY_PARENT
public static final String OVERRIDDEN_BY_PARENT
- See Also:
- Constant Field Values
-
INHERITED_FROM_GLOBAL
public static final String INHERITED_FROM_GLOBAL
- See Also:
- Constant Field Values
-
OVERRIDDEN_BY_GLOBAL
public static final String OVERRIDDEN_BY_GLOBAL
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ProjectState
@Inject public ProjectState(SitePaths sitePaths, ProjectCache projectCache, AllProjectsName allProjectsName, AllUsersName allUsersName, ProjectControl.AssistedFactory projectControlFactory, PrologEnvironment.Factory envFactory, GitRepositoryManager gitMgr, RulesCache rulesCache, List<CommentLinkInfo> commentLinks, CapabilityCollection.Factory limitsFactory, TransferConfig transferConfig, ProjectConfig config)
-
-
Method Detail
-
getCapabilityCollection
public CapabilityCollection getCapabilityCollection()
- Returns:
- cached computation of all global capabilities. This should only be invoked on the state
from
ProjectCache.getAllProjects()
. Null on any other project.
-
newPrologEnvironment
public PrologEnvironment newPrologEnvironment() throws com.googlecode.prolog_cafe.exceptions.CompileException
- Returns:
- Construct a new PrologEnvironment for the calling thread.
- Throws:
com.googlecode.prolog_cafe.exceptions.CompileException
-
newPrologEnvironment
public PrologEnvironment newPrologEnvironment(String name, Reader in) throws com.googlecode.prolog_cafe.exceptions.CompileException
LikenewPrologEnvironment()
but instead of reading the rules.pl read the provided input stream.- Parameters:
name
- a name of the input stream. Could be any name.in
- stream to read prolog rules from- Throws:
com.googlecode.prolog_cafe.exceptions.CompileException
-
getProject
public Project getProject()
-
getNameKey
public Project.NameKey getNameKey()
-
getName
public String getName()
-
getConfig
public ProjectConfig getConfig()
-
getConfig
public ProjectLevelConfig getConfig(String fileName)
-
getEffectiveMaxObjectSizeLimit
public ProjectState.EffectiveMaxObjectSizeLimit getEffectiveMaxObjectSizeLimit()
-
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).
-
controlFor
public ProjectControl controlFor(CurrentUser user)
-
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()
-
isUseContributorAgreements
public boolean isUseContributorAgreements()
-
isUseContentMerge
public boolean isUseContentMerge()
-
isUseSignedOffBy
public boolean isUseSignedOffBy()
-
isRequireChangeID
public boolean isRequireChangeID()
-
isCreateNewChangeForAllNotInTarget
public boolean isCreateNewChangeForAllNotInTarget()
-
isEnableSignedPush
public boolean isEnableSignedPush()
-
isRequireSignedPush
public boolean isRequireSignedPush()
-
isRejectImplicitMerges
public boolean isRejectImplicitMerges()
-
isPrivateByDefault
public boolean isPrivateByDefault()
-
isWorkInProgressByDefault
public boolean isWorkInProgressByDefault()
-
isEnableReviewerByEmail
public boolean isEnableReviewerByEmail()
-
isMatchAuthorToCommitterDate
public boolean isMatchAuthorToCommitterDate()
-
getLabelTypes
public LabelTypes getLabelTypes()
All available label types.
-
getLabelTypes
public LabelTypes getLabelTypes(ChangeNotes notes, CurrentUser user)
All available label types for this change and user.
-
getLabelTypes
public LabelTypes getLabelTypes(Branch.NameKey destination, CurrentUser user)
All available label types for this branch and user.
-
getCommentLinks
public List<CommentLinkInfo> getCommentLinks()
-
getBranchOrderSection
public BranchOrderSection getBranchOrderSection()
-
getSubscribeSections
public Collection<SubscribeSection> getSubscribeSections(Branch.NameKey branch)
-
getTheme
public ThemeInfo getTheme()
-
getAllGroups
public Set<GroupReference> getAllGroups()
-
getLocalGroups
public Set<GroupReference> getLocalGroups()
-
-