syncope-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ilgro...@apache.org
Subject syncope git commit: [SYNCOPE-881] Fix provided
Date Mon, 27 Jun 2016 19:35:01 GMT
Repository: syncope
Updated Branches:
  refs/heads/master d06975672 -> 629d18f2c


[SYNCOPE-881] Fix provided


Project: http://git-wip-us.apache.org/repos/asf/syncope/repo
Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/629d18f2
Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/629d18f2
Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/629d18f2

Branch: refs/heads/master
Commit: 629d18f2c62e72894676d9106aabea31954ca2e8
Parents: d069756
Author: Francesco Chicchiriccò <ilgrosso@apache.org>
Authored: Mon Jun 27 21:34:48 2016 +0200
Committer: Francesco Chicchiriccò <ilgrosso@apache.org>
Committed: Mon Jun 27 21:34:48 2016 +0200

----------------------------------------------------------------------
 .../console/commons/status/StatusUtils.java     |  4 +-
 .../syncope/client/console/panels/Realm.java    |  8 +-
 .../data/table/ConnObjectAttrColumn.java        |  4 +-
 .../console/wizards/any/ConnObjectPanel.java    |  4 +-
 .../syncope/common/lib/to/ConnObjectTO.java     |  2 +-
 .../core/persistence/api/dao/AnyObjectDAO.java  |  2 +-
 .../core/persistence/api/dao/UserDAO.java       |  2 +-
 .../persistence/jpa/dao/JPAAnyObjectDAO.java    |  5 +-
 .../core/persistence/jpa/dao/JPAUserDAO.java    | 10 +--
 .../DefaultAnyObjectProvisioningManager.java    |  2 +-
 .../java/DefaultUserProvisioningManager.java    |  4 +-
 .../java/data/AnyObjectDataBinderImpl.java      |  3 +-
 .../java/data/UserDataBinderImpl.java           |  3 +-
 .../AbstractPropagationTaskExecutor.java        | 76 +++++++----------
 .../propagation/PropagationManagerImpl.java     | 10 ++-
 .../pushpull/AbstractPushResultHandler.java     | 12 ++-
 .../activiti/ActivitiUserWorkflowAdapter.java   | 10 ++-
 .../workflow/activiti/task/PasswordReset.java   |  6 +-
 .../java/DefaultUserWorkflowAdapter.java        | 12 ++-
 .../AnyObjectDeprovisionProcessor.java          |  2 +-
 .../camel/processor/UserDeleteProcessor.java    |  2 +-
 .../processor/UserDeprovisionProcessor.java     |  2 +-
 .../syncope/fit/core/AnyObjectITCase.java       |  4 +-
 .../apache/syncope/fit/core/GroupITCase.java    |  2 +-
 .../syncope/fit/core/PropagationTaskITCase.java |  2 +-
 .../apache/syncope/fit/core/PullTaskITCase.java |  6 +-
 .../apache/syncope/fit/core/ResourceITCase.java |  2 +-
 .../org/apache/syncope/fit/core/UserITCase.java | 86 ++++++++++++++------
 .../apache/syncope/fit/core/VirAttrITCase.java  | 14 ++--
 29 files changed, 167 insertions(+), 134 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/syncope/blob/629d18f2/client/console/src/main/java/org/apache/syncope/client/console/commons/status/StatusUtils.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/commons/status/StatusUtils.java b/client/console/src/main/java/org/apache/syncope/client/console/commons/status/StatusUtils.java
index 989a19e..cfbf065 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/commons/status/StatusUtils.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/commons/status/StatusUtils.java
@@ -113,7 +113,7 @@ public class StatusUtils implements Serializable {
     }
 
     private Boolean isEnabled(final ConnObjectTO objectTO) {
-        final Map<String, AttrTO> attributeTOs = objectTO.getPlainAttrMap();
+        final Map<String, AttrTO> attributeTOs = objectTO.getAttrMap();
 
         final AttrTO status = attributeTOs.get(ConnIdSpecialAttributeName.ENABLE);
 
@@ -125,7 +125,7 @@ public class StatusUtils implements Serializable {
     private String getConnObjectLink(final ConnObjectTO objectTO) {
         final Map<String, AttrTO> attributeTOs = objectTO == null
                 ? Collections.<String, AttrTO>emptyMap()
-                : objectTO.getPlainAttrMap();
+                : objectTO.getAttrMap();
 
         final AttrTO name = attributeTOs.get(ConnIdSpecialAttributeName.NAME);
 

http://git-wip-us.apache.org/repos/asf/syncope/blob/629d18f2/client/console/src/main/java/org/apache/syncope/client/console/panels/Realm.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/panels/Realm.java b/client/console/src/main/java/org/apache/syncope/client/console/panels/Realm.java
index 86aa1ad..6a9ab08 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/panels/Realm.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/panels/Realm.java
@@ -201,12 +201,12 @@ public abstract class Realm extends WizardMgtPanel<RealmTO> {
                 if ("afterObj".equalsIgnoreCase(key)) {
                     ConnObjectTO afterObj = bean.getAfterObj();
                     String remoteId = afterObj == null
-                            || MapUtils.isEmpty(afterObj.getPlainAttrMap())
-                            || !afterObj.getPlainAttrMap().containsKey(ConnIdSpecialAttributeName.NAME)
+                            || MapUtils.isEmpty(afterObj.getAttrMap())
+                            || !afterObj.getAttrMap().containsKey(ConnIdSpecialAttributeName.NAME)
                             || CollectionUtils.isEmpty(
-                                    afterObj.getPlainAttrMap().get(ConnIdSpecialAttributeName.NAME).getValues())
+                                    afterObj.getAttrMap().get(ConnIdSpecialAttributeName.NAME).getValues())
                             ? StringUtils.EMPTY
-                            : afterObj.getPlainAttrMap().get(ConnIdSpecialAttributeName.NAME).getValues().
+                            : afterObj.getAttrMap().get(ConnIdSpecialAttributeName.NAME).getValues().
                             iterator().next();
 
                     return new Label("field", remoteId);

http://git-wip-us.apache.org/repos/asf/syncope/blob/629d18f2/client/console/src/main/java/org/apache/syncope/client/console/wicket/extensions/markup/html/repeater/data/table/ConnObjectAttrColumn.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/wicket/extensions/markup/html/repeater/data/table/ConnObjectAttrColumn.java b/client/console/src/main/java/org/apache/syncope/client/console/wicket/extensions/markup/html/repeater/data/table/ConnObjectAttrColumn.java
index 56ead58..907f647 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/wicket/extensions/markup/html/repeater/data/table/ConnObjectAttrColumn.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/wicket/extensions/markup/html/repeater/data/table/ConnObjectAttrColumn.java
@@ -48,8 +48,8 @@ public class ConnObjectAttrColumn extends AbstractColumn<ConnObjectTO, String> {
             final IModel<ConnObjectTO> rowModel) {
 
         List<String> values = null;
-        if (rowModel.getObject().getPlainAttrMap().containsKey(name)) {
-            values = rowModel.getObject().getPlainAttrMap().get(name).getValues();
+        if (rowModel.getObject().getAttrMap().containsKey(name)) {
+            values = rowModel.getObject().getAttrMap().get(name).getValues();
         }
 
         if (values == null || values.isEmpty()) {

http://git-wip-us.apache.org/repos/asf/syncope/blob/629d18f2/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/ConnObjectPanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/ConnObjectPanel.java b/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/ConnObjectPanel.java
index 329fff9..09e6351 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/ConnObjectPanel.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/ConnObjectPanel.java
@@ -88,11 +88,11 @@ public class ConnObjectPanel extends Panel {
 
         final Map<String, AttrTO> beforeProfile = connObjectTOs == null || connObjectTOs.getLeft() == null
                 ? null
-                : connObjectTOs.getLeft().getPlainAttrMap();
+                : connObjectTOs.getLeft().getAttrMap();
 
         final Map<String, AttrTO> afterProfile = connObjectTOs == null || connObjectTOs.getRight() == null
                 ? null
-                : connObjectTOs.getRight().getPlainAttrMap();
+                : connObjectTOs.getRight().getAttrMap();
 
         final ListView<String> propView = new ListView<String>("propView", formProps) {
 

http://git-wip-us.apache.org/repos/asf/syncope/blob/629d18f2/common/lib/src/main/java/org/apache/syncope/common/lib/to/ConnObjectTO.java
----------------------------------------------------------------------
diff --git a/common/lib/src/main/java/org/apache/syncope/common/lib/to/ConnObjectTO.java b/common/lib/src/main/java/org/apache/syncope/common/lib/to/ConnObjectTO.java
index 8f65b70..09784c8 100644
--- a/common/lib/src/main/java/org/apache/syncope/common/lib/to/ConnObjectTO.java
+++ b/common/lib/src/main/java/org/apache/syncope/common/lib/to/ConnObjectTO.java
@@ -47,7 +47,7 @@ public class ConnObjectTO extends AbstractBaseBean {
     }
 
     @JsonIgnore
-    public Map<String, AttrTO> getPlainAttrMap() {
+    public Map<String, AttrTO> getAttrMap() {
         Map<String, AttrTO> result = new HashMap<>(attrs.size());
         for (AttrTO attributeTO : attrs) {
             result.put(attributeTO.getSchema(), attributeTO);

http://git-wip-us.apache.org/repos/asf/syncope/blob/629d18f2/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/AnyObjectDAO.java
----------------------------------------------------------------------
diff --git a/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/AnyObjectDAO.java b/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/AnyObjectDAO.java
index c24b37d..d399ac8 100644
--- a/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/AnyObjectDAO.java
+++ b/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/AnyObjectDAO.java
@@ -56,5 +56,5 @@ public interface AnyObjectDAO extends AnyDAO<AnyObject> {
 
     Collection<ExternalResource> findAllResources(AnyObject anyObject);
 
-    Collection<String> findAllResourceNames(AnyObject anyObject);
+    Collection<String> findAllResourceNames(String key);
 }

http://git-wip-us.apache.org/repos/asf/syncope/blob/629d18f2/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/UserDAO.java
----------------------------------------------------------------------
diff --git a/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/UserDAO.java b/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/UserDAO.java
index 00921ee..d577327 100644
--- a/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/UserDAO.java
+++ b/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/UserDAO.java
@@ -58,7 +58,7 @@ public interface UserDAO extends AnyDAO<User> {
 
     Collection<ExternalResource> findAllResources(User user);
 
-    Collection<String> findAllResourceNames(User user);
+    Collection<String> findAllResourceNames(String key);
 
     Pair<Boolean, Boolean> enforcePolicies(User user);
 }

http://git-wip-us.apache.org/repos/asf/syncope/blob/629d18f2/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAAnyObjectDAO.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAAnyObjectDAO.java b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAAnyObjectDAO.java
index c527a15..2eae708 100644
--- a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAAnyObjectDAO.java
+++ b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAAnyObjectDAO.java
@@ -271,9 +271,8 @@ public class JPAAnyObjectDAO extends AbstractAnyDAO<AnyObject> implements AnyObj
 
     @Transactional(propagation = Propagation.REQUIRES_NEW, readOnly = true)
     @Override
-    public Collection<String> findAllResourceNames(final AnyObject anyObject) {
-        return CollectionUtils.collect(
-                findAllResources(anyObject), EntityUtils.<ExternalResource>keyTransformer());
+    public Collection<String> findAllResourceNames(final String key) {
+        return CollectionUtils.collect(findAllResources(authFind(key)), EntityUtils.<ExternalResource>keyTransformer());
     }
 
 }

http://git-wip-us.apache.org/repos/asf/syncope/blob/629d18f2/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAUserDAO.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAUserDAO.java b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAUserDAO.java
index 0cd53a0..a33e29e 100644
--- a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAUserDAO.java
+++ b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAUserDAO.java
@@ -525,14 +525,8 @@ public class JPAUserDAO extends AbstractAnyDAO<User> implements UserDAO {
 
     @Transactional(propagation = Propagation.REQUIRES_NEW, readOnly = true)
     @Override
-    public Collection<String> findAllResourceNames(final User user) {
-        return CollectionUtils.collect(findAllResources(user), new Transformer<ExternalResource, String>() {
-
-            @Override
-            public String transform(final ExternalResource input) {
-                return input.getKey();
-            }
-        });
+    public Collection<String> findAllResourceNames(final String key) {
+        return CollectionUtils.collect(findAllResources(authFind(key)), EntityUtils.keyTransformer());
     }
 
 }

http://git-wip-us.apache.org/repos/asf/syncope/blob/629d18f2/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/DefaultAnyObjectProvisioningManager.java
----------------------------------------------------------------------
diff --git a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/DefaultAnyObjectProvisioningManager.java b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/DefaultAnyObjectProvisioningManager.java
index 2f4ec41..7b82d1b 100644
--- a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/DefaultAnyObjectProvisioningManager.java
+++ b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/DefaultAnyObjectProvisioningManager.java
@@ -180,7 +180,7 @@ public class DefaultAnyObjectProvisioningManager implements AnyObjectProvisionin
                 AnyTypeKind.ANY_OBJECT,
                 key,
                 propByRes,
-                CollectionUtils.removeAll(anyObjectDAO.findAllResourceNames(anyObjectDAO.authFind(key)), resources));
+                CollectionUtils.removeAll(anyObjectDAO.findAllResourceNames(key), resources));
         PropagationReporter propagationReporter =
                 ApplicationContextProvider.getBeanFactory().getBean(PropagationReporter.class);
         taskExecutor.execute(tasks, propagationReporter, nullPriorityAsync);

http://git-wip-us.apache.org/repos/asf/syncope/blob/629d18f2/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 66edbcc..55128c1 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
@@ -201,7 +201,7 @@ public class DefaultUserProvisioningManager implements UserProvisioningManager {
             final String key, final Set<String> excludedResources, final boolean nullPriorityAsync) {
 
         PropagationByResource propByRes = new PropagationByResource();
-        propByRes.set(ResourceOperation.DELETE, userDAO.findAllResourceNames(userDAO.authFind(key)));
+        propByRes.set(ResourceOperation.DELETE, userDAO.findAllResourceNames(key));
 
         // Note here that we can only notify about "delete", not any other
         // task defined in workflow process definition: this because this
@@ -359,7 +359,7 @@ public class DefaultUserProvisioningManager implements UserProvisioningManager {
                 AnyTypeKind.USER,
                 key,
                 propByRes,
-                CollectionUtils.removeAll(userDAO.findAllResourceNames(userDAO.authFind(key)), resources));
+                CollectionUtils.removeAll(userDAO.findAllResourceNames(key), resources));
         PropagationReporter propagationReporter =
                 ApplicationContextProvider.getBeanFactory().getBean(PropagationReporter.class);
         taskExecutor.execute(tasks, propagationReporter, nullPriorityAsync);

http://git-wip-us.apache.org/repos/asf/syncope/blob/629d18f2/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/AnyObjectDataBinderImpl.java
----------------------------------------------------------------------
diff --git a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/AnyObjectDataBinderImpl.java b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/AnyObjectDataBinderImpl.java
index 3ad0ac9..74bf7e0 100644
--- a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/AnyObjectDataBinderImpl.java
+++ b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/AnyObjectDataBinderImpl.java
@@ -256,7 +256,8 @@ public class AnyObjectDataBinderImpl extends AbstractAnyDataBinder implements An
 
         SyncopeClientCompositeException scce = SyncopeClientException.buildComposite();
 
-        Collection<String> currentResources = anyObjectDAO.findAllResourceNames(anyObject);
+        Collection<String> currentResources = CollectionUtils.collect(
+                anyObjectDAO.findAllResources(anyObject), EntityUtils.keyTransformer());
 
         // fetch connObjectKeys before update
         Map<String, String> oldConnObjectKeys = getConnObjectKeys(anyObject);

http://git-wip-us.apache.org/repos/asf/syncope/blob/629d18f2/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/UserDataBinderImpl.java
----------------------------------------------------------------------
diff --git a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/UserDataBinderImpl.java b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/UserDataBinderImpl.java
index 422e769..ff485ed 100644
--- a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/UserDataBinderImpl.java
+++ b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/UserDataBinderImpl.java
@@ -310,7 +310,8 @@ public class UserDataBinderImpl extends AbstractAnyDataBinder implements UserDat
 
         SyncopeClientCompositeException scce = SyncopeClientException.buildComposite();
 
-        Collection<String> currentResources = userDAO.findAllResourceNames(user);
+        Collection<String> currentResources = CollectionUtils.collect(
+                userDAO.findAllResources(user), EntityUtils.keyTransformer());
 
         // fetch connObjectKeys before update
         Map<String, String> oldConnObjectKeys = getConnObjectKeys(user);

http://git-wip-us.apache.org/repos/asf/syncope/blob/629d18f2/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 0a94a62..856fcd0 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
@@ -51,16 +51,12 @@ import org.apache.syncope.core.provisioning.api.utils.ExceptionUtils2;
 import org.apache.syncope.core.persistence.api.dao.AnyObjectDAO;
 import org.apache.syncope.core.persistence.api.dao.RealmDAO;
 import org.apache.syncope.core.persistence.api.dao.VirSchemaDAO;
-import org.apache.syncope.core.persistence.api.entity.Any;
 import org.apache.syncope.core.persistence.api.entity.Realm;
 import org.apache.syncope.core.persistence.api.entity.VirSchema;
-import org.apache.syncope.core.persistence.api.entity.anyobject.AnyObject;
-import org.apache.syncope.core.persistence.api.entity.group.Group;
 import org.apache.syncope.core.persistence.api.entity.resource.ExternalResource;
 import org.apache.syncope.core.persistence.api.entity.resource.MappingItem;
 import org.apache.syncope.core.persistence.api.entity.resource.OrgUnit;
 import org.apache.syncope.core.persistence.api.entity.resource.Provision;
-import org.apache.syncope.core.persistence.api.entity.user.User;
 import org.apache.syncope.core.provisioning.api.AuditManager;
 import org.apache.syncope.core.provisioning.api.cache.VirAttrCache;
 import org.apache.syncope.core.provisioning.api.cache.VirAttrCacheValue;
@@ -285,41 +281,6 @@ public abstract class AbstractPropagationTaskExecutor implements PropagationTask
         return result;
     }
 
-    protected Any<?> getAny(final PropagationTask task) {
-        Any<?> any = null;
-
-        if (task.getEntityKey() != null && task.getAnyTypeKind() != null) {
-            switch (task.getAnyTypeKind()) {
-                case USER:
-                    try {
-                        any = userDAO.authFind(task.getEntityKey());
-                    } catch (Exception e) {
-                        LOG.error("Could not read user {}", task.getEntityKey(), e);
-                    }
-                    break;
-
-                case GROUP:
-                    try {
-                        any = groupDAO.authFind(task.getEntityKey());
-                    } catch (Exception e) {
-                        LOG.error("Could not read group {}", task.getEntityKey(), e);
-                    }
-                    break;
-
-                case ANY_OBJECT:
-                default:
-                    try {
-                        any = anyObjectDAO.authFind(task.getEntityKey());
-                    } catch (Exception e) {
-                        LOG.error("Could not read any object {}", task.getEntityKey(), e);
-                    }
-                    break;
-            }
-        }
-
-        return any;
-    }
-
     protected Uid delete(
             final PropagationTask task,
             final ConnectorObject beforeObj,
@@ -346,14 +307,35 @@ public abstract class AbstractPropagationTaskExecutor implements PropagationTask
              * update, this entity 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);
-            Collection<String> resources = any instanceof User
-                    ? userDAO.findAllResourceNames((User) any)
-                    : any instanceof AnyObject
-                            ? anyObjectDAO.findAllResourceNames((AnyObject) any)
-                            : any instanceof Group
-                                    ? ((Group) any).getResourceKeys()
-                                    : Collections.<String>emptySet();
+            Collection<String> resources = Collections.emptySet();
+            if (task.getEntityKey() != null && task.getAnyTypeKind() != null) {
+                switch (task.getAnyTypeKind()) {
+                    case USER:
+                        try {
+                            resources = userDAO.findAllResourceNames(task.getEntityKey());
+                        } catch (Exception e) {
+                            LOG.error("Could not read user {}", task.getEntityKey(), e);
+                        }
+                        break;
+
+                    case GROUP:
+                        try {
+                            resources = groupDAO.authFind(task.getEntityKey()).getResourceKeys();
+                        } catch (Exception e) {
+                            LOG.error("Could not read group {}", task.getEntityKey(), e);
+                        }
+                        break;
+
+                    case ANY_OBJECT:
+                    default:
+                        try {
+                            resources = anyObjectDAO.findAllResourceNames(task.getEntityKey());
+                        } catch (Exception e) {
+                            LOG.error("Could not read any object {}", task.getEntityKey(), e);
+                        }
+                        break;
+                }
+            }
             if (task.getAnyTypeKind() == null || !resources.contains(task.getResource().getKey())) {
                 LOG.debug("Delete {} on {}", beforeObj.getUid(), task.getResource().getKey());
 

http://git-wip-us.apache.org/repos/asf/syncope/blob/629d18f2/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/propagation/PropagationManagerImpl.java
----------------------------------------------------------------------
diff --git a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/propagation/PropagationManagerImpl.java b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/propagation/PropagationManagerImpl.java
index 9bf336e..57a4894 100644
--- a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/propagation/PropagationManagerImpl.java
+++ b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/propagation/PropagationManagerImpl.java
@@ -63,6 +63,7 @@ import org.apache.syncope.core.persistence.api.entity.resource.OrgUnit;
 import org.apache.syncope.core.persistence.api.entity.resource.Provision;
 import org.apache.syncope.core.persistence.api.entity.user.User;
 import org.apache.syncope.core.provisioning.api.MappingManager;
+import org.apache.syncope.core.provisioning.api.utils.EntityUtils;
 import org.apache.syncope.core.provisioning.java.utils.MappingUtils;
 import org.identityconnectors.framework.common.objects.Attribute;
 import org.identityconnectors.framework.common.objects.AttributeBuilder;
@@ -228,8 +229,7 @@ public class PropagationManagerImpl implements PropagationManager {
             origPropByRes.merge(wfResult.getPropByRes());
 
             Set<String> pwdResourceNames = new HashSet<>(userPatch.getPassword().getResources());
-            Collection<String> currentResourceNames =
-                    userDAO.findAllResourceNames(userDAO.authFind(userPatch.getKey()));
+            Collection<String> currentResourceNames = userDAO.findAllResourceNames(userPatch.getKey());
             pwdResourceNames.retainAll(currentResourceNames);
             PropagationByResource pwdPropByRes = new PropagationByResource();
             pwdPropByRes.addAll(ResourceOperation.UPDATE, pwdResourceNames);
@@ -342,9 +342,11 @@ public class PropagationManagerImpl implements PropagationManager {
         virtualResources.addAll(propByRes.get(ResourceOperation.CREATE));
         virtualResources.addAll(propByRes.get(ResourceOperation.UPDATE));
         if (any instanceof User) {
-            virtualResources.addAll(userDAO.findAllResourceNames((User) any));
+            virtualResources.addAll(CollectionUtils.collect(
+                    userDAO.findAllResources((User) any), EntityUtils.keyTransformer()));
         } else if (any instanceof AnyObject) {
-            virtualResources.addAll(anyObjectDAO.findAllResourceNames((AnyObject) any));
+            virtualResources.addAll(CollectionUtils.collect(
+                    anyObjectDAO.findAllResources((AnyObject) any), EntityUtils.keyTransformer()));
         } else {
             virtualResources.addAll(((Group) any).getResourceKeys());
         }

http://git-wip-us.apache.org/repos/asf/syncope/blob/629d18f2/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/pushpull/AbstractPushResultHandler.java
----------------------------------------------------------------------
diff --git a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/pushpull/AbstractPushResultHandler.java b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/pushpull/AbstractPushResultHandler.java
index cc9cd18..6227718 100644
--- a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/pushpull/AbstractPushResultHandler.java
+++ b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/pushpull/AbstractPushResultHandler.java
@@ -21,6 +21,7 @@ package org.apache.syncope.core.provisioning.java.pushpull;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.List;
+import org.apache.commons.collections4.CollectionUtils;
 import org.apache.commons.collections4.IteratorUtils;
 import org.apache.commons.lang3.exception.ExceptionUtils;
 import org.apache.syncope.common.lib.patch.AnyPatch;
@@ -47,6 +48,7 @@ import org.apache.syncope.core.provisioning.api.MappingManager;
 import org.apache.syncope.core.provisioning.api.TimeoutException;
 import org.apache.syncope.core.provisioning.api.pushpull.IgnoreProvisionException;
 import org.apache.syncope.core.provisioning.api.pushpull.SyncopePushResultHandler;
+import org.apache.syncope.core.provisioning.api.utils.EntityUtils;
 import org.apache.syncope.core.provisioning.java.utils.MappingUtils;
 import org.identityconnectors.framework.common.objects.ConnectorObject;
 import org.identityconnectors.framework.common.objects.ObjectClass;
@@ -267,7 +269,7 @@ public abstract class AbstractPushResultHandler extends AbstractSyncopeResultHan
                             if (!profile.getTask().isPerformUpdate()) {
                                 LOG.debug("PushTask not configured for update");
                             } else {
-                                update(any, status);
+                                update(any);
                             }
 
                             break;
@@ -397,15 +399,17 @@ public abstract class AbstractPushResultHandler extends AbstractSyncopeResultHan
         }
     }
 
-    private Any<?> update(final Any<?> any, final Boolean enabled) {
+    private Any<?> update(final Any<?> any) {
         boolean changepwd;
         Collection<String> resourceKeys;
         if (any instanceof User) {
             changepwd = true;
-            resourceKeys = userDAO.findAllResourceNames((User) any);
+            resourceKeys = CollectionUtils.collect(
+                    userDAO.findAllResources((User) any), EntityUtils.keyTransformer());
         } else if (any instanceof AnyObject) {
             changepwd = false;
-            resourceKeys = anyObjectDAO.findAllResourceNames((AnyObject) any);
+            resourceKeys = CollectionUtils.collect(
+                    anyObjectDAO.findAllResources((AnyObject) any), EntityUtils.keyTransformer());
         } else {
             changepwd = false;
             resourceKeys = ((Group) any).getResourceKeys();

http://git-wip-us.apache.org/repos/asf/syncope/blob/629d18f2/core/workflow-activiti/src/main/java/org/apache/syncope/core/workflow/activiti/ActivitiUserWorkflowAdapter.java
----------------------------------------------------------------------
diff --git a/core/workflow-activiti/src/main/java/org/apache/syncope/core/workflow/activiti/ActivitiUserWorkflowAdapter.java b/core/workflow-activiti/src/main/java/org/apache/syncope/core/workflow/activiti/ActivitiUserWorkflowAdapter.java
index 1df71a4..ef1e732 100644
--- a/core/workflow-activiti/src/main/java/org/apache/syncope/core/workflow/activiti/ActivitiUserWorkflowAdapter.java
+++ b/core/workflow-activiti/src/main/java/org/apache/syncope/core/workflow/activiti/ActivitiUserWorkflowAdapter.java
@@ -50,6 +50,7 @@ import org.activiti.engine.repository.Model;
 import org.activiti.engine.repository.ProcessDefinition;
 import org.activiti.engine.runtime.ProcessInstance;
 import org.activiti.engine.task.Task;
+import org.apache.commons.collections4.CollectionUtils;
 import org.apache.commons.io.IOUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.commons.lang3.tuple.ImmutablePair;
@@ -69,6 +70,7 @@ import org.apache.syncope.core.persistence.api.attrvalue.validation.InvalidEntit
 import org.apache.syncope.core.persistence.api.attrvalue.validation.ParsingValidationException;
 import org.apache.syncope.core.persistence.api.entity.user.User;
 import org.apache.syncope.core.provisioning.api.WorkflowResult;
+import org.apache.syncope.core.provisioning.api.utils.EntityUtils;
 import org.apache.syncope.core.workflow.activiti.spring.DomainProcessEngine;
 import org.apache.syncope.core.workflow.api.WorkflowDefinitionFormat;
 import org.apache.syncope.core.workflow.api.WorkflowException;
@@ -264,7 +266,9 @@ public class ActivitiUserWorkflowAdapter extends AbstractUserWorkflowAdapter {
         }
 
         PropagationByResource propByRes = new PropagationByResource();
-        propByRes.set(ResourceOperation.CREATE, userDAO.findAllResourceNames(user));
+        propByRes.set(
+                ResourceOperation.CREATE,
+                CollectionUtils.collect(userDAO.findAllResources(user), EntityUtils.keyTransformer()));
 
         saveForFormSubmit(user, userTO.getPassword(), propByRes);
 
@@ -403,7 +407,9 @@ public class ActivitiUserWorkflowAdapter extends AbstractUserWorkflowAdapter {
         doExecuteTask(user, "delete", null);
 
         PropagationByResource propByRes = new PropagationByResource();
-        propByRes.set(ResourceOperation.DELETE, userDAO.findAllResourceNames(user));
+        propByRes.set(
+                ResourceOperation.DELETE,
+                CollectionUtils.collect(userDAO.findAllResources(user), EntityUtils.keyTransformer()));
 
         saveForFormSubmit(user, null, propByRes);
 

http://git-wip-us.apache.org/repos/asf/syncope/blob/629d18f2/core/workflow-activiti/src/main/java/org/apache/syncope/core/workflow/activiti/task/PasswordReset.java
----------------------------------------------------------------------
diff --git a/core/workflow-activiti/src/main/java/org/apache/syncope/core/workflow/activiti/task/PasswordReset.java b/core/workflow-activiti/src/main/java/org/apache/syncope/core/workflow/activiti/task/PasswordReset.java
index 91b4bf4..997fd3b 100644
--- a/core/workflow-activiti/src/main/java/org/apache/syncope/core/workflow/activiti/task/PasswordReset.java
+++ b/core/workflow-activiti/src/main/java/org/apache/syncope/core/workflow/activiti/task/PasswordReset.java
@@ -18,12 +18,14 @@
  */
 package org.apache.syncope.core.workflow.activiti.task;
 
+import org.apache.commons.collections4.CollectionUtils;
 import org.apache.syncope.common.lib.patch.PasswordPatch;
 import org.apache.syncope.common.lib.patch.UserPatch;
 import org.apache.syncope.common.lib.types.PropagationByResource;
 import org.apache.syncope.core.persistence.api.dao.UserDAO;
 import org.apache.syncope.core.persistence.api.entity.user.User;
 import org.apache.syncope.core.provisioning.api.data.UserDataBinder;
+import org.apache.syncope.core.provisioning.api.utils.EntityUtils;
 import org.apache.syncope.core.workflow.api.WorkflowException;
 import org.apache.syncope.core.workflow.activiti.ActivitiUserWorkflowAdapter;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -56,7 +58,9 @@ public class PasswordReset extends AbstractActivitiServiceTask {
         UserPatch userPatch = new UserPatch();
         userPatch.setKey(user.getKey());
         userPatch.setPassword(new PasswordPatch.Builder().
-                onSyncope(true).resources(userDAO.findAllResourceNames(user)).value(password).build());
+                onSyncope(true).
+                resources(CollectionUtils.collect(userDAO.findAllResources(user), EntityUtils.keyTransformer())).
+                value(password).build());
 
         PropagationByResource propByRes = dataBinder.update(user, userPatch);
 

http://git-wip-us.apache.org/repos/asf/syncope/blob/629d18f2/core/workflow-java/src/main/java/org/apache/syncope/core/workflow/java/DefaultUserWorkflowAdapter.java
----------------------------------------------------------------------
diff --git a/core/workflow-java/src/main/java/org/apache/syncope/core/workflow/java/DefaultUserWorkflowAdapter.java b/core/workflow-java/src/main/java/org/apache/syncope/core/workflow/java/DefaultUserWorkflowAdapter.java
index 6ede0ef..46367e2 100644
--- a/core/workflow-java/src/main/java/org/apache/syncope/core/workflow/java/DefaultUserWorkflowAdapter.java
+++ b/core/workflow-java/src/main/java/org/apache/syncope/core/workflow/java/DefaultUserWorkflowAdapter.java
@@ -21,6 +21,7 @@ package org.apache.syncope.core.workflow.java;
 import java.io.OutputStream;
 import java.util.Collections;
 import java.util.List;
+import org.apache.commons.collections4.CollectionUtils;
 import org.apache.commons.lang3.tuple.ImmutablePair;
 import org.apache.commons.lang3.tuple.Pair;
 import org.apache.syncope.common.lib.patch.PasswordPatch;
@@ -32,6 +33,7 @@ import org.apache.syncope.common.lib.types.ResourceOperation;
 import org.apache.syncope.core.persistence.api.dao.ConfDAO;
 import org.apache.syncope.core.persistence.api.entity.user.User;
 import org.apache.syncope.core.provisioning.api.WorkflowResult;
+import org.apache.syncope.core.provisioning.api.utils.EntityUtils;
 import org.apache.syncope.core.workflow.api.WorkflowDefinitionFormat;
 import org.apache.syncope.core.workflow.api.WorkflowException;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -84,8 +86,10 @@ public class DefaultUserWorkflowAdapter extends AbstractUserWorkflowAdapter {
         user.setStatus(status);
         user = userDAO.save(user);
 
-        final PropagationByResource propByRes = new PropagationByResource();
-        propByRes.set(ResourceOperation.CREATE, userDAO.findAllResourceNames(user));
+        PropagationByResource propByRes = new PropagationByResource();
+        propByRes.set(
+                ResourceOperation.CREATE,
+                CollectionUtils.collect(userDAO.findAllResources(user), EntityUtils.keyTransformer()));
 
         return new WorkflowResult<Pair<String, Boolean>>(
                 new ImmutablePair<>(user.getKey(), propagateEnable), propByRes, "create");
@@ -151,7 +155,9 @@ public class DefaultUserWorkflowAdapter extends AbstractUserWorkflowAdapter {
         UserPatch userPatch = new UserPatch();
         userPatch.setKey(user.getKey());
         userPatch.setPassword(new PasswordPatch.Builder().
-                onSyncope(true).resources(userDAO.findAllResourceNames(user)).value(password).build());
+                onSyncope(true).
+                resources(CollectionUtils.collect(userDAO.findAllResources(user), EntityUtils.keyTransformer())).
+                value(password).build());
 
         return doUpdate(user, userPatch);
     }

http://git-wip-us.apache.org/repos/asf/syncope/blob/629d18f2/ext/camel/provisioning-camel/src/main/java/org/apache/syncope/core/provisioning/camel/processor/AnyObjectDeprovisionProcessor.java
----------------------------------------------------------------------
diff --git a/ext/camel/provisioning-camel/src/main/java/org/apache/syncope/core/provisioning/camel/processor/AnyObjectDeprovisionProcessor.java b/ext/camel/provisioning-camel/src/main/java/org/apache/syncope/core/provisioning/camel/processor/AnyObjectDeprovisionProcessor.java
index f6d0166..8831559 100644
--- a/ext/camel/provisioning-camel/src/main/java/org/apache/syncope/core/provisioning/camel/processor/AnyObjectDeprovisionProcessor.java
+++ b/ext/camel/provisioning-camel/src/main/java/org/apache/syncope/core/provisioning/camel/processor/AnyObjectDeprovisionProcessor.java
@@ -60,7 +60,7 @@ public class AnyObjectDeprovisionProcessor implements Processor {
                 AnyTypeKind.ANY_OBJECT,
                 key,
                 propByRes,
-                CollectionUtils.removeAll(anyObjectDAO.findAllResourceNames(anyObjectDAO.authFind(key)), resources));
+                CollectionUtils.removeAll(anyObjectDAO.findAllResourceNames(key), resources));
         PropagationReporter propagationReporter =
                 ApplicationContextProvider.getBeanFactory().getBean(PropagationReporter.class);
         taskExecutor.execute(tasks, propagationReporter, nullPriorityAsync);

http://git-wip-us.apache.org/repos/asf/syncope/blob/629d18f2/ext/camel/provisioning-camel/src/main/java/org/apache/syncope/core/provisioning/camel/processor/UserDeleteProcessor.java
----------------------------------------------------------------------
diff --git a/ext/camel/provisioning-camel/src/main/java/org/apache/syncope/core/provisioning/camel/processor/UserDeleteProcessor.java b/ext/camel/provisioning-camel/src/main/java/org/apache/syncope/core/provisioning/camel/processor/UserDeleteProcessor.java
index 949afb6..22195e3 100644
--- a/ext/camel/provisioning-camel/src/main/java/org/apache/syncope/core/provisioning/camel/processor/UserDeleteProcessor.java
+++ b/ext/camel/provisioning-camel/src/main/java/org/apache/syncope/core/provisioning/camel/processor/UserDeleteProcessor.java
@@ -54,7 +54,7 @@ public class UserDeleteProcessor implements Processor {
         Boolean nullPriorityAsync = exchange.getProperty("nullPriorityAsync", Boolean.class);
 
         PropagationByResource propByRes = new PropagationByResource();
-        propByRes.set(ResourceOperation.DELETE, userDAO.findAllResourceNames(userDAO.authFind(key)));
+        propByRes.set(ResourceOperation.DELETE, userDAO.findAllResourceNames(key));
 
         // Note here that we can only notify about "delete", not any other
         // task defined in workflow process definition: this because this

http://git-wip-us.apache.org/repos/asf/syncope/blob/629d18f2/ext/camel/provisioning-camel/src/main/java/org/apache/syncope/core/provisioning/camel/processor/UserDeprovisionProcessor.java
----------------------------------------------------------------------
diff --git a/ext/camel/provisioning-camel/src/main/java/org/apache/syncope/core/provisioning/camel/processor/UserDeprovisionProcessor.java b/ext/camel/provisioning-camel/src/main/java/org/apache/syncope/core/provisioning/camel/processor/UserDeprovisionProcessor.java
index 3cdf8d7..b0eab15 100644
--- a/ext/camel/provisioning-camel/src/main/java/org/apache/syncope/core/provisioning/camel/processor/UserDeprovisionProcessor.java
+++ b/ext/camel/provisioning-camel/src/main/java/org/apache/syncope/core/provisioning/camel/processor/UserDeprovisionProcessor.java
@@ -60,7 +60,7 @@ public class UserDeprovisionProcessor implements Processor {
                 AnyTypeKind.USER,
                 key,
                 propByRes,
-                CollectionUtils.removeAll(userDAO.findAllResourceNames(userDAO.authFind(key)), resources));
+                CollectionUtils.removeAll(userDAO.findAllResourceNames(key), resources));
         PropagationReporter propagationReporter =
                 ApplicationContextProvider.getBeanFactory().getBean(PropagationReporter.class);
         taskExecutor.execute(tasks, propagationReporter, nullPriorityAsync);

http://git-wip-us.apache.org/repos/asf/syncope/blob/629d18f2/fit/core-reference/src/test/java/org/apache/syncope/fit/core/AnyObjectITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/AnyObjectITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/AnyObjectITCase.java
index e5a9b08..171a197 100644
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/AnyObjectITCase.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/AnyObjectITCase.java
@@ -70,10 +70,10 @@ public class AnyObjectITCase extends AbstractITCase {
         ConnObjectTO connObjectTO =
                 resourceService.readConnObject(RESOURCE_NAME_DBSCRIPTED, anyObjectTO.getType(), anyObjectTO.getKey());
         assertNotNull(connObjectTO);
-        assertNotNull(connObjectTO.getPlainAttrMap().get("LOCATION"));
+        assertNotNull(connObjectTO.getAttrMap().get("LOCATION"));
         assertEquals(
                 anyObjectTO.getPlainAttrMap().get("location").getValues(),
-                connObjectTO.getPlainAttrMap().get("LOCATION").getValues());
+                connObjectTO.getAttrMap().get("LOCATION").getValues());
     }
 
     @Test

http://git-wip-us.apache.org/repos/asf/syncope/blob/629d18f2/fit/core-reference/src/test/java/org/apache/syncope/fit/core/GroupITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/GroupITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/GroupITCase.java
index bf2efbb..00959a0 100644
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/GroupITCase.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/GroupITCase.java
@@ -130,7 +130,7 @@ public class GroupITCase extends AbstractITCase {
         ConnObjectTO connObjectTO =
                 resourceService.readConnObject(RESOURCE_NAME_LDAP, AnyTypeKind.GROUP.name(), groupTO.getKey());
         assertNotNull(connObjectTO);
-        assertNotNull(connObjectTO.getPlainAttrMap().get("owner"));
+        assertNotNull(connObjectTO.getAttrMap().get("owner"));
 
         // SYNCOPE-515: remove ownership
         GroupPatch groupPatch = new GroupPatch();

http://git-wip-us.apache.org/repos/asf/syncope/blob/629d18f2/fit/core-reference/src/test/java/org/apache/syncope/fit/core/PropagationTaskITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/PropagationTaskITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/PropagationTaskITCase.java
index 357119d..893ab5a 100644
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/PropagationTaskITCase.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/PropagationTaskITCase.java
@@ -149,7 +149,7 @@ public class PropagationTaskITCase extends AbstractTaskITCase {
             ConnObjectTO connObjectTO = resourceService.
                     readConnObject(RESOURCE_NAME_DBSCRIPTED, anyObjectTO.getType(), anyObjectTO.getKey());
             assertFalse(anyObjectTO.getPlainAttrMap().get("location").getValues().get(0).endsWith(suffix));
-            assertTrue(connObjectTO.getPlainAttrMap().get("LOCATION").getValues().get(0).endsWith(suffix));
+            assertTrue(connObjectTO.getAttrMap().get("LOCATION").getValues().get(0).endsWith(suffix));
         } finally {
             resourceService.update(originalResource);
         }

http://git-wip-us.apache.org/repos/asf/syncope/blob/629d18f2/fit/core-reference/src/test/java/org/apache/syncope/fit/core/PullTaskITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/PullTaskITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/PullTaskITCase.java
index 5b62151..b08fc3d 100644
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/PullTaskITCase.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/PullTaskITCase.java
@@ -455,7 +455,7 @@ public class PullTaskITCase extends AbstractTaskITCase {
                     readConnObject(RESOURCE_NAME_DBSCRIPTED, anyObjectTO.getType(), anyObjectTO.getKey());
             assertFalse(anyObjectTO.getPlainAttrMap().get("location").getValues().get(0).
                     startsWith(PrefixMappingItemTransformer.PREFIX));
-            assertTrue(connObjectTO.getPlainAttrMap().get("LOCATION").getValues().get(0).
+            assertTrue(connObjectTO.getAttrMap().get("LOCATION").getValues().get(0).
                     startsWith(PrefixMappingItemTransformer.PREFIX));
 
             // 3. unlink any existing printer and delete from Syncope (printer is now only on external resource)
@@ -981,9 +981,9 @@ public class PullTaskITCase extends AbstractTaskITCase {
             ConnObjectTO connObject =
                     resourceService.readConnObject(RESOURCE_NAME_LDAP, AnyTypeKind.USER.name(), user.getKey());
             assertNotNull(getLdapRemoteObject(
-                    connObject.getPlainAttrMap().get(Name.NAME).getValues().get(0),
+                    connObject.getAttrMap().get(Name.NAME).getValues().get(0),
                     oldCleanPassword,
-                    connObject.getPlainAttrMap().get(Name.NAME).getValues().get(0)));
+                    connObject.getAttrMap().get(Name.NAME).getValues().get(0)));
 
             // 5. Update the LDAP Connector to retrieve passwords
             ResourceTO ldapResource = resourceService.read(RESOURCE_NAME_LDAP);

http://git-wip-us.apache.org/repos/asf/syncope/blob/629d18f2/fit/core-reference/src/test/java/org/apache/syncope/fit/core/ResourceITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/ResourceITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/ResourceITCase.java
index cb99b7a..8fa5aca 100644
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/ResourceITCase.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/ResourceITCase.java
@@ -604,7 +604,7 @@ public class ResourceITCase extends AbstractITCase {
 
                     @Override
                     public String transform(final ConnObjectTO input) {
-                        return input.getPlainAttrMap().get("__NAME__").getValues().get(0);
+                        return input.getAttrMap().get("__NAME__").getValues().get(0);
                     }
                 }, read);
 

http://git-wip-us.apache.org/repos/asf/syncope/blob/629d18f2/fit/core-reference/src/test/java/org/apache/syncope/fit/core/UserITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/UserITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/UserITCase.java
index af4b248..4c2c6de 100644
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/UserITCase.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/UserITCase.java
@@ -115,7 +115,7 @@ public class UserITCase extends AbstractITCase {
     private static final FastDateFormat DATE_FORMAT = DateFormatUtils.ISO_DATE_FORMAT;
 
     private boolean getBooleanAttribute(final ConnObjectTO connObjectTO, final String attrName) {
-        return Boolean.parseBoolean(connObjectTO.getPlainAttrMap().get(attrName).getValues().get(0));
+        return Boolean.parseBoolean(connObjectTO.getAttrMap().get(attrName).getValues().get(0));
     }
 
     public static UserTO getUniqueSampleTO(final String email) {
@@ -1121,7 +1121,7 @@ public class UserITCase extends AbstractITCase {
         ConnObjectTO connObjectTO =
                 resourceService.readConnObject(RESOURCE_NAME_CSV, AnyTypeKind.USER.name(), actual.getKey());
         assertNotNull(connObjectTO);
-        assertEquals("sx-dx", connObjectTO.getPlainAttrMap().get("THEIRGROUP").getValues().get(0));
+        assertEquals("sx-dx", connObjectTO.getAttrMap().get("THEIRGROUP").getValues().get(0));
     }
 
     @Test
@@ -1341,7 +1341,7 @@ public class UserITCase extends AbstractITCase {
         ConnObjectTO connObjectTO =
                 resourceService.readConnObject(RESOURCE_NAME_DBVIRATTR, AnyTypeKind.USER.name(), userTO.getKey());
         assertNotNull(connObjectTO);
-        assertEquals("virtualvalue", connObjectTO.getPlainAttrMap().get("USERNAME").getValues().get(0));
+        assertEquals("virtualvalue", connObjectTO.getAttrMap().get("USERNAME").getValues().get(0));
         // ----------------------------------
 
         userTO = userService.read(userTO.getKey());
@@ -1399,7 +1399,7 @@ public class UserITCase extends AbstractITCase {
 
         ConnObjectTO userOnDb = resourceService.readConnObject(
                 RESOURCE_NAME_TESTDB, AnyTypeKind.USER.name(), userTO.getKey());
-        final AttrTO pwdOnTestDbAttr = userOnDb.getPlainAttrMap().get(OperationalAttributes.PASSWORD_NAME);
+        final AttrTO pwdOnTestDbAttr = userOnDb.getAttrMap().get(OperationalAttributes.PASSWORD_NAME);
         assertNotNull(pwdOnTestDbAttr);
         assertNotNull(pwdOnTestDbAttr.getValues());
         assertFalse(pwdOnTestDbAttr.getValues().isEmpty());
@@ -1407,7 +1407,7 @@ public class UserITCase extends AbstractITCase {
 
         ConnObjectTO userOnDb2 = resourceService.readConnObject(
                 RESOURCE_NAME_TESTDB2, AnyTypeKind.USER.name(), userTO.getKey());
-        final AttrTO pwdOnTestDb2Attr = userOnDb2.getPlainAttrMap().get(OperationalAttributes.PASSWORD_NAME);
+        final AttrTO pwdOnTestDb2Attr = userOnDb2.getAttrMap().get(OperationalAttributes.PASSWORD_NAME);
         assertNotNull(pwdOnTestDb2Attr);
         assertNotNull(pwdOnTestDb2Attr.getValues());
         assertFalse(pwdOnTestDb2Attr.getValues().isEmpty());
@@ -1432,7 +1432,7 @@ public class UserITCase extends AbstractITCase {
 
         // 3c. verify that password *has* changed on testdb
         userOnDb = resourceService.readConnObject(RESOURCE_NAME_TESTDB, AnyTypeKind.USER.name(), userTO.getKey());
-        final AttrTO pwdOnTestDbAttrAfter = userOnDb.getPlainAttrMap().get(OperationalAttributes.PASSWORD_NAME);
+        final AttrTO pwdOnTestDbAttrAfter = userOnDb.getAttrMap().get(OperationalAttributes.PASSWORD_NAME);
         assertNotNull(pwdOnTestDbAttrAfter);
         assertNotNull(pwdOnTestDbAttrAfter.getValues());
         assertFalse(pwdOnTestDbAttrAfter.getValues().isEmpty());
@@ -1440,7 +1440,7 @@ public class UserITCase extends AbstractITCase {
 
         // 3d. verify that password hasn't changed on testdb2
         userOnDb2 = resourceService.readConnObject(RESOURCE_NAME_TESTDB2, AnyTypeKind.USER.name(), userTO.getKey());
-        final AttrTO pwdOnTestDb2AttrAfter = userOnDb2.getPlainAttrMap().get(OperationalAttributes.PASSWORD_NAME);
+        final AttrTO pwdOnTestDb2AttrAfter = userOnDb2.getAttrMap().get(OperationalAttributes.PASSWORD_NAME);
         assertNotNull(pwdOnTestDb2AttrAfter);
         assertNotNull(pwdOnTestDb2AttrAfter.getValues());
         assertFalse(pwdOnTestDb2AttrAfter.getValues().isEmpty());
@@ -1542,7 +1542,7 @@ public class UserITCase extends AbstractITCase {
 
         ConnObjectTO connObjectTO =
                 resourceService.readConnObject(RESOURCE_NAME_CSV, AnyTypeKind.USER.name(), userTO.getKey());
-        assertNull(connObjectTO.getPlainAttrMap().get("email"));
+        assertNull(connObjectTO.getAttrMap().get("email"));
     }
 
     @Test
@@ -1627,7 +1627,7 @@ public class UserITCase extends AbstractITCase {
         ConnObjectTO connObj = resourceService.readConnObject(
                 RESOURCE_NAME_LDAP, AnyTypeKind.GROUP.name(), groupTO.getKey());
         assertNotNull(connObj);
-        assertTrue(connObj.getPlainAttrMap().get("uniqueMember").getValues().
+        assertTrue(connObj.getAttrMap().get("uniqueMember").getValues().
                 contains("uid=" + userTO.getUsername() + ",ou=people,o=isp"));
 
         // 4. remove membership
@@ -1642,7 +1642,7 @@ public class UserITCase extends AbstractITCase {
         // 5. read group on resource, check that user DN was removed from uniqueMember
         connObj = resourceService.readConnObject(RESOURCE_NAME_LDAP, AnyTypeKind.GROUP.name(), groupTO.getKey());
         assertNotNull(connObj);
-        assertFalse(connObj.getPlainAttrMap().get("uniqueMember").getValues().
+        assertFalse(connObj.getAttrMap().get("uniqueMember").getValues().
                 contains("uid=" + userTO.getUsername() + ",ou=people,o=isp"));
 
         // 6. restore original resource-ldap group mapping
@@ -1681,10 +1681,10 @@ public class UserITCase extends AbstractITCase {
         ConnObjectTO connObj = resourceService.readConnObject(
                 RESOURCE_NAME_LDAP, AnyTypeKind.USER.name(), userTO.getKey());
         assertNotNull(connObj);
-        AttrTO registeredAddress = connObj.getPlainAttrMap().get("registeredAddress");
+        AttrTO registeredAddress = connObj.getAttrMap().get("registeredAddress");
         assertNotNull(registeredAddress);
         assertEquals(userTO.getPlainAttrMap().get("obscure").getValues(), registeredAddress.getValues());
-        AttrTO jpegPhoto = connObj.getPlainAttrMap().get("jpegPhoto");
+        AttrTO jpegPhoto = connObj.getAttrMap().get("jpegPhoto");
         assertNotNull(jpegPhoto);
         assertEquals(userTO.getPlainAttrMap().get("photo").getValues(), jpegPhoto.getValues());
 
@@ -2111,9 +2111,9 @@ public class UserITCase extends AbstractITCase {
 
         // 3. try (and succeed) to perform simple LDAP binding with provided password ('password123')
         assertNotNull(getLdapRemoteObject(
-                connObject.getPlainAttrMap().get(Name.NAME).getValues().get(0),
+                connObject.getAttrMap().get(Name.NAME).getValues().get(0),
                 "password123",
-                connObject.getPlainAttrMap().get(Name.NAME).getValues().get(0)));
+                connObject.getAttrMap().get(Name.NAME).getValues().get(0)));
 
         // 4. update user without any password change request
         UserPatch userPatch = new UserPatch();
@@ -2125,9 +2125,9 @@ public class UserITCase extends AbstractITCase {
 
         // 5. try (and succeed again) to perform simple LDAP binding: password has not changed
         assertNotNull(getLdapRemoteObject(
-                connObject.getPlainAttrMap().get(Name.NAME).getValues().get(0),
+                connObject.getAttrMap().get(Name.NAME).getValues().get(0),
                 "password123",
-                connObject.getPlainAttrMap().get(Name.NAME).getValues().get(0)));
+                connObject.getAttrMap().get(Name.NAME).getValues().get(0)));
     }
 
     @Test
@@ -2145,7 +2145,7 @@ public class UserITCase extends AbstractITCase {
                 resourceService.readConnObject(RESOURCE_NAME_WS1, AnyTypeKind.USER.name(), userTO.getKey());
         assertNotNull(actual);
         // check if mapping attribute with purpose NONE really hasn't been propagated
-        assertNull(actual.getPlainAttrMap().get("NAME"));
+        assertNull(actual.getAttrMap().get("NAME"));
 
         // 2.  update resource ws-target-resource-1
         ResourceTO ws1 = resourceService.read(RESOURCE_NAME_WS1);
@@ -2185,8 +2185,8 @@ public class UserITCase extends AbstractITCase {
         ConnObjectTO newUser =
                 resourceService.readConnObject(RESOURCE_NAME_WS1, AnyTypeKind.USER.name(), userTO.getKey());
 
-        assertNotNull(newUser.getPlainAttrMap().get("NAME"));
-        assertEquals("firstnameNew", newUser.getPlainAttrMap().get("NAME").getValues().get(0));
+        assertNotNull(newUser.getAttrMap().get("NAME"));
+        assertEquals("firstnameNew", newUser.getAttrMap().get("NAME").getValues().get(0));
 
         // 4.  restore resource ws-target-resource-1 mapping
         ws1NewUMapping = newWs1.getProvision(AnyTypeKind.USER.name()).getMapping();
@@ -2275,9 +2275,9 @@ public class UserITCase extends AbstractITCase {
                 resourceService.readConnObject(RESOURCE_NAME_LDAP, AnyTypeKind.USER.name(), user.getKey());
 
         assertNotNull(getLdapRemoteObject(
-                connObject.getPlainAttrMap().get(Name.NAME).getValues().get(0),
+                connObject.getAttrMap().get(Name.NAME).getValues().get(0),
                 "security123",
-                connObject.getPlainAttrMap().get(Name.NAME).getValues().get(0)));
+                connObject.getAttrMap().get(Name.NAME).getValues().get(0)));
 
         // 5. Remove LDAPPasswordPropagationActions
         resourceTO = resourceService.read(RESOURCE_NAME_LDAP);
@@ -2320,7 +2320,7 @@ public class UserITCase extends AbstractITCase {
         assertNotNull(connObjectTO);
 
         // check if password has not changed
-        assertEquals("password0", connObjectTO.getPlainAttrMap().
+        assertEquals("password0", connObjectTO.getAttrMap().
                 get(OperationalAttributes.PASSWORD_NAME).getValues().get(0));
         assertNull(userTO.getPassword());
 
@@ -2342,7 +2342,7 @@ public class UserITCase extends AbstractITCase {
         assertNotNull(connObjectTO);
 
         // check if password has been propagated and that saved userTO's password is null
-        assertEquals("passwordTESTNULL1", connObjectTO.getPlainAttrMap().
+        assertEquals("passwordTESTNULL1", connObjectTO.getAttrMap().
                 get(OperationalAttributes.PASSWORD_NAME).getValues().get(0));
         assertNull(userTO.getPassword());
 
@@ -2363,7 +2363,7 @@ public class UserITCase extends AbstractITCase {
         assertNotNull(connObjectTO);
 
         // check if password has been correctly propagated on Syncope and resource-csv as usual
-        assertEquals("passwordTESTNULL1", connObjectTO.getPlainAttrMap().
+        assertEquals("passwordTESTNULL1", connObjectTO.getAttrMap().
                 get(OperationalAttributes.PASSWORD_NAME).getValues().get(0));
         Pair<Map<String, Set<String>>, UserTO> self =
                 clientFactory.create(userTO.getUsername(), "passwordTESTNULL1").self();
@@ -2420,7 +2420,7 @@ public class UserITCase extends AbstractITCase {
         ConnObjectTO connObjectTO =
                 resourceService.readConnObject(RESOURCE_NAME_LDAP, AnyTypeKind.USER.name(), actual.getKey());
         assertNotNull(connObjectTO);
-        assertEquals("postalAddress", connObjectTO.getPlainAttrMap().get("postalAddress").getValues().get(0));
+        assertEquals("postalAddress", connObjectTO.getAttrMap().get("postalAddress").getValues().get(0));
 
         UserPatch userPatch = new UserPatch();
         userPatch.setKey(actual.getKey());
@@ -2430,7 +2430,7 @@ public class UserITCase extends AbstractITCase {
 
         connObjectTO = resourceService.readConnObject(RESOURCE_NAME_LDAP, AnyTypeKind.USER.name(), actual.getKey());
         assertNotNull(connObjectTO);
-        assertEquals("newPostalAddress", connObjectTO.getPlainAttrMap().get("postalAddress").getValues().get(0));
+        assertEquals("newPostalAddress", connObjectTO.getAttrMap().get("postalAddress").getValues().get(0));
     }
 
     @Test
@@ -2554,4 +2554,38 @@ public class UserITCase extends AbstractITCase {
         assertEquals(1, result.getPropagationStatuses().size());
         assertEquals(RESOURCE_NAME_TESTDB, result.getPropagationStatuses().get(0).getResource());
     }
+
+    @Test
+    public void issueSYNCOPE881() {
+        // 1. create group and assign LDAP
+        GroupTO group = GroupITCase.getSampleTO("syncope881G");
+        group.getVirAttrs().add(attrTO("rvirtualdata", "rvirtualvalue"));
+
+        group = createGroup(group).getEntity();
+        assertNotNull(group);
+        assertNotNull(resourceService.readConnObject(RESOURCE_NAME_LDAP, AnyTypeKind.GROUP.name(), group.getKey()));
+
+        // 2. create user and assign such group
+        UserTO user = getUniqueSampleTO("syncope881U@apache.org");
+        user.getMemberships().clear();
+        user.getMemberships().add(new MembershipTO.Builder().group(group.getKey()).build());
+
+        user = createUser(user).getEntity();
+        assertNotNull(user);
+
+        // 3. verify that user is in LDAP
+        ConnObjectTO connObject =
+                resourceService.readConnObject(RESOURCE_NAME_LDAP, AnyTypeKind.USER.name(), user.getKey());
+        assertNotNull(connObject);
+        AttrTO userDn = connObject.getAttrMap().get(Name.NAME);
+        assertNotNull(userDn);
+        assertEquals(1, userDn.getValues().size());
+        assertNotNull(getLdapRemoteObject(RESOURCE_LDAP_ADMIN_DN, RESOURCE_LDAP_ADMIN_PWD, userDn.getValues().get(0)));
+
+        // 4. remove user
+        userService.delete(user.getKey());
+
+        // 5. verify that user is not in LDAP anynmore
+        assertNull(getLdapRemoteObject(RESOURCE_LDAP_ADMIN_DN, RESOURCE_LDAP_ADMIN_PWD, userDn.getValues().get(0)));
+    }
 }

http://git-wip-us.apache.org/repos/asf/syncope/blob/629d18f2/fit/core-reference/src/test/java/org/apache/syncope/fit/core/VirAttrITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/VirAttrITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/VirAttrITCase.java
index 90e1c35..3c439ec 100644
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/VirAttrITCase.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/VirAttrITCase.java
@@ -137,7 +137,7 @@ public class VirAttrITCase extends AbstractITCase {
 
         ConnObjectTO connObjectTO =
                 resourceService.readConnObject(RESOURCE_NAME_WS2, AnyTypeKind.USER.name(), userTO.getKey());
-        assertEquals("virtualvalue", connObjectTO.getPlainAttrMap().get("COMPANYNAME").getValues().get(0));
+        assertEquals("virtualvalue", connObjectTO.getAttrMap().get("COMPANYNAME").getValues().get(0));
         // ----------------------------------
 
         // ----------------------------------
@@ -155,7 +155,7 @@ public class VirAttrITCase extends AbstractITCase {
         userTO = result.getEntity();
 
         connObjectTO = resourceService.readConnObject(RESOURCE_NAME_WS2, AnyTypeKind.USER.name(), userTO.getKey());
-        assertEquals("virtualvalue2", connObjectTO.getPlainAttrMap().get("COMPANYNAME").getValues().get(0));
+        assertEquals("virtualvalue2", connObjectTO.getAttrMap().get("COMPANYNAME").getValues().get(0));
         // ----------------------------------
 
         // ----------------------------------
@@ -169,7 +169,7 @@ public class VirAttrITCase extends AbstractITCase {
         assertEquals("suspended", userTO.getStatus());
 
         connObjectTO = resourceService.readConnObject(RESOURCE_NAME_WS2, AnyTypeKind.USER.name(), userTO.getKey());
-        assertEquals("virtualvalue2", connObjectTO.getPlainAttrMap().get("COMPANYNAME").getValues().get(0));
+        assertEquals("virtualvalue2", connObjectTO.getAttrMap().get("COMPANYNAME").getValues().get(0));
 
         statusPatch = new StatusPatch();
         statusPatch.setKey(userTO.getKey());
@@ -179,7 +179,7 @@ public class VirAttrITCase extends AbstractITCase {
         assertEquals("active", userTO.getStatus());
 
         connObjectTO = resourceService.readConnObject(RESOURCE_NAME_WS2, AnyTypeKind.USER.name(), userTO.getKey());
-        assertEquals("virtualvalue2", connObjectTO.getPlainAttrMap().get("COMPANYNAME").getValues().get(0));
+        assertEquals("virtualvalue2", connObjectTO.getAttrMap().get("COMPANYNAME").getValues().get(0));
         // ----------------------------------
 
         // ----------------------------------
@@ -197,11 +197,11 @@ public class VirAttrITCase extends AbstractITCase {
         userTO = result.getEntity();
 
         connObjectTO = resourceService.readConnObject(RESOURCE_NAME_WS2, AnyTypeKind.USER.name(), userTO.getKey());
-        assertEquals("Surname2", connObjectTO.getPlainAttrMap().get("SURNAME").getValues().get(0));
+        assertEquals("Surname2", connObjectTO.getAttrMap().get("SURNAME").getValues().get(0));
 
         // virtual attribute value did not change
-        assertFalse(connObjectTO.getPlainAttrMap().get("COMPANYNAME").getValues().isEmpty());
-        assertEquals("virtualvalue2", connObjectTO.getPlainAttrMap().get("COMPANYNAME").getValues().get(0));
+        assertFalse(connObjectTO.getAttrMap().get("COMPANYNAME").getValues().isEmpty());
+        assertEquals("virtualvalue2", connObjectTO.getAttrMap().get("COMPANYNAME").getValues().get(0));
         // ----------------------------------
     }
 


Mime
View raw message