in gremlin-client/src/main/java/software/amazon/neptune/cluster/NeptuneGremlinClusterBuilder.java [388:440]
public GremlinCluster create() {
innerBuilder.enableSsl(this.enableSsl);
Collection<Endpoint> filteredEndpoints = new ArrayList<>();
Set<String> rejectedReasons = new HashSet<>();
if (endpointFilter != null) {
innerBuilder.endpointFilter(endpointFilter);
for (Endpoint endpoint : endpoints) {
ApprovalResult approvalResult = endpointFilter.approveEndpoint(endpoint);
if (approvalResult.isApproved()) {
filteredEndpoints.add(endpoint);
} else {
rejectedReasons.add(approvalResult.reason());
}
}
} else {
filteredEndpoints.addAll(endpoints);
}
if (filteredEndpoints.isEmpty()) {
if (!rejectedReasons.isEmpty()) {
throw new EndpointsUnavailableException(rejectedReasons);
}
if (isDirectConnection()) {
throw new IllegalStateException("The list of endpoint addresses is empty. You must supply one or more endpoints.");
} else if (enableIamAuth) {
throw new IllegalStateException("The list of endpoint addresses is empty. You must supply one or more endpoints to sign the Host header.");
}
}
for (Endpoint endpoint : filteredEndpoints) {
innerBuilder.addContactPoint(endpoint);
}
TopologyAwareBuilderConfigurator configurator = new HandshakeInterceptorConfigurator(
isDirectConnection(),
interceptor,
enableIamAuth,
port,
proxyPort,
proxyAddress,
serviceRegion,
iamProfile,
credentials,
removeHostHeader
);
innerBuilder.topologyAwareBuilderConfigurator(configurator);
return innerBuilder.create();
}