You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@syncope.apache.org by il...@apache.org on 2018/10/23 12:27:24 UTC
[1/3] syncope git commit: [SYNCOPE-1387] Clearing up calls between
link() and update()
Repository: syncope
Updated Branches:
refs/heads/2_0_X 5eb958549 -> 5e854e117
refs/heads/2_1_X 292006e4c -> 6bb67afe2
refs/heads/master d9a879af8 -> e851b2818
[SYNCOPE-1387] Clearing up calls between link() and update()
Project: http://git-wip-us.apache.org/repos/asf/syncope/repo
Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/6bb67afe
Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/6bb67afe
Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/6bb67afe
Branch: refs/heads/2_1_X
Commit: 6bb67afe241f5bfb584db0a2bb14f007997e5427
Parents: 292006e
Author: Francesco Chicchiriccò <il...@apache.org>
Authored: Tue Oct 23 14:26:52 2018 +0200
Committer: Francesco Chicchiriccò <il...@apache.org>
Committed: Tue Oct 23 14:26:52 2018 +0200
----------------------------------------------------------------------
.../pushpull/DefaultRealmPullResultHandler.java | 28 ++++++++++----------
1 file changed, 14 insertions(+), 14 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/syncope/blob/6bb67afe/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/pushpull/DefaultRealmPullResultHandler.java
----------------------------------------------------------------------
diff --git a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/pushpull/DefaultRealmPullResultHandler.java b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/pushpull/DefaultRealmPullResultHandler.java
index fb29bd4..1e1fdd2 100644
--- a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/pushpull/DefaultRealmPullResultHandler.java
+++ b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/pushpull/DefaultRealmPullResultHandler.java
@@ -274,7 +274,7 @@ public class DefaultRealmPullResultHandler
finalize(operation, resultStatus, null, output, delta);
}
- private List<ProvisioningReport> update(final SyncDelta delta, final List<String> keys)
+ private List<ProvisioningReport> update(final SyncDelta delta, final List<String> keys, final boolean inLink)
throws JobExecutionException {
if (!profile.getTask().isPerformUpdate()) {
@@ -314,8 +314,10 @@ public class DefaultRealmPullResultHandler
output = null;
} else {
try {
- for (PullActions action : profile.getActions()) {
- action.beforeUpdate(profile, delta, before, null);
+ if (!inLink) {
+ for (PullActions action : profile.getActions()) {
+ action.beforeUpdate(profile, delta, before, null);
+ }
}
PropagationByResource propByRes = binder.update(realm, before);
@@ -414,15 +416,17 @@ public class DefaultRealmPullResultHandler
propByRes.add(ResourceOperation.DELETE, profile.getTask().getResource().getKey());
taskExecutor.execute(propagationManager.createTasks(realm, propByRes, null), false);
+ RealmTO realmTO;
if (unlink) {
realm.getResources().remove(profile.getTask().getResource());
- output = binder.getRealmTO(realmDAO.save(realm), true);
+ realmTO = binder.getRealmTO(realmDAO.save(realm), true);
} else {
- output = binder.getRealmTO(realm, true);
+ realmTO = binder.getRealmTO(realm, true);
}
+ output = realmTO;
for (PullActions action : profile.getActions()) {
- action.after(profile, delta, RealmTO.class.cast(output), result);
+ action.after(profile, delta, realmTO, result);
}
resultStatus = Result.SUCCESS;
@@ -510,11 +514,7 @@ public class DefaultRealmPullResultHandler
} else {
realm.add(profile.getTask().getResource());
}
- output = update(delta, Collections.singletonList(key));
-
- for (PullActions action : profile.getActions()) {
- action.after(profile, delta, RealmTO.class.cast(output), result);
- }
+ output = update(delta, Collections.singletonList(key), true);
resultStatus = Result.SUCCESS;
@@ -687,8 +687,8 @@ public class DefaultRealmPullResultHandler
if (keys.size() > 1) {
switch (profile.getConflictResolutionAction()) {
case IGNORE:
- throw new IgnoreProvisionException("More than one match found for "
- + processed.getObject().getUid().getUidValue() + ": " + keys);
+ throw new IgnoreProvisionException("More than one match found for "
+ + processed.getObject().getUid().getUidValue() + ": " + keys);
case FIRSTMATCH:
keys = keys.subList(0, 1);
@@ -725,7 +725,7 @@ public class DefaultRealmPullResultHandler
} else {
switch (profile.getTask().getMatchingRule()) {
case UPDATE:
- profile.getResults().addAll(update(processed, keys));
+ profile.getResults().addAll(update(processed, keys, false));
break;
case DEPROVISION:
[3/3] syncope git commit: [SYNCOPE-1387] Clearing up calls between
link() and update()
Posted by il...@apache.org.
[SYNCOPE-1387] Clearing up calls between link() and update()
Project: http://git-wip-us.apache.org/repos/asf/syncope/repo
Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/5e854e11
Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/5e854e11
Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/5e854e11
Branch: refs/heads/2_0_X
Commit: 5e854e117594da3a1ba78c0af8d53d89a66a9c5a
Parents: 5eb9585
Author: Francesco Chicchiriccò <il...@apache.org>
Authored: Tue Oct 23 14:26:52 2018 +0200
Committer: Francesco Chicchiriccò <il...@apache.org>
Committed: Tue Oct 23 14:27:06 2018 +0200
----------------------------------------------------------------------
.../pushpull/DefaultRealmPullResultHandler.java | 28 ++++++++++----------
1 file changed, 14 insertions(+), 14 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/syncope/blob/5e854e11/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/pushpull/DefaultRealmPullResultHandler.java
----------------------------------------------------------------------
diff --git a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/pushpull/DefaultRealmPullResultHandler.java b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/pushpull/DefaultRealmPullResultHandler.java
index ad45010..c315343 100644
--- a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/pushpull/DefaultRealmPullResultHandler.java
+++ b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/pushpull/DefaultRealmPullResultHandler.java
@@ -274,7 +274,7 @@ public class DefaultRealmPullResultHandler
finalize(operation, resultStatus, null, output, delta);
}
- private List<ProvisioningReport> update(final SyncDelta delta, final List<String> keys)
+ private List<ProvisioningReport> update(final SyncDelta delta, final List<String> keys, final boolean inLink)
throws JobExecutionException {
if (!profile.getTask().isPerformUpdate()) {
@@ -314,8 +314,10 @@ public class DefaultRealmPullResultHandler
output = null;
} else {
try {
- for (PullActions action : profile.getActions()) {
- action.beforeUpdate(profile, delta, before, null);
+ if (!inLink) {
+ for (PullActions action : profile.getActions()) {
+ action.beforeUpdate(profile, delta, before, null);
+ }
}
PropagationByResource propByRes = binder.update(realm, before);
@@ -414,15 +416,17 @@ public class DefaultRealmPullResultHandler
propByRes.add(ResourceOperation.DELETE, profile.getTask().getResource().getKey());
taskExecutor.execute(propagationManager.createTasks(realm, propByRes, null), false);
+ RealmTO realmTO;
if (unlink) {
realm.getResources().remove(profile.getTask().getResource());
- output = binder.getRealmTO(realmDAO.save(realm), true);
+ realmTO = binder.getRealmTO(realmDAO.save(realm), true);
} else {
- output = binder.getRealmTO(realm, true);
+ realmTO = binder.getRealmTO(realm, true);
}
+ output = realmTO;
for (PullActions action : profile.getActions()) {
- action.after(profile, delta, RealmTO.class.cast(output), result);
+ action.after(profile, delta, realmTO, result);
}
resultStatus = Result.SUCCESS;
@@ -510,11 +514,7 @@ public class DefaultRealmPullResultHandler
} else {
realm.add(profile.getTask().getResource());
}
- output = update(delta, Collections.singletonList(key));
-
- for (PullActions action : profile.getActions()) {
- action.after(profile, delta, RealmTO.class.cast(output), result);
- }
+ output = update(delta, Collections.singletonList(key), true);
resultStatus = Result.SUCCESS;
@@ -687,8 +687,8 @@ public class DefaultRealmPullResultHandler
if (keys.size() > 1) {
switch (profile.getResAct()) {
case IGNORE:
- throw new IgnoreProvisionException("More than one match found for "
- + processed.getObject().getUid().getUidValue() + ": " + keys);
+ throw new IgnoreProvisionException("More than one match found for "
+ + processed.getObject().getUid().getUidValue() + ": " + keys);
case FIRSTMATCH:
keys = keys.subList(0, 1);
@@ -725,7 +725,7 @@ public class DefaultRealmPullResultHandler
} else {
switch (profile.getTask().getMatchingRule()) {
case UPDATE:
- profile.getResults().addAll(update(processed, keys));
+ profile.getResults().addAll(update(processed, keys, false));
break;
case DEPROVISION:
[2/3] syncope git commit: [SYNCOPE-1387] Clearing up calls between
link() and update()
Posted by il...@apache.org.
[SYNCOPE-1387] Clearing up calls between link() and update()
Project: http://git-wip-us.apache.org/repos/asf/syncope/repo
Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/e851b281
Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/e851b281
Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/e851b281
Branch: refs/heads/master
Commit: e851b2818d72137f5e049d4b810504f51d6a0d70
Parents: d9a879a
Author: Francesco Chicchiriccò <il...@apache.org>
Authored: Tue Oct 23 14:26:52 2018 +0200
Committer: Francesco Chicchiriccò <il...@apache.org>
Committed: Tue Oct 23 14:27:01 2018 +0200
----------------------------------------------------------------------
.../pushpull/DefaultRealmPullResultHandler.java | 28 ++++++++++----------
1 file changed, 14 insertions(+), 14 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/syncope/blob/e851b281/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/pushpull/DefaultRealmPullResultHandler.java
----------------------------------------------------------------------
diff --git a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/pushpull/DefaultRealmPullResultHandler.java b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/pushpull/DefaultRealmPullResultHandler.java
index fb29bd4..1e1fdd2 100644
--- a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/pushpull/DefaultRealmPullResultHandler.java
+++ b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/pushpull/DefaultRealmPullResultHandler.java
@@ -274,7 +274,7 @@ public class DefaultRealmPullResultHandler
finalize(operation, resultStatus, null, output, delta);
}
- private List<ProvisioningReport> update(final SyncDelta delta, final List<String> keys)
+ private List<ProvisioningReport> update(final SyncDelta delta, final List<String> keys, final boolean inLink)
throws JobExecutionException {
if (!profile.getTask().isPerformUpdate()) {
@@ -314,8 +314,10 @@ public class DefaultRealmPullResultHandler
output = null;
} else {
try {
- for (PullActions action : profile.getActions()) {
- action.beforeUpdate(profile, delta, before, null);
+ if (!inLink) {
+ for (PullActions action : profile.getActions()) {
+ action.beforeUpdate(profile, delta, before, null);
+ }
}
PropagationByResource propByRes = binder.update(realm, before);
@@ -414,15 +416,17 @@ public class DefaultRealmPullResultHandler
propByRes.add(ResourceOperation.DELETE, profile.getTask().getResource().getKey());
taskExecutor.execute(propagationManager.createTasks(realm, propByRes, null), false);
+ RealmTO realmTO;
if (unlink) {
realm.getResources().remove(profile.getTask().getResource());
- output = binder.getRealmTO(realmDAO.save(realm), true);
+ realmTO = binder.getRealmTO(realmDAO.save(realm), true);
} else {
- output = binder.getRealmTO(realm, true);
+ realmTO = binder.getRealmTO(realm, true);
}
+ output = realmTO;
for (PullActions action : profile.getActions()) {
- action.after(profile, delta, RealmTO.class.cast(output), result);
+ action.after(profile, delta, realmTO, result);
}
resultStatus = Result.SUCCESS;
@@ -510,11 +514,7 @@ public class DefaultRealmPullResultHandler
} else {
realm.add(profile.getTask().getResource());
}
- output = update(delta, Collections.singletonList(key));
-
- for (PullActions action : profile.getActions()) {
- action.after(profile, delta, RealmTO.class.cast(output), result);
- }
+ output = update(delta, Collections.singletonList(key), true);
resultStatus = Result.SUCCESS;
@@ -687,8 +687,8 @@ public class DefaultRealmPullResultHandler
if (keys.size() > 1) {
switch (profile.getConflictResolutionAction()) {
case IGNORE:
- throw new IgnoreProvisionException("More than one match found for "
- + processed.getObject().getUid().getUidValue() + ": " + keys);
+ throw new IgnoreProvisionException("More than one match found for "
+ + processed.getObject().getUid().getUidValue() + ": " + keys);
case FIRSTMATCH:
keys = keys.subList(0, 1);
@@ -725,7 +725,7 @@ public class DefaultRealmPullResultHandler
} else {
switch (profile.getTask().getMatchingRule()) {
case UPDATE:
- profile.getResults().addAll(update(processed, keys));
+ profile.getResults().addAll(update(processed, keys, false));
break;
case DEPROVISION: