aboutsummaryrefslogtreecommitdiffstats
path: root/config-model/src/main/java/com/yahoo/vespa/model/application/validation/change/ChangeValidator.java
blob: 9992fa37e450f2d8571e5e383b166a012822fb1a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.model.application.validation.change;

import com.yahoo.config.model.api.ConfigChangeAction;
import com.yahoo.config.model.deploy.DeployState;
import com.yahoo.vespa.model.VespaModel;
import com.yahoo.config.application.api.ValidationOverrides;

import java.time.Instant;
import java.util.List;

/**
 * Interface for validating changes between a current active and next config model.
 *
 * @author geirst
 */
public interface ChangeValidator {

    /**
     * Validates the current active vespa model with the next model.
     * Both current and next should be non-null.
     *
     * @param current the current active model
     * @param next the next model we would like to activate
     * @return a list of actions specifying what needs to be done in order to activate the new model.
     *         Return an empty list if nothing needs to be done
     * @throws IllegalArgumentException if the change fails validation
     */
    List<ConfigChangeAction> validate(VespaModel current, VespaModel next, DeployState deployState);

}