You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@syncope.apache.org by md...@apache.org on 2014/11/10 12:17:31 UTC

[2/4] syncope git commit: [SYNCOPE-601] Merge from 1_1_X

[SYNCOPE-601] Merge from 1_1_X


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

Branch: refs/heads/1_2_X
Commit: 68991ba9e4d0c15c628c431727fda4ed436de5ce
Parents: 46d897f
Author: Marco Di Sabatino Di Diodoro <md...@apache.org>
Authored: Mon Nov 10 12:15:22 2014 +0100
Committer: Marco Di Sabatino Di Diodoro <md...@apache.org>
Committed: Mon Nov 10 12:15:22 2014 +0100

----------------------------------------------------------------------
 .../apache/syncope/core/sync/SyncUtilities.java | 25 +++++++++++++-------
 .../impl/AbstractSubjectSyncResultHandler.java  |  2 ++
 2 files changed, 19 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/syncope/blob/68991ba9/core/src/main/java/org/apache/syncope/core/sync/SyncUtilities.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/syncope/core/sync/SyncUtilities.java b/core/src/main/java/org/apache/syncope/core/sync/SyncUtilities.java
index 44190f2..0c3f146 100644
--- a/core/src/main/java/org/apache/syncope/core/sync/SyncUtilities.java
+++ b/core/src/main/java/org/apache/syncope/core/sync/SyncUtilities.java
@@ -126,15 +126,19 @@ public class SyncUtilities {
             }
 
             ConnectorObject connObj = found.iterator().next();
-            final List<Long> subjectIds = findExisting(connObj.getUid().getUidValue(), connObj, resource, attrUtil);
-            if (subjectIds.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);
-                }
+            try {
+                final List<Long> subjectIds = findExisting(connObj.getUid().getUidValue(), connObj, resource, attrUtil);
+                if (subjectIds.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);
+                    }
 
-                result = subjectIds.iterator().next();
+                    result = subjectIds.iterator().next();
+                }
+            } catch (IllegalArgumentException e) {
+                LOG.warn(e.getMessage());
             }
         }
 
@@ -251,6 +255,11 @@ public class SyncUtilities {
         for (String schema : altSearchSchemas) {
             Attribute value = extValues.get(schema);
 
+            if (value == null) {
+                throw new IllegalArgumentException(
+                        "Connector object does not contains the attributes to perform the search: " + schema);
+            }
+
             AttributeCond.Type type;
             String expression = null;
 

http://git-wip-us.apache.org/repos/asf/syncope/blob/68991ba9/core/src/main/java/org/apache/syncope/core/sync/impl/AbstractSubjectSyncResultHandler.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/syncope/core/sync/impl/AbstractSubjectSyncResultHandler.java b/core/src/main/java/org/apache/syncope/core/sync/impl/AbstractSubjectSyncResultHandler.java
index 54b7e3f..ff9bc3d 100644
--- a/core/src/main/java/org/apache/syncope/core/sync/impl/AbstractSubjectSyncResultHandler.java
+++ b/core/src/main/java/org/apache/syncope/core/sync/impl/AbstractSubjectSyncResultHandler.java
@@ -599,6 +599,8 @@ public abstract class AbstractSubjectSyncResultHandler extends AbstractSyncopeRe
             }
         } catch (IllegalStateException e) {
             LOG.warn(e.getMessage());
+        } catch (IllegalArgumentException e) {
+            LOG.warn(e.getMessage());
         }
     }