syncope-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ilgro...@apache.org
Subject [05/15] syncope git commit: FIT server integration tests
Date Fri, 23 Jan 2015 16:41:27 GMT
http://git-wip-us.apache.org/repos/asf/syncope/blob/80589a1b/syncope620/server/provisioning-java/src/main/java/org/apache/syncope/server/provisioning/java/sync/DefaultPushActions.java
----------------------------------------------------------------------
diff --git a/syncope620/server/provisioning-java/src/main/java/org/apache/syncope/server/provisioning/java/sync/DefaultPushActions.java b/syncope620/server/provisioning-java/src/main/java/org/apache/syncope/server/provisioning/java/sync/DefaultPushActions.java
index a9ba96e..dbbdd2a 100644
--- a/syncope620/server/provisioning-java/src/main/java/org/apache/syncope/server/provisioning/java/sync/DefaultPushActions.java
+++ b/syncope620/server/provisioning-java/src/main/java/org/apache/syncope/server/provisioning/java/sync/DefaultPushActions.java
@@ -18,7 +18,6 @@
  */
 package org.apache.syncope.server.provisioning.java.sync;
 
-import java.util.List;
 import org.apache.syncope.server.persistence.api.entity.Subject;
 import org.apache.syncope.server.provisioning.api.sync.PushActions;
 import org.apache.syncope.server.provisioning.api.sync.ProvisioningProfile;
@@ -78,11 +77,12 @@ public abstract class DefaultPushActions implements PushActions {
 
     @Override
     public <T extends Subject<?, ?, ?>> void after(
-            final ProvisioningProfile<?, ?> profile, final T subject, final ProvisioningResult result) throws JobExecutionException {
+            final ProvisioningProfile<?, ?> profile, final T subject, final ProvisioningResult result)
+            throws JobExecutionException {
     }
 
     @Override
-    public void afterAll(final ProvisioningProfile<?, ?> profile, final List<ProvisioningResult> results)
+    public void afterAll(final ProvisioningProfile<?, ?> profile)
             throws JobExecutionException {
     }
 }

http://git-wip-us.apache.org/repos/asf/syncope/blob/80589a1b/syncope620/server/provisioning-java/src/main/java/org/apache/syncope/server/provisioning/java/sync/DefaultSyncActions.java
----------------------------------------------------------------------
diff --git a/syncope620/server/provisioning-java/src/main/java/org/apache/syncope/server/provisioning/java/sync/DefaultSyncActions.java b/syncope620/server/provisioning-java/src/main/java/org/apache/syncope/server/provisioning/java/sync/DefaultSyncActions.java
index b957d2a..6589cdf 100644
--- a/syncope620/server/provisioning-java/src/main/java/org/apache/syncope/server/provisioning/java/sync/DefaultSyncActions.java
+++ b/syncope620/server/provisioning-java/src/main/java/org/apache/syncope/server/provisioning/java/sync/DefaultSyncActions.java
@@ -18,7 +18,6 @@
  */
 package org.apache.syncope.server.provisioning.java.sync;
 
-import java.util.List;
 import org.apache.syncope.common.lib.mod.AbstractSubjectMod;
 import org.apache.syncope.common.lib.to.AbstractSubjectTO;
 import org.apache.syncope.server.provisioning.api.sync.SyncActions;
@@ -104,12 +103,13 @@ public abstract class DefaultSyncActions implements SyncActions {
 
     @Override
     public <T extends AbstractSubjectTO> void after(
-            final ProvisioningProfile<?, ?> profile, final SyncDelta delta, final T subject, final ProvisioningResult result)
+            final ProvisioningProfile<?, ?> profile, final SyncDelta delta, final T subject,
+            final ProvisioningResult result)
             throws JobExecutionException {
     }
 
     @Override
-    public void afterAll(final ProvisioningProfile<?, ?> profile, final List<ProvisioningResult> results)
+    public void afterAll(final ProvisioningProfile<?, ?> profile)
             throws JobExecutionException {
     }
 }

http://git-wip-us.apache.org/repos/asf/syncope/blob/80589a1b/syncope620/server/provisioning-java/src/main/java/org/apache/syncope/server/provisioning/java/sync/LDAPMembershipSyncActions.java
----------------------------------------------------------------------
diff --git a/syncope620/server/provisioning-java/src/main/java/org/apache/syncope/server/provisioning/java/sync/LDAPMembershipSyncActions.java b/syncope620/server/provisioning-java/src/main/java/org/apache/syncope/server/provisioning/java/sync/LDAPMembershipSyncActions.java
index b705c64..145cd4d 100644
--- a/syncope620/server/provisioning-java/src/main/java/org/apache/syncope/server/provisioning/java/sync/LDAPMembershipSyncActions.java
+++ b/syncope620/server/provisioning-java/src/main/java/org/apache/syncope/server/provisioning/java/sync/LDAPMembershipSyncActions.java
@@ -146,17 +146,17 @@ public class LDAPMembershipSyncActions extends DefaultSyncActions {
     /**
      * Build UserMod for adding membership to given user, for given role.
      *
-     * @param userId user to be assigned membership to given role
+     * @param userKey user to be assigned membership to given role
      * @param roleTO role for adding membership
      * @return UserMod for user update
      */
-    protected UserMod getUserMod(final Long userId, final RoleTO roleTO) {
+    protected UserMod getUserMod(final Long userKey, final RoleTO roleTO) {
         UserMod userMod = new UserMod();
         // no actual modification takes place when user has already the role assigned
-        if (membersBeforeRoleUpdate.containsKey(userId)) {
-            membersBeforeRoleUpdate.remove(userId);
+        if (membersBeforeRoleUpdate.containsKey(userKey)) {
+            membersBeforeRoleUpdate.remove(userKey);
         } else {
-            userMod.setKey(userId);
+            userMod.setKey(userKey);
 
             MembershipMod membershipMod = new MembershipMod();
             membershipMod.setRole(roleTO.getKey());
@@ -265,13 +265,13 @@ public class LDAPMembershipSyncActions extends DefaultSyncActions {
         final Connector connector = profile.getConnector();
 
         for (Object membValue : getMembAttrValues(delta, connector)) {
-            Long userId = syncUtilities.findMatchingAttributableId(
+            Long userKey = syncUtilities.findMatchingAttributableKey(
                     ObjectClass.ACCOUNT,
                     membValue.toString(),
                     profile.getTask().getResource(),
                     profile.getConnector());
-            if (userId != null) {
-                UserMod userMod = getUserMod(userId, roleTO);
+            if (userKey != null) {
+                UserMod userMod = getUserMod(userKey, roleTO);
                 userUpdate(userMod, resource.getKey());
             }
         }

http://git-wip-us.apache.org/repos/asf/syncope/blob/80589a1b/syncope620/server/provisioning-java/src/main/java/org/apache/syncope/server/provisioning/java/sync/PushJobImpl.java
----------------------------------------------------------------------
diff --git a/syncope620/server/provisioning-java/src/main/java/org/apache/syncope/server/provisioning/java/sync/PushJobImpl.java b/syncope620/server/provisioning-java/src/main/java/org/apache/syncope/server/provisioning/java/sync/PushJobImpl.java
index d40b4be..3f7b291 100644
--- a/syncope620/server/provisioning-java/src/main/java/org/apache/syncope/server/provisioning/java/sync/PushJobImpl.java
+++ b/syncope620/server/provisioning-java/src/main/java/org/apache/syncope/server/provisioning/java/sync/PushJobImpl.java
@@ -18,7 +18,6 @@
  */
 package org.apache.syncope.server.provisioning.java.sync;
 
-import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
 import java.util.Set;
@@ -36,11 +35,12 @@ import org.apache.syncope.server.persistence.api.entity.user.UMapping;
 import org.apache.syncope.server.persistence.api.entity.user.User;
 import org.apache.syncope.server.provisioning.api.Connector;
 import org.apache.syncope.server.provisioning.api.sync.ProvisioningProfile;
-import org.apache.syncope.server.provisioning.api.sync.ProvisioningResult;
 import org.apache.syncope.server.provisioning.api.sync.PushActions;
 import org.apache.syncope.server.misc.spring.ApplicationContextProvider;
 import org.apache.syncope.server.misc.search.SearchCondConverter;
 import org.apache.syncope.server.provisioning.api.job.PushJob;
+import org.apache.syncope.server.provisioning.api.sync.RolePushResultHandler;
+import org.apache.syncope.server.provisioning.api.sync.UserPushResultHandler;
 import org.quartz.JobExecutionException;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.support.AbstractBeanDefinition;
@@ -50,6 +50,7 @@ import org.springframework.beans.factory.support.AbstractBeanDefinition;
  *
  * @see AbstractProvisioningJob
  * @see PushTask
+ * @see PushActions
  */
 public class PushJobImpl extends AbstractProvisioningJob<PushTask, PushActions> implements PushJob {
 
@@ -82,27 +83,26 @@ public class PushJobImpl extends AbstractProvisioningJob<PushTask, PushActions>
             final boolean dryRun) throws JobExecutionException {
         LOG.debug("Execute synchronization (push) with resource {}", pushTask.getResource());
 
-        final List<ProvisioningResult> results = new ArrayList<>();
-
         final Set<Long> authorizations = RoleEntitlementUtil.getRoleKeys(entitlementDAO.findAll());
 
         final ProvisioningProfile<PushTask, PushActions> profile = new ProvisioningProfile<>(connector, pushTask);
-        profile.getActions().addAll(actions);
+        if (actions != null) {
+            profile.getActions().addAll(actions);
+        }
         profile.setDryRun(dryRun);
         profile.setResAct(null);
-        profile.getResults().addAll(results);
 
         final UserPushResultHandler uhandler =
-                (UserPushResultHandler) ApplicationContextProvider.getApplicationContext().getBeanFactory().createBean(
-                        UserPushResultHandler.class, AbstractBeanDefinition.AUTOWIRE_BY_NAME, false);
+                (UserPushResultHandler) ApplicationContextProvider.getApplicationContext().getBeanFactory().
+                createBean(UserPushResultHandlerImpl.class, AbstractBeanDefinition.AUTOWIRE_BY_NAME, false);
         uhandler.setProfile(profile);
 
         final RolePushResultHandler rhandler =
-                (RolePushResultHandler) ApplicationContextProvider.getApplicationContext().getBeanFactory().createBean(
-                        RolePushResultHandler.class, AbstractBeanDefinition.AUTOWIRE_BY_NAME, false);
+                (RolePushResultHandler) ApplicationContextProvider.getApplicationContext().getBeanFactory().
+                createBean(RolePushResultHandlerImpl.class, AbstractBeanDefinition.AUTOWIRE_BY_NAME, false);
         rhandler.setProfile(profile);
 
-        if (!profile.isDryRun()) {
+        if (actions != null && !profile.isDryRun()) {
             for (PushActions action : actions) {
                 action.beforeAll(profile);
             }
@@ -139,13 +139,13 @@ public class PushJobImpl extends AbstractProvisioningJob<PushTask, PushActions>
             }
         }
 
-        if (!profile.isDryRun()) {
+        if (actions != null && !profile.isDryRun()) {
             for (PushActions action : actions) {
-                action.afterAll(profile, results);
+                action.afterAll(profile);
             }
         }
 
-        final String result = createReport(results, pushTask.getResource().getSyncTraceLevel(), dryRun);
+        final String result = createReport(profile.getResults(), pushTask.getResource().getSyncTraceLevel(), dryRun);
 
         LOG.debug("Sync result: {}", result);
 

http://git-wip-us.apache.org/repos/asf/syncope/blob/80589a1b/syncope620/server/provisioning-java/src/main/java/org/apache/syncope/server/provisioning/java/sync/RolePushResultHandler.java
----------------------------------------------------------------------
diff --git a/syncope620/server/provisioning-java/src/main/java/org/apache/syncope/server/provisioning/java/sync/RolePushResultHandler.java b/syncope620/server/provisioning-java/src/main/java/org/apache/syncope/server/provisioning/java/sync/RolePushResultHandler.java
deleted file mode 100644
index 60d6bdb..0000000
--- a/syncope620/server/provisioning-java/src/main/java/org/apache/syncope/server/provisioning/java/sync/RolePushResultHandler.java
+++ /dev/null
@@ -1,154 +0,0 @@
-/*
- * 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.server.provisioning.java.sync;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import org.apache.syncope.common.lib.mod.RoleMod;
-import org.apache.syncope.common.lib.to.AbstractSubjectTO;
-import org.apache.syncope.common.lib.to.RoleTO;
-import org.apache.syncope.common.lib.types.PropagationByResource;
-import org.apache.syncope.common.lib.types.ResourceOperation;
-import org.apache.syncope.server.persistence.api.entity.Mapping;
-import org.apache.syncope.server.persistence.api.entity.MappingItem;
-import org.apache.syncope.server.persistence.api.entity.Subject;
-import org.apache.syncope.server.persistence.api.entity.role.Role;
-import org.apache.syncope.server.provisioning.api.TimeoutException;
-import org.identityconnectors.framework.common.objects.ConnectorObject;
-import org.identityconnectors.framework.common.objects.ObjectClass;
-import org.identityconnectors.framework.common.objects.Uid;
-
-public class RolePushResultHandler extends AbstractSubjectPushResultHandler {
-
-    @Override
-    protected Subject<?, ?, ?> deprovision(final Subject<?, ?, ?> sbj) {
-        final RoleTO before = roleTransfer.getRoleTO(Role.class.cast(sbj));
-
-        final List<String> noPropResources = new ArrayList<>(before.getResources());
-        noPropResources.remove(profile.getTask().getResource().getKey());
-
-        taskExecutor.execute(propagationManager.getRoleDeleteTaskIds(before.getKey(), noPropResources));
-
-        return roleDAO.authFetch(before.getKey());
-    }
-
-    @Override
-    protected Subject<?, ?, ?> provision(final Subject<?, ?, ?> sbj, final Boolean enabled) {
-        final RoleTO before = roleTransfer.getRoleTO(Role.class.cast(sbj));
-
-        final List<String> noPropResources = new ArrayList<>(before.getResources());
-        noPropResources.remove(profile.getTask().getResource().getKey());
-
-        final PropagationByResource propByRes = new PropagationByResource();
-        propByRes.add(ResourceOperation.CREATE, profile.getTask().getResource().getKey());
-
-        taskExecutor.execute(propagationManager.getRoleCreateTaskIds(
-                before.getKey(),
-                Collections.unmodifiableCollection(before.getVirAttrs()),
-                propByRes,
-                noPropResources));
-
-        return roleDAO.authFetch(before.getKey());
-    }
-
-    @Override
-    protected Subject<?, ?, ?> link(final Subject<?, ?, ?> sbj, final Boolean unlink) {
-        final RoleMod roleMod = new RoleMod();
-        roleMod.setKey(sbj.getKey());
-
-        if (unlink) {
-            roleMod.getResourcesToRemove().add(profile.getTask().getResource().getKey());
-        } else {
-            roleMod.getResourcesToAdd().add(profile.getTask().getResource().getKey());
-        }
-
-        rwfAdapter.update(roleMod);
-
-        return roleDAO.authFetch(sbj.getKey());
-    }
-
-    @Override
-    protected Subject<?, ?, ?> unassign(final Subject<?, ?, ?> sbj) {
-        final RoleMod roleMod = new RoleMod();
-        roleMod.setKey(sbj.getKey());
-        roleMod.getResourcesToRemove().add(profile.getTask().getResource().getKey());
-        rwfAdapter.update(roleMod);
-        return deprovision(sbj);
-    }
-
-    @Override
-    protected Subject<?, ?, ?> assign(final Subject<?, ?, ?> sbj, final Boolean enabled) {
-        final RoleMod roleMod = new RoleMod();
-        roleMod.setKey(sbj.getKey());
-        roleMod.getResourcesToAdd().add(profile.getTask().getResource().getKey());
-        rwfAdapter.update(roleMod);
-        return provision(sbj, enabled);
-    }
-
-    @Override
-    protected String getName(final Subject<?, ?, ?> subject) {
-        return Role.class.cast(subject).getName();
-    }
-
-    @Override
-    protected AbstractSubjectTO getSubjectTO(final long key) {
-        try {
-            return roleTransfer.getRoleTO(roleDAO.authFetch(key));
-        } catch (Exception e) {
-            LOG.warn("Error retrieving user {}", key, e);
-            return null;
-        }
-    }
-
-    @Override
-    protected Subject<?, ?, ?> getSubject(final long key) {
-        try {
-            return roleDAO.authFetch(key);
-        } catch (Exception e) {
-            LOG.warn("Error retrieving role {}", key, e);
-            return null;
-        }
-    }
-
-    @Override
-    protected ConnectorObject getRemoteObject(final String accountId) {
-        ConnectorObject obj = null;
-
-        try {
-            final Uid uid = new Uid(accountId);
-
-            obj = profile.getConnector().getObject(
-                    ObjectClass.GROUP,
-                    uid,
-                    profile.getConnector().getOperationOptions(Collections.<MappingItem>emptySet()));
-        } catch (TimeoutException toe) {
-            LOG.debug("Request timeout", toe);
-            throw toe;
-        } catch (RuntimeException ignore) {
-            LOG.debug("While resolving {}", accountId, ignore);
-        }
-        return obj;
-    }
-
-    @Override
-    protected Mapping<?> getMapping() {
-        return profile.getTask().getResource().getRmapping();
-    }
-}

http://git-wip-us.apache.org/repos/asf/syncope/blob/80589a1b/syncope620/server/provisioning-java/src/main/java/org/apache/syncope/server/provisioning/java/sync/RolePushResultHandlerImpl.java
----------------------------------------------------------------------
diff --git a/syncope620/server/provisioning-java/src/main/java/org/apache/syncope/server/provisioning/java/sync/RolePushResultHandlerImpl.java b/syncope620/server/provisioning-java/src/main/java/org/apache/syncope/server/provisioning/java/sync/RolePushResultHandlerImpl.java
new file mode 100644
index 0000000..112d8cc
--- /dev/null
+++ b/syncope620/server/provisioning-java/src/main/java/org/apache/syncope/server/provisioning/java/sync/RolePushResultHandlerImpl.java
@@ -0,0 +1,155 @@
+/*
+ * 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.server.provisioning.java.sync;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import org.apache.syncope.common.lib.mod.RoleMod;
+import org.apache.syncope.common.lib.to.AbstractSubjectTO;
+import org.apache.syncope.common.lib.to.RoleTO;
+import org.apache.syncope.common.lib.types.PropagationByResource;
+import org.apache.syncope.common.lib.types.ResourceOperation;
+import org.apache.syncope.server.persistence.api.entity.Mapping;
+import org.apache.syncope.server.persistence.api.entity.MappingItem;
+import org.apache.syncope.server.persistence.api.entity.Subject;
+import org.apache.syncope.server.persistence.api.entity.role.Role;
+import org.apache.syncope.server.provisioning.api.TimeoutException;
+import org.apache.syncope.server.provisioning.api.sync.RolePushResultHandler;
+import org.identityconnectors.framework.common.objects.ConnectorObject;
+import org.identityconnectors.framework.common.objects.ObjectClass;
+import org.identityconnectors.framework.common.objects.Uid;
+
+public class RolePushResultHandlerImpl extends AbstractPushResultHandler implements RolePushResultHandler {
+
+    @Override
+    protected Subject<?, ?, ?> deprovision(final Subject<?, ?, ?> sbj) {
+        final RoleTO before = roleTransfer.getRoleTO(Role.class.cast(sbj));
+
+        final List<String> noPropResources = new ArrayList<>(before.getResources());
+        noPropResources.remove(profile.getTask().getResource().getKey());
+
+        taskExecutor.execute(propagationManager.getRoleDeleteTaskIds(before.getKey(), noPropResources));
+
+        return roleDAO.authFetch(before.getKey());
+    }
+
+    @Override
+    protected Subject<?, ?, ?> provision(final Subject<?, ?, ?> sbj, final Boolean enabled) {
+        final RoleTO before = roleTransfer.getRoleTO(Role.class.cast(sbj));
+
+        final List<String> noPropResources = new ArrayList<>(before.getResources());
+        noPropResources.remove(profile.getTask().getResource().getKey());
+
+        final PropagationByResource propByRes = new PropagationByResource();
+        propByRes.add(ResourceOperation.CREATE, profile.getTask().getResource().getKey());
+
+        taskExecutor.execute(propagationManager.getRoleCreateTaskIds(
+                before.getKey(),
+                Collections.unmodifiableCollection(before.getVirAttrs()),
+                propByRes,
+                noPropResources));
+
+        return roleDAO.authFetch(before.getKey());
+    }
+
+    @Override
+    protected Subject<?, ?, ?> link(final Subject<?, ?, ?> sbj, final Boolean unlink) {
+        final RoleMod roleMod = new RoleMod();
+        roleMod.setKey(sbj.getKey());
+
+        if (unlink) {
+            roleMod.getResourcesToRemove().add(profile.getTask().getResource().getKey());
+        } else {
+            roleMod.getResourcesToAdd().add(profile.getTask().getResource().getKey());
+        }
+
+        rwfAdapter.update(roleMod);
+
+        return roleDAO.authFetch(sbj.getKey());
+    }
+
+    @Override
+    protected Subject<?, ?, ?> unassign(final Subject<?, ?, ?> sbj) {
+        final RoleMod roleMod = new RoleMod();
+        roleMod.setKey(sbj.getKey());
+        roleMod.getResourcesToRemove().add(profile.getTask().getResource().getKey());
+        rwfAdapter.update(roleMod);
+        return deprovision(sbj);
+    }
+
+    @Override
+    protected Subject<?, ?, ?> assign(final Subject<?, ?, ?> sbj, final Boolean enabled) {
+        final RoleMod roleMod = new RoleMod();
+        roleMod.setKey(sbj.getKey());
+        roleMod.getResourcesToAdd().add(profile.getTask().getResource().getKey());
+        rwfAdapter.update(roleMod);
+        return provision(sbj, enabled);
+    }
+
+    @Override
+    protected String getName(final Subject<?, ?, ?> subject) {
+        return Role.class.cast(subject).getName();
+    }
+
+    @Override
+    protected AbstractSubjectTO getSubjectTO(final long key) {
+        try {
+            return roleTransfer.getRoleTO(key);
+        } catch (Exception e) {
+            LOG.warn("Error retrieving user {}", key, e);
+            return null;
+        }
+    }
+
+    @Override
+    protected Subject<?, ?, ?> getSubject(final long key) {
+        try {
+            return roleDAO.authFetch(key);
+        } catch (Exception e) {
+            LOG.warn("Error retrieving role {}", key, e);
+            return null;
+        }
+    }
+
+    @Override
+    protected ConnectorObject getRemoteObject(final String accountId) {
+        ConnectorObject obj = null;
+
+        try {
+            final Uid uid = new Uid(accountId);
+
+            obj = profile.getConnector().getObject(
+                    ObjectClass.GROUP,
+                    uid,
+                    profile.getConnector().getOperationOptions(Collections.<MappingItem>emptySet()));
+        } catch (TimeoutException toe) {
+            LOG.debug("Request timeout", toe);
+            throw toe;
+        } catch (RuntimeException ignore) {
+            LOG.debug("While resolving {}", accountId, ignore);
+        }
+        return obj;
+    }
+
+    @Override
+    protected Mapping<?> getMapping() {
+        return profile.getTask().getResource().getRmapping();
+    }
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/80589a1b/syncope620/server/provisioning-java/src/main/java/org/apache/syncope/server/provisioning/java/sync/RoleSyncResultHandler.java
----------------------------------------------------------------------
diff --git a/syncope620/server/provisioning-java/src/main/java/org/apache/syncope/server/provisioning/java/sync/RoleSyncResultHandler.java b/syncope620/server/provisioning-java/src/main/java/org/apache/syncope/server/provisioning/java/sync/RoleSyncResultHandler.java
deleted file mode 100644
index d172077..0000000
--- a/syncope620/server/provisioning-java/src/main/java/org/apache/syncope/server/provisioning/java/sync/RoleSyncResultHandler.java
+++ /dev/null
@@ -1,167 +0,0 @@
-/*
- * 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.server.provisioning.java.sync;
-
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import org.apache.syncope.common.lib.mod.AbstractSubjectMod;
-import org.apache.syncope.common.lib.mod.AttrMod;
-import org.apache.syncope.common.lib.mod.RoleMod;
-import org.apache.syncope.common.lib.mod.UserMod;
-import org.apache.syncope.common.lib.to.AbstractSubjectTO;
-import org.apache.syncope.common.lib.to.PropagationStatus;
-import org.apache.syncope.common.lib.to.RoleTO;
-import org.apache.syncope.common.lib.types.AttributableType;
-import org.apache.syncope.server.persistence.api.entity.AttributableUtil;
-import org.apache.syncope.server.provisioning.api.sync.ProvisioningResult;
-import org.identityconnectors.framework.common.objects.SyncDelta;
-
-public class RoleSyncResultHandler extends AbstractSubjectSyncResultHandler {
-
-    protected Map<Long, String> roleOwnerMap = new HashMap<>();
-
-    public Map<Long, String> getRoleOwnerMap() {
-        return this.roleOwnerMap;
-    }
-
-    @Override
-    protected AttributableUtil getAttributableUtil() {
-        return attrUtilFactory.getInstance(AttributableType.ROLE);
-    }
-
-    @Override
-    protected String getName(final AbstractSubjectTO subjectTO) {
-        return RoleTO.class.cast(subjectTO).getName();
-    }
-
-    @Override
-    protected AbstractSubjectTO getSubjectTO(final long key) {
-        try {
-            return roleTransfer.getRoleTO(roleDAO.authFetch(key));
-        } catch (Exception e) {
-            LOG.warn("Error retrieving role {}", key, e);
-            return null;
-        }
-    }
-
-    @Override
-    protected AbstractSubjectMod getSubjectMod(
-            final AbstractSubjectTO subjectTO, final SyncDelta delta) {
-
-        return connObjectUtil.getAttributableMod(
-                subjectTO.getKey(),
-                delta.getObject(),
-                subjectTO,
-                profile.getTask(),
-                attrUtilFactory.getInstance(AttributableType.ROLE));
-    }
-
-    @Override
-    protected AbstractSubjectTO create(
-            final AbstractSubjectTO subjectTO, final SyncDelta _delta, final ProvisioningResult result) {
-
-        RoleTO roleTO = RoleTO.class.cast(subjectTO);
-
-        Map.Entry<Long, List<PropagationStatus>> created = roleProvisioningManager.create(roleTO, roleOwnerMap,
-                Collections.singleton(profile.getTask().getResource().getKey()));
-
-        roleTO = roleTransfer.getRoleTO(roleDAO.authFetch(created.getKey()));
-
-        result.setId(created.getKey());
-        result.setName(getName(subjectTO));
-
-        return roleTO;
-    }
-
-    @Override
-    protected AbstractSubjectTO link(
-            final AbstractSubjectTO before,
-            final ProvisioningResult result,
-            final boolean unlink) {
-
-        final RoleMod roleMod = new RoleMod();
-        roleMod.setKey(before.getKey());
-
-        if (unlink) {
-            roleMod.getResourcesToRemove().add(profile.getTask().getResource().getKey());
-        } else {
-            roleMod.getResourcesToAdd().add(profile.getTask().getResource().getKey());
-        }
-
-        return roleTransfer.getRoleTO(roleDAO.authFetch(rwfAdapter.update(roleMod).getResult()));
-    }
-
-    @Override
-    protected AbstractSubjectTO update(
-            final AbstractSubjectTO before,
-            final AbstractSubjectMod subjectMod,
-            final SyncDelta delta,
-            final ProvisioningResult result) {
-
-        RoleMod roleMod = RoleMod.class.cast(subjectMod);
-
-        Map.Entry<Long, List<PropagationStatus>> updated = roleProvisioningManager.update(roleMod);
-
-        //moved after role provisioning manager
-        String roleOwner = null;
-        for (AttrMod attrMod : roleMod.getAttrsToUpdate()) {
-            if (attrMod.getSchema().isEmpty()) {
-                roleOwner = attrMod.getValuesToBeAdded().iterator().next();
-            }
-        }
-        if (roleOwner != null) {
-            roleOwnerMap.put(updated.getKey(), roleOwner);
-        }
-
-        final RoleTO after = roleTransfer.getRoleTO(roleDAO.authFetch(updated.getKey()));
-
-        result.setName(getName(after));
-
-        return after;
-    }
-
-    @Override
-    protected void deprovision(final Long id, final boolean unlink) {
-
-        taskExecutor.execute(
-                propagationManager.getRoleDeleteTaskIds(id, profile.getTask().getResource().getKey()));
-
-        if (unlink) {
-            final UserMod userMod = new UserMod();
-            userMod.setKey(id);
-            userMod.getResourcesToRemove().add(profile.getTask().getResource().getKey());
-        }
-    }
-
-    @Override
-    protected void delete(final Long id) {
-        try {
-            taskExecutor.execute(
-                    propagationManager.getRoleDeleteTaskIds(id, profile.getTask().getResource().getKey()));
-        } catch (Exception e) {
-            // A propagation failure doesn't imply a synchronization failure.
-            // The propagation exception status will be reported into the propagation task execution.
-            LOG.error("Could not propagate user " + id, e);
-        }
-
-        roleProvisioningManager.delete(id);
-    }
-}

http://git-wip-us.apache.org/repos/asf/syncope/blob/80589a1b/syncope620/server/provisioning-java/src/main/java/org/apache/syncope/server/provisioning/java/sync/RoleSyncResultHandlerImpl.java
----------------------------------------------------------------------
diff --git a/syncope620/server/provisioning-java/src/main/java/org/apache/syncope/server/provisioning/java/sync/RoleSyncResultHandlerImpl.java b/syncope620/server/provisioning-java/src/main/java/org/apache/syncope/server/provisioning/java/sync/RoleSyncResultHandlerImpl.java
new file mode 100644
index 0000000..2cada75
--- /dev/null
+++ b/syncope620/server/provisioning-java/src/main/java/org/apache/syncope/server/provisioning/java/sync/RoleSyncResultHandlerImpl.java
@@ -0,0 +1,169 @@
+/*
+ * 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.server.provisioning.java.sync;
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import org.apache.syncope.common.lib.mod.AbstractSubjectMod;
+import org.apache.syncope.common.lib.mod.AttrMod;
+import org.apache.syncope.common.lib.mod.RoleMod;
+import org.apache.syncope.common.lib.mod.UserMod;
+import org.apache.syncope.common.lib.to.AbstractSubjectTO;
+import org.apache.syncope.common.lib.to.PropagationStatus;
+import org.apache.syncope.common.lib.to.RoleTO;
+import org.apache.syncope.common.lib.types.AttributableType;
+import org.apache.syncope.server.persistence.api.entity.AttributableUtil;
+import org.apache.syncope.server.provisioning.api.sync.ProvisioningResult;
+import org.apache.syncope.server.provisioning.api.sync.RoleSyncResultHandler;
+import org.identityconnectors.framework.common.objects.SyncDelta;
+
+public class RoleSyncResultHandlerImpl extends AbstractSyncResultHandler implements RoleSyncResultHandler {
+
+    protected Map<Long, String> roleOwnerMap = new HashMap<>();
+
+    @Override
+    public Map<Long, String> getRoleOwnerMap() {
+        return this.roleOwnerMap;
+    }
+
+    @Override
+    protected AttributableUtil getAttributableUtil() {
+        return attrUtilFactory.getInstance(AttributableType.ROLE);
+    }
+
+    @Override
+    protected String getName(final AbstractSubjectTO subjectTO) {
+        return RoleTO.class.cast(subjectTO).getName();
+    }
+
+    @Override
+    protected AbstractSubjectTO getSubjectTO(final long key) {
+        try {
+            return roleTransfer.getRoleTO(key);
+        } catch (Exception e) {
+            LOG.warn("Error retrieving role {}", key, e);
+            return null;
+        }
+    }
+
+    @Override
+    protected AbstractSubjectMod getSubjectMod(
+            final AbstractSubjectTO subjectTO, final SyncDelta delta) {
+
+        return connObjectUtil.getAttributableMod(
+                subjectTO.getKey(),
+                delta.getObject(),
+                subjectTO,
+                profile.getTask(),
+                attrUtilFactory.getInstance(AttributableType.ROLE));
+    }
+
+    @Override
+    protected AbstractSubjectTO create(
+            final AbstractSubjectTO subjectTO, final SyncDelta _delta, final ProvisioningResult result) {
+
+        RoleTO roleTO = RoleTO.class.cast(subjectTO);
+
+        Map.Entry<Long, List<PropagationStatus>> created = roleProvisioningManager.create(roleTO, roleOwnerMap,
+                Collections.singleton(profile.getTask().getResource().getKey()));
+
+        roleTO = roleTransfer.getRoleTO(created.getKey());
+
+        result.setId(created.getKey());
+        result.setName(getName(subjectTO));
+
+        return roleTO;
+    }
+
+    @Override
+    protected AbstractSubjectTO link(
+            final AbstractSubjectTO before,
+            final ProvisioningResult result,
+            final boolean unlink) {
+
+        final RoleMod roleMod = new RoleMod();
+        roleMod.setKey(before.getKey());
+
+        if (unlink) {
+            roleMod.getResourcesToRemove().add(profile.getTask().getResource().getKey());
+        } else {
+            roleMod.getResourcesToAdd().add(profile.getTask().getResource().getKey());
+        }
+
+        return roleTransfer.getRoleTO(rwfAdapter.update(roleMod).getResult());
+    }
+
+    @Override
+    protected AbstractSubjectTO update(
+            final AbstractSubjectTO before,
+            final AbstractSubjectMod subjectMod,
+            final SyncDelta delta,
+            final ProvisioningResult result) {
+
+        RoleMod roleMod = RoleMod.class.cast(subjectMod);
+
+        Map.Entry<Long, List<PropagationStatus>> updated = roleProvisioningManager.update(roleMod);
+
+        //moved after role provisioning manager
+        String roleOwner = null;
+        for (AttrMod attrMod : roleMod.getPlainAttrsToUpdate()) {
+            if (attrMod.getSchema().isEmpty()) {
+                roleOwner = attrMod.getValuesToBeAdded().iterator().next();
+            }
+        }
+        if (roleOwner != null) {
+            roleOwnerMap.put(updated.getKey(), roleOwner);
+        }
+
+        final RoleTO after = roleTransfer.getRoleTO(updated.getKey());
+
+        result.setName(getName(after));
+
+        return after;
+    }
+
+    @Override
+    protected void deprovision(final Long id, final boolean unlink) {
+
+        taskExecutor.execute(
+                propagationManager.getRoleDeleteTaskIds(id, profile.getTask().getResource().getKey()));
+
+        if (unlink) {
+            final UserMod userMod = new UserMod();
+            userMod.setKey(id);
+            userMod.getResourcesToRemove().add(profile.getTask().getResource().getKey());
+        }
+    }
+
+    @Override
+    protected void delete(final Long id) {
+        try {
+            taskExecutor.execute(
+                    propagationManager.getRoleDeleteTaskIds(id, profile.getTask().getResource().getKey()));
+        } catch (Exception e) {
+            // A propagation failure doesn't imply a synchronization failure.
+            // The propagation exception status will be reported into the propagation task execution.
+            LOG.error("Could not propagate user " + id, e);
+        }
+
+        roleProvisioningManager.delete(id);
+    }
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/80589a1b/syncope620/server/provisioning-java/src/main/java/org/apache/syncope/server/provisioning/java/sync/SyncJobImpl.java
----------------------------------------------------------------------
diff --git a/syncope620/server/provisioning-java/src/main/java/org/apache/syncope/server/provisioning/java/sync/SyncJobImpl.java b/syncope620/server/provisioning-java/src/main/java/org/apache/syncope/server/provisioning/java/sync/SyncJobImpl.java
index c47bff6..47a118f 100644
--- a/syncope620/server/provisioning-java/src/main/java/org/apache/syncope/server/provisioning/java/sync/SyncJobImpl.java
+++ b/syncope620/server/provisioning-java/src/main/java/org/apache/syncope/server/provisioning/java/sync/SyncJobImpl.java
@@ -18,8 +18,6 @@
  */
 package org.apache.syncope.server.provisioning.java.sync;
 
-import java.util.ArrayList;
-import java.util.List;
 import java.util.Map;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.syncope.common.lib.mod.ReferenceMod;
@@ -34,11 +32,12 @@ import org.apache.syncope.server.persistence.api.entity.task.SyncTask;
 import org.apache.syncope.server.persistence.api.entity.user.UMapping;
 import org.apache.syncope.server.provisioning.api.Connector;
 import org.apache.syncope.server.provisioning.api.sync.ProvisioningProfile;
-import org.apache.syncope.server.provisioning.api.sync.ProvisioningResult;
 import org.apache.syncope.server.provisioning.api.sync.SyncActions;
 import org.apache.syncope.server.misc.security.UnauthorizedRoleException;
 import org.apache.syncope.server.misc.spring.ApplicationContextProvider;
 import org.apache.syncope.server.provisioning.api.job.SyncJob;
+import org.apache.syncope.server.provisioning.api.sync.RoleSyncResultHandler;
+import org.apache.syncope.server.provisioning.api.sync.UserSyncResultHandler;
 import org.apache.syncope.server.workflow.api.RoleWorkflowAdapter;
 import org.identityconnectors.framework.common.objects.ObjectClass;
 import org.identityconnectors.framework.common.objects.SyncToken;
@@ -74,14 +73,14 @@ public class SyncJobImpl extends AbstractProvisioningJob<SyncTask, SyncActions>
                 roleMod.setRoleOwner(null);
                 roleMod.setUserOwner(null);
             } else {
-                Long userId = syncUtilities.findMatchingAttributableId(
+                Long userId = syncUtilities.findMatchingAttributableKey(
                         ObjectClass.ACCOUNT,
                         entry.getValue(),
                         rhandler.getProfile().getTask().getResource(),
                         rhandler.getProfile().getConnector());
 
                 if (userId == null) {
-                    Long roleId = syncUtilities.findMatchingAttributableId(
+                    Long roleId = syncUtilities.findMatchingAttributableKey(
                             ObjectClass.GROUP,
                             entry.getValue(),
                             rhandler.getProfile().getTask().getResource(),
@@ -109,27 +108,26 @@ public class SyncJobImpl extends AbstractProvisioningJob<SyncTask, SyncActions>
 
         LOG.debug("Execute synchronization with token {}", syncTask.getResource().getUsyncToken());
 
-        final List<ProvisioningResult> results = new ArrayList<>();
-
         final ProvisioningProfile<SyncTask, SyncActions> profile = new ProvisioningProfile<>(connector, syncTask);
-        profile.getActions().addAll(actions);
+        if (actions != null) {
+            profile.getActions().addAll(actions);
+        }
         profile.setDryRun(dryRun);
         profile.setResAct(getSyncPolicySpec(syncTask).getConflictResolutionAction());
-        profile.getResults().addAll(results);
 
         // Prepare handler for SyncDelta objects (users)
         final UserSyncResultHandler uhandler =
-                (UserSyncResultHandler) ApplicationContextProvider.getApplicationContext().getBeanFactory().createBean(
-                        UserSyncResultHandler.class, AbstractBeanDefinition.AUTOWIRE_BY_NAME, false);
+                (UserSyncResultHandler) ApplicationContextProvider.getApplicationContext().getBeanFactory().
+                createBean(UserSyncResultHandlerImpl.class, AbstractBeanDefinition.AUTOWIRE_BY_NAME, false);
         uhandler.setProfile(profile);
 
         // Prepare handler for SyncDelta objects (roles/groups)
         final RoleSyncResultHandler rhandler =
-                (RoleSyncResultHandler) ApplicationContextProvider.getApplicationContext().getBeanFactory().createBean(
-                        RoleSyncResultHandler.class, AbstractBeanDefinition.AUTOWIRE_BY_NAME, false);
+                (RoleSyncResultHandler) ApplicationContextProvider.getApplicationContext().getBeanFactory().
+                createBean(RoleSyncResultHandlerImpl.class, AbstractBeanDefinition.AUTOWIRE_BY_NAME, false);
         rhandler.setProfile(profile);
 
-        if (!profile.isDryRun()) {
+        if (actions != null && !profile.isDryRun()) {
             for (SyncActions action : actions) {
                 action.beforeAll(profile);
             }
@@ -189,13 +187,13 @@ public class SyncJobImpl extends AbstractProvisioningJob<SyncTask, SyncActions>
             LOG.error("While setting role owners", e);
         }
 
-        if (!profile.isDryRun()) {
+        if (actions != null && !profile.isDryRun()) {
             for (SyncActions action : actions) {
-                action.afterAll(profile, results);
+                action.afterAll(profile);
             }
         }
 
-        final String result = createReport(results, syncTask.getResource().getSyncTraceLevel(), dryRun);
+        final String result = createReport(profile.getResults(), syncTask.getResource().getSyncTraceLevel(), dryRun);
 
         LOG.debug("Sync result: {}", result);
 

http://git-wip-us.apache.org/repos/asf/syncope/blob/80589a1b/syncope620/server/provisioning-java/src/main/java/org/apache/syncope/server/provisioning/java/sync/SyncUtilities.java
----------------------------------------------------------------------
diff --git a/syncope620/server/provisioning-java/src/main/java/org/apache/syncope/server/provisioning/java/sync/SyncUtilities.java b/syncope620/server/provisioning-java/src/main/java/org/apache/syncope/server/provisioning/java/sync/SyncUtilities.java
index 0d62487..299aba0 100644
--- a/syncope620/server/provisioning-java/src/main/java/org/apache/syncope/server/provisioning/java/sync/SyncUtilities.java
+++ b/syncope620/server/provisioning-java/src/main/java/org/apache/syncope/server/provisioning/java/sync/SyncUtilities.java
@@ -115,11 +115,12 @@ public class SyncUtilities {
     @Autowired
     protected AttributableUtilFactory attrUtilFactory;
 
-    public Long findMatchingAttributableId(
+    public Long findMatchingAttributableKey(
             final ObjectClass oclass,
             final String name,
             final ExternalResource resource,
             final Connector connector) {
+
         Long result = null;
 
         final AttributableUtil attrUtil = attrUtilFactory.getInstance(oclass);
@@ -137,15 +138,15 @@ public class SyncUtilities {
 
             ConnectorObject connObj = found.iterator().next();
             try {
-                final List<Long> subjectIds = findExisting(connObj.getUid().getUidValue(), connObj, resource, attrUtil);
-                if (subjectIds.isEmpty()) {
+                List<Long> subjectKeys = findExisting(connObj.getUid().getUidValue(), connObj, resource, attrUtil);
+                if (subjectKeys.isEmpty()) {
                     LOG.debug("No matching {} found for {}, aborting", attrUtil.getType(), connObj);
                 } else {
-                    if (subjectIds.size() > 1) {
-                        LOG.warn("More than one {} found {} - taking first only", attrUtil.getType(), subjectIds);
+                    if (subjectKeys.size() > 1) {
+                        LOG.warn("More than one {} found {} - taking first only", attrUtil.getType(), subjectKeys);
                     }
 
-                    result = subjectIds.iterator().next();
+                    result = subjectKeys.iterator().next();
                 }
             } catch (IllegalArgumentException e) {
                 LOG.warn(e.getMessage());
@@ -155,14 +156,14 @@ public class SyncUtilities {
         return result;
     }
 
-    public List<Long> findByAccountIdItem(
+    private List<Long> findByAccountIdItem(
             final String uid, final ExternalResource resource, final AttributableUtil attrUtil) {
         final List<Long> result = new ArrayList<>();
 
         final MappingItem accountIdItem = attrUtil.getAccountIdItem(resource);
         switch (accountIdItem.getIntMappingType()) {
-            case UserSchema:
-            case RoleSchema:
+            case UserPlainSchema:
+            case RolePlainSchema:
                 final PlainAttrValue value = attrUtil.newPlainAttrValue();
 
                 PlainSchema schema = plainSchemaDAO.find(accountIdItem.getIntAttrName(), attrUtil.plainSchemaClass());
@@ -227,7 +228,7 @@ public class SyncUtilities {
         return result;
     }
 
-    public List<Long> search(final SearchCond searchCond, final SubjectType type) {
+    private List<Long> search(final SearchCond searchCond, final SubjectType type) {
         final List<Long> result = new ArrayList<>();
 
         List<Subject<?, ?, ?>> subjects = searchDAO.search(
@@ -240,13 +241,13 @@ public class SyncUtilities {
         return result;
     }
 
-    public List<Long> findByCorrelationRule(
+    private List<Long> findByCorrelationRule(
             final ConnectorObject connObj, final SyncCorrelationRule rule, final SubjectType type) {
 
         return search(rule.getSearchCond(connObj), type);
     }
 
-    public List<Long> findByAttributableSearch(
+    private List<Long> findByAttributableSearch(
             final ConnectorObject connObj,
             final List<String> altSearchSchemas,
             final ExternalResource resource,
@@ -287,7 +288,7 @@ public class SyncUtilities {
             SearchCond nodeCond;
             // users: just id or username can be selected to be used
             // roles: just id or name can be selected to be used
-            if ("id".equalsIgnoreCase(schema)
+            if ("key".equalsIgnoreCase(schema)
                     || "username".equalsIgnoreCase(schema) || "name".equalsIgnoreCase(schema)) {
 
                 SubjectCond cond = new SubjectCond();

http://git-wip-us.apache.org/repos/asf/syncope/blob/80589a1b/syncope620/server/provisioning-java/src/main/java/org/apache/syncope/server/provisioning/java/sync/UserPushResultHandler.java
----------------------------------------------------------------------
diff --git a/syncope620/server/provisioning-java/src/main/java/org/apache/syncope/server/provisioning/java/sync/UserPushResultHandler.java b/syncope620/server/provisioning-java/src/main/java/org/apache/syncope/server/provisioning/java/sync/UserPushResultHandler.java
deleted file mode 100644
index 3302388..0000000
--- a/syncope620/server/provisioning-java/src/main/java/org/apache/syncope/server/provisioning/java/sync/UserPushResultHandler.java
+++ /dev/null
@@ -1,159 +0,0 @@
-/*
- * 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.server.provisioning.java.sync;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import org.apache.syncope.common.lib.mod.UserMod;
-import org.apache.syncope.common.lib.to.AbstractSubjectTO;
-import org.apache.syncope.common.lib.to.UserTO;
-import org.apache.syncope.common.lib.types.PropagationByResource;
-import org.apache.syncope.common.lib.types.ResourceOperation;
-import org.apache.syncope.server.persistence.api.entity.Mapping;
-import org.apache.syncope.server.persistence.api.entity.MappingItem;
-import org.apache.syncope.server.persistence.api.entity.Subject;
-import org.apache.syncope.server.persistence.api.entity.user.User;
-import org.apache.syncope.server.provisioning.api.TimeoutException;
-import org.identityconnectors.framework.common.objects.ConnectorObject;
-import org.identityconnectors.framework.common.objects.ObjectClass;
-import org.identityconnectors.framework.common.objects.Uid;
-
-public class UserPushResultHandler extends AbstractSubjectPushResultHandler {
-
-    @Override
-    protected Subject<?, ?, ?> deprovision(final Subject<?, ?, ?> sbj) {
-        final UserTO before = userTransfer.getUserTO(userDAO.authFetch(sbj.getKey()));
-
-        final List<String> noPropResources = new ArrayList<>(before.getResources());
-        noPropResources.remove(profile.getTask().getResource().getKey());
-
-        taskExecutor.execute(propagationManager.getUserDeleteTaskIds(before.getKey(),
-                Collections.singleton(profile.getTask().getResource().getKey()), noPropResources));
-
-        return userDAO.authFetch(before.getKey());
-    }
-
-    @Override
-    protected Subject<?, ?, ?> provision(final Subject<?, ?, ?> sbj, final Boolean enabled) {
-        final UserTO before = userTransfer.getUserTO(userDAO.authFetch(sbj.getKey()));
-
-        final List<String> noPropResources = new ArrayList<>(before.getResources());
-        noPropResources.remove(profile.getTask().getResource().getKey());
-
-        final PropagationByResource propByRes = new PropagationByResource();
-        propByRes.add(ResourceOperation.CREATE, profile.getTask().getResource().getKey());
-
-        taskExecutor.execute(propagationManager.getUserCreateTaskIds(
-                before.getKey(),
-                enabled,
-                propByRes,
-                null,
-                Collections.unmodifiableCollection(before.getVirAttrs()),
-                Collections.unmodifiableCollection(before.getMemberships()),
-                noPropResources));
-
-        return userDAO.authFetch(before.getKey());
-    }
-
-    @Override
-    protected Subject<?, ?, ?> link(final Subject<?, ?, ?> sbj, final Boolean unlink) {
-        final UserMod userMod = new UserMod();
-        userMod.setKey(sbj.getKey());
-
-        if (unlink) {
-            userMod.getResourcesToRemove().add(profile.getTask().getResource().getKey());
-        } else {
-            userMod.getResourcesToAdd().add(profile.getTask().getResource().getKey());
-        }
-
-        uwfAdapter.update(userMod);
-
-        return userDAO.authFetch(userMod.getKey());
-    }
-
-    @Override
-    protected Subject<?, ?, ?> unassign(final Subject<?, ?, ?> sbj) {
-        final UserMod userMod = new UserMod();
-        userMod.setKey(sbj.getKey());
-        userMod.getResourcesToRemove().add(profile.getTask().getResource().getKey());
-        uwfAdapter.update(userMod);
-        return deprovision(sbj);
-    }
-
-    @Override
-    protected Subject<?, ?, ?> assign(final Subject<?, ?, ?> sbj, final Boolean enabled) {
-        final UserMod userMod = new UserMod();
-        userMod.setKey(sbj.getKey());
-        userMod.getResourcesToAdd().add(profile.getTask().getResource().getKey());
-        uwfAdapter.update(userMod);
-        return provision(sbj, enabled);
-    }
-
-    @Override
-    protected String getName(final Subject<?, ?, ?> subject) {
-        return User.class.cast(subject).getUsername();
-    }
-
-    @Override
-    protected AbstractSubjectTO getSubjectTO(final long key) {
-        try {
-            return userTransfer.getUserTO(userDAO.authFetch(key));
-        } catch (Exception e) {
-            LOG.warn("Error retrieving user {}", key, e);
-            return null;
-        }
-    }
-
-    @Override
-    protected Subject<?, ?, ?> getSubject(final long key) {
-        try {
-            return userDAO.authFetch(key);
-        } catch (Exception e) {
-            LOG.warn("Error retrieving user {}", key, e);
-            return null;
-        }
-    }
-
-    @Override
-    protected ConnectorObject getRemoteObject(final String accountId) {
-        ConnectorObject obj = null;
-
-        try {
-            final Uid uid = new Uid(accountId);
-
-            obj = profile.getConnector().getObject(
-                    ObjectClass.ACCOUNT,
-                    uid,
-                    profile.getConnector().getOperationOptions(Collections.<MappingItem>emptySet()));
-
-        } catch (TimeoutException toe) {
-            LOG.debug("Request timeout", toe);
-            throw toe;
-        } catch (RuntimeException ignore) {
-            LOG.debug("While resolving {}", accountId, ignore);
-        }
-        return obj;
-    }
-
-    @Override
-    protected Mapping<?> getMapping() {
-        return profile.getTask().getResource().getUmapping();
-    }
-}

http://git-wip-us.apache.org/repos/asf/syncope/blob/80589a1b/syncope620/server/provisioning-java/src/main/java/org/apache/syncope/server/provisioning/java/sync/UserPushResultHandlerImpl.java
----------------------------------------------------------------------
diff --git a/syncope620/server/provisioning-java/src/main/java/org/apache/syncope/server/provisioning/java/sync/UserPushResultHandlerImpl.java b/syncope620/server/provisioning-java/src/main/java/org/apache/syncope/server/provisioning/java/sync/UserPushResultHandlerImpl.java
new file mode 100644
index 0000000..57fe4a7
--- /dev/null
+++ b/syncope620/server/provisioning-java/src/main/java/org/apache/syncope/server/provisioning/java/sync/UserPushResultHandlerImpl.java
@@ -0,0 +1,160 @@
+/*
+ * 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.server.provisioning.java.sync;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import org.apache.syncope.common.lib.mod.UserMod;
+import org.apache.syncope.common.lib.to.AbstractSubjectTO;
+import org.apache.syncope.common.lib.to.UserTO;
+import org.apache.syncope.common.lib.types.PropagationByResource;
+import org.apache.syncope.common.lib.types.ResourceOperation;
+import org.apache.syncope.server.persistence.api.entity.Mapping;
+import org.apache.syncope.server.persistence.api.entity.MappingItem;
+import org.apache.syncope.server.persistence.api.entity.Subject;
+import org.apache.syncope.server.persistence.api.entity.user.User;
+import org.apache.syncope.server.provisioning.api.TimeoutException;
+import org.apache.syncope.server.provisioning.api.sync.UserPushResultHandler;
+import org.identityconnectors.framework.common.objects.ConnectorObject;
+import org.identityconnectors.framework.common.objects.ObjectClass;
+import org.identityconnectors.framework.common.objects.Uid;
+
+public class UserPushResultHandlerImpl extends AbstractPushResultHandler implements UserPushResultHandler {
+
+    @Override
+    protected Subject<?, ?, ?> deprovision(final Subject<?, ?, ?> sbj) {
+        final UserTO before = userTransfer.getUserTO(sbj.getKey());
+
+        final List<String> noPropResources = new ArrayList<>(before.getResources());
+        noPropResources.remove(profile.getTask().getResource().getKey());
+
+        taskExecutor.execute(propagationManager.getUserDeleteTaskIds(before.getKey(),
+                Collections.singleton(profile.getTask().getResource().getKey()), noPropResources));
+
+        return userDAO.authFetch(before.getKey());
+    }
+
+    @Override
+    protected Subject<?, ?, ?> provision(final Subject<?, ?, ?> sbj, final Boolean enabled) {
+        final UserTO before = userTransfer.getUserTO(sbj.getKey());
+
+        final List<String> noPropResources = new ArrayList<>(before.getResources());
+        noPropResources.remove(profile.getTask().getResource().getKey());
+
+        final PropagationByResource propByRes = new PropagationByResource();
+        propByRes.add(ResourceOperation.CREATE, profile.getTask().getResource().getKey());
+
+        taskExecutor.execute(propagationManager.getUserCreateTaskIds(
+                before.getKey(),
+                enabled,
+                propByRes,
+                null,
+                Collections.unmodifiableCollection(before.getVirAttrs()),
+                Collections.unmodifiableCollection(before.getMemberships()),
+                noPropResources));
+
+        return userDAO.authFetch(before.getKey());
+    }
+
+    @Override
+    protected Subject<?, ?, ?> link(final Subject<?, ?, ?> sbj, final Boolean unlink) {
+        final UserMod userMod = new UserMod();
+        userMod.setKey(sbj.getKey());
+
+        if (unlink) {
+            userMod.getResourcesToRemove().add(profile.getTask().getResource().getKey());
+        } else {
+            userMod.getResourcesToAdd().add(profile.getTask().getResource().getKey());
+        }
+
+        uwfAdapter.update(userMod);
+
+        return userDAO.authFetch(userMod.getKey());
+    }
+
+    @Override
+    protected Subject<?, ?, ?> unassign(final Subject<?, ?, ?> sbj) {
+        final UserMod userMod = new UserMod();
+        userMod.setKey(sbj.getKey());
+        userMod.getResourcesToRemove().add(profile.getTask().getResource().getKey());
+        uwfAdapter.update(userMod);
+        return deprovision(sbj);
+    }
+
+    @Override
+    protected Subject<?, ?, ?> assign(final Subject<?, ?, ?> sbj, final Boolean enabled) {
+        final UserMod userMod = new UserMod();
+        userMod.setKey(sbj.getKey());
+        userMod.getResourcesToAdd().add(profile.getTask().getResource().getKey());
+        uwfAdapter.update(userMod);
+        return provision(sbj, enabled);
+    }
+
+    @Override
+    protected String getName(final Subject<?, ?, ?> subject) {
+        return User.class.cast(subject).getUsername();
+    }
+
+    @Override
+    protected AbstractSubjectTO getSubjectTO(final long key) {
+        try {
+            return userTransfer.getUserTO(key);
+        } catch (Exception e) {
+            LOG.warn("Error retrieving user {}", key, e);
+            return null;
+        }
+    }
+
+    @Override
+    protected Subject<?, ?, ?> getSubject(final long key) {
+        try {
+            return userDAO.authFetch(key);
+        } catch (Exception e) {
+            LOG.warn("Error retrieving user {}", key, e);
+            return null;
+        }
+    }
+
+    @Override
+    protected ConnectorObject getRemoteObject(final String accountId) {
+        ConnectorObject obj = null;
+
+        try {
+            final Uid uid = new Uid(accountId);
+
+            obj = profile.getConnector().getObject(
+                    ObjectClass.ACCOUNT,
+                    uid,
+                    profile.getConnector().getOperationOptions(Collections.<MappingItem>emptySet()));
+
+        } catch (TimeoutException toe) {
+            LOG.debug("Request timeout", toe);
+            throw toe;
+        } catch (RuntimeException ignore) {
+            LOG.debug("While resolving {}", accountId, ignore);
+        }
+        return obj;
+    }
+
+    @Override
+    protected Mapping<?> getMapping() {
+        return profile.getTask().getResource().getUmapping();
+    }
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/80589a1b/syncope620/server/provisioning-java/src/main/java/org/apache/syncope/server/provisioning/java/sync/UserSyncResultHandler.java
----------------------------------------------------------------------
diff --git a/syncope620/server/provisioning-java/src/main/java/org/apache/syncope/server/provisioning/java/sync/UserSyncResultHandler.java b/syncope620/server/provisioning-java/src/main/java/org/apache/syncope/server/provisioning/java/sync/UserSyncResultHandler.java
deleted file mode 100644
index 58e81ed..0000000
--- a/syncope620/server/provisioning-java/src/main/java/org/apache/syncope/server/provisioning/java/sync/UserSyncResultHandler.java
+++ /dev/null
@@ -1,155 +0,0 @@
-/*
- * 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.server.provisioning.java.sync;
-
-import java.util.Collections;
-import java.util.List;
-import java.util.Map;
-import org.apache.syncope.common.lib.mod.AbstractSubjectMod;
-import org.apache.syncope.common.lib.mod.UserMod;
-import org.apache.syncope.common.lib.to.AbstractSubjectTO;
-import org.apache.syncope.common.lib.to.PropagationStatus;
-import org.apache.syncope.common.lib.to.UserTO;
-import org.apache.syncope.common.lib.types.AttributableType;
-import org.apache.syncope.server.persistence.api.entity.AttributableUtil;
-import org.apache.syncope.server.provisioning.api.sync.ProvisioningResult;
-import org.identityconnectors.framework.common.objects.SyncDelta;
-import org.quartz.JobExecutionException;
-
-public class UserSyncResultHandler extends AbstractSubjectSyncResultHandler {
-
-    @Override
-    protected AttributableUtil getAttributableUtil() {
-        return attrUtilFactory.getInstance(AttributableType.USER);
-    }
-
-    @Override
-    protected String getName(final AbstractSubjectTO subjectTO) {
-        return UserTO.class.cast(subjectTO).getUsername();
-    }
-
-    @Override
-    protected AbstractSubjectTO getSubjectTO(final long key) {
-        try {
-            return userTransfer.getUserTO(userDAO.authFetch(key));
-        } catch (Exception e) {
-            LOG.warn("Error retrieving user {}", key, e);
-            return null;
-        }
-    }
-
-    @Override
-    protected AbstractSubjectMod getSubjectMod(
-            final AbstractSubjectTO subjectTO, final SyncDelta delta) {
-
-        return connObjectUtil.getAttributableMod(
-                subjectTO.getKey(),
-                delta.getObject(),
-                subjectTO,
-                profile.getTask(),
-                getAttributableUtil());
-    }
-
-    @Override
-    protected AbstractSubjectTO create(
-            final AbstractSubjectTO subjectTO, final SyncDelta delta, final ProvisioningResult result) {
-
-        UserTO userTO = UserTO.class.cast(subjectTO);
-
-        Boolean enabled = syncUtilities.readEnabled(delta.getObject(), profile.getTask());
-        //Delegate User Workflow Creation and its Propagation to provisioning manager
-        Map.Entry<Long, List<PropagationStatus>> created = userProvisioningManager.create(userTO, true, true, enabled,
-                Collections.singleton(profile.getTask().getResource().getKey()));
-
-        userTO = userTransfer.getUserTO(userDAO.authFetch(created.getKey()));
-
-        result.setId(created.getKey());
-
-        return userTO;
-    }
-
-    @Override
-    protected List<ProvisioningResult> link(SyncDelta delta, List<Long> subjects, AttributableUtil attrUtil,
-            boolean unlink) throws JobExecutionException {
-        return super.link(delta, subjects, attrUtil, unlink); //To change body of generated methods, choose Tools | Templates.
-    }
-
-    @Override
-    protected AbstractSubjectTO link(
-            final AbstractSubjectTO before,
-            final ProvisioningResult result,
-            final boolean unlink) {
-
-        final UserMod userMod = new UserMod();
-        userMod.setKey(before.getKey());
-
-        if (unlink) {
-            userMod.getResourcesToRemove().add(profile.getTask().getResource().getKey());
-        } else {
-            userMod.getResourcesToAdd().add(profile.getTask().getResource().getKey());
-        }
-
-        return userTransfer.getUserTO(userDAO.authFetch(uwfAdapter.update(userMod).getResult().getKey().getKey()));
-    }
-
-    @Override
-    protected AbstractSubjectTO update(
-            final AbstractSubjectTO before,
-            final AbstractSubjectMod subjectMod,
-            final SyncDelta delta,
-            final ProvisioningResult result) {
-
-        final UserMod userMod = UserMod.class.cast(subjectMod);
-        final Boolean enabled = syncUtilities.readEnabled(delta.getObject(), profile.getTask());
-
-        Map.Entry<Long, List<PropagationStatus>> updated = userProvisioningManager.update(userMod, before.getKey(),
-                result, enabled, Collections.singleton(profile.getTask().getResource().getKey()));
-
-        return userTransfer.getUserTO(userDAO.authFetch(updated.getKey()));
-    }
-
-    @Override
-    protected void deprovision(
-            final Long key,
-            final boolean unlink) {
-
-        taskExecutor.execute(
-                propagationManager.getUserDeleteTaskIds(key, profile.getTask().getResource().getKey()));
-
-        if (unlink) {
-            final UserMod userMod = new UserMod();
-            userMod.setKey(key);
-            userMod.getResourcesToRemove().add(profile.getTask().getResource().getKey());
-        }
-    }
-
-    @Override
-    protected void delete(final Long key) {
-        try {
-            userProvisioningManager.
-                    delete(key, Collections.<String>singleton(profile.getTask().getResource().getKey()));
-        } catch (Exception e) {
-            // A propagation failure doesn't imply a synchronization failure.
-            // The propagation exception status will be reported into the propagation task execution.
-            LOG.error("Could not propagate user " + key, e);
-        }
-
-        uwfAdapter.delete(key);
-    }
-}

http://git-wip-us.apache.org/repos/asf/syncope/blob/80589a1b/syncope620/server/provisioning-java/src/main/java/org/apache/syncope/server/provisioning/java/sync/UserSyncResultHandlerImpl.java
----------------------------------------------------------------------
diff --git a/syncope620/server/provisioning-java/src/main/java/org/apache/syncope/server/provisioning/java/sync/UserSyncResultHandlerImpl.java b/syncope620/server/provisioning-java/src/main/java/org/apache/syncope/server/provisioning/java/sync/UserSyncResultHandlerImpl.java
new file mode 100644
index 0000000..9a7e1ba
--- /dev/null
+++ b/syncope620/server/provisioning-java/src/main/java/org/apache/syncope/server/provisioning/java/sync/UserSyncResultHandlerImpl.java
@@ -0,0 +1,149 @@
+/*
+ * 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.server.provisioning.java.sync;
+
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+import org.apache.syncope.common.lib.mod.AbstractSubjectMod;
+import org.apache.syncope.common.lib.mod.UserMod;
+import org.apache.syncope.common.lib.to.AbstractSubjectTO;
+import org.apache.syncope.common.lib.to.PropagationStatus;
+import org.apache.syncope.common.lib.to.UserTO;
+import org.apache.syncope.common.lib.types.AttributableType;
+import org.apache.syncope.server.persistence.api.entity.AttributableUtil;
+import org.apache.syncope.server.provisioning.api.sync.ProvisioningResult;
+import org.apache.syncope.server.provisioning.api.sync.UserSyncResultHandler;
+import org.identityconnectors.framework.common.objects.SyncDelta;
+
+public class UserSyncResultHandlerImpl extends AbstractSyncResultHandler implements UserSyncResultHandler {
+
+    @Override
+    protected AttributableUtil getAttributableUtil() {
+        return attrUtilFactory.getInstance(AttributableType.USER);
+    }
+
+    @Override
+    protected String getName(final AbstractSubjectTO subjectTO) {
+        return UserTO.class.cast(subjectTO).getUsername();
+    }
+
+    @Override
+    protected AbstractSubjectTO getSubjectTO(final long key) {
+        try {
+            return userTransfer.getUserTO(key);
+        } catch (Exception e) {
+            LOG.warn("Error retrieving user {}", key, e);
+            return null;
+        }
+    }
+
+    @Override
+    protected AbstractSubjectMod getSubjectMod(
+            final AbstractSubjectTO subjectTO, final SyncDelta delta) {
+
+        return connObjectUtil.getAttributableMod(
+                subjectTO.getKey(),
+                delta.getObject(),
+                subjectTO,
+                profile.getTask(),
+                getAttributableUtil());
+    }
+
+    @Override
+    protected AbstractSubjectTO create(
+            final AbstractSubjectTO subjectTO, final SyncDelta delta, final ProvisioningResult result) {
+
+        UserTO userTO = UserTO.class.cast(subjectTO);
+
+        Boolean enabled = syncUtilities.readEnabled(delta.getObject(), profile.getTask());
+        //Delegate User Workflow Creation and its Propagation to provisioning manager
+        Map.Entry<Long, List<PropagationStatus>> created = userProvisioningManager.create(userTO, true, true, enabled,
+                Collections.singleton(profile.getTask().getResource().getKey()));
+
+        userTO = userTransfer.getUserTO(created.getKey());
+
+        result.setId(created.getKey());
+
+        return userTO;
+    }
+
+    @Override
+    protected AbstractSubjectTO link(
+            final AbstractSubjectTO before,
+            final ProvisioningResult result,
+            final boolean unlink) {
+
+        final UserMod userMod = new UserMod();
+        userMod.setKey(before.getKey());
+
+        if (unlink) {
+            userMod.getResourcesToRemove().add(profile.getTask().getResource().getKey());
+        } else {
+            userMod.getResourcesToAdd().add(profile.getTask().getResource().getKey());
+        }
+
+        return userTransfer.getUserTO(uwfAdapter.update(userMod).getResult().getKey().getKey());
+    }
+
+    @Override
+    protected AbstractSubjectTO update(
+            final AbstractSubjectTO before,
+            final AbstractSubjectMod subjectMod,
+            final SyncDelta delta,
+            final ProvisioningResult result) {
+
+        final UserMod userMod = UserMod.class.cast(subjectMod);
+        final Boolean enabled = syncUtilities.readEnabled(delta.getObject(), profile.getTask());
+
+        Map.Entry<Long, List<PropagationStatus>> updated = userProvisioningManager.update(userMod, before.getKey(),
+                result, enabled, Collections.singleton(profile.getTask().getResource().getKey()));
+
+        return userTransfer.getUserTO(updated.getKey());
+    }
+
+    @Override
+    protected void deprovision(
+            final Long key,
+            final boolean unlink) {
+
+        taskExecutor.execute(
+                propagationManager.getUserDeleteTaskIds(key, profile.getTask().getResource().getKey()));
+
+        if (unlink) {
+            final UserMod userMod = new UserMod();
+            userMod.setKey(key);
+            userMod.getResourcesToRemove().add(profile.getTask().getResource().getKey());
+        }
+    }
+
+    @Override
+    protected void delete(final Long key) {
+        try {
+            userProvisioningManager.
+                    delete(key, Collections.<String>singleton(profile.getTask().getResource().getKey()));
+        } catch (Exception e) {
+            // A propagation failure doesn't imply a synchronization failure.
+            // The propagation exception status will be reported into the propagation task execution.
+            LOG.error("Could not propagate user " + key, e);
+        }
+
+        uwfAdapter.delete(key);
+    }
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/80589a1b/syncope620/server/provisioning-java/src/main/resources/mailTemplates/optin.html.vm
----------------------------------------------------------------------
diff --git a/syncope620/server/provisioning-java/src/main/resources/mailTemplates/optin.html.vm b/syncope620/server/provisioning-java/src/main/resources/mailTemplates/optin.html.vm
index 007b09b..8240c7b 100644
--- a/syncope620/server/provisioning-java/src/main/resources/mailTemplates/optin.html.vm
+++ b/syncope620/server/provisioning-java/src/main/resources/mailTemplates/optin.html.vm
@@ -18,19 +18,19 @@ under the License.
 -->
 <html>
 <body>
-<h3>Hi $user.getAttrMap().get("firstname").getValues().get(0) $user.getAttrMap().get("surname").getValues().get(0), welcome to Syncope!</h3>
+<h3>Hi $user.getPlainAttrMap().get("firstname").getValues().get(0) $user.getPlainAttrMap().get("surname").getValues().get(0), welcome to Syncope!</h3>
 
 <p>
    Your username is $user.getUsername().<br/>
-   Your email address is $user.getAttrMap().get("email").getValues().get(0).
-   Your email address inside a <a href="http://localhost/?email=$esc.url($user.getAttrMap().get("email").getValues().get(0))">link</a>.
+   Your email address is $user.getPlainAttrMap().get("email").getValues().get(0).
+   Your email address inside a <a href="http://localhost/?email=$esc.url($user.getPlainAttrMap().get("email").getValues().get(0))">link</a>.
 </p>
 
 <p>
     This message was sent to the following recipients:
 <ul>
 #foreach($recipient in $recipients)
-  <li>$recipient.getAttrMap().get("email").getValues().get(0)</li>
+  <li>$recipient.getPlainAttrMap().get("email").getValues().get(0)</li>
 #end
 </ul>
 

http://git-wip-us.apache.org/repos/asf/syncope/blob/80589a1b/syncope620/server/provisioning-java/src/main/resources/mailTemplates/optin.txt.vm
----------------------------------------------------------------------
diff --git a/syncope620/server/provisioning-java/src/main/resources/mailTemplates/optin.txt.vm b/syncope620/server/provisioning-java/src/main/resources/mailTemplates/optin.txt.vm
index b79b317..fc8e398 100644
--- a/syncope620/server/provisioning-java/src/main/resources/mailTemplates/optin.txt.vm
+++ b/syncope620/server/provisioning-java/src/main/resources/mailTemplates/optin.txt.vm
@@ -14,15 +14,15 @@
 # KIND, either express or implied.  See the License for the
 # specific language governing permissions and limitations
 # under the License.
-Hi $user.getAttrMap().get("firstname").getValues().get(0) $user.getAttrMap().get("surname").getValues().get(0), welcome to Syncope!
+Hi $user.getPlainAttrMap().get("firstname").getValues().get(0) $user.getPlainAttrMap().get("surname").getValues().get(0), welcome to Syncope!
 
 Your username is $user.getUsername().
-Your email address is $user.getAttrMap().get("email").getValues().get(0).
-Your email address inside a link: http://localhost/?email=$esc.url($user.getAttrMap().get("email").getValues().get(0)) .
+Your email address is $user.getPlainAttrMap().get("email").getValues().get(0).
+Your email address inside a link: http://localhost/?email=$esc.url($user.getPlainAttrMap().get("email").getValues().get(0)) .
 
 This message was sent to the following recipients:
 #foreach($recipient in $recipients)
-   * $recipient.getAttrMap().get("surname").getValues().get(0)
+   * $recipient.getPlainAttrMap().get("surname").getValues().get(0)
 #end
 
 because one of the following events occurred:

http://git-wip-us.apache.org/repos/asf/syncope/blob/80589a1b/syncope620/server/provisioning-java/src/main/resources/provisioningContext.xml
----------------------------------------------------------------------
diff --git a/syncope620/server/provisioning-java/src/main/resources/provisioningContext.xml b/syncope620/server/provisioning-java/src/main/resources/provisioningContext.xml
index d3fa665..3b4301e 100644
--- a/syncope620/server/provisioning-java/src/main/resources/provisioningContext.xml
+++ b/syncope620/server/provisioning-java/src/main/resources/provisioningContext.xml
@@ -20,10 +20,16 @@ under the License.
 <beans xmlns="http://www.springframework.org/schema/beans"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xmlns:context="http://www.springframework.org/schema/context"
+       xmlns:task="http://www.springframework.org/schema/task"
        xsi:schemaLocation="http://www.springframework.org/schema/beans
                            http://www.springframework.org/schema/beans/spring-beans.xsd
                            http://www.springframework.org/schema/context
-                           http://www.springframework.org/schema/context/spring-context.xsd">
+                           http://www.springframework.org/schema/context/spring-context.xsd
+                           http://www.springframework.org/schema/task
+                           http://www.springframework.org/schema/task/spring-task.xsd">
+  
+  <task:annotation-driven executor="connectorExecutor"/>
+  <task:executor id="connectorExecutor" pool-size="10"/>
   
   <bean id="scheduler" class="org.springframework.scheduling.quartz.SchedulerFactoryBean"
         lazy-init="false" depends-on="nonJPAdbInitializer">
@@ -34,7 +40,7 @@ under the License.
     <property name="dataSource" ref="dataSource"/>
     <property name="transactionManager" ref="transactionManager"/>
     <property name="jobFactory">
-      <bean class="org.springframework.scheduling.quartz.SpringBeanJobFactory"/>
+      <bean class="org.apache.syncope.server.provisioning.java.job.SpringBeanJobFactory"/>
     </property>
     <property name="quartzProperties">
       <props>

http://git-wip-us.apache.org/repos/asf/syncope/blob/80589a1b/syncope620/server/provisioning-java/src/test/java/org/apache/syncope/server/provisioning/java/data/ResourceDataBinderTest.java
----------------------------------------------------------------------
diff --git a/syncope620/server/provisioning-java/src/test/java/org/apache/syncope/server/provisioning/java/data/ResourceDataBinderTest.java b/syncope620/server/provisioning-java/src/test/java/org/apache/syncope/server/provisioning/java/data/ResourceDataBinderTest.java
index 8b8a39b..34d73fe 100644
--- a/syncope620/server/provisioning-java/src/test/java/org/apache/syncope/server/provisioning/java/data/ResourceDataBinderTest.java
+++ b/syncope620/server/provisioning-java/src/test/java/org/apache/syncope/server/provisioning/java/data/ResourceDataBinderTest.java
@@ -115,7 +115,7 @@ public class ResourceDataBinderTest extends AbstractTest {
 
         MappingItemTO item = new MappingItemTO();
         item.setIntAttrName("userId");
-        item.setIntMappingType(IntMappingType.UserSchema);
+        item.setIntMappingType(IntMappingType.UserPlainSchema);
         item.setExtAttrName("campo1");
         item.setAccountid(true);
         item.setMandatoryCondition("false");

http://git-wip-us.apache.org/repos/asf/syncope/blob/80589a1b/syncope620/server/rest-cxf/src/main/java/org/apache/syncope/server/rest/cxf/service/AbstractServiceImpl.java
----------------------------------------------------------------------
diff --git a/syncope620/server/rest-cxf/src/main/java/org/apache/syncope/server/rest/cxf/service/AbstractServiceImpl.java b/syncope620/server/rest-cxf/src/main/java/org/apache/syncope/server/rest/cxf/service/AbstractServiceImpl.java
index 9168ab1..94003ab 100644
--- a/syncope620/server/rest-cxf/src/main/java/org/apache/syncope/server/rest/cxf/service/AbstractServiceImpl.java
+++ b/syncope620/server/rest-cxf/src/main/java/org/apache/syncope/server/rest/cxf/service/AbstractServiceImpl.java
@@ -163,7 +163,7 @@ abstract class AbstractServiceImpl implements JAXRSService {
             return Collections.<OrderByClause>emptyList();
         }
 
-        List<OrderByClause> result = new ArrayList<OrderByClause>();
+        List<OrderByClause> result = new ArrayList<>();
 
         for (String clause : orderBy.split(",")) {
             String[] elems = clause.split(" ");
@@ -195,7 +195,7 @@ abstract class AbstractServiceImpl implements JAXRSService {
     protected <T extends AbstractBaseBean> PagedResult<T> buildPagedResult(
             final List<T> list, final int page, final int size, final int totalCount) {
 
-        PagedResult<T> result = new PagedResult<T>();
+        PagedResult<T> result = new PagedResult<>();
         result.getResult().addAll(list);
 
         result.setPage(page);

http://git-wip-us.apache.org/repos/asf/syncope/blob/80589a1b/syncope620/server/rest-cxf/src/main/java/org/apache/syncope/server/rest/cxf/service/LoggerServiceImpl.java
----------------------------------------------------------------------
diff --git a/syncope620/server/rest-cxf/src/main/java/org/apache/syncope/server/rest/cxf/service/LoggerServiceImpl.java b/syncope620/server/rest-cxf/src/main/java/org/apache/syncope/server/rest/cxf/service/LoggerServiceImpl.java
index 09995b1..7651d05 100644
--- a/syncope620/server/rest-cxf/src/main/java/org/apache/syncope/server/rest/cxf/service/LoggerServiceImpl.java
+++ b/syncope620/server/rest-cxf/src/main/java/org/apache/syncope/server/rest/cxf/service/LoggerServiceImpl.java
@@ -80,7 +80,7 @@ public class LoggerServiceImpl extends AbstractServiceImpl implements LoggerServ
     public LoggerTO read(final LoggerType type, final String name) {
         List<LoggerTO> logger = list(type);
         for (LoggerTO l : logger) {
-            if (l.getName().equals(name)) {
+            if (l.getKey().equals(name)) {
                 return l;
             }
         }

http://git-wip-us.apache.org/repos/asf/syncope/blob/80589a1b/syncope620/server/rest-cxf/src/main/java/org/apache/syncope/server/rest/cxf/service/ReportServiceImpl.java
----------------------------------------------------------------------
diff --git a/syncope620/server/rest-cxf/src/main/java/org/apache/syncope/server/rest/cxf/service/ReportServiceImpl.java b/syncope620/server/rest-cxf/src/main/java/org/apache/syncope/server/rest/cxf/service/ReportServiceImpl.java
index 3b30337..32306e9 100644
--- a/syncope620/server/rest-cxf/src/main/java/org/apache/syncope/server/rest/cxf/service/ReportServiceImpl.java
+++ b/syncope620/server/rest-cxf/src/main/java/org/apache/syncope/server/rest/cxf/service/ReportServiceImpl.java
@@ -92,14 +92,14 @@ public class ReportServiceImpl extends AbstractServiceImpl implements ReportServ
     }
 
     @Override
-    public ReportExecTO readExecution(final Long executionId) {
-        return logic.readExecution(executionId);
+    public ReportExecTO readExecution(final Long executionKey) {
+        return logic.readExecution(executionKey);
     }
 
     @Override
-    public Response exportExecutionResult(final Long executionId, final ReportExecExportFormat fmt) {
+    public Response exportExecutionResult(final Long executionKey, final ReportExecExportFormat fmt) {
         final ReportExecExportFormat format = (fmt == null) ? ReportExecExportFormat.XML : fmt;
-        final ReportExec reportExec = logic.getAndCheckReportExec(executionId);
+        final ReportExec reportExec = logic.getAndCheckReportExec(executionKey);
         StreamingOutput sout = new StreamingOutput() {
 
             @Override
@@ -125,7 +125,7 @@ public class ReportServiceImpl extends AbstractServiceImpl implements ReportServ
     }
 
     @Override
-    public void deleteExecution(final Long executionId) {
-        logic.deleteExecution(executionId);
+    public void deleteExecution(final Long executionKey) {
+        logic.deleteExecution(executionKey);
     }
 }


Mime
View raw message