Package com.google.gerrit.server.project
Class ProjectConfig
- java.lang.Object
- 
- com.google.gerrit.server.git.meta.VersionedMetaData
- 
- com.google.gerrit.server.project.ProjectConfig
 
 
- 
- All Implemented Interfaces:
- ValidationError.Sink
 
 public class ProjectConfig extends VersionedMetaData implements ValidationError.Sink 
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description static classProjectConfig.Factory- 
Nested classes/interfaces inherited from class com.google.gerrit.server.git.meta.VersionedMetaDataVersionedMetaData.BatchMetaDataUpdate, VersionedMetaData.PathInfo
 
- 
 - 
Field Summary- 
Fields inherited from class com.google.gerrit.server.git.meta.VersionedMetaDatainserter, newTree, projectName, reader, revision, rw
 
- 
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddCommentLinkSection(StoredCommentLinkInfo commentLink)voidaddSubscribeSection(SubscribeSection s)static StoredCommentLinkInfobuildCommentLink(org.eclipse.jgit.lib.Config cfg, String name, boolean allowRaw)voiderror(ValidationError error)AccessSectiongetAccessSection(String name)Returns an access section,nametypically is a ref pattern.Collection<AccessSection>getAccessSections()AccountsSectiongetAccountsSection()BranchOrderSectiongetBranchOrderSection()CachedProjectConfiggetCacheable()Returns an immutable, thread-safe representation of this object that can be cached.booleangetCheckReceivedObjects()Returns the checkReceivedObjects for this project, default is true.Collection<StoredCommentLinkInfo>getCommentLinkSections()ContributorAgreementgetContributorAgreement(String name)Collection<ContributorAgreement>getContributorAgreements()GroupReferencegetGroup(AccountGroup.UUID uuid)Returns the group reference, if the group is used by at least one rule.GroupReferencegetGroup(String groupName)Returns the group reference corresponding to the specified group name if the group is used by at least one rule or plugin value.Map<String,LabelType>getLabelSections()longgetMaxObjectSizeLimit()Returns the maxObjectSizeLimit configured on this project, or zero if not configured.ConfiguredMimeTypesgetMimeTypes()Project.NameKeygetName()Collection<NotifyConfig>getNotifyConfigs()PluginConfiggetPluginConfig(String pluginName)ProjectgetProject()protected StringgetRefName()Returns name of the reference storing this configuration.org.eclipse.jgit.lib.ObjectIdgetRulesId()Returns the project's rules.pl ObjectId, if present in the branch.Map<String,SubmitRequirement>getSubmitRequirementSections()Map<Project.NameKey,SubscribeSection>getSubscribeSections()List<ValidationError>getValidationErrors()Get the validation errors, if any were discovered during load.booleanhasLegacyPermissions()voidload(org.eclipse.jgit.lib.Repository repo)voidload(org.eclipse.jgit.lib.Repository repo, org.eclipse.jgit.lib.ObjectId revision)voidload(org.eclipse.jgit.revwalk.RevWalk rw, org.eclipse.jgit.lib.ObjectId revision)protected voidonLoad()Set up the metadata, parsing any state from the loaded revision.protected booleanonSave(org.eclipse.jgit.lib.CommitBuilder commit)Save any changes to the metadata in a commit.voidputNotifyConfig(String name, NotifyConfig nc)voidremove(AccessSection section)voidremove(AccessSection section, Permission permission)voidremove(AccessSection section, Permission permission, PermissionRule rule)voidremove(ContributorAgreement section)voidremoveCommentLinkSection(String name)voidrenameGroup(AccountGroup.UUID uuid, String newName)voidreplace(ContributorAgreement section)GroupReferenceresolve(GroupReference group)voidsetAccountsSection(AccountsSection accountsSection)voidsetBranchOrderSection(BranchOrderSection branchOrderSection)voidsetProject(Project.Builder project)booleanupdateGroupNames(GroupBackend groupBackend)Check all GroupReferences use current group name, repairing stale ones.voidupdateLabelType(String name, Consumer<LabelType.Builder> update)Allows a mutation of an existingLabelType.voidupdatePluginConfig(String pluginName, Consumer<PluginConfig.Update> pluginConfigUpdate)voidupdateProject(Consumer<Project.Builder> update)voidupsertAccessSection(String name, Consumer<AccessSection.Builder> update)voidupsertContributorAgreement(ContributorAgreement ca)Adds or replaces the givenContributorAgreementin this config.voidupsertLabelType(LabelType labelType)Adds or replaces the givenLabelTypein this config.voidupsertSubmitRequirement(SubmitRequirement requirement)static StringvalidMaxObjectSizeLimit(String value)- 
Methods inherited from class com.google.gerrit.server.git.meta.VersionedMetaDatacommit, commitToNewRef, getObjectId, getPathInfos, getRevision, load, load, load, load, load, openUpdate, readConfig, readConfig, readFile, readTree, readUTF8, saveConfig, saveFile, saveUTF8, set, set, set
 
- 
 
- 
- 
- 
Field Detail- 
COMMENTLINKpublic static final String COMMENTLINK - See Also:
- Constant Field Values
 
 - 
LABELpublic static final String LABEL - See Also:
- Constant Field Values
 
 - 
KEY_FUNCTIONpublic static final String KEY_FUNCTION - See Also:
- Constant Field Values
 
 - 
KEY_DEFAULT_VALUEpublic static final String KEY_DEFAULT_VALUE - See Also:
- Constant Field Values
 
 - 
KEY_COPY_MIN_SCOREpublic static final String KEY_COPY_MIN_SCORE - See Also:
- Constant Field Values
 
 - 
KEY_ALLOW_POST_SUBMITpublic static final String KEY_ALLOW_POST_SUBMIT - See Also:
- Constant Field Values
 
 - 
KEY_IGNORE_SELF_APPROVALpublic static final String KEY_IGNORE_SELF_APPROVAL - See Also:
- Constant Field Values
 
 - 
KEY_COPY_ANY_SCOREpublic static final String KEY_COPY_ANY_SCORE - See Also:
- Constant Field Values
 
 - 
KEY_COPY_CONDITIONpublic static final String KEY_COPY_CONDITION - See Also:
- Constant Field Values
 
 - 
KEY_COPY_MAX_SCOREpublic static final String KEY_COPY_MAX_SCORE - See Also:
- Constant Field Values
 
 - 
KEY_COPY_ALL_SCORES_IF_LIST_OF_FILES_DID_NOT_CHANGEpublic static final String KEY_COPY_ALL_SCORES_IF_LIST_OF_FILES_DID_NOT_CHANGE - See Also:
- Constant Field Values
 
 - 
KEY_COPY_ALL_SCORES_ON_MERGE_FIRST_PARENT_UPDATEpublic static final String KEY_COPY_ALL_SCORES_ON_MERGE_FIRST_PARENT_UPDATE - See Also:
- Constant Field Values
 
 - 
KEY_COPY_ALL_SCORES_ON_TRIVIAL_REBASEpublic static final String KEY_COPY_ALL_SCORES_ON_TRIVIAL_REBASE - See Also:
- Constant Field Values
 
 - 
KEY_COPY_ALL_SCORES_IF_NO_CODE_CHANGEpublic static final String KEY_COPY_ALL_SCORES_IF_NO_CODE_CHANGE - See Also:
- Constant Field Values
 
 - 
KEY_COPY_ALL_SCORES_IF_NO_CHANGEpublic static final String KEY_COPY_ALL_SCORES_IF_NO_CHANGE - See Also:
- Constant Field Values
 
 - 
KEY_COPY_VALUEpublic static final String KEY_COPY_VALUE - See Also:
- Constant Field Values
 
 - 
KEY_VALUEpublic static final String KEY_VALUE - See Also:
- Constant Field Values
 
 - 
KEY_CAN_OVERRIDEpublic static final String KEY_CAN_OVERRIDE - See Also:
- Constant Field Values
 
 - 
KEY_BRANCHpublic static final String KEY_BRANCH - See Also:
- Constant Field Values
 
 - 
SUBMIT_REQUIREMENTpublic static final String SUBMIT_REQUIREMENT - See Also:
- Constant Field Values
 
 - 
KEY_SR_DESCRIPTIONpublic static final String KEY_SR_DESCRIPTION - See Also:
- Constant Field Values
 
 - 
KEY_SR_APPLICABILITY_EXPRESSIONpublic static final String KEY_SR_APPLICABILITY_EXPRESSION - See Also:
- Constant Field Values
 
 - 
KEY_SR_SUBMITTABILITY_EXPRESSIONpublic static final String KEY_SR_SUBMITTABILITY_EXPRESSION - See Also:
- Constant Field Values
 
 - 
KEY_SR_OVERRIDE_EXPRESSIONpublic static final String KEY_SR_OVERRIDE_EXPRESSION - See Also:
- Constant Field Values
 
 - 
KEY_SR_OVERRIDE_IN_CHILD_PROJECTSpublic static final String KEY_SR_OVERRIDE_IN_CHILD_PROJECTS - See Also:
- Constant Field Values
 
 - 
KEY_MATCHpublic static final String KEY_MATCH - See Also:
- Constant Field Values
 
 - 
KEY_LINKpublic static final String KEY_LINK - See Also:
- Constant Field Values
 
 - 
KEY_ENABLEDpublic static final String KEY_ENABLED - See Also:
- Constant Field Values
 
 - 
PROJECT_CONFIGpublic static final String PROJECT_CONFIG - See Also:
- Constant Field Values
 
 - 
ACCESSpublic static final String ACCESS - See Also:
- Constant Field Values
 
 
- 
 - 
Method Detail- 
getCacheablepublic CachedProjectConfig getCacheable() Returns an immutable, thread-safe representation of this object that can be cached.
 - 
buildCommentLinkpublic static StoredCommentLinkInfo buildCommentLink(org.eclipse.jgit.lib.Config cfg, String name, boolean allowRaw) throws IllegalArgumentException - Throws:
- IllegalArgumentException
 
 - 
addCommentLinkSectionpublic void addCommentLinkSection(StoredCommentLinkInfo commentLink) 
 - 
removeCommentLinkSectionpublic void removeCommentLinkSection(String name) 
 - 
loadpublic void load(org.eclipse.jgit.lib.Repository repo) throws IOException, org.eclipse.jgit.errors.ConfigInvalidException- Throws:
- IOException
- org.eclipse.jgit.errors.ConfigInvalidException
 
 - 
loadpublic void load(org.eclipse.jgit.lib.Repository repo, org.eclipse.jgit.lib.ObjectId revision) throws IOException, org.eclipse.jgit.errors.ConfigInvalidException- Throws:
- IOException
- org.eclipse.jgit.errors.ConfigInvalidException
 
 - 
loadpublic void load(org.eclipse.jgit.revwalk.RevWalk rw, org.eclipse.jgit.lib.ObjectId revision) throws IOException, org.eclipse.jgit.errors.ConfigInvalidException- Throws:
- IOException
- org.eclipse.jgit.errors.ConfigInvalidException
 
 - 
getNamepublic Project.NameKey getName() 
 - 
getProjectpublic Project getProject() 
 - 
setProjectpublic void setProject(Project.Builder project) 
 - 
updateProjectpublic void updateProject(Consumer<Project.Builder> update) 
 - 
getAccountsSectionpublic AccountsSection getAccountsSection() 
 - 
setAccountsSectionpublic void setAccountsSection(AccountsSection accountsSection) 
 - 
getAccessSectionpublic AccessSection getAccessSection(String name) Returns an access section,nametypically is a ref pattern.
 - 
upsertAccessSectionpublic void upsertAccessSection(String name, Consumer<AccessSection.Builder> update) 
 - 
getAccessSectionspublic Collection<AccessSection> getAccessSections() 
 - 
getBranchOrderSectionpublic BranchOrderSection getBranchOrderSection() 
 - 
setBranchOrderSectionpublic void setBranchOrderSection(BranchOrderSection branchOrderSection) 
 - 
getSubscribeSectionspublic Map<Project.NameKey,SubscribeSection> getSubscribeSections() 
 - 
addSubscribeSectionpublic void addSubscribeSection(SubscribeSection s) 
 - 
removepublic void remove(AccessSection section) 
 - 
removepublic void remove(AccessSection section, Permission permission) 
 - 
removepublic void remove(AccessSection section, Permission permission, PermissionRule rule) 
 - 
getContributorAgreementpublic ContributorAgreement getContributorAgreement(String name) 
 - 
getContributorAgreementspublic Collection<ContributorAgreement> getContributorAgreements() 
 - 
removepublic void remove(ContributorAgreement section) 
 - 
replacepublic void replace(ContributorAgreement section) 
 - 
getNotifyConfigspublic Collection<NotifyConfig> getNotifyConfigs() 
 - 
putNotifyConfigpublic void putNotifyConfig(String name, NotifyConfig nc) 
 - 
getSubmitRequirementSectionspublic Map<String,SubmitRequirement> getSubmitRequirementSections() 
 - 
upsertSubmitRequirementpublic void upsertSubmitRequirement(SubmitRequirement requirement) 
 - 
upsertLabelTypepublic void upsertLabelType(LabelType labelType) Adds or replaces the givenLabelTypein this config.
 - 
updateLabelTypepublic void updateLabelType(String name, Consumer<LabelType.Builder> update) Allows a mutation of an existingLabelType.
 - 
upsertContributorAgreementpublic void upsertContributorAgreement(ContributorAgreement ca) Adds or replaces the givenContributorAgreementin this config.
 - 
getCommentLinkSectionspublic Collection<StoredCommentLinkInfo> getCommentLinkSections() 
 - 
getMimeTypespublic ConfiguredMimeTypes getMimeTypes() 
 - 
resolvepublic GroupReference resolve(GroupReference group) 
 - 
renameGrouppublic void renameGroup(AccountGroup.UUID uuid, String newName) 
 - 
getGrouppublic GroupReference getGroup(AccountGroup.UUID uuid) Returns the group reference, if the group is used by at least one rule.
 - 
getGrouppublic GroupReference getGroup(String groupName) Returns the group reference corresponding to the specified group name if the group is used by at least one rule or plugin value.
 - 
getRulesIdpublic org.eclipse.jgit.lib.ObjectId getRulesId() Returns the project's rules.pl ObjectId, if present in the branch. Null if it doesn't exist.
 - 
getMaxObjectSizeLimitpublic long getMaxObjectSizeLimit() Returns the maxObjectSizeLimit configured on this project, or zero if not configured.
 - 
getCheckReceivedObjectspublic boolean getCheckReceivedObjects() Returns the checkReceivedObjects for this project, default is true.
 - 
updateGroupNamespublic boolean updateGroupNames(GroupBackend groupBackend) Check all GroupReferences use current group name, repairing stale ones.- Parameters:
- groupBackend- cache to use when looking up group information by UUID.
- Returns:
- true if one or more group names was stale.
 
 - 
getValidationErrorspublic List<ValidationError> getValidationErrors() Get the validation errors, if any were discovered during load.- Returns:
- list of errors; empty list if there are no errors.
 
 - 
getRefNameprotected String getRefName() Description copied from class:VersionedMetaDataReturns name of the reference storing this configuration.- Specified by:
- getRefNamein class- VersionedMetaData
 
 - 
onLoadprotected void onLoad() throws IOException, org.eclipse.jgit.errors.ConfigInvalidExceptionDescription copied from class:VersionedMetaDataSet up the metadata, parsing any state from the loaded revision.- Specified by:
- onLoadin class- VersionedMetaData
- Throws:
- IOException
- org.eclipse.jgit.errors.ConfigInvalidException
 
 - 
updatePluginConfigpublic void updatePluginConfig(String pluginName, Consumer<PluginConfig.Update> pluginConfigUpdate) 
 - 
getPluginConfigpublic PluginConfig getPluginConfig(String pluginName) 
 - 
onSaveprotected boolean onSave(org.eclipse.jgit.lib.CommitBuilder commit) throws IOException, org.eclipse.jgit.errors.ConfigInvalidExceptionDescription copied from class:VersionedMetaDataSave any changes to the metadata in a commit.- Specified by:
- onSavein class- VersionedMetaData
- Returns:
- true if the commit should proceed, false to abort.
- Throws:
- IOException
- org.eclipse.jgit.errors.ConfigInvalidException
 
 - 
validMaxObjectSizeLimitpublic static String validMaxObjectSizeLimit(String value) throws org.eclipse.jgit.errors.ConfigInvalidException - Throws:
- org.eclipse.jgit.errors.ConfigInvalidException
 
 - 
errorpublic void error(ValidationError error) - Specified by:
- errorin interface- ValidationError.Sink
 
 - 
hasLegacyPermissionspublic boolean hasLegacyPermissions() 
 
- 
 
-