use of com.sequenceiq.freeipa.service.freeipa.user.UserSyncLogEvent.RETRIEVE_FULL_UMS_STATE in project cloudbreak by hortonworks.
the class UserSyncForEnvService method startAsyncSyncsForStacks.
private Map<String, Future<SyncStatusDetail>> startAsyncSyncsForStacks(String operationId, String accountId, List<Stack> stacks, UserSyncRequestFilter userSyncFilter, UserSyncOptions options, Set<String> environmentCrns) {
if (userSyncFilter.getDeletedWorkloadUser().isEmpty()) {
UserSyncLogEvent logRetrieveUmsEvent = options.isFullSync() ? RETRIEVE_FULL_UMS_STATE : RETRIEVE_PARTIAL_UMS_STATE;
LOGGER.debug("Starting {} for environments {} ...", logRetrieveUmsEvent, environmentCrns);
Map<String, UmsUsersState> envToUmsStateMap = umsUsersStateProviderDispatcher.getEnvToUmsUsersStateMap(accountId, environmentCrns, userSyncFilter.getUserCrnFilter(), userSyncFilter.getMachineUserCrnFilter(), MDCUtils.getRequestId());
LOGGER.debug("Finished {}.", logRetrieveUmsEvent);
UmsEventGenerationIds umsEventGenerationIds = options.isFullSync() ? umsEventGenerationIdsProvider.getEventGenerationIds(accountId, MDCUtils.getRequestId()) : null;
return stacks.stream().collect(Collectors.toMap(Stack::getEnvironmentCrn, stack -> asyncSynchronizeStack(stack, envToUmsStateMap.get(stack.getEnvironmentCrn()), umsEventGenerationIds, options, operationId, accountId)));
} else {
String deletedWorkloadUser = userSyncFilter.getDeletedWorkloadUser().get();
return stacks.stream().collect(Collectors.toMap(Stack::getEnvironmentCrn, stack -> asyncSynchronizeStackForDeleteUser(stack, deletedWorkloadUser)));
}
}
Aggregations