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
- 
Nested Class SummaryNested ClassesNested classes/interfaces inherited from class com.google.gerrit.server.git.meta.VersionedMetaDataVersionedMetaData.BatchMetaDataUpdate, VersionedMetaData.PathInfo
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final com.google.common.collect.ImmutableSet<String> static final StringFields inherited from class com.google.gerrit.server.git.meta.VersionedMetaDatainserter, newTree, projectName, reader, revision, rw
- 
Method SummaryModifier and TypeMethodDescriptionvoidaddCommentLinkSection(StoredCommentLinkInfo commentLink) voidstatic StoredCommentLinkInfobuildCommentLink(org.eclipse.jgit.lib.Config cfg, String name) voidvoiderror(ValidationError error) getAccessSection(String name) Returns an access section,nametypically is a ref pattern.Returns an immutable, thread-safe representation of this object that can be cached.booleanReturns the checkReceivedObjects for this project, default is true.getGroup(AccountGroup.UUID uuid) Returns the group reference, if the group is used by at least one rule.Returns the group reference corresponding to the specified group name if the group is used by at least one rule or plugin value.longReturns the maxObjectSizeLimit configured on this project, or zero if not configured.getName()getPluginConfig(String pluginName) protected StringReturns name of the reference storing this configuration.org.eclipse.jgit.lib.ObjectIdReturns the project's rules.pl ObjectId, if present in the branch.Get the validation errors, if any were discovered during load.booleanvoidload(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) voidvoidrenameGroup(AccountGroup.UUID uuid, String newName) voidreplace(ContributorAgreement section) resolve(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) voidAdds or replaces the givenContributorAgreementin this config.voidupsertLabelType(LabelType labelType) Adds or replaces the givenLabelTypein this config.voidupsertSubmitRequirement(SubmitRequirement requirement) Adds or replaces the givenSubmitRequirementin this config.static StringvalidMaxObjectSizeLimit(String value) Methods inherited from class com.google.gerrit.server.git.meta.VersionedMetaDatacommit, commit, commit, commitToNewRef, getObjectId, getPathInfos, getRevision, load, load, load, load, load, openUpdate, openUpdate, readConfig, readConfig, readFile, readTree, readUTF8, saveConfig, saveFile, saveUTF8, set, set, set
- 
Field Details- 
RULES_PL_FILE- See Also:
 
- 
COMMENTLINK- See Also:
 
- 
LABEL- See Also:
 
- 
KEY_LABEL_DESCRIPTION- See Also:
 
- 
KEY_FUNCTION- See Also:
 
- 
KEY_DEFAULT_VALUE- See Also:
 
- 
KEY_ALLOW_POST_SUBMIT- See Also:
 
- 
KEY_IGNORE_SELF_APPROVAL- See Also:
 
- 
KEY_COPY_CONDITION- See Also:
 
- 
KEY_VALUE- See Also:
 
- 
KEY_CAN_OVERRIDE- See Also:
 
- 
KEY_BRANCH- See Also:
 
- 
SUBMIT_REQUIREMENT- See Also:
 
- 
KEY_SR_DESCRIPTION- See Also:
 
- 
KEY_SR_APPLICABILITY_EXPRESSION- See Also:
 
- 
KEY_SR_SUBMITTABILITY_EXPRESSION- See Also:
 
- 
KEY_SR_OVERRIDE_EXPRESSION- See Also:
 
- 
KEY_SR_OVERRIDE_IN_CHILD_PROJECTS- See Also:
 
- 
SR_KEYS
- 
KEY_MATCH- See Also:
 
- 
KEY_LINK- See Also:
 
- 
KEY_PREFIX- See Also:
 
- 
KEY_SUFFIX- See Also:
 
- 
KEY_TEXT- See Also:
 
- 
KEY_ENABLED- See Also:
 
- 
PROJECT_CONFIG- See Also:
 
- 
ACCESS- See Also:
 
 
- 
- 
Method Details- 
getCacheableReturns an immutable, thread-safe representation of this object that can be cached.
- 
buildCommentLinkpublic static StoredCommentLinkInfo buildCommentLink(org.eclipse.jgit.lib.Config cfg, String name) throws IllegalArgumentException - Throws:
- IllegalArgumentException
 
- 
addCommentLinkSection
- 
removeCommentLinkSection
- 
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
 
- 
getName
- 
getProject
- 
setProject
- 
updateProject
- 
getAccountsSection
- 
setAccountsSection
- 
getAccessSectionReturns an access section,nametypically is a ref pattern.
- 
upsertAccessSection
- 
getAccessSections
- 
getBranchOrderSection
- 
setBranchOrderSection
- 
getSubscribeSections
- 
addSubscribeSection
- 
remove
- 
remove
- 
remove
- 
getContributorAgreement
- 
getContributorAgreements
- 
replace
- 
getNotifyConfigs
- 
putNotifyConfig
- 
getLabelSections
- 
getSubmitRequirementSections
- 
upsertSubmitRequirementAdds or replaces the givenSubmitRequirementin this config.
- 
clearSubmitRequirementspublic void clearSubmitRequirements()
- 
upsertLabelTypeAdds or replaces the givenLabelTypein this config.
- 
updateLabelTypeAllows a mutation of an existingLabelType.
- 
upsertContributorAgreementAdds or replaces the givenContributorAgreementin this config.
- 
getCommentLinkSections
- 
getMimeTypes
- 
resolve
- 
renameGroup
- 
getGroupReturns the group reference, if the group is used by at least one rule.
- 
getGroupReturns 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.
- 
updateGroupNamesCheck 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.
 
- 
getValidationErrorsGet the validation errors, if any were discovered during load.- Returns:
- list of errors; empty list if there are no errors.
 
- 
getRefNameDescription copied from class:VersionedMetaDataReturns name of the reference storing this configuration.- Specified by:
- getRefNamein class- VersionedMetaData
 
- 
onLoadDescription 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
 
- 
updatePluginConfig
- 
getPluginConfig
- 
onSaveprotected boolean onSave(org.eclipse.jgit.lib.CommitBuilder commit) throws IOException, org.eclipse.jgit.errors.ConfigInvalidException Description 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
 
- 
error- Specified by:
- errorin interface- ValidationError.Sink
 
- 
hasLegacyPermissionspublic boolean hasLegacyPermissions()
 
-