summaryrefslogtreecommitdiffstats
path: root/config-model-api
diff options
context:
space:
mode:
authorJon Bratseth <bratseth@yahoo-inc.com>2017-04-07 16:49:04 +0200
committerJon Bratseth <bratseth@yahoo-inc.com>2017-04-07 16:49:04 +0200
commit025167b28f847e56333db4922d7a7543fcad7a1a (patch)
treea2466cbccc5fcffa89eb23464a915c83b83ef051 /config-model-api
parentb2f526a6b79965b9ff871d8cdfe283dccc1eefe8 (diff)
Pass wanted node Vespa version around
Diffstat (limited to 'config-model-api')
-rw-r--r--config-model-api/pom.xml6
-rw-r--r--config-model-api/src/main/java/com/yahoo/config/model/api/ModelContext.java11
-rw-r--r--config-model-api/src/main/java/com/yahoo/config/model/api/ModelFactory.java11
3 files changed, 20 insertions, 8 deletions
diff --git a/config-model-api/pom.xml b/config-model-api/pom.xml
index cf016ec4ee0..8fa2d482cab 100644
--- a/config-model-api/pom.xml
+++ b/config-model-api/pom.xml
@@ -29,6 +29,12 @@
</dependency>
<dependency>
<groupId>com.yahoo.vespa</groupId>
+ <artifactId>component</artifactId>
+ <version>${project.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.yahoo.vespa</groupId>
<artifactId>defaults</artifactId>
<version>${project.version}</version>
<scope>provided</scope>
diff --git a/config-model-api/src/main/java/com/yahoo/config/model/api/ModelContext.java b/config-model-api/src/main/java/com/yahoo/config/model/api/ModelContext.java
index 9226e3bbe11..9b9869a5a3c 100644
--- a/config-model-api/src/main/java/com/yahoo/config/model/api/ModelContext.java
+++ b/config-model-api/src/main/java/com/yahoo/config/model/api/ModelContext.java
@@ -1,12 +1,12 @@
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.config.model.api;
+import com.yahoo.component.Version;
import com.yahoo.config.application.api.ApplicationPackage;
import com.yahoo.config.application.api.DeployLogger;
import com.yahoo.config.application.api.FileRegistry;
import com.yahoo.config.provision.ApplicationId;
import com.yahoo.config.provision.Rotation;
-import com.yahoo.config.provision.Version;
import com.yahoo.config.provision.Zone;
import java.io.File;
@@ -30,7 +30,14 @@ public interface ModelContext {
FileRegistry getFileRegistry();
Properties properties();
default Optional<File> appDir() { return Optional.empty();}
- default Optional<Version> vespaVersion() { return Optional.empty(); }
+
+ /** @deprecated TODO: Remove this when no config models older than 6.98 are used */
+ @SuppressWarnings("unused")
+ @Deprecated
+ default Optional<com.yahoo.config.provision.Version> vespaVersion() { return Optional.empty(); }
+
+ Version modelVespaVersion();
+ Version wantedNodeVespaVersion();
interface Properties {
boolean multitenant();
diff --git a/config-model-api/src/main/java/com/yahoo/config/model/api/ModelFactory.java b/config-model-api/src/main/java/com/yahoo/config/model/api/ModelFactory.java
index a61001cc9d9..2f80e66af05 100644
--- a/config-model-api/src/main/java/com/yahoo/config/model/api/ModelFactory.java
+++ b/config-model-api/src/main/java/com/yahoo/config/model/api/ModelFactory.java
@@ -9,10 +9,9 @@ import com.yahoo.config.provision.Version;
public interface ModelFactory {
/**
- * Gets version of this {@link ModelFactory}. The version will be used to dispatch deployments to the correct
- * {@link ModelFactory}.
+ * Returns the Vespa version of the models this builds.
*
- * @return The version of a {@link Model} instance that this factory can create.
+ * @return the version of a {@link Model} instance that this factory can create.
*/
Version getVersion();
@@ -21,7 +20,7 @@ public interface ModelFactory {
* validation will be done, calling this method assumes that {@link #createAndValidateModel} has already
* been called at some point for this model.
*
- * @param modelContext An instance of {@link ModelContext}, containing dependencies for creating a {@link Model}.
+ * @param modelContext an instance of {@link ModelContext}, containing dependencies for creating a {@link Model}.
* @return a {@link Model} instance.
*/
Model createModel(ModelContext modelContext);
@@ -30,8 +29,8 @@ public interface ModelFactory {
* Creates an instance of a {@link Model}. The resulting instance will be used to serve config. Any validation
* of a {@link Model} and the {@link ModelContext} can be done in this method.
*
- * @param modelContext An instance of {@link ModelContext}, containing dependencies for creating a {@link Model}.
- * @param ignoreValidationErrors true if validation errors should not trigger exceptions.
+ * @param modelContext an instance of {@link ModelContext}, containing dependencies for creating a {@link Model}
+ * @param ignoreValidationErrors true if validation errors should not trigger exceptions
* @return a {@link ModelCreateResult} instance.
*/
ModelCreateResult createAndValidateModel(ModelContext modelContext, boolean ignoreValidationErrors);