diff options
author | gjoranv <gv@verizonmedia.com> | 2021-06-28 19:14:37 +0200 |
---|---|---|
committer | gjoranv <gv@verizonmedia.com> | 2021-06-28 19:14:37 +0200 |
commit | f3dc1d5a0a36bb698c8471340e90ee8e50e0222d (patch) | |
tree | 0a454da02811cd28e7e8452af9a246b26c4aeaff /config-model | |
parent | 9b7582100d7752185dd94a1dceea5b625c26044c (diff) |
Throw an exception upon 'rest-api' in services.xml.
Diffstat (limited to 'config-model')
-rw-r--r-- | config-model/src/main/java/com/yahoo/vespa/model/container/xml/ContainerModelBuilder.java | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/container/xml/ContainerModelBuilder.java b/config-model/src/main/java/com/yahoo/vespa/model/container/xml/ContainerModelBuilder.java index 67350e634af..3b04d536300 100644 --- a/config-model/src/main/java/com/yahoo/vespa/model/container/xml/ContainerModelBuilder.java +++ b/config-model/src/main/java/com/yahoo/vespa/model/container/xml/ContainerModelBuilder.java @@ -78,7 +78,6 @@ import com.yahoo.vespa.model.container.http.Http; import com.yahoo.vespa.model.container.http.JettyHttpServer; import com.yahoo.vespa.model.container.http.ssl.HostedSslConnectorFactory; import com.yahoo.vespa.model.container.http.xml.HttpBuilder; -import com.yahoo.vespa.model.container.jersey.xml.RestApiBuilder; import com.yahoo.vespa.model.container.processing.ProcessingChains; import com.yahoo.vespa.model.container.search.ContainerSearch; import com.yahoo.vespa.model.container.search.GUIHandler; @@ -185,7 +184,7 @@ public class ContainerModelBuilder extends ConfigModelBuilder<ContainerModel> { addConfiguredComponents(deployState, cluster, spec); addSecretStore(cluster, spec, deployState); - addRestApis(deployState, spec, cluster); + throwUponRestApi(spec); // TODO: remove addServlets(deployState, spec, cluster); addModelEvaluation(spec, cluster, context); @@ -517,10 +516,9 @@ public class ContainerModelBuilder extends ConfigModelBuilder<ContainerModel> { return http; } - private void addRestApis(DeployState deployState, Element spec, ApplicationContainerCluster cluster) { - for (Element restApiElem : XML.getChildren(spec, "rest-api")) { - cluster.addRestApi( - new RestApiBuilder().build(deployState, cluster, restApiElem)); + private void throwUponRestApi(Element spec) { + if(! XML.getChildren(spec, "rest-api").isEmpty()) { + throw new IllegalArgumentException("The 'rest-api' element is no longer allowed in services.xml."); } } |