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:30 UTC
[1/4] syncope git commit: [SYNCOPE-601]
Repository: syncope
Updated Branches:
refs/heads/1_1_X 296ffa369 -> 3d5a3706c
refs/heads/1_2_X 46d897f06 -> 68991ba9e
refs/heads/master c65bc32d8 -> 550d3fcac
[SYNCOPE-601]
Project: http://git-wip-us.apache.org/repos/asf/syncope/repo
Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/3d5a3706
Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/3d5a3706
Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/3d5a3706
Branch: refs/heads/1_1_X
Commit: 3d5a3706c5c5bfff149d1244a5221a77659dc757
Parents: 296ffa3
Author: Marco Di Sabatino Di Diodoro <md...@apache.org>
Authored: Mon Nov 10 11:48:08 2014 +0100
Committer: Marco Di Sabatino Di Diodoro <md...@apache.org>
Committed: Mon Nov 10 11:48:08 2014 +0100
----------------------------------------------------------------------
.../sync/impl/SyncopeSyncResultHandler.java | 130 ++++++++++---------
1 file changed, 72 insertions(+), 58 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/syncope/blob/3d5a3706/core/src/main/java/org/apache/syncope/core/sync/impl/SyncopeSyncResultHandler.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/syncope/core/sync/impl/SyncopeSyncResultHandler.java b/core/src/main/java/org/apache/syncope/core/sync/impl/SyncopeSyncResultHandler.java
index 277e15b..f2cb5bd 100644
--- a/core/src/main/java/org/apache/syncope/core/sync/impl/SyncopeSyncResultHandler.java
+++ b/core/src/main/java/org/apache/syncope/core/sync/impl/SyncopeSyncResultHandler.java
@@ -392,10 +392,15 @@ public class SyncopeSyncResultHandler implements SyncResultsHandler {
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;
- if (value == null || value.getValue() == null || value.getValue().isEmpty()
+ if (value.getValue() == null || value.getValue().isEmpty()
|| (value.getValue().size() == 1 && value.getValue().get(0) == null)) {
type = AttributeCond.Type.ISNULL;
} else {
@@ -487,15 +492,19 @@ public class SyncopeSyncResultHandler implements SyncResultsHandler {
}
ConnectorObject connObj = found.iterator().next();
- final List<Long> subjectIds = findExisting(connObj.getUid().getUidValue(), connObj, 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, 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());
}
}
@@ -951,63 +960,68 @@ public class SyncopeSyncResultHandler implements SyncResultsHandler {
final String uid = delta.getPreviousUid() == null
? delta.getUid().getUidValue()
: delta.getPreviousUid().getUidValue();
- final List<Long> subjectIds = findExisting(uid, delta.getObject(), attrUtil);
- if (SyncDeltaType.CREATE_OR_UPDATE == delta.getDeltaType()) {
- if (subjectIds.isEmpty()) {
- results.addAll(create(delta, attrUtil, dryRun));
- } else if (subjectIds.size() == 1) {
- results.addAll(update(delta, subjectIds.subList(0, 1), attrUtil, dryRun));
- } else {
- switch (resAct) {
- case IGNORE:
- LOG.error("More than one match {}", subjectIds);
- break;
+ try {
+ final List<Long> subjectIds = findExisting(uid, delta.getObject(), attrUtil);
+
+ if (SyncDeltaType.CREATE_OR_UPDATE == delta.getDeltaType()) {
+ if (subjectIds.isEmpty()) {
+ results.addAll(create(delta, attrUtil, dryRun));
+ } else if (subjectIds.size() == 1) {
+ results.addAll(update(delta, subjectIds.subList(0, 1), attrUtil, dryRun));
+ } else {
+ switch (resAct) {
+ case IGNORE:
+ LOG.error("More than one match {}", subjectIds);
+ break;
- case FIRSTMATCH:
- results.addAll(update(delta, subjectIds.subList(0, 1), attrUtil, dryRun));
- break;
+ case FIRSTMATCH:
+ results.addAll(update(delta, subjectIds.subList(0, 1), attrUtil, dryRun));
+ break;
- case LASTMATCH:
- results.addAll(update(delta, subjectIds.subList(subjectIds.size() - 1, subjectIds.size()),
- attrUtil, dryRun));
- break;
+ case LASTMATCH:
+ results.addAll(update(delta, subjectIds.subList(subjectIds.size() - 1, subjectIds.size()),
+ attrUtil, dryRun));
+ break;
- case ALL:
- results.addAll(update(delta, subjectIds, attrUtil, dryRun));
- break;
+ case ALL:
+ results.addAll(update(delta, subjectIds, attrUtil, dryRun));
+ break;
- default:
+ default:
+ }
}
- }
- } else if (SyncDeltaType.DELETE == delta.getDeltaType()) {
- if (subjectIds.isEmpty()) {
- LOG.debug("No match found for deletion");
- } else if (subjectIds.size() == 1) {
- results.addAll(delete(delta, subjectIds, attrUtil, dryRun));
- } else {
- switch (resAct) {
- case IGNORE:
- LOG.error("More than one match {}", subjectIds);
- break;
-
- case FIRSTMATCH:
- results.addAll(delete(delta, subjectIds.subList(0, 1), attrUtil, dryRun));
- break;
-
- case LASTMATCH:
- results.addAll(delete(delta, subjectIds.subList(subjectIds.size() - 1, subjectIds.size()),
- attrUtil,
- dryRun));
- break;
-
- case ALL:
- results.addAll(delete(delta, subjectIds, attrUtil, dryRun));
- break;
-
- default:
+ } else if (SyncDeltaType.DELETE == delta.getDeltaType()) {
+ if (subjectIds.isEmpty()) {
+ LOG.debug("No match found for deletion");
+ } else if (subjectIds.size() == 1) {
+ results.addAll(delete(delta, subjectIds, attrUtil, dryRun));
+ } else {
+ switch (resAct) {
+ case IGNORE:
+ LOG.error("More than one match {}", subjectIds);
+ break;
+
+ case FIRSTMATCH:
+ results.addAll(delete(delta, subjectIds.subList(0, 1), attrUtil, dryRun));
+ break;
+
+ case LASTMATCH:
+ results.addAll(delete(delta, subjectIds.subList(subjectIds.size() - 1, subjectIds.size()),
+ attrUtil,
+ dryRun));
+ break;
+
+ case ALL:
+ results.addAll(delete(delta, subjectIds, attrUtil, dryRun));
+ break;
+
+ default:
+ }
}
}
+ } catch (IllegalArgumentException e) {
+ LOG.warn(e.getMessage());
}
}
}
[4/4] syncope git commit: Merge branch '1_2_X'
Posted by md...@apache.org.
Merge branch '1_2_X'
Project: http://git-wip-us.apache.org/repos/asf/syncope/repo
Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/550d3fca
Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/550d3fca
Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/550d3fca
Branch: refs/heads/master
Commit: 550d3fcacd611089f65d4e56942387db9cfc41c2
Parents: c65bc32 68991ba
Author: Marco Di Sabatino Di Diodoro <md...@apache.org>
Authored: Mon Nov 10 12:16:03 2014 +0100
Committer: Marco Di Sabatino Di Diodoro <md...@apache.org>
Committed: Mon Nov 10 12:16:03 2014 +0100
----------------------------------------------------------------------
.../apache/syncope/core/sync/SyncUtilities.java | 25 +++++++++++++-------
.../impl/AbstractSubjectSyncResultHandler.java | 2 ++
2 files changed, 19 insertions(+), 8 deletions(-)
----------------------------------------------------------------------
[2/4] syncope git commit: [SYNCOPE-601] Merge from 1_1_X
Posted by md...@apache.org.
[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());
}
}
[3/4] syncope git commit: [SYNCOPE-601] Merge from 1_1_X
Posted by md...@apache.org.
[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/master
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());
}
}