syncope-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdisabat...@apache.org
Subject svn commit: r1367981 - in /incubator/syncope/branches/1_0_X/core/src/main/java/org/apache/syncope/core/scheduling: DefaultSyncJobActions.java SyncJob.java SyncJobActions.java
Date Wed, 01 Aug 2012 13:23:32 GMT
Author: mdisabatino
Date: Wed Aug  1 13:23:32 2012
New Revision: 1367981

URL: http://svn.apache.org/viewvc?rev=1367981&view=rev
Log:
SYNCOPE-178 Fix synchronization / full reconciliation

Modified:
    incubator/syncope/branches/1_0_X/core/src/main/java/org/apache/syncope/core/scheduling/DefaultSyncJobActions.java
    incubator/syncope/branches/1_0_X/core/src/main/java/org/apache/syncope/core/scheduling/SyncJob.java
    incubator/syncope/branches/1_0_X/core/src/main/java/org/apache/syncope/core/scheduling/SyncJobActions.java

Modified: incubator/syncope/branches/1_0_X/core/src/main/java/org/apache/syncope/core/scheduling/DefaultSyncJobActions.java
URL: http://svn.apache.org/viewvc/incubator/syncope/branches/1_0_X/core/src/main/java/org/apache/syncope/core/scheduling/DefaultSyncJobActions.java?rev=1367981&r1=1367980&r2=1367981&view=diff
==============================================================================
--- incubator/syncope/branches/1_0_X/core/src/main/java/org/apache/syncope/core/scheduling/DefaultSyncJobActions.java
(original)
+++ incubator/syncope/branches/1_0_X/core/src/main/java/org/apache/syncope/core/scheduling/DefaultSyncJobActions.java
Wed Aug  1 13:23:32 2012
@@ -19,11 +19,11 @@
 package org.apache.syncope.core.scheduling;
 
 import java.util.List;
-import org.identityconnectors.framework.common.objects.SyncDelta;
-import org.quartz.JobExecutionException;
 import org.apache.syncope.client.mod.UserMod;
 import org.apache.syncope.client.to.UserTO;
 import org.apache.syncope.core.persistence.beans.SyncTask;
+import org.identityconnectors.framework.common.objects.SyncDelta;
+import org.quartz.JobExecutionException;
 
 /**
  * Default (empty) implementation of SyncJobActions.
@@ -53,9 +53,8 @@ public class DefaultSyncJobActions imple
     }
 
     @Override
-    public SyncDelta after(final SyncDelta delta, final UserTO user, final SyncResult result)
+    public void after(final SyncDelta delta, final UserTO user, final SyncResult result)
             throws JobExecutionException {
-        return delta;
     }
 
     @Override

Modified: incubator/syncope/branches/1_0_X/core/src/main/java/org/apache/syncope/core/scheduling/SyncJob.java
URL: http://svn.apache.org/viewvc/incubator/syncope/branches/1_0_X/core/src/main/java/org/apache/syncope/core/scheduling/SyncJob.java?rev=1367981&r1=1367980&r2=1367981&view=diff
==============================================================================
--- incubator/syncope/branches/1_0_X/core/src/main/java/org/apache/syncope/core/scheduling/SyncJob.java
(original)
+++ incubator/syncope/branches/1_0_X/core/src/main/java/org/apache/syncope/core/scheduling/SyncJob.java
Wed Aug  1 13:23:32 2012
@@ -24,21 +24,6 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 import javassist.NotFoundException;
-import org.identityconnectors.framework.common.objects.Attribute;
-import org.identityconnectors.framework.common.objects.AttributeUtil;
-import org.identityconnectors.framework.common.objects.ConnectorObject;
-import org.identityconnectors.framework.common.objects.ObjectClass;
-import org.identityconnectors.framework.common.objects.OperationalAttributes;
-import org.identityconnectors.framework.common.objects.SyncDelta;
-import org.identityconnectors.framework.common.objects.SyncResultsHandler;
-import org.quartz.JobExecutionException;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
-import org.springframework.security.core.GrantedAuthority;
-import org.springframework.security.core.authority.SimpleGrantedAuthority;
-import org.springframework.security.core.context.SecurityContextHolder;
-import org.springframework.security.core.userdetails.User;
-import org.springframework.security.core.userdetails.UserDetails;
 import org.apache.syncope.client.mod.UserMod;
 import org.apache.syncope.client.search.AttributeCond;
 import org.apache.syncope.client.search.NodeCond;
@@ -74,6 +59,21 @@ import org.apache.syncope.core.workflow.
 import org.apache.syncope.types.ConflictResolutionAction;
 import org.apache.syncope.types.SyncPolicySpec;
 import org.apache.syncope.types.TraceLevel;
+import org.identityconnectors.framework.common.objects.Attribute;
+import org.identityconnectors.framework.common.objects.AttributeUtil;
+import org.identityconnectors.framework.common.objects.ConnectorObject;
+import org.identityconnectors.framework.common.objects.ObjectClass;
+import org.identityconnectors.framework.common.objects.OperationalAttributes;
+import org.identityconnectors.framework.common.objects.SyncDelta;
+import org.identityconnectors.framework.common.objects.SyncResultsHandler;
+import org.quartz.JobExecutionException;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
+import org.springframework.security.core.GrantedAuthority;
+import org.springframework.security.core.authority.SimpleGrantedAuthority;
+import org.springframework.security.core.context.SecurityContextHolder;
+import org.springframework.security.core.userdetails.User;
+import org.springframework.security.core.userdetails.UserDetails;
 
 /**
  * Job for executing synchronization tasks.
@@ -352,7 +352,7 @@ public class SyncJob extends AbstractTas
             }
         }
 
-        delta = actions.after(delta, userTO, result);
+        actions.after(delta, userTO, result);
 
         return result;
     }
@@ -405,7 +405,7 @@ public class SyncJob extends AbstractTas
                     LOG.error("Could not update user " + delta.getUid().getUidValue(), e);
                 }
 
-                delta = actions.after(delta, userTO, result);
+                actions.after(delta, userTO, result);
                 results.add(result);
             } catch (NotFoundException e) {
                 LOG.error("Could not find user {}", userId, e);
@@ -457,7 +457,7 @@ public class SyncJob extends AbstractTas
                     }
                 }
 
-                delta = actions.after(delta, userTO, result);
+                actions.after(delta, userTO, result);
                 results.add(result);
             } catch (NotFoundException e) {
                 LOG.error("Could not find user {}", userId, e);
@@ -642,9 +642,8 @@ public class SyncJob extends AbstractTas
                     @Override
                     public boolean handle(final SyncDelta delta) {
                         try {
-
-                            return results.addAll(handleDelta(syncTask, delta, conflictResolutionAction,
dryRun));
-
+                            results.addAll(handleDelta(syncTask, delta, conflictResolutionAction,
dryRun));
+                            return true;
                         } catch (JobExecutionException e) {
                             LOG.error("Reconciliation failed", e);
                             return false;
@@ -658,8 +657,8 @@ public class SyncJob extends AbstractTas
                     public boolean handle(final SyncDelta delta) {
                         try {
 
-                            return results.addAll(handleDelta(syncTask, delta, conflictResolutionAction,
dryRun));
-
+                            results.addAll(handleDelta(syncTask, delta, conflictResolutionAction,
dryRun));
+                            return true;
                         } catch (JobExecutionException e) {
                             LOG.error("Synchronization failed", e);
                             return false;
@@ -707,12 +706,12 @@ public class SyncJob extends AbstractTas
         final List<SyncResult> results = new ArrayList<SyncResult>();
 
         LOG.debug("Process '{}' for '{}'", delta.getDeltaType(), delta.getUid().getUidValue());
-
+        
         final List<Long> users = findExistingUsers(delta);
-
+        
         switch (delta.getDeltaType()) {
             case CREATE_OR_UPDATE:
-                if (users.isEmpty()) {
+                if (users.isEmpty()) { 
                     if (syncTask.isPerformCreate()) {
                         results.add(createUser(delta, dryRun));
                     } else {

Modified: incubator/syncope/branches/1_0_X/core/src/main/java/org/apache/syncope/core/scheduling/SyncJobActions.java
URL: http://svn.apache.org/viewvc/incubator/syncope/branches/1_0_X/core/src/main/java/org/apache/syncope/core/scheduling/SyncJobActions.java?rev=1367981&r1=1367980&r2=1367981&view=diff
==============================================================================
--- incubator/syncope/branches/1_0_X/core/src/main/java/org/apache/syncope/core/scheduling/SyncJobActions.java
(original)
+++ incubator/syncope/branches/1_0_X/core/src/main/java/org/apache/syncope/core/scheduling/SyncJobActions.java
Wed Aug  1 13:23:32 2012
@@ -19,11 +19,11 @@
 package org.apache.syncope.core.scheduling;
 
 import java.util.List;
-import org.identityconnectors.framework.common.objects.SyncDelta;
-import org.quartz.JobExecutionException;
 import org.apache.syncope.client.mod.UserMod;
 import org.apache.syncope.client.to.UserTO;
 import org.apache.syncope.core.persistence.beans.SyncTask;
+import org.identityconnectors.framework.common.objects.SyncDelta;
+import org.quartz.JobExecutionException;
 
 /**
  * Interface for actions to be performed during SyncJob execution.
@@ -41,7 +41,7 @@ public interface SyncJobActions {
     /**
      * Action to be executed before to create a synchronized user locally.
      *
-     * @param delta rerieved synchronization information.
+     * @param delta retrieved synchronization information.
      * @param user user to be created.
      * @return synchronization information used for user status evaluation and to be passed
to the 'after' method.
      * @throws JobExecutionException in case of generic failure.
@@ -74,12 +74,11 @@ public interface SyncJobActions {
      * Action to be executed after each local user synchronization.
      *
      * @param delta retrieved synchronization information (may be modified by 'beforeCreate/beforeUpdate/beforeDelete').
-     * @param user synchronizad local user.
+     * @param user synchronized local user.
      * @param result global synchronization results at the current synchronization step.
-     * @return synchronization information.
      * @throws JobExecutionException in case of generic failure.
      */
-    SyncDelta after(final SyncDelta delta, final UserTO user, final SyncResult result) throws
JobExecutionException;
+    void after(final SyncDelta delta, final UserTO user, final SyncResult result) throws
JobExecutionException;
 
     /**
      * Action to be executed after the synchronization task completion.



Mime
View raw message