diff options
Diffstat (limited to 'config-model/src/main/java/com/yahoo/config')
4 files changed, 10 insertions, 18 deletions
diff --git a/config-model/src/main/java/com/yahoo/config/model/ApplicationConfigProducerRoot.java b/config-model/src/main/java/com/yahoo/config/model/ApplicationConfigProducerRoot.java index 46ec84caf24..e6df94c8855 100644 --- a/config-model/src/main/java/com/yahoo/config/model/ApplicationConfigProducerRoot.java +++ b/config-model/src/main/java/com/yahoo/config/model/ApplicationConfigProducerRoot.java @@ -130,7 +130,7 @@ public class ApplicationConfigProducerRoot extends AbstractConfigProducer<Abstra if (admin != null) { Routing routing = configModels.getRouting(); if (routing == null) { - routing = new Routing(ConfigModelContext.create(configModels, this, "routing", Optional.empty())); + routing = new Routing(ConfigModelContext.create(configModels, this, "routing")); configModels.add(routing); } this.routing = routing; diff --git a/config-model/src/main/java/com/yahoo/config/model/ConfigModelContext.java b/config-model/src/main/java/com/yahoo/config/model/ConfigModelContext.java index edd0ed4bf29..b5382b09193 100644 --- a/config-model/src/main/java/com/yahoo/config/model/ConfigModelContext.java +++ b/config-model/src/main/java/com/yahoo/config/model/ConfigModelContext.java @@ -22,15 +22,13 @@ public class ConfigModelContext { private final String producerId; private final DeployState deployState; private final ConfigModelRepoAdder configModelRepoAdder; - private final Optional<Element> servicesElement; private ConfigModelContext(DeployState deployState, ConfigModelRepoAdder configModelRepoAdder, - AbstractConfigProducer parent, String producerId, Optional<Element> servicesElement) { + AbstractConfigProducer parent, String producerId) { this.deployState = deployState; this.configModelRepoAdder = configModelRepoAdder; this.parent = parent; this.producerId = producerId; - this.servicesElement = servicesElement; } public ApplicationPackage getApplicationPackage() { return deployState.getApplicationPackage(); } @@ -38,20 +36,18 @@ public class ConfigModelContext { public AbstractConfigProducer getParentProducer() { return parent; } public DeployLogger getDeployLogger() { return deployState.getDeployLogger(); } public DeployState getDeployState() { return deployState; } - /** Returns the services element (root) in which this model needs to be built, if any */ - public Optional<Element> servicesElement() { return servicesElement; } /** Returns write access to the config model repo, or null (only) if this is improperly initialized during testing */ public ConfigModelRepoAdder getConfigModelRepoAdder() { return configModelRepoAdder; } /** Create a new context with a different parent */ public ConfigModelContext withParent(AbstractConfigProducer newParent) { - return ConfigModelContext.create(deployState, configModelRepoAdder, newParent, producerId, servicesElement); + return ConfigModelContext.create(deployState, configModelRepoAdder, newParent, producerId); } /** Create a new context with a different config model producer id */ public ConfigModelContext withId(String producerId) { - return ConfigModelContext.create(deployState, configModelRepoAdder, parent, producerId, servicesElement); + return ConfigModelContext.create(deployState, configModelRepoAdder, parent, producerId); } /** @@ -60,12 +56,11 @@ public class ConfigModelContext { * @param deployState the global deploy state for this model * @param parent the parent to be used for the config model * @param producerId the id to be used for the config model - * @param servicesElement the services element (root) in which this model needs to be built, if any * @return a model context that can be passed to a model */ public static ConfigModelContext create(DeployState deployState, ConfigModelRepoAdder configModelRepoAdder, - AbstractConfigProducer parent, String producerId, Optional<Element> servicesElement) { - return new ConfigModelContext(deployState, configModelRepoAdder, parent, producerId, servicesElement); + AbstractConfigProducer parent, String producerId) { + return new ConfigModelContext(deployState, configModelRepoAdder, parent, producerId); } /** @@ -73,12 +68,11 @@ public class ConfigModelContext { * * @param parent the parent to be used for the config model. * @param producerId the id to be used for the config model. - * @param servicesElement the services element (root) in which this model needs to be built, if any * @return a model context that can be passed to a model. */ public static ConfigModelContext create(ConfigModelRepoAdder configModelRepoAdder, - AbstractConfigProducer parent, String producerId, Optional<Element> servicesElement) { - return create(parent.getRoot().getDeployState(), configModelRepoAdder, parent, producerId, servicesElement); + AbstractConfigProducer parent, String producerId) { + return create(parent.getRoot().getDeployState(), configModelRepoAdder, parent, producerId); } } diff --git a/config-model/src/main/java/com/yahoo/config/model/ConfigModelRepo.java b/config-model/src/main/java/com/yahoo/config/model/ConfigModelRepo.java index 91142ccbeae..d4b6751c356 100644 --- a/config-model/src/main/java/com/yahoo/config/model/ConfigModelRepo.java +++ b/config-model/src/main/java/com/yahoo/config/model/ConfigModelRepo.java @@ -174,8 +174,7 @@ public class ConfigModelRepo implements ConfigModelRepoAdder, Serializable, Iter private ConfigModel buildModel(ModelNode node, DeployState deployState, AbstractConfigProducer parent, Element servicesElement) { ConfigModelBuilder builder = node.builder; - ConfigModelContext context = ConfigModelContext.create(deployState, this, parent, - getIdString(servicesElement), Optional.of(servicesElement)); + ConfigModelContext context = ConfigModelContext.create(deployState, this, parent, getIdString(servicesElement)); return builder.build(node, servicesElement, context); } diff --git a/config-model/src/main/java/com/yahoo/config/model/builder/xml/ConfigModelBuilder.java b/config-model/src/main/java/com/yahoo/config/model/builder/xml/ConfigModelBuilder.java index 4fed0a8aa41..37da769ae33 100644 --- a/config-model/src/main/java/com/yahoo/config/model/builder/xml/ConfigModelBuilder.java +++ b/config-model/src/main/java/com/yahoo/config/model/builder/xml/ConfigModelBuilder.java @@ -57,8 +57,7 @@ public abstract class ConfigModelBuilder<MODEL extends ConfigModel> extends Abst */ public final MODEL build(DeployState deployState, ConfigModelRepo configModelRepo, AbstractConfigProducer parent, Element spec) { - ConfigModelContext context = ConfigModelContext.create(deployState, configModelRepo, parent, - getIdString(spec), Optional.empty()); + ConfigModelContext context = ConfigModelContext.create(deployState, configModelRepo, parent, getIdString(spec)); return build(new DefaultModelInstanceFactory(), spec, context); } |