syncope-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ilgro...@apache.org
Subject [4/4] syncope git commit: Ensure to send the connObjectKey is __NAME__ is different from __UID__
Date Thu, 31 Aug 2017 15:24:15 GMT
Ensure to send the connObjectKey is __NAME__ is different from __UID__


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

Branch: refs/heads/master
Commit: eeef6376354eb042fabff60a6f80da3be86d0e93
Parents: 8ce2748
Author: Francesco Chicchiriccò <ilgrosso@apache.org>
Authored: Thu Aug 31 17:17:37 2017 +0200
Committer: Francesco Chicchiriccò <ilgrosso@apache.org>
Committed: Thu Aug 31 17:24:06 2017 +0200

----------------------------------------------------------------------
 .../syncope/core/provisioning/java/MappingManagerImpl.java   | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/syncope/blob/eeef6376/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/MappingManagerImpl.java
----------------------------------------------------------------------
diff --git a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/MappingManagerImpl.java
b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/MappingManagerImpl.java
index 1597b11..b05e5b6 100644
--- a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/MappingManagerImpl.java
+++ b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/MappingManagerImpl.java
@@ -87,6 +87,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 import org.springframework.transaction.annotation.Transactional;
 import org.apache.syncope.core.provisioning.api.data.ItemTransformer;
+import org.identityconnectors.framework.common.objects.Name;
 
 @Component
 public class MappingManagerImpl implements MappingManager {
@@ -193,7 +194,12 @@ public class MappingManagerImpl implements MappingManager {
             attributes.add(AttributeBuilder.build(
                     MappingUtils.getConnObjectKeyItem(provision).get().getExtAttrName(),
connObjectKey));
         }
-        attributes.add(MappingUtils.evaluateNAME(any, provision, connObjectKey));
+        Name name = MappingUtils.evaluateNAME(any, provision, connObjectKey);
+        attributes.add(name);
+        if (connObjectKey != null && !connObjectKey.equals(name.getNameValue()) &&
connObjectKeyExtAttr == null) {
+            attributes.add(AttributeBuilder.build(
+                    MappingUtils.getConnObjectKeyItem(provision).get().getExtAttrName(),
connObjectKey));
+        }
 
         if (enable != null) {
             attributes.add(AttributeBuilder.buildEnabled(enable));


Mime
View raw message