summaryrefslogtreecommitdiffstats
path: root/controller-api
diff options
context:
space:
mode:
authorMartin Polden <mpolden@mpolden.no>2021-11-08 15:06:05 +0100
committerMartin Polden <mpolden@mpolden.no>2021-11-10 12:43:27 +0100
commitf669a154dc0f8cedb7a37438aa0c9a5f7b1472ac (patch)
treeb87972f0e04a01ac3c78f1dc1222fae7d01283a1 /controller-api
parent57a586648350c489f6035a8972fa01373fb7f3b5 (diff)
Add scope to container endpoint
Diffstat (limited to 'controller-api')
-rw-r--r--controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/configserver/ContainerEndpoint.java16
1 files changed, 11 insertions, 5 deletions
diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/configserver/ContainerEndpoint.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/configserver/ContainerEndpoint.java
index 3e9169a83aa..bac34e73dc5 100644
--- a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/configserver/ContainerEndpoint.java
+++ b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/configserver/ContainerEndpoint.java
@@ -12,10 +12,12 @@ import java.util.Objects;
public class ContainerEndpoint {
private final String clusterId;
+ private final String scope;
private final List<String> names;
- public ContainerEndpoint(String clusterId, List<String> names) {
+ public ContainerEndpoint(String clusterId, String scope, List<String> names) {
this.clusterId = nonEmpty(clusterId, "message must be non-empty");
+ this.scope = Objects.requireNonNull(scope, "scope must be non-null");
this.names = List.copyOf(Objects.requireNonNull(names, "names must be non-null"));
}
@@ -24,6 +26,11 @@ public class ContainerEndpoint {
return clusterId;
}
+ /** The scope of this endpoint */
+ public String scope() {
+ return scope;
+ }
+
/**
* All valid DNS names for this endpoint. This can contain both proper DNS names and synthetic identifiers used for
* routing, such as a Host header value that is not necessarily a proper DNS name.
@@ -37,18 +44,17 @@ public class ContainerEndpoint {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
ContainerEndpoint that = (ContainerEndpoint) o;
- return clusterId.equals(that.clusterId) &&
- names.equals(that.names);
+ return clusterId.equals(that.clusterId) && scope.equals(that.scope) && names.equals(that.names);
}
@Override
public int hashCode() {
- return Objects.hash(clusterId, names);
+ return Objects.hash(clusterId, scope, names);
}
@Override
public String toString() {
- return "container endpoint for " + clusterId + " " + names;
+ return "container endpoint for " + clusterId + ": " + names + " [scope=" + scope + "]";
}
private static String nonEmpty(String s, String message) {