ConfigInfo: Move to extension API

Change-Id: I165b1afbae4acb027b08c590256515f863478d7b
This commit is contained in:
David Pursehouse
2016-06-21 13:53:47 +09:00
parent 8219d818a7
commit fa5f097af2
18 changed files with 181 additions and 110 deletions

View File

@@ -18,8 +18,10 @@ import com.google.common.base.CharMatcher;
import com.google.common.base.Joiner;
import com.google.common.base.Strings;
import com.google.gerrit.common.ChangeHooks;
import com.google.gerrit.extensions.api.projects.ConfigInfo;
import com.google.gerrit.extensions.api.projects.ConfigInput;
import com.google.gerrit.extensions.api.projects.ConfigValue;
import com.google.gerrit.extensions.api.projects.ProjectConfigEntryType;
import com.google.gerrit.extensions.registration.DynamicMap;
import com.google.gerrit.extensions.restapi.BadRequestException;
import com.google.gerrit.extensions.restapi.ResourceConflictException;
@@ -197,7 +199,7 @@ public class PutConfig implements RestModifyView<ProjectResource, ConfigInput> {
}
ProjectState state = projectStateFactory.create(projectConfig);
return new ConfigInfo(serverEnableSignedPush,
return new ConfigInfoImpl(serverEnableSignedPush,
state.controlFor(user.get()), config, pluginConfigEntries,
cfgFactory, allProjects, views);
} catch (RepositoryNotFoundException notFound) {
@@ -226,7 +228,7 @@ public class PutConfig implements RestModifyView<ProjectResource, ConfigInput> {
}
String oldValue = cfg.getString(v.getKey());
String value = v.getValue().value;
if (projectConfigEntry.getType() == ProjectConfigEntry.Type.ARRAY) {
if (projectConfigEntry.getType() == ProjectConfigEntryType.ARRAY) {
List<String> l = Arrays.asList(cfg.getStringList(v.getKey()));
oldValue = Joiner.on("\n").join(l);
value = Joiner.on("\n").join(v.getValue().values);