Remove constraint that we can have only one main endpoint in EndpointList
@@ -25,13 +25,6 @@ public class EndpointList {
private final List<Endpoint> endpoints;
private EndpointList(List<Endpoint> endpoints) {
- long mainEndpoints = endpoints.stream()
- .filter(endpoint -> endpoint.scope() == Endpoint.Scope.global)
- .filter(Predicate.not(Endpoint::directRouting))
- .filter(Predicate.not(Endpoint::legacy)).count();
- if (mainEndpoints > 1) {
- throw new IllegalArgumentException("Can have only 1 non-legacy global endpoint, got " + endpoints);
- }
if (endpoints.stream().distinct().count() != endpoints.size()) {
throw new IllegalArgumentException("Expected all endpoints to be distinct, got " + endpoints);
}
