use of io.datarouter.aws.rds.service.AuroraDnsService.DnsHostEntryDto in project datarouter by hotpads.
the class AuroraInstancesHandler method inspectClientUrl.
@Handler(defaultHandler = true)
public Mav inspectClientUrl() {
List<DnsHostEntryDto> otherReaderInstances = new ArrayList<>();
List<ClientId> clientsMissingOtherInstances = new ArrayList<>();
for (ClientId primaryClientId : dnsService.getPrimaryClientIds()) {
DnsHostEntryDto otherEntry = dnsService.getOtherReader(primaryClientId.getName());
if (otherEntry == null) {
clientsMissingOtherInstances.add(primaryClientId);
} else {
otherReaderInstances.add(otherEntry);
}
}
List<DomContent> fragments = new ArrayList<>();
fragments.add(makeAuroraClientsTable("Aurora Clients", dnsService.checkClientEndpoint().getLeft()));
if (otherReaderInstances.size() != 0) {
fragments.add(makeAuroraClientsTable("Aurora Other Instances", otherReaderInstances));
}
if (clientsMissingOtherInstances.size() != 0) {
fragments.add(makeForm(clientsMissingOtherInstances));
}
ContainerTag<?> content = div(each(fragments.stream())).withClass("container my-4");
return pageFactory.startBuilder(request).withTitle("Aurora Clients").withContent(content).buildMav();
}
Aggregations