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 Summary
Nested ClassesNested classes/interfaces inherited from class com.google.gerrit.server.git.meta.VersionedMetaData
VersionedMetaData.BatchMetaDataUpdate, VersionedMetaData.PathInfo -
Field Summary
FieldsModifier 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.VersionedMetaData
inserter, newTree, projectName, reader, revision, rw -
Method Summary
Modifier 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.VersionedMetaData
commit, 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
-
getCacheable
Returns an immutable, thread-safe representation of this object that can be cached. -
buildCommentLink
public static StoredCommentLinkInfo buildCommentLink(org.eclipse.jgit.lib.Config cfg, String name) throws IllegalArgumentException - Throws:
IllegalArgumentException
-
addCommentLinkSection
-
removeCommentLinkSection
-
load
public void load(org.eclipse.jgit.lib.Repository repo) throws IOException, org.eclipse.jgit.errors.ConfigInvalidException - Throws:
IOExceptionorg.eclipse.jgit.errors.ConfigInvalidException
-
load
public void load(org.eclipse.jgit.lib.Repository repo, org.eclipse.jgit.lib.ObjectId revision) throws IOException, org.eclipse.jgit.errors.ConfigInvalidException - Throws:
IOExceptionorg.eclipse.jgit.errors.ConfigInvalidException
-
load
public void load(org.eclipse.jgit.revwalk.RevWalk rw, org.eclipse.jgit.lib.ObjectId revision) throws IOException, org.eclipse.jgit.errors.ConfigInvalidException - Throws:
IOExceptionorg.eclipse.jgit.errors.ConfigInvalidException
-
getName
-
getProject
-
setProject
-
updateProject
-
getAccountsSection
-
setAccountsSection
-
getAccessSection
Returns an access section,nametypically is a ref pattern. -
upsertAccessSection
-
getAccessSections
-
getBranchOrderSection
-
setBranchOrderSection
-
getSubscribeSections
-
addSubscribeSection
-
remove
-
remove
-
remove
-
getContributorAgreement
-
getContributorAgreements
-
replace
-
getNotifyConfigs
-
putNotifyConfig
-
getLabelSections
-
getSubmitRequirementSections
-
upsertSubmitRequirement
Adds or replaces the givenSubmitRequirementin this config. -
clearSubmitRequirements
public void clearSubmitRequirements() -
upsertLabelType
Adds or replaces the givenLabelTypein this config. -
updateLabelType
Allows a mutation of an existingLabelType. -
upsertContributorAgreement
Adds or replaces the givenContributorAgreementin this config. -
getCommentLinkSections
-
getMimeTypes
-
resolve
-
renameGroup
-
getGroup
Returns the group reference, if the group is used by at least one rule. -
getGroup
Returns the group reference corresponding to the specified group name if the group is used by at least one rule or plugin value. -
getRulesId
public org.eclipse.jgit.lib.ObjectId getRulesId()Returns the project's rules.pl ObjectId, if present in the branch. Null if it doesn't exist. -
getMaxObjectSizeLimit
public long getMaxObjectSizeLimit()Returns the maxObjectSizeLimit configured on this project, or zero if not configured. -
getCheckReceivedObjects
public boolean getCheckReceivedObjects()Returns the checkReceivedObjects for this project, default is true. -
updateGroupNames
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.
-
getValidationErrors
Get the validation errors, if any were discovered during load.- Returns:
- list of errors; empty list if there are no errors.
-
getRefName
Description copied from class:VersionedMetaDataReturns name of the reference storing this configuration.- Specified by:
getRefNamein classVersionedMetaData
-
onLoad
Description copied from class:VersionedMetaDataSet up the metadata, parsing any state from the loaded revision.- Specified by:
onLoadin classVersionedMetaData- Throws:
IOExceptionorg.eclipse.jgit.errors.ConfigInvalidException
-
updatePluginConfig
-
getPluginConfig
-
onSave
protected 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 classVersionedMetaData- Returns:
- true if the commit should proceed, false to abort.
- Throws:
IOExceptionorg.eclipse.jgit.errors.ConfigInvalidException
-
validMaxObjectSizeLimit
public static String validMaxObjectSizeLimit(String value) throws org.eclipse.jgit.errors.ConfigInvalidException - Throws:
org.eclipse.jgit.errors.ConfigInvalidException
-
error
- Specified by:
errorin interfaceValidationError.Sink
-
hasLegacyPermissions
public boolean hasLegacyPermissions()
-