class SystemFlagsDeployer {

    SystemFlagsDeployResult deployFlags(SystemFlagsDataArchive archive, boolean dryRun) {
        Map<FlagsTarget, Future<SystemFlagsDeployResult>> futures = new HashMap<>();
        for (FlagsTarget target : targets) {
            futures.put(target, executor.submit(() -> deployFlags(target, archive.flagData(target), dryRun)));
        }
        List<SystemFlagsDeployResult> results = new ArrayList<>();
        futures.forEach((target, future) -> {
            try {
                results.add(future.get());
            } catch (InterruptedException | ExecutionException e) {
                log.log(Level.SEVERE, String.format("Failed to deploy flags for target '%s': %s", target, e.getMessage()), e);
                throw new RuntimeException(e);
            }
        });
        try {
            archive.validateAllFilesAreForTargets(system, targets);
        } catch (IllegalArgumentException e) {
            results.add(new SystemFlagsDeployResult(List.of(OperationError.archiveValidationFailed(e.getMessage()))));
        }
        return SystemFlagsDeployResult.merge(results);
    }

      SystemFlagsDeployer(ServiceIdentityProvider identityProvider, SystemName system, Set<FlagsTarget> targets);
      SystemFlagsDeployer(FlagsClient client, SystemName system, Set<FlagsTarget> targets);

}