syncope-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ilgro...@apache.org
Subject [5/7] syncope git commit: [SYNCOPE-141][SYNCOPE-142] Implementation completed
Date Thu, 29 Oct 2015 16:33:41 GMT
http://git-wip-us.apache.org/repos/asf/syncope/blob/1b81e33c/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/DefaultUserProvisioningManager.java
----------------------------------------------------------------------
diff --git a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/DefaultUserProvisioningManager.java b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/DefaultUserProvisioningManager.java
index 5424486..d9028af 100644
--- a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/DefaultUserProvisioningManager.java
+++ b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/DefaultUserProvisioningManager.java
@@ -47,9 +47,9 @@ import org.apache.syncope.core.provisioning.api.propagation.PropagationException
 import org.apache.syncope.core.provisioning.api.propagation.PropagationManager;
 import org.apache.syncope.core.provisioning.api.propagation.PropagationReporter;
 import org.apache.syncope.core.provisioning.api.propagation.PropagationTaskExecutor;
-import org.apache.syncope.core.provisioning.api.sync.ProvisioningResult;
 import org.apache.syncope.core.misc.spring.ApplicationContextProvider;
 import org.apache.syncope.core.provisioning.api.VirAttrHandler;
+import org.apache.syncope.core.provisioning.api.sync.ProvisioningReport;
 import org.apache.syncope.core.workflow.api.UserWorkflowAdapter;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -75,23 +75,32 @@ public class DefaultUserProvisioningManager implements UserProvisioningManager {
     protected UserDAO userDAO;
 
     @Override
-    public Pair<Long, List<PropagationStatus>> create(final UserTO userTO) {
-        return create(userTO, true, false, null, Collections.<String>emptySet());
+    public Pair<Long, List<PropagationStatus>> create(final UserTO userTO, final boolean nullPriorityAsync) {
+        return create(userTO, true, false, null, Collections.<String>emptySet(), nullPriorityAsync);
     }
 
     @Override
-    public Pair<Long, List<PropagationStatus>> create(final UserTO userTO, final boolean storePassword) {
-        return create(userTO, storePassword, false, null, Collections.<String>emptySet());
+    public Pair<Long, List<PropagationStatus>> create(
+            final UserTO userTO, final boolean storePassword, final boolean nullPriorityAsync) {
+
+        return create(userTO, storePassword, false, null, Collections.<String>emptySet(), nullPriorityAsync);
     }
 
     @Override
-    public Pair<Long, List<PropagationStatus>> create(final UserTO userTO, final Set<String> excludedResources) {
-        return create(userTO, false, false, null, excludedResources);
+    public Pair<Long, List<PropagationStatus>> create(
+            final UserTO userTO, final Set<String> excludedResources, final boolean nullPriorityAsync) {
+
+        return create(userTO, false, false, null, excludedResources, nullPriorityAsync);
     }
 
     @Override
-    public Pair<Long, List<PropagationStatus>> create(final UserTO userTO, final boolean storePassword,
-            final boolean disablePwdPolicyCheck, final Boolean enabled, final Set<String> excludedResources) {
+    public Pair<Long, List<PropagationStatus>> create(
+            final UserTO userTO,
+            final boolean storePassword,
+            final boolean disablePwdPolicyCheck,
+            final Boolean enabled,
+            final Set<String> excludedResources,
+            final boolean nullPriorityAsync) {
 
         WorkflowResult<Pair<Long, Boolean>> created =
                 uwfAdapter.create(userTO, disablePwdPolicyCheck, enabled, storePassword);
@@ -105,49 +114,46 @@ public class DefaultUserProvisioningManager implements UserProvisioningManager {
                 excludedResources);
         PropagationReporter propagationReporter =
                 ApplicationContextProvider.getBeanFactory().getBean(PropagationReporter.class);
-        try {
-            taskExecutor.execute(tasks, propagationReporter);
-        } catch (PropagationException e) {
-            LOG.error("Error propagation primary resource", e);
-            propagationReporter.onPrimaryResourceFailure(tasks);
-        }
+        taskExecutor.execute(tasks, propagationReporter, nullPriorityAsync);
 
         return new ImmutablePair<>(created.getResult().getKey(), propagationReporter.getStatuses());
     }
 
     @Override
-    public Pair<Long, List<PropagationStatus>> update(final UserPatch userPatch) {
+    public Pair<Long, List<PropagationStatus>> update(final UserPatch userPatch, final boolean nullPriorityAsync) {
         WorkflowResult<Pair<UserPatch, Boolean>> updated = uwfAdapter.update(userPatch);
 
         List<PropagationTask> tasks = propagationManager.getUserUpdateTasks(updated);
         PropagationReporter propagationReporter =
                 ApplicationContextProvider.getBeanFactory().getBean(PropagationReporter.class);
-        try {
-            taskExecutor.execute(tasks, propagationReporter);
-        } catch (PropagationException e) {
-            LOG.error("Error propagation primary resource", e);
-            propagationReporter.onPrimaryResourceFailure(tasks);
-        }
+        taskExecutor.execute(tasks, propagationReporter, nullPriorityAsync);
 
         return new ImmutablePair<>(updated.getResult().getKey().getKey(), propagationReporter.getStatuses());
     }
 
     @Override
-    public Pair<Long, List<PropagationStatus>> update(final UserPatch userPatch, final Set<String> excludedResources) {
-        return update(userPatch, userPatch.getKey(), new ProvisioningResult(), null, excludedResources);
+    public Pair<Long, List<PropagationStatus>> update(
+            final UserPatch userPatch, final Set<String> excludedResources, final boolean nullPriorityAsync) {
+
+        return update(userPatch, new ProvisioningReport(), null, excludedResources, nullPriorityAsync);
     }
 
     @Override
-    public Pair<Long, List<PropagationStatus>> update(final UserPatch userPatch, final Long key,
-            final ProvisioningResult result, final Boolean enabled, final Set<String> excludedResources) {
+    public Pair<Long, List<PropagationStatus>> update(
+            final UserPatch userPatch,
+            final ProvisioningReport result,
+            final Boolean enabled,
+            final Set<String> excludedResources,
+            final boolean nullPriorityAsync) {
 
         WorkflowResult<Pair<UserPatch, Boolean>> updated;
         try {
             updated = uwfAdapter.update(userPatch);
         } catch (Exception e) {
-            LOG.error("Update of user {} failed, trying to sync its status anyway (if configured)", key, e);
+            LOG.error("Update of user {} failed, trying to sync its status anyway (if configured)",
+                    userPatch.getKey(), e);
 
-            result.setStatus(ProvisioningResult.Status.FAILURE);
+            result.setStatus(ProvisioningReport.Status.FAILURE);
             result.setMessage("Update failed, trying to sync status anyway (if configured)\n" + e.getMessage());
 
             updated = new WorkflowResult<Pair<UserPatch, Boolean>>(
@@ -156,15 +162,15 @@ public class DefaultUserProvisioningManager implements UserProvisioningManager {
         }
 
         if (enabled != null) {
-            User user = userDAO.find(key);
+            User user = userDAO.find(userPatch.getKey());
 
             WorkflowResult<Long> enableUpdate = null;
             if (user.isSuspended() == null) {
-                enableUpdate = uwfAdapter.activate(key, null);
+                enableUpdate = uwfAdapter.activate(userPatch.getKey(), null);
             } else if (enabled && user.isSuspended()) {
-                enableUpdate = uwfAdapter.reactivate(key);
+                enableUpdate = uwfAdapter.reactivate(userPatch.getKey());
             } else if (!enabled && !user.isSuspended()) {
-                enableUpdate = uwfAdapter.suspend(key);
+                enableUpdate = uwfAdapter.suspend(userPatch.getKey());
             }
 
             if (enableUpdate != null) {
@@ -180,23 +186,20 @@ public class DefaultUserProvisioningManager implements UserProvisioningManager {
                 updated, updated.getResult().getKey().getPassword() != null, excludedResources);
         PropagationReporter propagationReporter = ApplicationContextProvider.getBeanFactory().
                 getBean(PropagationReporter.class);
-        try {
-            taskExecutor.execute(tasks, propagationReporter);
-        } catch (PropagationException e) {
-            LOG.error("Error propagation primary resource", e);
-            propagationReporter.onPrimaryResourceFailure(tasks);
-        }
+        taskExecutor.execute(tasks, propagationReporter, nullPriorityAsync);
 
         return new ImmutablePair<>(updated.getResult().getKey().getKey(), propagationReporter.getStatuses());
     }
 
     @Override
-    public List<PropagationStatus> delete(final Long key) {
-        return delete(key, Collections.<String>emptySet());
+    public List<PropagationStatus> delete(final Long key, final boolean nullPriorityAsync) {
+        return delete(key, Collections.<String>emptySet(), nullPriorityAsync);
     }
 
     @Override
-    public List<PropagationStatus> delete(final Long key, final Set<String> excludedResources) {
+    public List<PropagationStatus> delete(
+            final Long key, final Set<String> excludedResources, final boolean nullPriorityAsync) {
+
         PropagationByResource propByRes = new PropagationByResource();
         propByRes.set(ResourceOperation.DELETE, userDAO.findAllResourceNames(userDAO.authFind(key)));
 
@@ -212,12 +215,7 @@ public class DefaultUserProvisioningManager implements UserProvisioningManager {
                 excludedResources);
         PropagationReporter propagationReporter =
                 ApplicationContextProvider.getBeanFactory().getBean(PropagationReporter.class);
-        try {
-            taskExecutor.execute(tasks, propagationReporter);
-        } catch (PropagationException e) {
-            LOG.error("Error propagation primary resource", e);
-            propagationReporter.onPrimaryResourceFailure(tasks);
-        }
+        taskExecutor.execute(tasks, propagationReporter, nullPriorityAsync);
 
         try {
             uwfAdapter.delete(key);
@@ -240,33 +238,41 @@ public class DefaultUserProvisioningManager implements UserProvisioningManager {
     }
 
     @Override
-    public Pair<Long, List<PropagationStatus>> activate(final StatusPatch statusPatch) {
+    public Pair<Long, List<PropagationStatus>> activate(
+            final StatusPatch statusPatch, final boolean nullPriorityAsync) {
+
         WorkflowResult<Long> updated = statusPatch.isOnSyncope()
                 ? uwfAdapter.activate(statusPatch.getKey(), statusPatch.getToken())
                 : new WorkflowResult<>(statusPatch.getKey(), null, statusPatch.getType().name().toLowerCase());
 
-        return new ImmutablePair<>(updated.getResult(), propagateStatus(statusPatch));
+        return new ImmutablePair<>(updated.getResult(), propagateStatus(statusPatch, nullPriorityAsync));
     }
 
     @Override
-    public Pair<Long, List<PropagationStatus>> reactivate(final StatusPatch statusPatch) {
+    public Pair<Long, List<PropagationStatus>> reactivate(
+            final StatusPatch statusPatch, final boolean nullPriorityAsync) {
+
         WorkflowResult<Long> updated = statusPatch.isOnSyncope()
                 ? uwfAdapter.reactivate(statusPatch.getKey())
                 : new WorkflowResult<>(statusPatch.getKey(), null, statusPatch.getType().name().toLowerCase());
 
-        return new ImmutablePair<>(updated.getResult(), propagateStatus(statusPatch));
+        return new ImmutablePair<>(updated.getResult(), propagateStatus(statusPatch, nullPriorityAsync));
     }
 
     @Override
-    public Pair<Long, List<PropagationStatus>> suspend(final StatusPatch statusPatch) {
+    public Pair<Long, List<PropagationStatus>> suspend(
+            final StatusPatch statusPatch, final boolean nullPriorityAsync) {
+
         WorkflowResult<Long> updated = statusPatch.isOnSyncope()
                 ? uwfAdapter.suspend(statusPatch.getKey())
                 : new WorkflowResult<>(statusPatch.getKey(), null, statusPatch.getType().name().toLowerCase());
 
-        return new ImmutablePair<>(updated.getResult(), propagateStatus(statusPatch));
+        return new ImmutablePair<>(updated.getResult(), propagateStatus(statusPatch, nullPriorityAsync));
     }
 
-    protected List<PropagationStatus> propagateStatus(final StatusPatch statusPatch) {
+    protected List<PropagationStatus> propagateStatus(
+            final StatusPatch statusPatch, final boolean nullPriorityAsync) {
+
         PropagationByResource propByRes = new PropagationByResource();
         propByRes.addAll(ResourceOperation.UPDATE, statusPatch.getResources());
         List<PropagationTask> tasks = propagationManager.getUpdateTasks(
@@ -279,12 +285,7 @@ public class DefaultUserProvisioningManager implements UserProvisioningManager {
                 null);
         PropagationReporter propReporter =
                 ApplicationContextProvider.getBeanFactory().getBean(PropagationReporter.class);
-        try {
-            taskExecutor.execute(tasks, propReporter);
-        } catch (PropagationException e) {
-            LOG.error("Error propagation primary resource", e);
-            propReporter.onPrimaryResourceFailure(tasks);
-        }
+        taskExecutor.execute(tasks, propReporter, nullPriorityAsync);
 
         return propReporter.getStatuses();
     }
@@ -308,7 +309,11 @@ public class DefaultUserProvisioningManager implements UserProvisioningManager {
 
     @Override
     public List<PropagationStatus> provision(
-            final Long key, final boolean changePwd, final String password, final Collection<String> resources) {
+            final Long key,
+            final boolean changePwd,
+            final String password,
+            final Collection<String> resources,
+            final boolean nullPriorityAsync) {
 
         UserPatch userPatch = new UserPatch();
         userPatch.setKey(key);
@@ -338,18 +343,15 @@ public class DefaultUserProvisioningManager implements UserProvisioningManager {
         List<PropagationTask> tasks = propagationManager.getUserUpdateTasks(wfResult, changePwd, null);
         PropagationReporter propagationReporter =
                 ApplicationContextProvider.getBeanFactory().getBean(PropagationReporter.class);
-        try {
-            taskExecutor.execute(tasks, propagationReporter);
-        } catch (PropagationException e) {
-            LOG.error("Error propagation primary resource", e);
-            propagationReporter.onPrimaryResourceFailure(tasks);
-        }
+        taskExecutor.execute(tasks, propagationReporter, nullPriorityAsync);
 
         return propagationReporter.getStatuses();
     }
 
     @Override
-    public List<PropagationStatus> deprovision(final Long key, final Collection<String> resources) {
+    public List<PropagationStatus> deprovision(
+            final Long key, final Collection<String> resources, final boolean nullPriorityAsync) {
+
         PropagationByResource propByRes = new PropagationByResource();
         propByRes.set(ResourceOperation.DELETE, resources);
 
@@ -360,12 +362,7 @@ public class DefaultUserProvisioningManager implements UserProvisioningManager {
                 CollectionUtils.removeAll(userDAO.findAllResourceNames(userDAO.authFind(key)), resources));
         PropagationReporter propagationReporter =
                 ApplicationContextProvider.getBeanFactory().getBean(PropagationReporter.class);
-        try {
-            taskExecutor.execute(tasks, propagationReporter);
-        } catch (PropagationException e) {
-            LOG.error("Error propagation primary resource", e);
-            propagationReporter.onPrimaryResourceFailure(tasks);
-        }
+        taskExecutor.execute(tasks, propagationReporter, nullPriorityAsync);
 
         return propagationReporter.getStatuses();
     }
@@ -383,11 +380,6 @@ public class DefaultUserProvisioningManager implements UserProvisioningManager {
 
         PropagationReporter propReporter =
                 ApplicationContextProvider.getBeanFactory().getBean(PropagationReporter.class);
-        try {
-            taskExecutor.execute(tasks, propReporter);
-        } catch (PropagationException e) {
-            LOG.error("Error propagation primary resource", e);
-            propReporter.onPrimaryResourceFailure(tasks);
-        }
+        taskExecutor.execute(tasks, propReporter, false);
     }
 }

http://git-wip-us.apache.org/repos/asf/syncope/blob/1b81e33c/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/AbstractAnyDataBinder.java
----------------------------------------------------------------------
diff --git a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/AbstractAnyDataBinder.java b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/AbstractAnyDataBinder.java
index 4af649f..bd7fb02 100644
--- a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/AbstractAnyDataBinder.java
+++ b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/AbstractAnyDataBinder.java
@@ -681,7 +681,10 @@ abstract class AbstractAnyDataBinder {
                             + " on resource '" + resource.getKey() + "'");
                 }
 
-                connObjectKeys.put(resource.getKey(), mappingUtils.getConnObjectKeyValue(any, provision));
+                String connObjectKey = mappingUtils.getConnObjectKeyValue(any, provision);
+                if (connObjectKey != null) {
+                    connObjectKeys.put(resource.getKey(), connObjectKey);
+                }
             }
         }
 

http://git-wip-us.apache.org/repos/asf/syncope/blob/1b81e33c/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/ResourceDataBinderImpl.java
----------------------------------------------------------------------
diff --git a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/ResourceDataBinderImpl.java b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/ResourceDataBinderImpl.java
index dff71a0..5f0decf 100644
--- a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/ResourceDataBinderImpl.java
+++ b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/ResourceDataBinderImpl.java
@@ -101,8 +101,6 @@ public class ResourceDataBinderImpl implements ResourceDataBinder {
 
         resource.setEnforceMandatoryCondition(resourceTO.isEnforceMandatoryCondition());
 
-        resource.setPropagationPrimary(resourceTO.isPropagationPrimary());
-
         resource.setPropagationPriority(resourceTO.getPropagationPriority());
 
         resource.setRandomPwdIfNotProvided(resourceTO.isRandomPwdIfNotProvided());
@@ -335,8 +333,6 @@ public class ResourceDataBinderImpl implements ResourceDataBinder {
 
         resourceTO.setEnforceMandatoryCondition(resource.isEnforceMandatoryCondition());
 
-        resourceTO.setPropagationPrimary(resource.isPropagationPrimary());
-
         resourceTO.setPropagationPriority(resource.getPropagationPriority());
 
         resourceTO.setRandomPwdIfNotProvided(resource.isRandomPwdIfNotProvided());

http://git-wip-us.apache.org/repos/asf/syncope/blob/1b81e33c/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/TaskDataBinderImpl.java
----------------------------------------------------------------------
diff --git a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/TaskDataBinderImpl.java b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/TaskDataBinderImpl.java
index e0f8cd8..3207bd2 100644
--- a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/TaskDataBinderImpl.java
+++ b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/TaskDataBinderImpl.java
@@ -299,6 +299,7 @@ public class TaskDataBinderImpl implements TaskDataBinder {
                             + task.getClass().getName());
                 }
                 ((PropagationTaskTO) taskTO).setResource(((PropagationTask) task).getResource().getKey());
+                ((PropagationTaskTO) taskTO).setAttributes(((PropagationTask) task).getSerializedAttributes());
                 break;
 
             case SCHEDULED:

http://git-wip-us.apache.org/repos/asf/syncope/blob/1b81e33c/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/job/SchedulerShutdown.java
----------------------------------------------------------------------
diff --git a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/job/SchedulerShutdown.java b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/job/SchedulerShutdown.java
index 8129928..7104f52 100644
--- a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/job/SchedulerShutdown.java
+++ b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/job/SchedulerShutdown.java
@@ -18,8 +18,6 @@
  */
 package org.apache.syncope.core.provisioning.java.job;
 
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 import org.springframework.beans.BeansException;
 import org.springframework.beans.factory.DisposableBean;
 import org.springframework.context.ApplicationContext;
@@ -31,8 +29,6 @@ import org.springframework.scheduling.quartz.SchedulerFactoryBean;
  */
 public class SchedulerShutdown implements ApplicationContextAware, DisposableBean {
 
-    private static final Logger LOG = LoggerFactory.getLogger(SchedulerShutdown.class);
-
     private ApplicationContext ctx;
 
     @Override

http://git-wip-us.apache.org/repos/asf/syncope/blob/1b81e33c/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/job/SpringBeanJobFactory.java
----------------------------------------------------------------------
diff --git a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/job/SpringBeanJobFactory.java b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/job/SpringBeanJobFactory.java
index 925c6e6..713566c 100644
--- a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/job/SpringBeanJobFactory.java
+++ b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/job/SpringBeanJobFactory.java
@@ -51,10 +51,10 @@ public class SpringBeanJobFactory extends org.springframework.scheduling.quartz.
 
     @Override
     protected Object createJobInstance(final TriggerFiredBundle bundle) throws Exception {
-        final ApplicationContext ctx = ((ConfigurableApplicationContext) schedulerContext.get("applicationContext"));
+        ApplicationContext ctx = ((ConfigurableApplicationContext) schedulerContext.get("applicationContext"));
 
-        final Object job = ctx.getBean(bundle.getJobDetail().getKey().getName());
-        final BeanWrapper wrapper = PropertyAccessorFactory.forBeanPropertyAccess(job);
+        Object job = ctx.getBean(bundle.getJobDetail().getKey().getName());
+        BeanWrapper wrapper = PropertyAccessorFactory.forBeanPropertyAccess(job);
         if (isEligibleForPropertyPopulation(wrapper.getWrappedInstance())) {
             final MutablePropertyValues pvs = new MutablePropertyValues();
             if (this.schedulerContext != null) {

http://git-wip-us.apache.org/repos/asf/syncope/blob/1b81e33c/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/notification/NotificationManagerImpl.java
----------------------------------------------------------------------
diff --git a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/notification/NotificationManagerImpl.java b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/notification/NotificationManagerImpl.java
index fd4af1b..c6f08a3 100644
--- a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/notification/NotificationManagerImpl.java
+++ b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/notification/NotificationManagerImpl.java
@@ -35,6 +35,7 @@ import org.apache.syncope.common.lib.types.AuditElements.Result;
 import org.apache.syncope.common.lib.types.AuditLoggerName;
 import org.apache.syncope.common.lib.types.IntMappingType;
 import org.apache.syncope.common.lib.to.AnyObjectTO;
+import org.apache.syncope.common.lib.to.ProvisioningResult;
 import org.apache.syncope.common.lib.types.AnyTypeKind;
 import org.apache.syncope.core.persistence.api.dao.ConfDAO;
 import org.apache.syncope.core.persistence.api.dao.NotificationDAO;
@@ -272,16 +273,22 @@ public class NotificationManagerImpl implements NotificationManager {
 
         if (before instanceof UserTO) {
             any = userDAO.find(((UserTO) before).getKey());
-        } else if (output instanceof UserTO) {
-            any = userDAO.find(((UserTO) output).getKey());
+        } else if (output instanceof ProvisioningResult
+                && ((ProvisioningResult) output).getAny() instanceof UserTO) {
+
+            any = userDAO.find(((ProvisioningResult) output).getAny().getKey());
         } else if (before instanceof AnyObjectTO) {
             any = anyObjectDAO.find(((AnyObjectTO) before).getKey());
-        } else if (output instanceof AnyObjectTO) {
-            any = anyObjectDAO.find(((AnyObjectTO) output).getKey());
+        } else if (output instanceof ProvisioningResult
+                && ((ProvisioningResult) output).getAny() instanceof AnyObjectTO) {
+
+            any = anyObjectDAO.find(((ProvisioningResult) output).getAny().getKey());
         } else if (before instanceof GroupTO) {
             any = groupDAO.find(((GroupTO) before).getKey());
-        } else if (output instanceof GroupTO) {
-            any = groupDAO.find(((GroupTO) output).getKey());
+        } else if (output instanceof ProvisioningResult
+                && ((ProvisioningResult) output).getAny() instanceof GroupTO) {
+
+            any = groupDAO.find(((ProvisioningResult) output).getAny().getKey());
         }
 
         AnyType anyType = any == null ? null : any.getType();

http://git-wip-us.apache.org/repos/asf/syncope/blob/1b81e33c/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/propagation/AbstractPropagationTaskExecutor.java
----------------------------------------------------------------------
diff --git a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/propagation/AbstractPropagationTaskExecutor.java b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/propagation/AbstractPropagationTaskExecutor.java
index d513069..cbc26f5 100644
--- a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/propagation/AbstractPropagationTaskExecutor.java
+++ b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/propagation/AbstractPropagationTaskExecutor.java
@@ -62,6 +62,7 @@ import org.apache.syncope.core.persistence.api.entity.user.User;
 import org.apache.syncope.core.provisioning.api.cache.VirAttrCache;
 import org.apache.syncope.core.provisioning.api.cache.VirAttrCacheValue;
 import org.apache.syncope.core.provisioning.api.notification.NotificationManager;
+import org.apache.syncope.core.provisioning.api.propagation.PropagationException;
 import org.identityconnectors.framework.common.exceptions.ConnectorException;
 import org.identityconnectors.framework.common.objects.Attribute;
 import org.identityconnectors.framework.common.objects.AttributeUtil;
@@ -311,17 +312,17 @@ public abstract class AbstractPropagationTaskExecutor implements PropagationTask
         } else {
             /*
              * We must choose here whether to
-             * a. actually delete the provided user / group from the external resource
-             * b. just update the provided user / group data onto the external resource
+             * a. actually delete the provided any object from the external resource
+             * b. just update the provided any object data onto the external resource
              *
-             * (a) happens when either there is no user / group associated with the PropagationTask (this takes place
+             * (a) happens when either there is no any object associated with the PropagationTask (this takes place
              * when the task is generated via UserLogic.delete() / GroupLogic.delete()) or the provided updated
-             * user / group hasn't the current resource assigned (when the task is generated via
+             * any object hasn't the current resource assigned (when the task is generated via
              * UserController.update() / GroupLogic.update()).
              *
-             * (b) happens when the provided updated user / group does have the current resource assigned (when the task
+             * (b) happens when the provided updated any object does have the current resource assigned (when the task
              * is generated via UserLogic.update() / GroupLogic.updae()): this basically means that before such
-             * update, this user / group used to have the current resource assigned by more than one mean (for example,
+             * update, this any object used to have the current resource assigned by more than one mean (for example,
              * two different memberships with the same resource).
              */
             Any<?, ?> any = getAny(task);
@@ -452,13 +453,13 @@ public abstract class AbstractPropagationTaskExecutor implements PropagationTask
                 task.addExec(execution);
 
                 taskDAO.save(task);
-                // this flush call is needed to generate a value for the execution id
+                // needed to generate a value for the execution key
                 taskDAO.flush();
             }
 
             if (reporter != null) {
-                reporter.onSuccessOrSecondaryResourceFailures(
-                        task.getResource().getKey(),
+                reporter.onSuccessOrNonPriorityResourceFailures(
+                        task,
                         PropagationTaskExecStatus.valueOf(execution.getStatus()),
                         failureReason,
                         beforeObj,
@@ -491,16 +492,30 @@ public abstract class AbstractPropagationTaskExecutor implements PropagationTask
 
     @Override
     public void execute(final Collection<PropagationTask> tasks) {
-        execute(tasks, null);
+        execute(tasks, null, false);
     }
 
+    protected abstract void doExecute(
+            Collection<PropagationTask> tasks, PropagationReporter reporter, boolean nullPriorityAsync);
+
     @Override
-    public abstract void execute(Collection<PropagationTask> tasks, final PropagationReporter reporter);
+    public void execute(
+            final Collection<PropagationTask> tasks,
+            final PropagationReporter reporter,
+            final boolean nullPriorityAsync) {
+
+        try {
+            doExecute(tasks, reporter, nullPriorityAsync);
+        } catch (PropagationException e) {
+            LOG.error("Error propagation priority resource", e);
+            reporter.onPriorityResourceFailure(e.getResourceName(), tasks);
+        }
+    }
 
     /**
      * Check whether an execution has to be stored, for a given task.
      *
-     * @param task execution's task
+     * @param task propagation task
      * @param execution to be decide whether to store or not
      * @return true if execution has to be store, false otherwise
      */

http://git-wip-us.apache.org/repos/asf/syncope/blob/1b81e33c/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/propagation/DefaultPropagationReporter.java
----------------------------------------------------------------------
diff --git a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/propagation/DefaultPropagationReporter.java b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/propagation/DefaultPropagationReporter.java
index d635e15..8e780f4 100644
--- a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/propagation/DefaultPropagationReporter.java
+++ b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/propagation/DefaultPropagationReporter.java
@@ -19,7 +19,11 @@
 package org.apache.syncope.core.provisioning.java.propagation;
 
 import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
 import java.util.List;
+import org.apache.commons.collections4.CollectionUtils;
+import org.apache.commons.collections4.Predicate;
 import org.apache.syncope.common.lib.to.PropagationStatus;
 import org.apache.syncope.common.lib.types.PropagationTaskExecStatus;
 import org.apache.syncope.core.persistence.api.entity.task.PropagationTask;
@@ -39,56 +43,68 @@ public class DefaultPropagationReporter implements PropagationReporter {
 
     protected final List<PropagationStatus> statuses = new ArrayList<>();
 
+    protected boolean add(final PropagationStatus status) {
+        return CollectionUtils.exists(statuses, new Predicate<PropagationStatus>() {
+
+            @Override
+            public boolean evaluate(final PropagationStatus item) {
+                return item.getResource().equals(status.getResource());
+            }
+        })
+                ? false
+                : statuses.add(status);
+    }
+
     @Override
-    public void onSuccessOrSecondaryResourceFailures(final String resource,
+    public void onSuccessOrNonPriorityResourceFailures(
+            final PropagationTask propagationTask,
             final PropagationTaskExecStatus executionStatus,
-            final String failureReason, final ConnectorObject beforeObj, final ConnectorObject afterObj) {
+            final String failureReason,
+            final ConnectorObject beforeObj,
+            final ConnectorObject afterObj) {
 
-        PropagationStatus propagation = new PropagationStatus();
-        propagation.setResource(resource);
-        propagation.setStatus(executionStatus);
-        propagation.setFailureReason(failureReason);
+        PropagationStatus status = new PropagationStatus();
+        status.setResource(propagationTask.getResource().getKey());
+        status.setStatus(executionStatus);
+        status.setFailureReason(failureReason);
 
         if (beforeObj != null) {
-            propagation.setBeforeObj(connObjectUtils.getConnObjectTO(beforeObj));
+            status.setBeforeObj(connObjectUtils.getConnObjectTO(beforeObj));
         }
 
         if (afterObj != null) {
-            propagation.setAfterObj(connObjectUtils.getConnObjectTO(afterObj));
+            status.setAfterObj(connObjectUtils.getConnObjectTO(afterObj));
         }
 
-        statuses.add(propagation);
-    }
-
-    private boolean containsPropagationStatusTO(final String resourceName) {
-        for (PropagationStatus status : statuses) {
-            if (resourceName.equals(status.getResource())) {
-                return true;
-            }
-        }
-        return false;
+        add(status);
     }
 
     @Override
-    public void onPrimaryResourceFailure(final List<PropagationTask> tasks) {
-        final String failedResource = statuses.get(statuses.size() - 1).getResource();
-
-        LOG.debug("Propagation error: {} primary resource failed to propagate", failedResource);
-
-        for (PropagationTask propagationTask : tasks) {
-            if (!containsPropagationStatusTO(propagationTask.getResource().getKey())) {
-                PropagationStatus propagationStatusTO = new PropagationStatus();
-                propagationStatusTO.setResource(propagationTask.getResource().getKey());
-                propagationStatusTO.setStatus(PropagationTaskExecStatus.FAILURE);
-                propagationStatusTO.setFailureReason(
-                        "Propagation error: " + failedResource + " primary resource failed to propagate.");
-                statuses.add(propagationStatusTO);
+    public void onPriorityResourceFailure(final String failingResource, final Collection<PropagationTask> tasks) {
+        LOG.debug("Propagation error: {} priority resource failed to propagate", failingResource);
+
+        final PropagationTask propagationTask = CollectionUtils.find(tasks, new Predicate<PropagationTask>() {
+
+            @Override
+            public boolean evaluate(final PropagationTask task) {
+                return task.getResource().getKey().equals(failingResource);
             }
+        });
+
+        if (propagationTask == null) {
+            LOG.error("Could not find {} for {}", PropagationTask.class.getName(), failingResource);
+        } else {
+            PropagationStatus status = new PropagationStatus();
+            status.setResource(propagationTask.getResource().getKey());
+            status.setStatus(PropagationTaskExecStatus.FAILURE);
+            status.setFailureReason(
+                    "Propagation error: " + failingResource + " priority resource failed to propagate.");
+            add(status);
         }
     }
 
     @Override
     public List<PropagationStatus> getStatuses() {
-        return statuses;
+        return Collections.unmodifiableList(statuses);
     }
 }

http://git-wip-us.apache.org/repos/asf/syncope/blob/1b81e33c/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/propagation/PriorityPropagationTaskExecutor.java
----------------------------------------------------------------------
diff --git a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/propagation/PriorityPropagationTaskExecutor.java b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/propagation/PriorityPropagationTaskExecutor.java
index 90d56ba..5ea6616 100644
--- a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/propagation/PriorityPropagationTaskExecutor.java
+++ b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/propagation/PriorityPropagationTaskExecutor.java
@@ -23,77 +23,139 @@ import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.Comparator;
+import java.util.HashMap;
+import java.util.HashSet;
 import java.util.List;
-import org.apache.syncope.common.lib.types.AuditElements;
-import org.apache.syncope.common.lib.types.AuditElements.Result;
+import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.CompletionService;
+import java.util.concurrent.ExecutorCompletionService;
+import java.util.concurrent.Future;
+import java.util.concurrent.TimeUnit;
+import javax.annotation.Resource;
+import org.apache.commons.collections4.CollectionUtils;
+import org.apache.commons.collections4.Predicate;
 import org.apache.syncope.common.lib.types.PropagationTaskExecStatus;
+import org.apache.syncope.core.misc.spring.ApplicationContextProvider;
 import org.apache.syncope.core.persistence.api.entity.task.PropagationTask;
 import org.apache.syncope.core.persistence.api.entity.task.TaskExec;
 import org.apache.syncope.core.provisioning.api.propagation.PropagationException;
 import org.apache.syncope.core.provisioning.api.propagation.PropagationReporter;
+import org.apache.syncope.core.provisioning.api.propagation.PropagationTaskCallable;
+import org.springframework.beans.factory.support.AbstractBeanDefinition;
+import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
 
 /**
- * Sort the given collection by looking at related ExternalResource's priority, then execute.
+ * Sorts the tasks to be executed according to related
+ * {@link org.apache.syncope.core.persistence.api.entity.resource.ExternalResource}'s priority, then execute.
+ * Tasks related to resources with NULL priority are executed after other tasks, concurrently.
+ * Failure during execution of a task related to resource with non-NULL priority are treated as fatal and will interrupt
+ * the whole process, resulting in a global failure.
  */
 public class PriorityPropagationTaskExecutor extends AbstractPropagationTaskExecutor {
 
+    @Resource(name = "propagationTaskExecutorAsyncExecutor")
+    protected ThreadPoolTaskExecutor executor;
+
     @Override
-    public void execute(final Collection<PropagationTask> tasks, final PropagationReporter reporter) {
-        List<PropagationTask> prioritizedTasks = new ArrayList<>(tasks);
-        Collections.sort(prioritizedTasks, new PriorityComparator());
+    public PropagationTaskCallable newPropagationTaskCallable(
+            final PropagationTask task, final PropagationReporter reporter) {
 
-        LOG.debug("Propagation tasks sorted by priority, before execution: {}", prioritizedTasks);
+        PropagationTaskCallable callable = (PropagationTaskCallable) ApplicationContextProvider.getBeanFactory().
+                createBean(PropagationTaskCallableImpl.class, AbstractBeanDefinition.AUTOWIRE_BY_TYPE, false);
+        callable.setExecutor(this);
+        callable.setTask(task);
+        callable.setReporter(reporter);
 
-        Result result = Result.SUCCESS;
+        return callable;
+    }
 
-        try {
-            for (PropagationTask task : prioritizedTasks) {
-                LOG.debug("Execution started for {}", task);
+    @Override
+    protected void doExecute(
+            final Collection<PropagationTask> tasks,
+            final PropagationReporter reporter,
+            final boolean nullPriorityAsync) {
 
-                TaskExec execution = execute(task, reporter);
+        List<PropagationTask> prioritizedTasks = CollectionUtils.select(tasks, new Predicate<PropagationTask>() {
 
-                LOG.debug("Execution finished for {}, {}", task, execution);
+            @Override
+            public boolean evaluate(final PropagationTask task) {
+                return task.getResource().getPropagationPriority() != null;
+            }
+        }, new ArrayList<PropagationTask>());
+        Collections.sort(prioritizedTasks, new PriorityComparator());
+        LOG.debug("Propagation tasks sorted by priority, for serial execution: {}", prioritizedTasks);
 
-                // Propagation is interrupted as soon as the result of the
-                // communication with a primary resource is in error
-                PropagationTaskExecStatus execStatus;
-                try {
-                    execStatus = PropagationTaskExecStatus.valueOf(execution.getStatus());
-                } catch (IllegalArgumentException e) {
-                    LOG.error("Unexpected execution status found {}", execution.getStatus());
-                    execStatus = PropagationTaskExecStatus.FAILURE;
+        Collection<PropagationTask> concurrentTasks = CollectionUtils.subtract(tasks, prioritizedTasks);
+        LOG.debug("Propagation tasks for concurrent execution: {}", concurrentTasks);
+
+        // first process priority resources sequentially and fail as soon as any propagation failure is reported
+        for (PropagationTask task : prioritizedTasks) {
+            TaskExec execution = null;
+            PropagationTaskExecStatus execStatus;
+            try {
+                execution = newPropagationTaskCallable(task, reporter).call();
+                execStatus = PropagationTaskExecStatus.valueOf(execution.getStatus());
+            } catch (Exception e) {
+                LOG.error("Unexpected exception", e);
+                execStatus = PropagationTaskExecStatus.FAILURE;
+            }
+            if (execStatus != PropagationTaskExecStatus.SUCCESS) {
+                throw new PropagationException(
+                        task.getResource().getKey(), execution == null ? null : execution.getMessage());
+            }
+        }
+
+        // then process non-priority resources concurrently...
+        final CompletionService<TaskExec> completionService = new ExecutorCompletionService<>(executor);
+        Map<PropagationTask, Future<TaskExec>> nullPriority = new HashMap<>(concurrentTasks.size());
+        for (PropagationTask task : concurrentTasks) {
+            try {
+                nullPriority.put(
+                        task,
+                        completionService.submit(newPropagationTaskCallable(task, reporter)));
+            } catch (Exception e) {
+                LOG.error("Unexpected exception", e);
+            }
+        }
+        // ...waiting for all callables to complete, if async processing was not required
+        if (!nullPriority.isEmpty()) {
+            if (nullPriorityAsync) {
+                for (Map.Entry<PropagationTask, Future<TaskExec>> entry : nullPriority.entrySet()) {
+                    reporter.onSuccessOrNonPriorityResourceFailures(
+                            entry.getKey(), PropagationTaskExecStatus.CREATED, null, null, null);
                 }
-                if (task.getResource().isPropagationPrimary() && execStatus != PropagationTaskExecStatus.SUCCESS) {
-                    result = Result.FAILURE;
-                    throw new PropagationException(task.getResource().getKey(), execution.getMessage());
+            } else {
+                final Set<Future<TaskExec>> nullPriorityFutures = new HashSet<>(nullPriority.values());
+                try {
+                    executor.submit(new Runnable() {
+
+                        @Override
+                        public void run() {
+                            while (!nullPriorityFutures.isEmpty()) {
+                                try {
+                                    nullPriorityFutures.remove(completionService.take());
+                                } catch (Exception e) {
+                                    LOG.error("Unexpected exception", e);
+                                }
+                            }
+                        }
+                    }).get(60, TimeUnit.SECONDS);
+                } catch (Exception e) {
+                    LOG.error("Unexpected exception", e);
+                } finally {
+                    for (Future<TaskExec> future : nullPriorityFutures) {
+                        future.cancel(true);
+                    }
+                    nullPriorityFutures.clear();
+                    nullPriority.clear();
                 }
             }
-        } finally {
-            notificationManager.createTasks(
-                    AuditElements.EventCategoryType.PROPAGATION,
-                    null,
-                    null,
-                    null,
-                    result,
-                    reporter == null ? null : reporter.getStatuses(),
-                    tasks);
-
-            auditManager.audit(
-                    AuditElements.EventCategoryType.PROPAGATION,
-                    null,
-                    null,
-                    null,
-                    result,
-                    reporter == null ? null : reporter.getStatuses(),
-                    tasks);
         }
     }
 
     /**
      * Compare propagation tasks according to related ExternalResource's priority.
-     *
-     * @see PropagationTask
-     * @see org.apache.syncope.core.persistence.beans.ExternalResource#propagationPriority
      */
     protected static class PriorityComparator implements Comparator<PropagationTask>, Serializable {
 
@@ -101,12 +163,8 @@ public class PriorityPropagationTaskExecutor extends AbstractPropagationTaskExec
 
         @Override
         public int compare(final PropagationTask task1, final PropagationTask task2) {
-            int prop1 = task1.getResource().getPropagationPriority() == null
-                    ? Integer.MIN_VALUE
-                    : task1.getResource().getPropagationPriority();
-            int prop2 = task2.getResource().getPropagationPriority() == null
-                    ? Integer.MIN_VALUE
-                    : task2.getResource().getPropagationPriority();
+            int prop1 = task1.getResource().getPropagationPriority();
+            int prop2 = task2.getResource().getPropagationPriority();
 
             return prop1 > prop2
                     ? 1
@@ -115,4 +173,5 @@ public class PriorityPropagationTaskExecutor extends AbstractPropagationTaskExec
                             : -1;
         }
     }
+
 }

http://git-wip-us.apache.org/repos/asf/syncope/blob/1b81e33c/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/propagation/PropagationTaskCallableImpl.java
----------------------------------------------------------------------
diff --git a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/propagation/PropagationTaskCallableImpl.java b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/propagation/PropagationTaskCallableImpl.java
new file mode 100644
index 0000000..4e6b875
--- /dev/null
+++ b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/propagation/PropagationTaskCallableImpl.java
@@ -0,0 +1,94 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.core.provisioning.java.propagation;
+
+import java.util.Collection;
+import org.apache.syncope.core.misc.security.AuthContextUtils;
+import org.apache.syncope.core.misc.security.SyncopeAuthenticationDetails;
+import org.apache.syncope.core.persistence.api.entity.task.PropagationTask;
+import org.apache.syncope.core.persistence.api.entity.task.TaskExec;
+import org.apache.syncope.core.provisioning.api.propagation.PropagationReporter;
+import org.apache.syncope.core.provisioning.api.propagation.PropagationTaskCallable;
+import org.apache.syncope.core.provisioning.api.propagation.PropagationTaskExecutor;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
+import org.springframework.security.core.GrantedAuthority;
+import org.springframework.security.core.context.SecurityContext;
+import org.springframework.security.core.context.SecurityContextHolder;
+import org.springframework.security.core.userdetails.User;
+import org.springframework.transaction.annotation.Transactional;
+
+@Transactional(rollbackFor = { Throwable.class })
+public class PropagationTaskCallableImpl implements PropagationTaskCallable {
+
+    private static final Logger LOG = LoggerFactory.getLogger(PropagationTaskCallable.class);
+
+    private final String domain;
+
+    private final String username;
+
+    private final Collection<? extends GrantedAuthority> authorities;
+
+    private PropagationTaskExecutor executor;
+
+    private PropagationTask task;
+
+    private PropagationReporter reporter;
+
+    public PropagationTaskCallableImpl() {
+        SecurityContext ctx = SecurityContextHolder.getContext();
+        domain = AuthContextUtils.getDomain();
+        username = ctx.getAuthentication().getName();
+        authorities = ctx.getAuthentication().getAuthorities();
+    }
+
+    @Override
+    public void setExecutor(final PropagationTaskExecutor executor) {
+        this.executor = executor;
+    }
+
+    @Override
+    public void setTask(final PropagationTask task) {
+        this.task = task;
+    }
+
+    @Override
+    public void setReporter(final PropagationReporter reporter) {
+        this.reporter = reporter;
+    }
+
+    @Override
+    public TaskExec call() throws Exception {
+        // set security context according to the one gathered at instantiation time from the calling thread
+        UsernamePasswordAuthenticationToken auth = new UsernamePasswordAuthenticationToken(
+                new User(username, "FAKE_PASSWORD", authorities), "FAKE_PASSWORD", authorities);
+        auth.setDetails(new SyncopeAuthenticationDetails(domain));
+        SecurityContextHolder.getContext().setAuthentication(auth);
+
+        LOG.debug("Execution started for {}", task);
+
+        TaskExec execution = executor.execute(task, reporter);
+
+        LOG.debug("Execution completed for {}, {}", task, execution);
+
+        return execution;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/1b81e33c/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/sync/AbstractProvisioningJobDelegate.java
----------------------------------------------------------------------
diff --git a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/sync/AbstractProvisioningJobDelegate.java b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/sync/AbstractProvisioningJobDelegate.java
index 0c8deb2..d6f4c15 100644
--- a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/sync/AbstractProvisioningJobDelegate.java
+++ b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/sync/AbstractProvisioningJobDelegate.java
@@ -34,7 +34,7 @@ import org.apache.syncope.core.persistence.api.entity.task.ProvisioningTask;
 import org.apache.syncope.core.persistence.api.entity.task.TaskExec;
 import org.apache.syncope.core.provisioning.api.Connector;
 import org.apache.syncope.core.provisioning.api.ConnectorFactory;
-import org.apache.syncope.core.provisioning.api.sync.ProvisioningResult;
+import org.apache.syncope.core.provisioning.api.sync.ProvisioningReport;
 import org.apache.syncope.core.provisioning.java.job.AbstractSchedTaskJobDelegate;
 import org.apache.syncope.core.provisioning.java.job.TaskJob;
 import org.quartz.JobExecutionException;
@@ -75,7 +75,7 @@ public abstract class AbstractProvisioningJobDelegate<T extends ProvisioningTask
      * @param dryRun dry run?
      * @return report as string
      */
-    protected String createReport(final Collection<ProvisioningResult> provResults, final TraceLevel syncTraceLevel,
+    protected String createReport(final Collection<ProvisioningReport> provResults, final TraceLevel syncTraceLevel,
             final boolean dryRun) {
 
         if (syncTraceLevel == TraceLevel.NONE) {
@@ -88,32 +88,32 @@ public abstract class AbstractProvisioningJobDelegate<T extends ProvisioningTask
             report.append("==>Dry run only, no modifications were made<==\n\n");
         }
 
-        List<ProvisioningResult> uSuccCreate = new ArrayList<>();
-        List<ProvisioningResult> uFailCreate = new ArrayList<>();
-        List<ProvisioningResult> uSuccUpdate = new ArrayList<>();
-        List<ProvisioningResult> uFailUpdate = new ArrayList<>();
-        List<ProvisioningResult> uSuccDelete = new ArrayList<>();
-        List<ProvisioningResult> uFailDelete = new ArrayList<>();
-        List<ProvisioningResult> uSuccNone = new ArrayList<>();
-        List<ProvisioningResult> uIgnore = new ArrayList<>();
-        List<ProvisioningResult> gSuccCreate = new ArrayList<>();
-        List<ProvisioningResult> gFailCreate = new ArrayList<>();
-        List<ProvisioningResult> gSuccUpdate = new ArrayList<>();
-        List<ProvisioningResult> gFailUpdate = new ArrayList<>();
-        List<ProvisioningResult> gSuccDelete = new ArrayList<>();
-        List<ProvisioningResult> gFailDelete = new ArrayList<>();
-        List<ProvisioningResult> gSuccNone = new ArrayList<>();
-        List<ProvisioningResult> gIgnore = new ArrayList<>();
-        List<ProvisioningResult> aSuccCreate = new ArrayList<>();
-        List<ProvisioningResult> aFailCreate = new ArrayList<>();
-        List<ProvisioningResult> aSuccUpdate = new ArrayList<>();
-        List<ProvisioningResult> aFailUpdate = new ArrayList<>();
-        List<ProvisioningResult> aSuccDelete = new ArrayList<>();
-        List<ProvisioningResult> aFailDelete = new ArrayList<>();
-        List<ProvisioningResult> aSuccNone = new ArrayList<>();
-        List<ProvisioningResult> aIgnore = new ArrayList<>();
-
-        for (ProvisioningResult provResult : provResults) {
+        List<ProvisioningReport> uSuccCreate = new ArrayList<>();
+        List<ProvisioningReport> uFailCreate = new ArrayList<>();
+        List<ProvisioningReport> uSuccUpdate = new ArrayList<>();
+        List<ProvisioningReport> uFailUpdate = new ArrayList<>();
+        List<ProvisioningReport> uSuccDelete = new ArrayList<>();
+        List<ProvisioningReport> uFailDelete = new ArrayList<>();
+        List<ProvisioningReport> uSuccNone = new ArrayList<>();
+        List<ProvisioningReport> uIgnore = new ArrayList<>();
+        List<ProvisioningReport> gSuccCreate = new ArrayList<>();
+        List<ProvisioningReport> gFailCreate = new ArrayList<>();
+        List<ProvisioningReport> gSuccUpdate = new ArrayList<>();
+        List<ProvisioningReport> gFailUpdate = new ArrayList<>();
+        List<ProvisioningReport> gSuccDelete = new ArrayList<>();
+        List<ProvisioningReport> gFailDelete = new ArrayList<>();
+        List<ProvisioningReport> gSuccNone = new ArrayList<>();
+        List<ProvisioningReport> gIgnore = new ArrayList<>();
+        List<ProvisioningReport> aSuccCreate = new ArrayList<>();
+        List<ProvisioningReport> aFailCreate = new ArrayList<>();
+        List<ProvisioningReport> aSuccUpdate = new ArrayList<>();
+        List<ProvisioningReport> aFailUpdate = new ArrayList<>();
+        List<ProvisioningReport> aSuccDelete = new ArrayList<>();
+        List<ProvisioningReport> aFailDelete = new ArrayList<>();
+        List<ProvisioningReport> aSuccNone = new ArrayList<>();
+        List<ProvisioningReport> aIgnore = new ArrayList<>();
+
+        for (ProvisioningReport provResult : provResults) {
             AnyType anyType = anyTypeDAO.find(provResult.getAnyType());
 
             switch (provResult.getStatus()) {
@@ -293,76 +293,76 @@ public abstract class AbstractProvisioningJobDelegate<T extends ProvisioningTask
         if (syncTraceLevel == TraceLevel.FAILURES || syncTraceLevel == TraceLevel.ALL) {
             if (!uFailCreate.isEmpty()) {
                 report.append("\n\nUsers failed to create: ");
-                report.append(ProvisioningResult.produceReport(uFailCreate, syncTraceLevel));
+                report.append(ProvisioningReport.produceReport(uFailCreate, syncTraceLevel));
             }
             if (!uFailUpdate.isEmpty()) {
                 report.append("\nUsers failed to update: ");
-                report.append(ProvisioningResult.produceReport(uFailUpdate, syncTraceLevel));
+                report.append(ProvisioningReport.produceReport(uFailUpdate, syncTraceLevel));
             }
             if (!uFailDelete.isEmpty()) {
                 report.append("\nUsers failed to delete: ");
-                report.append(ProvisioningResult.produceReport(uFailDelete, syncTraceLevel));
+                report.append(ProvisioningReport.produceReport(uFailDelete, syncTraceLevel));
             }
 
             if (!gFailCreate.isEmpty()) {
                 report.append("\n\nGroups failed to create: ");
-                report.append(ProvisioningResult.produceReport(gFailCreate, syncTraceLevel));
+                report.append(ProvisioningReport.produceReport(gFailCreate, syncTraceLevel));
             }
             if (!gFailUpdate.isEmpty()) {
                 report.append("\nGroups failed to update: ");
-                report.append(ProvisioningResult.produceReport(gFailUpdate, syncTraceLevel));
+                report.append(ProvisioningReport.produceReport(gFailUpdate, syncTraceLevel));
             }
             if (!gFailDelete.isEmpty()) {
                 report.append("\nGroups failed to delete: ");
-                report.append(ProvisioningResult.produceReport(gFailDelete, syncTraceLevel));
+                report.append(ProvisioningReport.produceReport(gFailDelete, syncTraceLevel));
             }
 
             if (!aFailCreate.isEmpty()) {
                 report.append("\nAny objects failed to create: ");
-                report.append(ProvisioningResult.produceReport(aFailCreate, syncTraceLevel));
+                report.append(ProvisioningReport.produceReport(aFailCreate, syncTraceLevel));
             }
             if (!aFailUpdate.isEmpty()) {
                 report.append("\nAny objects failed to update: ");
-                report.append(ProvisioningResult.produceReport(aFailUpdate, syncTraceLevel));
+                report.append(ProvisioningReport.produceReport(aFailUpdate, syncTraceLevel));
             }
             if (!aFailDelete.isEmpty()) {
                 report.append("\nAny objects failed to delete: ");
-                report.append(ProvisioningResult.produceReport(aFailDelete, syncTraceLevel));
+                report.append(ProvisioningReport.produceReport(aFailDelete, syncTraceLevel));
             }
         }
 
         // Succeeded, only if on 'ALL' level
         if (syncTraceLevel == TraceLevel.ALL) {
             report.append("\n\nUsers created:\n").
-                    append(ProvisioningResult.produceReport(uSuccCreate, syncTraceLevel)).
+                    append(ProvisioningReport.produceReport(uSuccCreate, syncTraceLevel)).
                     append("\nUsers updated:\n").
-                    append(ProvisioningResult.produceReport(uSuccUpdate, syncTraceLevel)).
+                    append(ProvisioningReport.produceReport(uSuccUpdate, syncTraceLevel)).
                     append("\nUsers deleted:\n").
-                    append(ProvisioningResult.produceReport(uSuccDelete, syncTraceLevel)).
+                    append(ProvisioningReport.produceReport(uSuccDelete, syncTraceLevel)).
                     append("\nUsers no operation:\n").
-                    append(ProvisioningResult.produceReport(uSuccNone, syncTraceLevel)).
+                    append(ProvisioningReport.produceReport(uSuccNone, syncTraceLevel)).
                     append("\nUsers ignored:\n").
-                    append(ProvisioningResult.produceReport(uIgnore, syncTraceLevel));
+                    append(ProvisioningReport.produceReport(uIgnore, syncTraceLevel));
             report.append("\n\nGroups created:\n").
-                    append(ProvisioningResult.produceReport(gSuccCreate, syncTraceLevel)).
+                    append(ProvisioningReport.produceReport(gSuccCreate, syncTraceLevel)).
                     append("\nGroups updated:\n").
-                    append(ProvisioningResult.produceReport(gSuccUpdate, syncTraceLevel)).
+                    append(ProvisioningReport.produceReport(gSuccUpdate, syncTraceLevel)).
                     append("\nGroups deleted:\n").
-                    append(ProvisioningResult.produceReport(gSuccDelete, syncTraceLevel)).
+                    append(ProvisioningReport.produceReport(gSuccDelete, syncTraceLevel)).
                     append("\nGroups no operation:\n").
-                    append(ProvisioningResult.produceReport(gSuccNone, syncTraceLevel)).
+                    append(ProvisioningReport.produceReport(gSuccNone, syncTraceLevel)).
                     append("\nGroups ignored:\n").
-                    append(ProvisioningResult.produceReport(gSuccNone, syncTraceLevel));
+                    append(ProvisioningReport.produceReport(gSuccNone, syncTraceLevel));
             report.append("\n\nAny objects created:\n").
-                    append(ProvisioningResult.produceReport(aSuccCreate, syncTraceLevel)).
+                    append(ProvisioningReport.produceReport(aSuccCreate, syncTraceLevel)).
                     append("\nAny objects updated:\n").
-                    append(ProvisioningResult.produceReport(aSuccUpdate, syncTraceLevel)).
+                    append(ProvisioningReport.produceReport(aSuccUpdate, syncTraceLevel)).
                     append("\nAny objects deleted:\n").
-                    append(ProvisioningResult.produceReport(aSuccDelete, syncTraceLevel)).
+                    append(ProvisioningReport.produceReport(aSuccDelete, syncTraceLevel)).
                     append("\nAny objects no operation:\n").
-                    append(ProvisioningResult.produceReport(aSuccNone, syncTraceLevel)).
+                    append(ProvisioningReport.produceReport(aSuccNone, syncTraceLevel)).
                     append("\nAny objects ignored:\n").
-                    append(ProvisioningResult.produceReport(aSuccNone, syncTraceLevel));
+                    append(ProvisioningReport.produceReport(aSuccNone, syncTraceLevel));
         }
 
         return report.toString();

http://git-wip-us.apache.org/repos/asf/syncope/blob/1b81e33c/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/sync/AbstractPushResultHandler.java
----------------------------------------------------------------------
diff --git a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/sync/AbstractPushResultHandler.java b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/sync/AbstractPushResultHandler.java
index f938faf..5daea51 100644
--- a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/sync/AbstractPushResultHandler.java
+++ b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/sync/AbstractPushResultHandler.java
@@ -35,7 +35,7 @@ import org.apache.syncope.common.lib.types.ResourceOperation;
 import org.apache.syncope.common.lib.types.UnmatchingRule;
 import org.apache.syncope.core.persistence.api.entity.task.PushTask;
 import org.apache.syncope.core.persistence.api.entity.user.User;
-import org.apache.syncope.core.provisioning.api.sync.ProvisioningResult;
+import org.apache.syncope.core.provisioning.api.sync.ProvisioningReport;
 import org.apache.syncope.core.provisioning.api.sync.PushActions;
 import org.apache.syncope.core.misc.utils.MappingUtils;
 import org.apache.syncope.core.persistence.api.entity.Any;
@@ -154,10 +154,10 @@ public abstract class AbstractPushResultHandler extends AbstractSyncopeResultHan
             doHandle(any);
             return true;
         } catch (IgnoreProvisionException e) {
-            ProvisioningResult result = new ProvisioningResult();
+            ProvisioningReport result = new ProvisioningReport();
             result.setOperation(ResourceOperation.NONE);
             result.setAnyType(any == null ? null : any.getType().getKey());
-            result.setStatus(ProvisioningResult.Status.IGNORE);
+            result.setStatus(ProvisioningReport.Status.IGNORE);
             result.setKey(anyKey);
             profile.getResults().add(result);
 
@@ -172,7 +172,7 @@ public abstract class AbstractPushResultHandler extends AbstractSyncopeResultHan
     protected final void doHandle(final Any<?, ?> any) throws JobExecutionException {
         AnyUtils anyUtils = anyUtilsFactory.getInstance(any);
 
-        ProvisioningResult result = new ProvisioningResult();
+        ProvisioningReport result = new ProvisioningReport();
         profile.getResults().add(result);
 
         result.setKey(any.getKey());
@@ -204,7 +204,7 @@ public abstract class AbstractPushResultHandler extends AbstractSyncopeResultHan
             } else {
                 result.setOperation(getResourceOperation(profile.getTask().getMatchingRule()));
             }
-            result.setStatus(ProvisioningResult.Status.SUCCESS);
+            result.setStatus(ProvisioningReport.Status.SUCCESS);
         } else {
             try {
                 if (beforeObj == null) {
@@ -338,13 +338,13 @@ public abstract class AbstractPushResultHandler extends AbstractSyncopeResultHan
                     action.after(this.getProfile(), any, result);
                 }
 
-                result.setStatus(ProvisioningResult.Status.SUCCESS);
+                result.setStatus(ProvisioningReport.Status.SUCCESS);
                 resultStatus = AuditElements.Result.SUCCESS;
                 output = getRemoteObject(connObjecKey, provision.getObjectClass());
             } catch (IgnoreProvisionException e) {
                 throw e;
             } catch (Exception e) {
-                result.setStatus(ProvisioningResult.Status.FAILURE);
+                result.setStatus(ProvisioningReport.Status.FAILURE);
                 result.setMessage(ExceptionUtils.getRootCauseMessage(e));
                 resultStatus = AuditElements.Result.FAILURE;
                 output = e;

http://git-wip-us.apache.org/repos/asf/syncope/blob/1b81e33c/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/sync/AbstractSyncResultHandler.java
----------------------------------------------------------------------
diff --git a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/sync/AbstractSyncResultHandler.java b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/sync/AbstractSyncResultHandler.java
index 3967f2b..2c5bbb9 100644
--- a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/sync/AbstractSyncResultHandler.java
+++ b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/sync/AbstractSyncResultHandler.java
@@ -46,7 +46,7 @@ import org.apache.syncope.core.provisioning.api.ProvisioningManager;
 import org.apache.syncope.core.provisioning.api.cache.VirAttrCache;
 import org.apache.syncope.core.provisioning.api.cache.VirAttrCacheValue;
 import org.apache.syncope.core.provisioning.api.sync.IgnoreProvisionException;
-import org.apache.syncope.core.provisioning.api.sync.ProvisioningResult;
+import org.apache.syncope.core.provisioning.api.sync.ProvisioningReport;
 import org.apache.syncope.core.provisioning.api.sync.SyncopeSyncResultHandler;
 import org.identityconnectors.framework.common.objects.Attribute;
 import org.identityconnectors.framework.common.objects.SyncDelta;
@@ -72,7 +72,7 @@ public abstract class AbstractSyncResultHandler extends AbstractSyncopeResultHan
 
     protected abstract ProvisioningManager<?, ?> getProvisioningManager();
 
-    protected abstract AnyTO doCreate(AnyTO anyTO, SyncDelta delta, ProvisioningResult result);
+    protected abstract AnyTO doCreate(AnyTO anyTO, SyncDelta delta, ProvisioningReport result);
 
     protected AnyTO doLink(final AnyTO before, final boolean unlink) {
         AnyPatch patch = newPatch(before.getKey());
@@ -84,7 +84,7 @@ public abstract class AbstractSyncResultHandler extends AbstractSyncopeResultHan
         return getAnyTO(update(patch).getResult());
     }
 
-    protected abstract AnyTO doUpdate(AnyTO before, AnyPatch anyPatch, SyncDelta delta, ProvisioningResult result);
+    protected abstract AnyTO doUpdate(AnyTO before, AnyPatch anyPatch, SyncDelta delta, ProvisioningReport result);
 
     protected void doDeprovision(final AnyTypeKind kind, final Long key, final boolean unlink) {
         PropagationByResource propByRes = new PropagationByResource();
@@ -118,7 +118,7 @@ public abstract class AbstractSyncResultHandler extends AbstractSyncopeResultHan
             LOG.error("Could not propagate anyObject " + key, e);
         }
 
-        getProvisioningManager().delete(key);
+        getProvisioningManager().delete(key, true);
     }
 
     @Override
@@ -134,11 +134,11 @@ public abstract class AbstractSyncResultHandler extends AbstractSyncopeResultHan
             doHandle(delta, provision);
             return true;
         } catch (IgnoreProvisionException e) {
-            ProvisioningResult result = new ProvisioningResult();
+            ProvisioningReport result = new ProvisioningReport();
             result.setOperation(ResourceOperation.NONE);
             result.setAnyType(provision == null
                     ? getAnyUtils().getAnyTypeKind().name() : provision.getAnyType().getKey());
-            result.setStatus(ProvisioningResult.Status.IGNORE);
+            result.setStatus(ProvisioningReport.Status.IGNORE);
             result.setKey(0L);
             result.setName(delta.getObject().getName().getNameValue());
             profile.getResults().add(result);
@@ -151,23 +151,23 @@ public abstract class AbstractSyncResultHandler extends AbstractSyncopeResultHan
         }
     }
 
-    protected List<ProvisioningResult> assign(
+    protected List<ProvisioningReport> assign(
             final SyncDelta delta, final Provision provision, final AnyUtils anyUtils)
             throws JobExecutionException {
 
         if (!profile.getTask().isPerformCreate()) {
             LOG.debug("SyncTask not configured for create");
-            return Collections.<ProvisioningResult>emptyList();
+            return Collections.<ProvisioningReport>emptyList();
         }
 
         AnyTO anyTO = connObjectUtils.getAnyTO(delta.getObject(), profile.getTask(), provision, anyUtils);
 
         anyTO.getResources().add(profile.getTask().getResource().getKey());
 
-        ProvisioningResult result = new ProvisioningResult();
+        ProvisioningReport result = new ProvisioningReport();
         result.setOperation(ResourceOperation.CREATE);
         result.setAnyType(provision.getAnyType().getKey());
-        result.setStatus(ProvisioningResult.Status.SUCCESS);
+        result.setStatus(ProvisioningReport.Status.SUCCESS);
         result.setName(getName(anyTO));
 
         if (profile.isDryRun()) {
@@ -184,21 +184,21 @@ public abstract class AbstractSyncResultHandler extends AbstractSyncopeResultHan
         return Collections.singletonList(result);
     }
 
-    protected List<ProvisioningResult> provision(
+    protected List<ProvisioningReport> provision(
             final SyncDelta delta, final Provision provision, final AnyUtils anyUtils)
             throws JobExecutionException {
 
         if (!profile.getTask().isPerformCreate()) {
             LOG.debug("SyncTask not configured for create");
-            return Collections.<ProvisioningResult>emptyList();
+            return Collections.<ProvisioningReport>emptyList();
         }
 
         AnyTO anyTO = connObjectUtils.getAnyTO(delta.getObject(), profile.getTask(), provision, anyUtils);
 
-        ProvisioningResult result = new ProvisioningResult();
+        ProvisioningReport result = new ProvisioningReport();
         result.setOperation(ResourceOperation.CREATE);
         result.setAnyType(provision.getAnyType().getKey());
-        result.setStatus(ProvisioningResult.Status.SUCCESS);
+        result.setStatus(ProvisioningReport.Status.SUCCESS);
         result.setName(getName(anyTO));
 
         if (profile.isDryRun()) {
@@ -219,7 +219,7 @@ public abstract class AbstractSyncResultHandler extends AbstractSyncopeResultHan
             final AnyTO anyTO,
             final SyncDelta delta,
             final String operation,
-            final ProvisioningResult result)
+            final ProvisioningReport result)
             throws JobExecutionException {
 
         Object output;
@@ -247,7 +247,7 @@ public abstract class AbstractSyncResultHandler extends AbstractSyncopeResultHan
                 action.onError(this.getProfile(), delta, result, e);
             }
         } catch (Exception e) {
-            result.setStatus(ProvisioningResult.Status.FAILURE);
+            result.setStatus(ProvisioningReport.Status.FAILURE);
             result.setMessage(ExceptionUtils.getRootCauseMessage(e));
             LOG.error("Could not create {} {} ", anyTO.getType(), delta.getUid().getUidValue(), e);
             output = e;
@@ -261,31 +261,31 @@ public abstract class AbstractSyncResultHandler extends AbstractSyncopeResultHan
         audit(operation, resultStatus, null, output, delta);
     }
 
-    protected List<ProvisioningResult> update(final SyncDelta delta, final List<Long> anys,
+    protected List<ProvisioningReport> update(final SyncDelta delta, final List<Long> anys,
             final Provision provision) throws JobExecutionException {
 
         if (!profile.getTask().isPerformUpdate()) {
             LOG.debug("SyncTask not configured for update");
-            return Collections.<ProvisioningResult>emptyList();
+            return Collections.<ProvisioningReport>emptyList();
         }
 
         LOG.debug("About to update {}", anys);
 
-        List<ProvisioningResult> results = new ArrayList<>();
+        List<ProvisioningReport> results = new ArrayList<>();
 
         SyncDelta workingDelta = delta;
         for (Long key : anys) {
             LOG.debug("About to update {}", key);
 
-            ProvisioningResult result = new ProvisioningResult();
+            ProvisioningReport result = new ProvisioningReport();
             result.setOperation(ResourceOperation.UPDATE);
             result.setAnyType(provision.getAnyType().getKey());
-            result.setStatus(ProvisioningResult.Status.SUCCESS);
+            result.setStatus(ProvisioningReport.Status.SUCCESS);
             result.setKey(key);
 
             AnyTO before = getAnyTO(key);
             if (before == null) {
-                result.setStatus(ProvisioningResult.Status.FAILURE);
+                result.setStatus(ProvisioningReport.Status.FAILURE);
                 result.setMessage(String.format("Any '%s(%d)' not found", provision.getAnyType().getKey(), key));
             } else {
                 result.setName(getName(before));
@@ -335,7 +335,7 @@ public abstract class AbstractSyncResultHandler extends AbstractSyncopeResultHan
                             action.onError(this.getProfile(), workingDelta, result, e);
                         }
                     } catch (Exception e) {
-                        result.setStatus(ProvisioningResult.Status.FAILURE);
+                        result.setStatus(ProvisioningReport.Status.FAILURE);
                         result.setMessage(ExceptionUtils.getRootCauseMessage(e));
                         LOG.error("Could not update {} {}",
                                 provision.getAnyType().getKey(), workingDelta.getUid().getUidValue(), e);
@@ -354,7 +354,7 @@ public abstract class AbstractSyncResultHandler extends AbstractSyncopeResultHan
         return results;
     }
 
-    protected List<ProvisioningResult> deprovision(
+    protected List<ProvisioningReport> deprovision(
             final SyncDelta delta,
             final List<Long> anys,
             final Provision provision,
@@ -363,12 +363,12 @@ public abstract class AbstractSyncResultHandler extends AbstractSyncopeResultHan
 
         if (!profile.getTask().isPerformUpdate()) {
             LOG.debug("SyncTask not configured for update");
-            return Collections.<ProvisioningResult>emptyList();
+            return Collections.<ProvisioningReport>emptyList();
         }
 
         LOG.debug("About to update {}", anys);
 
-        final List<ProvisioningResult> updResults = new ArrayList<>();
+        final List<ProvisioningReport> updResults = new ArrayList<>();
 
         for (Long key : anys) {
             LOG.debug("About to unassign resource {}", key);
@@ -376,16 +376,16 @@ public abstract class AbstractSyncResultHandler extends AbstractSyncopeResultHan
             Object output;
             Result resultStatus;
 
-            ProvisioningResult result = new ProvisioningResult();
+            ProvisioningReport result = new ProvisioningReport();
             result.setOperation(ResourceOperation.DELETE);
             result.setAnyType(provision.getAnyType().getKey());
-            result.setStatus(ProvisioningResult.Status.SUCCESS);
+            result.setStatus(ProvisioningReport.Status.SUCCESS);
             result.setKey(key);
 
             AnyTO before = getAnyTO(key);
 
             if (before == null) {
-                result.setStatus(ProvisioningResult.Status.FAILURE);
+                result.setStatus(ProvisioningReport.Status.FAILURE);
                 result.setMessage(String.format("Any '%s(%d)' not found", provision.getAnyType().getKey(), key));
             }
 
@@ -430,7 +430,7 @@ public abstract class AbstractSyncResultHandler extends AbstractSyncopeResultHan
                             action.onError(this.getProfile(), delta, result, e);
                         }
                     } catch (Exception e) {
-                        result.setStatus(ProvisioningResult.Status.FAILURE);
+                        result.setStatus(ProvisioningReport.Status.FAILURE);
                         result.setMessage(ExceptionUtils.getRootCauseMessage(e));
                         LOG.error("Could not update {} {}",
                                 provision.getAnyType().getKey(), delta.getUid().getUidValue(), e);
@@ -452,7 +452,7 @@ public abstract class AbstractSyncResultHandler extends AbstractSyncopeResultHan
         return updResults;
     }
 
-    protected List<ProvisioningResult> link(
+    protected List<ProvisioningReport> link(
             final SyncDelta delta,
             final List<Long> anys,
             final Provision provision,
@@ -461,12 +461,12 @@ public abstract class AbstractSyncResultHandler extends AbstractSyncopeResultHan
 
         if (!profile.getTask().isPerformUpdate()) {
             LOG.debug("SyncTask not configured for update");
-            return Collections.<ProvisioningResult>emptyList();
+            return Collections.<ProvisioningReport>emptyList();
         }
 
         LOG.debug("About to update {}", anys);
 
-        final List<ProvisioningResult> updResults = new ArrayList<>();
+        final List<ProvisioningReport> updResults = new ArrayList<>();
 
         for (Long key : anys) {
             LOG.debug("About to unassign resource {}", key);
@@ -474,16 +474,16 @@ public abstract class AbstractSyncResultHandler extends AbstractSyncopeResultHan
             Object output;
             Result resultStatus;
 
-            ProvisioningResult result = new ProvisioningResult();
+            ProvisioningReport result = new ProvisioningReport();
             result.setOperation(ResourceOperation.NONE);
             result.setAnyType(provision.getAnyType().getKey());
-            result.setStatus(ProvisioningResult.Status.SUCCESS);
+            result.setStatus(ProvisioningReport.Status.SUCCESS);
             result.setKey(key);
 
             AnyTO before = getAnyTO(key);
 
             if (before == null) {
-                result.setStatus(ProvisioningResult.Status.FAILURE);
+                result.setStatus(ProvisioningReport.Status.FAILURE);
                 result.setMessage(String.format("Any '%s(%d)' not found", provision.getAnyType().getKey(), key));
             }
 
@@ -527,7 +527,7 @@ public abstract class AbstractSyncResultHandler extends AbstractSyncopeResultHan
                             action.onError(this.getProfile(), delta, result, e);
                         }
                     } catch (Exception e) {
-                        result.setStatus(ProvisioningResult.Status.FAILURE);
+                        result.setStatus(ProvisioningReport.Status.FAILURE);
                         result.setMessage(ExceptionUtils.getRootCauseMessage(e));
                         LOG.error("Could not update {} {}",
                                 provision.getAnyType().getKey(), delta.getUid().getUidValue(), e);
@@ -548,7 +548,7 @@ public abstract class AbstractSyncResultHandler extends AbstractSyncopeResultHan
         return updResults;
     }
 
-    protected List<ProvisioningResult> delete(
+    protected List<ProvisioningReport> delete(
             final SyncDelta delta,
             final List<Long> anys,
             final Provision provision)
@@ -556,19 +556,19 @@ public abstract class AbstractSyncResultHandler extends AbstractSyncopeResultHan
 
         if (!profile.getTask().isPerformDelete()) {
             LOG.debug("SyncTask not configured for delete");
-            return Collections.<ProvisioningResult>emptyList();
+            return Collections.<ProvisioningReport>emptyList();
         }
 
         LOG.debug("About to delete {}", anys);
 
-        List<ProvisioningResult> delResults = new ArrayList<>();
+        List<ProvisioningReport> delResults = new ArrayList<>();
 
         SyncDelta workingDelta = delta;
         for (Long key : anys) {
             Object output;
             Result resultStatus = Result.FAILURE;
 
-            ProvisioningResult result = new ProvisioningResult();
+            ProvisioningReport result = new ProvisioningReport();
 
             try {
                 AnyTO before = getAnyTO(key);
@@ -577,7 +577,7 @@ public abstract class AbstractSyncResultHandler extends AbstractSyncopeResultHan
                 result.setName(getName(before));
                 result.setOperation(ResourceOperation.DELETE);
                 result.setAnyType(provision.getAnyType().getKey());
-                result.setStatus(ProvisioningResult.Status.SUCCESS);
+                result.setStatus(ProvisioningReport.Status.SUCCESS);
 
                 if (!profile.isDryRun()) {
                     for (SyncActions action : profile.getActions()) {
@@ -595,7 +595,7 @@ public abstract class AbstractSyncResultHandler extends AbstractSyncopeResultHan
                     } catch (IgnoreProvisionException e) {
                         throw e;
                     } catch (Exception e) {
-                        result.setStatus(ProvisioningResult.Status.FAILURE);
+                        result.setStatus(ProvisioningReport.Status.FAILURE);
                         result.setMessage(ExceptionUtils.getRootCauseMessage(e));
                         LOG.error("Could not delete {} {}", provision.getAnyType().getKey(), key, e);
                         output = e;
@@ -621,7 +621,7 @@ public abstract class AbstractSyncResultHandler extends AbstractSyncopeResultHan
         return delResults;
     }
 
-    private List<ProvisioningResult> ignore(
+    private List<ProvisioningReport> ignore(
             final SyncDelta delta,
             final Provision provision,
             final boolean matching)
@@ -629,14 +629,14 @@ public abstract class AbstractSyncResultHandler extends AbstractSyncopeResultHan
 
         LOG.debug("Any to ignore {}", delta.getObject().getUid().getUidValue());
 
-        final List<ProvisioningResult> ignoreResults = new ArrayList<>();
-        ProvisioningResult result = new ProvisioningResult();
+        final List<ProvisioningReport> ignoreResults = new ArrayList<>();
+        ProvisioningReport result = new ProvisioningReport();
 
         result.setKey(null);
         result.setName(delta.getObject().getUid().getUidValue());
         result.setOperation(ResourceOperation.NONE);
         result.setAnyType(provision.getAnyType().getKey());
-        result.setStatus(ProvisioningResult.Status.SUCCESS);
+        result.setStatus(ProvisioningReport.Status.SUCCESS);
         ignoreResults.add(result);
 
         if (!profile.isDryRun()) {


Mime
View raw message