summaryrefslogtreecommitdiffstats
path: root/config-model-api
diff options
context:
space:
mode:
authorHarald Musum <musum@yahooinc.com>2023-09-04 14:56:49 +0200
committerGitHub <noreply@github.com>2023-09-04 14:56:49 +0200
commit6e298f7f8f3130cd8f3f75702ef1e10a0f5d55cc (patch)
tree04859bba148bf4609d9509538e481931490eb273 /config-model-api
parente428de004953c5015936ee14714af8984b026c18 (diff)
Revert "Add auth method to ApplicationClusterEndpoint"
Diffstat (limited to 'config-model-api')
-rw-r--r--config-model-api/src/main/java/com/yahoo/config/model/api/ApplicationClusterEndpoint.java61
-rw-r--r--config-model-api/src/main/java/com/yahoo/config/model/api/ContainerEndpoint.java23
2 files changed, 29 insertions, 55 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 e70b0f1a599..b7969267328 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
@@ -18,6 +18,21 @@ import java.util.stream.Stream;
* @author mortent
*/
public class ApplicationClusterEndpoint {
+ @Override
+ public String toString() {
+ return "ApplicationClusterEndpoint{" +
+ "dnsName=" + dnsName +
+ ", scope=" + scope +
+ ", routingMethod=" + routingMethod +
+ ", weight=" + weight +
+ ", hostNames=" + hostNames +
+ ", clusterId='" + clusterId + "'" +
+ '}';
+ }
+
+ public enum Scope {application, global, zone}
+
+ public enum RoutingMethod {shared, sharedLayer4, exclusive}
private final DnsName dnsName;
private final Scope scope;
@@ -25,16 +40,14 @@ public class ApplicationClusterEndpoint {
private final int weight;
private final List<String> hostNames;
private final String clusterId;
- private final AuthMethod authMethod;
- private ApplicationClusterEndpoint(DnsName dnsName, Scope scope, RoutingMethod routingMethod, int weight, List<String> hostNames, String clusterId, AuthMethod authMethod) {
- this.dnsName = Objects.requireNonNull(dnsName);
- this.scope = Objects.requireNonNull(scope);
- this.routingMethod = Objects.requireNonNull(routingMethod);
+ private ApplicationClusterEndpoint(DnsName dnsName, Scope scope, RoutingMethod routingMethod, int weight, List<String> hostNames, String clusterId) {
+ this.dnsName = dnsName;
+ this.scope = scope;
+ this.routingMethod = routingMethod;
this.weight = weight;
- this.hostNames = List.copyOf(Objects.requireNonNull(hostNames));
- this.clusterId = Objects.requireNonNull(clusterId);
- this.authMethod = Objects.requireNonNull(authMethod);
+ this.hostNames = List.copyOf(hostNames);
+ this.clusterId = clusterId;
}
public DnsName dnsName() {
@@ -61,33 +74,10 @@ public class ApplicationClusterEndpoint {
return clusterId;
}
- public AuthMethod authMethod() {
- return authMethod;
- }
-
- @Override
- public String toString() {
- return "ApplicationClusterEndpoint{" +
- "dnsName=" + dnsName +
- ", scope=" + scope +
- ", routingMethod=" + routingMethod +
- ", weight=" + weight +
- ", hostNames=" + hostNames +
- ", clusterId='" + clusterId + '\'' +
- ", authMethod=" + authMethod +
- '}';
- }
-
public static Builder builder() {
return new Builder();
}
- public enum Scope { application, global, zone }
-
- public enum RoutingMethod { shared, sharedLayer4, exclusive }
-
- public enum AuthMethod { mtls, token }
-
public static class Builder {
private DnsName dnsName;
@@ -96,7 +86,6 @@ public class ApplicationClusterEndpoint {
private int weigth = 1;
private List<String> hosts;
private String clusterId;
- private AuthMethod authMethod;
public Builder dnsName(DnsName name) {
this.dnsName = name;
@@ -143,15 +132,9 @@ public class ApplicationClusterEndpoint {
return this;
}
- public Builder authMethod(AuthMethod authMethod) {
- this.authMethod = authMethod;
- return this;
- }
-
public ApplicationClusterEndpoint build() {
- return new ApplicationClusterEndpoint(dnsName, scope, routingMethod, weigth, hosts, clusterId, authMethod);
+ return new ApplicationClusterEndpoint(dnsName, scope, routingMethod, weigth, hosts, clusterId);
}
-
}
public static class DnsName implements Comparable<DnsName> {
diff --git a/config-model-api/src/main/java/com/yahoo/config/model/api/ContainerEndpoint.java b/config-model-api/src/main/java/com/yahoo/config/model/api/ContainerEndpoint.java
index de06ddd549a..78da750fb5b 100644
--- a/config-model-api/src/main/java/com/yahoo/config/model/api/ContainerEndpoint.java
+++ b/config-model-api/src/main/java/com/yahoo/config/model/api/ContainerEndpoint.java
@@ -3,7 +3,9 @@ package com.yahoo.config.model.api;
import java.util.List;
import java.util.Objects;
+import java.util.Optional;
import java.util.OptionalInt;
+import java.util.OptionalLong;
/**
* ContainerEndpoint tracks the service names that a Container Cluster should be
@@ -19,7 +21,6 @@ public class ContainerEndpoint {
private final List<String> names;
private final OptionalInt weight;
private final ApplicationClusterEndpoint.RoutingMethod routingMethod;
- private final ApplicationClusterEndpoint.AuthMethod authMethod;
public ContainerEndpoint(String clusterId, ApplicationClusterEndpoint.Scope scope, List<String> names) {
this(clusterId, scope, names, OptionalInt.empty());
@@ -30,16 +31,11 @@ public class ContainerEndpoint {
}
public ContainerEndpoint(String clusterId, ApplicationClusterEndpoint.Scope scope, List<String> names, OptionalInt weight, ApplicationClusterEndpoint.RoutingMethod routingMethod) {
- this(clusterId, scope, names, weight, routingMethod, ApplicationClusterEndpoint.AuthMethod.mtls);
- }
-
- public ContainerEndpoint(String clusterId, ApplicationClusterEndpoint.Scope scope, List<String> names, OptionalInt weight, ApplicationClusterEndpoint.RoutingMethod routingMethod, ApplicationClusterEndpoint.AuthMethod authMethod) {
this.clusterId = Objects.requireNonNull(clusterId);
this.scope = Objects.requireNonNull(scope);
this.names = List.copyOf(Objects.requireNonNull(names));
- this.weight = Objects.requireNonNull(weight);
- this.routingMethod = Objects.requireNonNull(routingMethod);
- this.authMethod = Objects.requireNonNull(authMethod);
+ this.weight = weight;
+ this.routingMethod = routingMethod;
}
public String clusterId() {
@@ -62,10 +58,6 @@ public class ContainerEndpoint {
return routingMethod;
}
- public ApplicationClusterEndpoint.AuthMethod authMethod() {
- return authMethod;
- }
-
@Override
public boolean equals(Object o) {
if (this == o) return true;
@@ -75,17 +67,16 @@ public class ContainerEndpoint {
Objects.equals(scope, that.scope) &&
Objects.equals(names, that.names) &&
Objects.equals(weight, that.weight) &&
- Objects.equals(routingMethod, that.routingMethod) &&
- Objects.equals(authMethod, that.authMethod);
+ Objects.equals(routingMethod, that.routingMethod);
}
@Override
public int hashCode() {
- return Objects.hash(clusterId, names, scope, weight, routingMethod, authMethod);
+ return Objects.hash(clusterId, names, scope, weight, routingMethod);
}
@Override
public String toString() {
- return String.format("container endpoint %s -> %s [scope=%s, weight=%s, routingMethod=%s, authMethod=%s]", clusterId, names, scope, weight, routingMethod, authMethod);
+ return String.format("container endpoint %s -> %s [scope=%s, weight=%s, routingMetod=%s]", clusterId, names, scope, weight, routingMethod);
}
}