class WorkloadCredentialService {

    public void setWorkloadCredentials(FreeIpaClient freeIpaClient, Map<String, WorkloadCredential> workloadCredentials,
            BiConsumer<String, String> warnings) throws FreeIpaClientException {
        for (Map.Entry<String, WorkloadCredential> entry : workloadCredentials.entrySet()) {
            try {
                setWorkloadCredential(freeIpaClient, entry.getKey(), entry.getValue());
            } catch (IOException e) {
                recordWarning(entry.getKey(), e, warnings);
            } catch (FreeIpaClientException e) {
                recordWarning(entry.getKey(), e, warnings);
                if (e.isClientUnusable()) {
                    LOGGER.warn("Client is not usable for further usage");
                    throw e;
                }
            }
        }
    }

}