diff options
author | Jon Marius Venstad <venstad@gmail.com> | 2020-11-20 12:42:47 +0100 |
---|---|---|
committer | Jon Marius Venstad <venstad@gmail.com> | 2020-11-20 12:42:47 +0100 |
commit | 28ebee04d75871c2e268bfd8375b02759ca52d4e (patch) | |
tree | 7216fd3c40cb21cd8cd965459b594ba13a6ead7e /config-model-api/src/main/java/com/yahoo/config/model/api/ConfigChangeAction.java | |
parent | b7835ceb503084f32cb09875b1e6243bed81e463 (diff) |
Add Optional<ValidationId> to ConfigActionChange and use to validate actions
Diffstat (limited to 'config-model-api/src/main/java/com/yahoo/config/model/api/ConfigChangeAction.java')
-rw-r--r-- | config-model-api/src/main/java/com/yahoo/config/model/api/ConfigChangeAction.java | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/config-model-api/src/main/java/com/yahoo/config/model/api/ConfigChangeAction.java b/config-model-api/src/main/java/com/yahoo/config/model/api/ConfigChangeAction.java index f8f0a3dfb1a..70a54918216 100644 --- a/config-model-api/src/main/java/com/yahoo/config/model/api/ConfigChangeAction.java +++ b/config-model-api/src/main/java/com/yahoo/config/model/api/ConfigChangeAction.java @@ -5,6 +5,7 @@ import com.yahoo.config.application.api.ValidationId; import com.yahoo.config.provision.ClusterSpec; import java.util.List; +import java.util.Optional; /** * Contains the action to be performed on the given services to handle a config change @@ -38,12 +39,13 @@ public interface ConfigChangeAction { /** Returns the list of services where the action must be performed */ List<ServiceInfo> getServices(); - /** - * Returns whether this change should be allowed. - * Implementations which allow this to return false should inherit {@link DisallowableConfigChangeAction} - */ + /** Returns whether this change should be allowed. */ + // TODO jonmv: remove in 2021. boolean allowed(); + /** When this is non-empty, validation may fail unless this validation id is allowed by validation overrides. */ + default Optional<ValidationId> validationId() { return Optional.empty(); } + /** The id of the cluster that needs this action applied */ // TODO: Remove this default implementation after October 2020 default ClusterSpec.Id clusterId() { return null; } |