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 Summary
Nested Classes Modifier and Type Class Description static class
ProjectConfig.Factory
-
Nested classes/interfaces inherited from class com.google.gerrit.server.git.meta.VersionedMetaData
VersionedMetaData.BatchMetaDataUpdate, VersionedMetaData.PathInfo
-
-
Field Summary
Fields Modifier and Type Field Description static String
ACCESS
static String
COMMENTLINK
static String
KEY_ALLOW_POST_SUBMIT
static String
KEY_BRANCH
static String
KEY_CAN_OVERRIDE
static String
KEY_COPY_ALL_SCORES_IF_NO_CHANGE
static String
KEY_COPY_ALL_SCORES_IF_NO_CODE_CHANGE
static String
KEY_COPY_ALL_SCORES_ON_MERGE_FIRST_PARENT_UPDATE
static String
KEY_COPY_ALL_SCORES_ON_TRIVIAL_REBASE
static String
KEY_COPY_MAX_SCORE
static String
KEY_COPY_MIN_SCORE
static String
KEY_DEFAULT_VALUE
static String
KEY_FUNCTION
static String
KEY_IGNORE_SELF_APPROVAL
static String
KEY_VALUE
static String
LABEL
static String
PROJECT_CONFIG
-
Fields inherited from class com.google.gerrit.server.git.meta.VersionedMetaData
inserter, newTree, projectName, reader, revision, rw
-
-
Method Summary
-
Methods inherited from class com.google.gerrit.server.git.meta.VersionedMetaData
commit, commitToNewRef, getObjectId, getPathInfos, getRevision, load, load, load, load, load, openUpdate, readConfig, readConfig, readFile, readTree, readUTF8, saveConfig, saveFile, saveUTF8, set, set, set
-
-
-
-
Field Detail
-
COMMENTLINK
public static final String COMMENTLINK
- See Also:
- Constant Field Values
-
LABEL
public static final String LABEL
- See Also:
- Constant Field Values
-
KEY_FUNCTION
public static final String KEY_FUNCTION
- See Also:
- Constant Field Values
-
KEY_DEFAULT_VALUE
public static final String KEY_DEFAULT_VALUE
- See Also:
- Constant Field Values
-
KEY_COPY_MIN_SCORE
public static final String KEY_COPY_MIN_SCORE
- See Also:
- Constant Field Values
-
KEY_ALLOW_POST_SUBMIT
public static final String KEY_ALLOW_POST_SUBMIT
- See Also:
- Constant Field Values
-
KEY_IGNORE_SELF_APPROVAL
public static final String KEY_IGNORE_SELF_APPROVAL
- See Also:
- Constant Field Values
-
KEY_COPY_MAX_SCORE
public static final String KEY_COPY_MAX_SCORE
- See Also:
- Constant Field Values
-
KEY_COPY_ALL_SCORES_ON_MERGE_FIRST_PARENT_UPDATE
public static final String KEY_COPY_ALL_SCORES_ON_MERGE_FIRST_PARENT_UPDATE
- See Also:
- Constant Field Values
-
KEY_COPY_ALL_SCORES_ON_TRIVIAL_REBASE
public static final String KEY_COPY_ALL_SCORES_ON_TRIVIAL_REBASE
- See Also:
- Constant Field Values
-
KEY_COPY_ALL_SCORES_IF_NO_CODE_CHANGE
public static final String KEY_COPY_ALL_SCORES_IF_NO_CODE_CHANGE
- See Also:
- Constant Field Values
-
KEY_COPY_ALL_SCORES_IF_NO_CHANGE
public static final String KEY_COPY_ALL_SCORES_IF_NO_CHANGE
- See Also:
- Constant Field Values
-
KEY_VALUE
public static final String KEY_VALUE
- See Also:
- Constant Field Values
-
KEY_CAN_OVERRIDE
public static final String KEY_CAN_OVERRIDE
- See Also:
- Constant Field Values
-
KEY_BRANCH
public static final String KEY_BRANCH
- See Also:
- Constant Field Values
-
PROJECT_CONFIG
public static final String PROJECT_CONFIG
- See Also:
- Constant Field Values
-
ACCESS
public static final String ACCESS
- See Also:
- Constant Field Values
-
-
Method Detail
-
buildCommentLink
public static CommentLinkInfoImpl buildCommentLink(org.eclipse.jgit.lib.Config cfg, String name, boolean allowRaw) throws IllegalArgumentException
- Throws:
IllegalArgumentException
-
addCommentLinkSection
public void addCommentLinkSection(CommentLinkInfoImpl commentLink)
-
load
public void load(org.eclipse.jgit.lib.Repository repo) throws IOException, org.eclipse.jgit.errors.ConfigInvalidException
- Throws:
IOException
org.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:
IOException
org.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:
IOException
org.eclipse.jgit.errors.ConfigInvalidException
-
getName
public Project.NameKey getName()
-
getProject
public Project getProject()
-
getAccountsSection
public AccountsSection getAccountsSection()
-
getAccessSection
public AccessSection getAccessSection(String name)
-
getAccessSection
public AccessSection getAccessSection(String name, boolean create)
-
getAccessSections
public Collection<AccessSection> getAccessSections()
-
getBranchOrderSection
public BranchOrderSection getBranchOrderSection()
-
getSubscribeSections
public Map<Project.NameKey,SubscribeSection> getSubscribeSections()
-
getSubscribeSections
public Collection<SubscribeSection> getSubscribeSections(Branch.NameKey branch)
-
addSubscribeSection
public void addSubscribeSection(SubscribeSection s)
-
remove
public void remove(AccessSection section)
-
remove
public void remove(AccessSection section, Permission permission)
-
remove
public void remove(AccessSection section, Permission permission, PermissionRule rule)
-
replace
public void replace(AccessSection section)
-
getContributorAgreement
public ContributorAgreement getContributorAgreement(String name)
-
getContributorAgreement
public ContributorAgreement getContributorAgreement(String name, boolean create)
-
getContributorAgreements
public Collection<ContributorAgreement> getContributorAgreements()
-
remove
public void remove(ContributorAgreement section)
-
replace
public void replace(ContributorAgreement section)
-
getNotifyConfigs
public Collection<NotifyConfig> getNotifyConfigs()
-
putNotifyConfig
public void putNotifyConfig(String name, NotifyConfig nc)
-
getCommentLinkSections
public Collection<CommentLinkInfoImpl> getCommentLinkSections()
-
getMimeTypes
public ConfiguredMimeTypes getMimeTypes()
-
resolve
public GroupReference resolve(GroupReference group)
-
getGroup
public GroupReference getGroup(AccountGroup.UUID uuid)
- Returns:
- the group reference, if the group is used by at least one rule.
-
getGroup
public 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.
-
getAllGroupUUIDs
public Set<AccountGroup.UUID> getAllGroupUUIDs()
- Returns:
- set of all groups used by this configuration.
-
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
public 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.
-
getValidationErrors
public List<ValidationError> getValidationErrors()
Get the validation errors, if any were discovered during load.- Returns:
- list of errors; empty list if there are no errors.
-
getRefName
protected String getRefName()
- Specified by:
getRefName
in classVersionedMetaData
- Returns:
- name of the reference storing this configuration.
-
onLoad
protected void onLoad() throws IOException, org.eclipse.jgit.errors.ConfigInvalidException
Description copied from class:VersionedMetaData
Set up the metadata, parsing any state from the loaded revision.- Specified by:
onLoad
in classVersionedMetaData
- Throws:
IOException
org.eclipse.jgit.errors.ConfigInvalidException
-
getPluginConfig
public PluginConfig getPluginConfig(String pluginName)
-
onSave
protected boolean onSave(org.eclipse.jgit.lib.CommitBuilder commit) throws IOException, org.eclipse.jgit.errors.ConfigInvalidException
Description copied from class:VersionedMetaData
Save any changes to the metadata in a commit.- Specified by:
onSave
in classVersionedMetaData
- Returns:
- true if the commit should proceed, false to abort.
- Throws:
IOException
org.eclipse.jgit.errors.ConfigInvalidException
-
validMaxObjectSizeLimit
public static String validMaxObjectSizeLimit(String value) throws org.eclipse.jgit.errors.ConfigInvalidException
- Throws:
org.eclipse.jgit.errors.ConfigInvalidException
-
error
public void error(ValidationError error)
- Specified by:
error
in interfaceValidationError.Sink
-
hasLegacyPermissions
public boolean hasLegacyPermissions()
-
-