// information could only be available after uwfAdapter.delete(), which
// will also effectively remove user from db, thus making virtually
// impossible by NotificationManager to fetch required user information
List<PropagationTask> tasks = propagationManager.getUserDeleteTaskIds(userId);
PropagationReporter propagationReporter = ApplicationContextProvider.getApplicationContext().
getBean(PropagationReporter.class);
try {
taskExecutor.execute(tasks, propagationReporter);
} catch (PropagationException e) {
LOG.error("Error propagation primary resource", e);
propagationReporter.onPrimaryResourceFailure(tasks);
}
uwfAdapter.delete(userId);
final UserTO deletedTO;
SyncopeUser deleted = userDAO.find(userId);
if (deleted == null) {
deletedTO = new UserTO();
deletedTO.setId(userId);
} else {
deletedTO = binder.getUserTO(userId);
}
deletedTO.getPropagationStatusTOs().addAll(propagationReporter.getStatuses());
return deletedTO;
}