class AllHostPublicDnsEntryService extends BaseDnsEntryService {

    @Override
    protected Map<String, List<String>> getComponentLocation(Stack stack) {
        InstanceMetaData primaryGatewayInstance = stack.getPrimaryGatewayInstance();
        Function<InstanceGroup, List<String>> notTerminatedAndPrimaryGatewayInstances = ig -> ig.getNotTerminatedInstanceMetaDataSet()
                .stream()
                .filter(im -> !im.getDiscoveryFQDN().equals(primaryGatewayInstance.getDiscoveryFQDN()))
                .map(InstanceMetaData::getDiscoveryFQDN)
                .collect(Collectors.toList());

        return stack.getInstanceGroups()
                .stream()
                .filter(ig -> !(ig.getNotTerminatedInstanceMetaDataSet().contains(primaryGatewayInstance) && ig.getNodeCount() == GROUP_WITH_SINGLE_NODE))
                .collect(Collectors.toMap(InstanceGroup::getGroupName, notTerminatedAndPrimaryGatewayInstances));
    }

}