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/06/29 11:46:27 UTC

[2/2] syncope git commit: Cleanup unused code

Cleanup unused code


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

Branch: refs/heads/master
Commit: ea18f558a233b8b80dff4e328f74abb9418a2b58
Parents: 71ebdb9
Author: Francesco Chicchiriccò <il...@apache.org>
Authored: Fri Jun 29 13:46:07 2018 +0200
Committer: Francesco Chicchiriccò <il...@apache.org>
Committed: Fri Jun 29 13:46:17 2018 +0200

----------------------------------------------------------------------
 .../pushpull/AbstractPullResultHandler.java     | 23 ++------------------
 .../pushpull/DefaultUserPullResultHandler.java  | 14 ------------
 2 files changed, 2 insertions(+), 35 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/syncope/blob/ea18f558/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/pushpull/AbstractPullResultHandler.java
----------------------------------------------------------------------
diff --git a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/pushpull/AbstractPullResultHandler.java b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/pushpull/AbstractPullResultHandler.java
index 6de2eec..f493785 100644
--- a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/pushpull/AbstractPullResultHandler.java
+++ b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/pushpull/AbstractPullResultHandler.java
@@ -27,7 +27,6 @@ import org.apache.syncope.common.lib.AnyOperations;
 import org.apache.syncope.common.lib.patch.AnyPatch;
 import org.apache.syncope.common.lib.patch.StringPatchItem;
 import org.apache.syncope.common.lib.to.AnyTO;
-import org.apache.syncope.common.lib.types.AnyTypeKind;
 import org.apache.syncope.common.lib.types.AuditElements;
 import org.apache.syncope.common.lib.types.AuditElements.Result;
 import org.apache.syncope.common.lib.types.MatchingRule;
@@ -105,25 +104,6 @@ public abstract class AbstractPullResultHandler extends AbstractSyncopeResultHan
 
     protected abstract AnyPatch doUpdate(AnyTO before, AnyPatch anyPatch, SyncDelta delta, ProvisioningReport result);
 
-    protected void doDelete(final AnyTypeKind kind, final String key) {
-        PropagationByResource propByRes = new PropagationByResource();
-        propByRes.add(ResourceOperation.DELETE, profile.getTask().getResource().getKey());
-        try {
-            taskExecutor.execute(propagationManager.getDeleteTasks(
-                    kind,
-                    key,
-                    propByRes,
-                    null),
-                    false);
-        } catch (Exception e) {
-            // A propagation failure doesn't imply a pull failure.
-            // The propagation exception status will be reported into the propagation task execution.
-            LOG.error("Could not propagate anyObject " + key, e);
-        }
-
-        getProvisioningManager().delete(key, Collections.singleton(profile.getTask().getResource().getKey()), true);
-    }
-
     @Override
     public void setPullExecutor(final SyncopePullExecutor executor) {
         this.executor = executor;
@@ -685,7 +665,8 @@ public abstract class AbstractPullResultHandler extends AbstractSyncopeResultHan
                     }
 
                     try {
-                        doDelete(provision.getAnyType().getKind(), key);
+                        getProvisioningManager().
+                                delete(key, Collections.singleton(profile.getTask().getResource().getKey()), true);
                         output = null;
                         resultStatus = Result.SUCCESS;
 

http://git-wip-us.apache.org/repos/asf/syncope/blob/ea18f558/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/pushpull/DefaultUserPullResultHandler.java
----------------------------------------------------------------------
diff --git a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/pushpull/DefaultUserPullResultHandler.java b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/pushpull/DefaultUserPullResultHandler.java
index e600c93..953cb26 100644
--- a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/pushpull/DefaultUserPullResultHandler.java
+++ b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/pushpull/DefaultUserPullResultHandler.java
@@ -99,18 +99,4 @@ public class DefaultUserPullResultHandler extends AbstractPullResultHandler impl
 
         return updated.getLeft();
     }
-
-    @Override
-    protected void doDelete(final AnyTypeKind kind, final String key) {
-        try {
-            userProvisioningManager.delete(
-                    key, Collections.<String>singleton(profile.getTask().getResource().getKey()), true);
-        } catch (Exception e) {
-            // A propagation failure doesn't imply a pull failure.
-            // The propagation exception status will be reported into the propagation task execution.
-            LOG.error("Could not propagate user " + key, e);
-        }
-
-        uwfAdapter.delete(key);
-    }
 }