blob: 73da37d00484d145c9ceeea728583ddb9f226d92 (
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
|
// 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;
import com.yahoo.config.model.deploy.DeployState;
import com.yahoo.vespa.model.VespaModel;
import java.util.List;
/**
* Validates routing
*
*/
public class RoutingValidator extends Validator {
@Override
public void validate(VespaModel model, DeployState deployState) {
List<String> errors = model.getRouting().getErrors();
if (!errors.isEmpty()) {
StringBuilder msg = new StringBuilder();
msg.append("The routing specification contains ").append(errors.size()).append(" error(s):\n");
for (int i = 0, len = errors.size(); i < len; ++i) {
msg.append(i + 1).append(". ").append(errors.get(i)).append("\n");
}
throw new IllegalArgumentException(msg.toString());
}
}
}
|