public class ProjectConfig extends VersionedMetaData implements ValidationError.Sink
VersionedMetaData.BatchMetaDataUpdate, VersionedMetaData.PathInfo
Modifier and Type | Field and Description |
---|---|
static String |
COMMENTLINK |
static String |
PROJECT_CONFIG |
inserter, newTree, reader, revision
Constructor and Description |
---|
ProjectConfig(com.google.gerrit.reviewdb.client.Project.NameKey projectName) |
Modifier and Type | Method and Description |
---|---|
void |
addSubscribeSection(com.google.gerrit.common.data.SubscribeSection s) |
static CommentLinkInfoImpl |
buildCommentLink(org.eclipse.jgit.lib.Config cfg,
String name,
boolean allowRaw) |
void |
error(ValidationError error) |
com.google.gerrit.common.data.AccessSection |
getAccessSection(String name) |
com.google.gerrit.common.data.AccessSection |
getAccessSection(String name,
boolean create) |
Collection<com.google.gerrit.common.data.AccessSection> |
getAccessSections() |
AccountsSection |
getAccountsSection() |
Set<com.google.gerrit.reviewdb.client.AccountGroup.UUID> |
getAllGroupUUIDs() |
BranchOrderSection |
getBranchOrderSection() |
boolean |
getCheckReceivedObjects() |
Collection<CommentLinkInfoImpl> |
getCommentLinkSections() |
com.google.gerrit.common.data.ContributorAgreement |
getContributorAgreement(String name) |
com.google.gerrit.common.data.ContributorAgreement |
getContributorAgreement(String name,
boolean create) |
Collection<com.google.gerrit.common.data.ContributorAgreement> |
getContributorAgreements() |
com.google.gerrit.common.data.GroupReference |
getGroup(com.google.gerrit.reviewdb.client.AccountGroup.UUID uuid) |
Map<String,com.google.gerrit.common.data.LabelType> |
getLabelSections() |
long |
getMaxObjectSizeLimit() |
ConfiguredMimeTypes |
getMimeTypes() |
com.google.gerrit.reviewdb.client.Project.NameKey |
getName() |
Collection<NotifyConfig> |
getNotifyConfigs() |
PluginConfig |
getPluginConfig(String pluginName) |
com.google.gerrit.reviewdb.client.Project |
getProject() |
protected String |
getRefName() |
org.eclipse.jgit.lib.ObjectId |
getRulesId() |
Collection<com.google.gerrit.common.data.SubscribeSection> |
getSubscribeSections(com.google.gerrit.reviewdb.client.Branch.NameKey branch) |
List<ValidationError> |
getValidationErrors()
Get the validation errors, if any were discovered during load.
|
protected void |
onLoad()
Set up the metadata, parsing any state from the loaded revision.
|
protected boolean |
onSave(org.eclipse.jgit.lib.CommitBuilder commit)
Save any changes to the metadata in a commit.
|
void |
putNotifyConfig(String name,
NotifyConfig nc) |
static ProjectConfig |
read(MetaDataUpdate update) |
static ProjectConfig |
read(MetaDataUpdate update,
org.eclipse.jgit.lib.ObjectId id) |
void |
remove(com.google.gerrit.common.data.AccessSection section) |
void |
remove(com.google.gerrit.common.data.AccessSection section,
com.google.gerrit.common.data.Permission permission) |
void |
remove(com.google.gerrit.common.data.AccessSection section,
com.google.gerrit.common.data.Permission permission,
com.google.gerrit.common.data.PermissionRule rule) |
void |
remove(com.google.gerrit.common.data.ContributorAgreement section) |
void |
replace(com.google.gerrit.common.data.AccessSection section) |
void |
replace(com.google.gerrit.common.data.ContributorAgreement section) |
com.google.gerrit.common.data.GroupReference |
resolve(com.google.gerrit.reviewdb.client.AccountGroup group) |
com.google.gerrit.common.data.GroupReference |
resolve(com.google.gerrit.common.data.GroupReference group) |
boolean |
updateGroupNames(GroupBackend groupBackend)
Check all GroupReferences use current group name, repairing stale ones.
|
static String |
validMaxObjectSizeLimit(String value) |
commit, commitToNewRef, getObjectId, getPathInfos, getRevision, load, load, load, load, load, openUpdate, readConfig, readFile, readTree, readUTF8, saveConfig, saveFile, saveUTF8, set, set, set
public static final String COMMENTLINK
public static final String PROJECT_CONFIG
public ProjectConfig(com.google.gerrit.reviewdb.client.Project.NameKey projectName)
public static ProjectConfig read(MetaDataUpdate update) throws IOException, org.eclipse.jgit.errors.ConfigInvalidException
IOException
org.eclipse.jgit.errors.ConfigInvalidException
public static ProjectConfig read(MetaDataUpdate update, org.eclipse.jgit.lib.ObjectId id) throws IOException, org.eclipse.jgit.errors.ConfigInvalidException
IOException
org.eclipse.jgit.errors.ConfigInvalidException
public static CommentLinkInfoImpl buildCommentLink(org.eclipse.jgit.lib.Config cfg, String name, boolean allowRaw) throws IllegalArgumentException
IllegalArgumentException
public com.google.gerrit.reviewdb.client.Project.NameKey getName()
public com.google.gerrit.reviewdb.client.Project getProject()
public AccountsSection getAccountsSection()
public com.google.gerrit.common.data.AccessSection getAccessSection(String name)
public com.google.gerrit.common.data.AccessSection getAccessSection(String name, boolean create)
public Collection<com.google.gerrit.common.data.AccessSection> getAccessSections()
public BranchOrderSection getBranchOrderSection()
public Collection<com.google.gerrit.common.data.SubscribeSection> getSubscribeSections(com.google.gerrit.reviewdb.client.Branch.NameKey branch)
public void addSubscribeSection(com.google.gerrit.common.data.SubscribeSection s)
public void remove(com.google.gerrit.common.data.AccessSection section)
public void remove(com.google.gerrit.common.data.AccessSection section, com.google.gerrit.common.data.Permission permission)
public void remove(com.google.gerrit.common.data.AccessSection section, com.google.gerrit.common.data.Permission permission, com.google.gerrit.common.data.PermissionRule rule)
public void replace(com.google.gerrit.common.data.AccessSection section)
public com.google.gerrit.common.data.ContributorAgreement getContributorAgreement(String name)
public com.google.gerrit.common.data.ContributorAgreement getContributorAgreement(String name, boolean create)
public Collection<com.google.gerrit.common.data.ContributorAgreement> getContributorAgreements()
public void remove(com.google.gerrit.common.data.ContributorAgreement section)
public void replace(com.google.gerrit.common.data.ContributorAgreement section)
public Collection<NotifyConfig> getNotifyConfigs()
public void putNotifyConfig(String name, NotifyConfig nc)
public Collection<CommentLinkInfoImpl> getCommentLinkSections()
public ConfiguredMimeTypes getMimeTypes()
public com.google.gerrit.common.data.GroupReference resolve(com.google.gerrit.reviewdb.client.AccountGroup group)
public com.google.gerrit.common.data.GroupReference resolve(com.google.gerrit.common.data.GroupReference group)
public com.google.gerrit.common.data.GroupReference getGroup(com.google.gerrit.reviewdb.client.AccountGroup.UUID uuid)
public Set<com.google.gerrit.reviewdb.client.AccountGroup.UUID> getAllGroupUUIDs()
public org.eclipse.jgit.lib.ObjectId getRulesId()
public long getMaxObjectSizeLimit()
public boolean getCheckReceivedObjects()
public boolean updateGroupNames(GroupBackend groupBackend)
groupBackend
- cache to use when looking up group information by UUID.public List<ValidationError> getValidationErrors()
protected String getRefName()
getRefName
in class VersionedMetaData
protected void onLoad() throws IOException, org.eclipse.jgit.errors.ConfigInvalidException
VersionedMetaData
onLoad
in class VersionedMetaData
IOException
org.eclipse.jgit.errors.ConfigInvalidException
public PluginConfig getPluginConfig(String pluginName)
protected boolean onSave(org.eclipse.jgit.lib.CommitBuilder commit) throws IOException, org.eclipse.jgit.errors.ConfigInvalidException
VersionedMetaData
onSave
in class VersionedMetaData
IOException
org.eclipse.jgit.errors.ConfigInvalidException
public static final String validMaxObjectSizeLimit(String value) throws org.eclipse.jgit.errors.ConfigInvalidException
org.eclipse.jgit.errors.ConfigInvalidException
public void error(ValidationError error)
error
in interface ValidationError.Sink