diff options
author | Morten Tokle <mortent@verizonmedia.com> | 2021-11-15 15:22:51 +0100 |
---|---|---|
committer | Morten Tokle <mortent@verizonmedia.com> | 2021-11-15 15:41:11 +0100 |
commit | 73b6ca079f9eadf9a1e039d04487b0bfa557fca7 (patch) | |
tree | 6c23331a2f084b4bdb77183c9a06e47c5aa5a079 /config-model-api | |
parent | 07585461ac07eed2beaa68b322b63cd50a8047f3 (diff) |
Include clusterId
Diffstat (limited to 'config-model-api')
-rw-r--r-- | config-model-api/src/main/java/com/yahoo/config/model/api/ApplicationClusterEndpoint.java | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/config-model-api/src/main/java/com/yahoo/config/model/api/ApplicationClusterEndpoint.java b/config-model-api/src/main/java/com/yahoo/config/model/api/ApplicationClusterEndpoint.java index 38a122c4fab..1c45e4ba5dd 100644 --- a/config-model-api/src/main/java/com/yahoo/config/model/api/ApplicationClusterEndpoint.java +++ b/config-model-api/src/main/java/com/yahoo/config/model/api/ApplicationClusterEndpoint.java @@ -26,13 +26,15 @@ public class ApplicationClusterEndpoint { private final RoutingMethod routingMethod; private final int weight; private final List<String> hostNames; + private final String clusterId; - private ApplicationClusterEndpoint(DnsName dnsName, Scope scope, RoutingMethod routingMethod, int weight, List<String> hostNames) { - this.dnsName = dnsName; - this.scope = scope; - this.routingMethod = routingMethod; + private ApplicationClusterEndpoint(DnsName dnsName, Scope scope, RoutingMethod routingMethod, int weight, List<String> hostNames, String clusterId) { + this.dnsName = Objects.requireNonNull(dnsName); + this.scope = Objects.requireNonNull(scope); + this.routingMethod = Objects.requireNonNull(routingMethod); this.weight = weight; - this.hostNames = List.copyOf(hostNames); + this.hostNames = List.copyOf(Objects.requireNonNull(hostNames)); + this.clusterId = Objects.requireNonNull(clusterId); } public DnsName dnsName() { @@ -55,6 +57,10 @@ public class ApplicationClusterEndpoint { return hostNames; } + public String clusterId() { + return clusterId; + } + public static Builder builder() { return new Builder(); } @@ -66,6 +72,7 @@ public class ApplicationClusterEndpoint { private RoutingMethod routingMethod; private int weigth = 1; private List<String> hosts; + private String clusterId; public Builder dnsName(DnsName name) { this.dnsName = name; @@ -102,8 +109,13 @@ public class ApplicationClusterEndpoint { return this; } + public Builder clusterId(String clusterId) { + this.clusterId = clusterId; + return this; + } + public ApplicationClusterEndpoint build() { - return new ApplicationClusterEndpoint(dnsName, scope, routingMethod, weigth, hosts); + return new ApplicationClusterEndpoint(dnsName, scope, routingMethod, weigth, hosts, clusterId); } } |