use of com.sequenceiq.freeipa.api.v1.freeipa.user.model.WorkloadCredentialsUpdateType in project cloudbreak by hortonworks.
the class WorkloadCredentialServiceTest method setWorkloadCredentials.
private void setWorkloadCredentials(boolean batchCallEnabled, boolean updateOptimizationEnabled, FreeIpaClient ipaClient, Map<String, WorkloadCredential> usersWorkloadCredentialMap, Set<String> usersWithCredentialsToUpdate, Map<String, String> userToCrnMap, BiConsumer<String, String> warnings) throws FreeIpaClientException, TimeoutException {
ImmutableSet<WorkloadCredentialUpdate> credentialUpdates = usersWithCredentialsToUpdate.stream().map(username -> new WorkloadCredentialUpdate(username, userToCrnMap.get(username), usersWorkloadCredentialMap.get(username))).collect(ImmutableSet.toImmutableSet());
WorkloadCredentialsUpdateType credentialsUpdateType = updateOptimizationEnabled ? WorkloadCredentialsUpdateType.UPDATE_IF_CHANGED : WorkloadCredentialsUpdateType.FORCE_UPDATE;
underTest.setWorkloadCredentials(new UserSyncOptions(false, batchCallEnabled, credentialsUpdateType), ipaClient, credentialUpdates, warnings);
}
use of com.sequenceiq.freeipa.api.v1.freeipa.user.model.WorkloadCredentialsUpdateType in project cloudbreak by hortonworks.
the class UserSyncService method getUserSyncOptions.
private UserSyncOptions getUserSyncOptions(String accountId, boolean fullSync, WorkloadCredentialsUpdateType requestedCredentialsUpdateType) {
WorkloadCredentialsUpdateType credentialsUpdateType = requestedCredentialsUpdateType == WorkloadCredentialsUpdateType.UPDATE_IF_CHANGED && !entitlementService.usersyncCredentialsUpdateOptimizationEnabled(accountId) ? WorkloadCredentialsUpdateType.FORCE_UPDATE : requestedCredentialsUpdateType;
UserSyncOptions userSyncOptions = new UserSyncOptions(fullSync, entitlementService.isFmsToFreeipaBatchCallEnabled(accountId), credentialsUpdateType);
LOGGER.info("Credentials update optimization is{} enabled for this sync request", userSyncOptions.isCredentialsUpdateOptimizationEnabled() ? "" : " not");
return userSyncOptions;
}
Aggregations