Repository: syncope
Updated Branches:
  refs/heads/2_0_X e49ee0747 -> 69afe1a09
  refs/heads/master c02ed90d8 -> f3795a8d5


[SYNCOPE-1010] Missing mamagement in PushJobDelegate


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

Branch: refs/heads/2_0_X
Commit: 69afe1a09a175dac1c9d5fc503875ef4e3efe1b1
Parents: e49ee07
Author: Francesco Chicchiriccò <ilgro...@apache.org>
Authored: Sun Feb 12 07:52:27 2017 +0100
Committer: Francesco Chicchiriccò <ilgro...@apache.org>
Committed: Sun Feb 12 07:52:27 2017 +0100

----------------------------------------------------------------------
 .../pushpull/AbstractPushResultHandler.java     | 20 ++++++++++----------
 .../java/pushpull/PushJobDelegate.java          |  9 +++++----
 .../pushpull/RealmPushResultHandlerImpl.java    | 20 ++++++++++----------
 3 files changed, 25 insertions(+), 24 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/syncope/blob/69afe1a0/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/pushpull/AbstractPushResultHandler.java
----------------------------------------------------------------------
diff --git 
a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/pushpull/AbstractPushResultHandler.java
 
b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/pushpull/AbstractPushResultHandler.java
index a93c239..9d4ab3e 100644
--- 
a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/pushpull/AbstractPushResultHandler.java
+++ 
b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/pushpull/AbstractPushResultHandler.java
@@ -214,7 +214,7 @@ public abstract class AbstractPushResultHandler extends 
AbstractSyncopeResultHan
                     switch (profile.getTask().getUnmatchingRule()) {
                         case ASSIGN:
                             for (PushActions action : profile.getActions()) {
-                                action.beforeAssign(this.getProfile(), any);
+                                action.beforeAssign(profile, any);
                             }
 
                             if (!profile.getTask().isPerformCreate()) {
@@ -227,7 +227,7 @@ public abstract class AbstractPushResultHandler extends 
AbstractSyncopeResultHan
 
                         case PROVISION:
                             for (PushActions action : profile.getActions()) {
-                                action.beforeProvision(this.getProfile(), any);
+                                action.beforeProvision(profile, any);
                             }
 
                             if (!profile.getTask().isPerformCreate()) {
@@ -240,7 +240,7 @@ public abstract class AbstractPushResultHandler extends 
AbstractSyncopeResultHan
 
                         case UNLINK:
                             for (PushActions action : profile.getActions()) {
-                                action.beforeUnlink(this.getProfile(), any);
+                                action.beforeUnlink(profile, any);
                             }
 
                             if (!profile.getTask().isPerformUpdate()) {
@@ -264,7 +264,7 @@ public abstract class AbstractPushResultHandler extends 
AbstractSyncopeResultHan
                     switch (profile.getTask().getMatchingRule()) {
                         case UPDATE:
                             for (PushActions action : profile.getActions()) {
-                                action.beforeUpdate(this.getProfile(), any);
+                                action.beforeUpdate(profile, any);
                             }
                             if (!profile.getTask().isPerformUpdate()) {
                                 LOG.debug("PushTask not configured for 
update");
@@ -276,7 +276,7 @@ public abstract class AbstractPushResultHandler extends 
AbstractSyncopeResultHan
 
                         case DEPROVISION:
                             for (PushActions action : profile.getActions()) {
-                                action.beforeDeprovision(this.getProfile(), 
any);
+                                action.beforeDeprovision(profile, any);
                             }
 
                             if (!profile.getTask().isPerformDelete()) {
@@ -289,7 +289,7 @@ public abstract class AbstractPushResultHandler extends 
AbstractSyncopeResultHan
 
                         case UNASSIGN:
                             for (PushActions action : profile.getActions()) {
-                                action.beforeUnassign(this.getProfile(), any);
+                                action.beforeUnassign(profile, any);
                             }
 
                             if (!profile.getTask().isPerformDelete()) {
@@ -302,7 +302,7 @@ public abstract class AbstractPushResultHandler extends 
AbstractSyncopeResultHan
 
                         case LINK:
                             for (PushActions action : profile.getActions()) {
-                                action.beforeLink(this.getProfile(), any);
+                                action.beforeLink(profile, any);
                             }
 
                             if (!profile.getTask().isPerformUpdate()) {
@@ -315,7 +315,7 @@ public abstract class AbstractPushResultHandler extends 
AbstractSyncopeResultHan
 
                         case UNLINK:
                             for (PushActions action : profile.getActions()) {
-                                action.beforeUnlink(this.getProfile(), any);
+                                action.beforeUnlink(profile, any);
                             }
 
                             if (!profile.getTask().isPerformUpdate()) {
@@ -335,7 +335,7 @@ public abstract class AbstractPushResultHandler extends 
AbstractSyncopeResultHan
                 }
 
                 for (PushActions action : profile.getActions()) {
-                    action.after(this.getProfile(), any, result);
+                    action.after(profile, any, result);
                 }
 
                 result.setStatus(ProvisioningReport.Status.SUCCESS);
@@ -352,7 +352,7 @@ public abstract class AbstractPushResultHandler extends 
AbstractSyncopeResultHan
                 LOG.warn("Error pushing {} towards {}", any, 
profile.getTask().getResource(), e);
 
                 for (PushActions action : profile.getActions()) {
-                    action.onError(this.getProfile(), any, result, e);
+                    action.onError(profile, any, result, e);
                 }
 
                 throw new JobExecutionException(e);

http://git-wip-us.apache.org/repos/asf/syncope/blob/69afe1a0/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/pushpull/PushJobDelegate.java
----------------------------------------------------------------------
diff --git 
a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/pushpull/PushJobDelegate.java
 
b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/pushpull/PushJobDelegate.java
index a2b1566..be6ffe6 100644
--- 
a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/pushpull/PushJobDelegate.java
+++ 
b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/pushpull/PushJobDelegate.java
@@ -134,6 +134,7 @@ public class PushJobDelegate extends 
AbstractProvisioningJobDelegate<PushTask> {
         }
 
         ProvisioningProfile<PushTask, PushActions> profile = new 
ProvisioningProfile<>(connector, pushTask);
+        profile.getActions().addAll(actions);
         profile.setDryRun(dryRun);
         profile.setResAct(null);
 
@@ -147,7 +148,7 @@ public class PushJobDelegate extends 
AbstractProvisioningJobDelegate<PushTask> {
         if (pushTask.getResource().getOrgUnit() != null) {
             SyncopePushResultHandler rhandler =
                     (SyncopePushResultHandler) 
ApplicationContextProvider.getBeanFactory().
-                    createBean(RealmPushResultHandlerImpl.class, 
AbstractBeanDefinition.AUTOWIRE_BY_NAME, false);
+                            createBean(RealmPushResultHandlerImpl.class, 
AbstractBeanDefinition.AUTOWIRE_BY_NAME, false);
             rhandler.setProfile(profile);
 
             for (Realm realm : realmDAO.findAll()) {
@@ -166,17 +167,17 @@ public class PushJobDelegate extends 
AbstractProvisioningJobDelegate<PushTask> {
         // ...then provisions for any types
         AnyObjectPushResultHandler ahandler =
                 (AnyObjectPushResultHandler) 
ApplicationContextProvider.getBeanFactory().
-                createBean(AnyObjectPushResultHandlerImpl.class, 
AbstractBeanDefinition.AUTOWIRE_BY_NAME, false);
+                        createBean(AnyObjectPushResultHandlerImpl.class, 
AbstractBeanDefinition.AUTOWIRE_BY_NAME, false);
         ahandler.setProfile(profile);
 
         UserPushResultHandler uhandler =
                 (UserPushResultHandler) 
ApplicationContextProvider.getBeanFactory().
-                createBean(UserPushResultHandlerImpl.class, 
AbstractBeanDefinition.AUTOWIRE_BY_NAME, false);
+                        createBean(UserPushResultHandlerImpl.class, 
AbstractBeanDefinition.AUTOWIRE_BY_NAME, false);
         uhandler.setProfile(profile);
 
         GroupPushResultHandler ghandler =
                 (GroupPushResultHandler) 
ApplicationContextProvider.getBeanFactory().
-                createBean(GroupPushResultHandlerImpl.class, 
AbstractBeanDefinition.AUTOWIRE_BY_NAME, false);
+                        createBean(GroupPushResultHandlerImpl.class, 
AbstractBeanDefinition.AUTOWIRE_BY_NAME, false);
         ghandler.setProfile(profile);
 
         for (Provision provision : pushTask.getResource().getProvisions()) {

http://git-wip-us.apache.org/repos/asf/syncope/blob/69afe1a0/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/pushpull/RealmPushResultHandlerImpl.java
----------------------------------------------------------------------
diff --git 
a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/pushpull/RealmPushResultHandlerImpl.java
 
b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/pushpull/RealmPushResultHandlerImpl.java
index f0b4438..34e7530 100644
--- 
a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/pushpull/RealmPushResultHandlerImpl.java
+++ 
b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/pushpull/RealmPushResultHandlerImpl.java
@@ -167,7 +167,7 @@ public class RealmPushResultHandlerImpl
                     switch (profile.getTask().getUnmatchingRule()) {
                         case ASSIGN:
                             for (PushActions action : profile.getActions()) {
-                                action.beforeAssign(this.getProfile(), realm);
+                                action.beforeAssign(profile, realm);
                             }
 
                             if (!profile.getTask().isPerformCreate()) {
@@ -180,7 +180,7 @@ public class RealmPushResultHandlerImpl
 
                         case PROVISION:
                             for (PushActions action : profile.getActions()) {
-                                action.beforeProvision(this.getProfile(), 
realm);
+                                action.beforeProvision(profile, realm);
                             }
 
                             if (!profile.getTask().isPerformCreate()) {
@@ -193,7 +193,7 @@ public class RealmPushResultHandlerImpl
 
                         case UNLINK:
                             for (PushActions action : profile.getActions()) {
-                                action.beforeUnlink(this.getProfile(), realm);
+                                action.beforeUnlink(profile, realm);
                             }
 
                             if (!profile.getTask().isPerformUpdate()) {
@@ -217,7 +217,7 @@ public class RealmPushResultHandlerImpl
                     switch (profile.getTask().getMatchingRule()) {
                         case UPDATE:
                             for (PushActions action : profile.getActions()) {
-                                action.beforeUpdate(this.getProfile(), realm);
+                                action.beforeUpdate(profile, realm);
                             }
                             if (!profile.getTask().isPerformUpdate()) {
                                 LOG.debug("PushTask not configured for 
update");
@@ -229,7 +229,7 @@ public class RealmPushResultHandlerImpl
 
                         case DEPROVISION:
                             for (PushActions action : profile.getActions()) {
-                                action.beforeDeprovision(this.getProfile(), 
realm);
+                                action.beforeDeprovision(profile, realm);
                             }
 
                             if (!profile.getTask().isPerformDelete()) {
@@ -242,7 +242,7 @@ public class RealmPushResultHandlerImpl
 
                         case UNASSIGN:
                             for (PushActions action : profile.getActions()) {
-                                action.beforeUnassign(this.getProfile(), 
realm);
+                                action.beforeUnassign(profile, realm);
                             }
 
                             if (!profile.getTask().isPerformDelete()) {
@@ -255,7 +255,7 @@ public class RealmPushResultHandlerImpl
 
                         case LINK:
                             for (PushActions action : profile.getActions()) {
-                                action.beforeLink(this.getProfile(), realm);
+                                action.beforeLink(profile, realm);
                             }
 
                             if (!profile.getTask().isPerformUpdate()) {
@@ -268,7 +268,7 @@ public class RealmPushResultHandlerImpl
 
                         case UNLINK:
                             for (PushActions action : profile.getActions()) {
-                                action.beforeUnlink(this.getProfile(), realm);
+                                action.beforeUnlink(profile, realm);
                             }
 
                             if (!profile.getTask().isPerformUpdate()) {
@@ -288,7 +288,7 @@ public class RealmPushResultHandlerImpl
                 }
 
                 for (PushActions action : profile.getActions()) {
-                    action.after(this.getProfile(), realm, result);
+                    action.after(profile, realm, result);
                 }
 
                 result.setStatus(ProvisioningReport.Status.SUCCESS);
@@ -308,7 +308,7 @@ public class RealmPushResultHandlerImpl
                 LOG.warn("Error pushing {} towards {}", realm, 
profile.getTask().getResource(), e);
 
                 for (PushActions action : profile.getActions()) {
-                    action.onError(this.getProfile(), realm, result, e);
+                    action.onError(profile, realm, result, e);
                 }
 
                 throw new JobExecutionException(e);

Reply via email to