You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@syncope.apache.org by fm...@apache.org on 2013/04/23 17:31:18 UTC
svn commit: r1471012 - in /syncope/trunk: ./
core/src/main/java/org/apache/syncope/core/sync/impl/SyncopeSyncResultHandler.java
Author: fmartelli
Date: Tue Apr 23 15:31:17 2013
New Revision: 1471012
URL: http://svn.apache.org/r1471012
Log:
merged from 1.1.X
Modified:
syncope/trunk/ (props changed)
syncope/trunk/core/src/main/java/org/apache/syncope/core/sync/impl/SyncopeSyncResultHandler.java
Propchange: syncope/trunk/
------------------------------------------------------------------------------
Merged /syncope/branches/1_1_X:r1470987-1471011
Modified: syncope/trunk/core/src/main/java/org/apache/syncope/core/sync/impl/SyncopeSyncResultHandler.java
URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/main/java/org/apache/syncope/core/sync/impl/SyncopeSyncResultHandler.java?rev=1471012&r1=1471011&r2=1471012&view=diff
==============================================================================
--- syncope/trunk/core/src/main/java/org/apache/syncope/core/sync/impl/SyncopeSyncResultHandler.java (original)
+++ syncope/trunk/core/src/main/java/org/apache/syncope/core/sync/impl/SyncopeSyncResultHandler.java Tue Apr 23 15:31:17 2013
@@ -512,6 +512,7 @@ public class SyncopeSyncResultHandler im
final SyncResult result = new SyncResult();
result.setOperation(ResourceOperation.CREATE);
result.setSubjectType(attrUtil.getType());
+ result.setStatus(SyncResult.Status.SUCCESS);
AbstractAttributableTO subjectTO = connObjectUtil.getAttributableTO(delta.getObject(), syncTask, attrUtil);
@@ -525,7 +526,6 @@ public class SyncopeSyncResultHandler im
if (subjectTO instanceof RoleTO) {
result.setName(((RoleTO) subjectTO).getName());
}
- result.setStatus(SyncResult.Status.SUCCESS);
} else {
try {
if (AttributableType.USER == attrUtil.getType()) {
@@ -565,8 +565,10 @@ public class SyncopeSyncResultHandler im
result.setId(created.getResult());
result.setName(((RoleTO) subjectTO).getName());
}
- result.setStatus(SyncResult.Status.SUCCESS);
+
} catch (PropagationException e) {
+ // A propagation failure doesn't imply a synchronization failure.
+ // The propagation exception status will be reported into the propagation task execution.
LOG.error("Could not propagate {} {}", attrUtil.getType(), delta.getUid().getUidValue(), e);
} catch (Exception e) {
result.setStatus(SyncResult.Status.FAILURE);
@@ -716,9 +718,8 @@ public class SyncopeSyncResultHandler im
result.setName(updated.getName());
}
} catch (PropagationException e) {
- result.setStatus(SyncResult.Status.FAILURE);
- result.setMessage(delta.getUid().getUidValue() + "updated but not propagated\n" + e.getMessage());
-
+ // A propagation failure doesn't imply a synchronization failure.
+ // The propagation exception status will be reported into the propagation task execution.
LOG.error("Could not propagate {} {}", attrUtil.getType(), delta.getUid().getUidValue(), e);
} catch (Exception e) {
result.setStatus(SyncResult.Status.FAILURE);
@@ -778,6 +779,8 @@ public class SyncopeSyncResultHandler im
}
taskExecutor.execute(tasks);
} catch (Exception e) {
+ // A propagation failure doesn't imply a synchronization failure.
+ // The propagation exception status will be reported into the propagation task execution.
LOG.error("Could not propagate user " + id, e);
}
@@ -789,7 +792,7 @@ public class SyncopeSyncResultHandler im
rwfAdapter.delete(id);
}
} catch (Exception e) {
- result.setStatus(SyncResult.Status.SUCCESS);
+ result.setStatus(SyncResult.Status.FAILURE);
result.setMessage(e.getMessage());
LOG.error("Could not delete {} {}", attrUtil.getType(), id, e);
}