syncope-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ilgro...@apache.org
Subject [1/7] syncope git commit: More robust handling of few edge cases
Date Thu, 24 Mar 2016 16:09:51 GMT
Repository: syncope
Updated Branches:
  refs/heads/master c2af45e21 -> 18e9a4907


More robust handling of few edge cases


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

Branch: refs/heads/master
Commit: 5c7309096e656549bcf39c4beb9156ed3eb9a5d0
Parents: c2af45e
Author: Francesco Chicchiriccò <ilgrosso@apache.org>
Authored: Tue Mar 22 17:38:23 2016 +0100
Committer: Francesco Chicchiriccò <ilgrosso@apache.org>
Committed: Tue Mar 22 17:38:23 2016 +0100

----------------------------------------------------------------------
 .../core/logic/report/ReconciliationReportlet.java    | 14 +++++++-------
 .../java/propagation/PropagationManagerImpl.java      | 11 +++++++++--
 2 files changed, 16 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/syncope/blob/5c730909/core/logic/src/main/java/org/apache/syncope/core/logic/report/ReconciliationReportlet.java
----------------------------------------------------------------------
diff --git a/core/logic/src/main/java/org/apache/syncope/core/logic/report/ReconciliationReportlet.java
b/core/logic/src/main/java/org/apache/syncope/core/logic/report/ReconciliationReportlet.java
index 37d69d7..a1c86c6 100644
--- a/core/logic/src/main/java/org/apache/syncope/core/logic/report/ReconciliationReportlet.java
+++ b/core/logic/src/main/java/org/apache/syncope/core/logic/report/ReconciliationReportlet.java
@@ -272,24 +272,24 @@ public class ReconciliationReportlet extends AbstractReportlet {
             for (final ExternalResource resource : anyUtils.getAllResources(any)) {
                 Provision provision = resource.getProvision(any.getType());
                 MappingItem connObjectKeyItem = MappingManagerImpl.getConnObjectKeyItem(provision);
-                if (provision != null && connObjectKeyItem != null) {
-                    // 1. build connObjectKeyValue
-                    final String connObjectKeyValue = mappingManager.getConnObjectKeyValue(any,
provision);
-
-                    // 2. read from the underlying connector
+                final String connObjectKeyValue = connObjectKeyItem == null
+                        ? StringUtils.EMPTY
+                        : mappingManager.getConnObjectKeyValue(any, provision);
+                if (provision != null && connObjectKeyItem != null && StringUtils.isNotBlank(connObjectKeyValue))
{
+                    // 1. read from the underlying connector
                     Connector connector = connFactory.getConnector(resource);
                     ConnectorObject connectorObject = connector.getObject(provision.getObjectClass(),
                             new Uid(connObjectKeyValue),
                             MappingManagerImpl.buildOperationOptions(provision.getMapping().getItems().iterator()));
 
                     if (connectorObject == null) {
-                        // 3. not found on resource?
+                        // 2. not found on resource?
                         LOG.error("Object {} with class {} not found on resource {}",
                                 connObjectKeyValue, provision.getObjectClass(), resource);
 
                         missing.add(new Missing(resource.getKey(), connObjectKeyValue));
                     } else {
-                        // 4. found but misaligned?
+                        // 3. found but misaligned?
                         Pair<String, Set<Attribute>> preparedAttrs =
                                 mappingManager.prepareAttrs(any, null, false, null, provision);
                         preparedAttrs.getRight().add(AttributeBuilder.build(

http://git-wip-us.apache.org/repos/asf/syncope/blob/5c730909/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/propagation/PropagationManagerImpl.java
----------------------------------------------------------------------
diff --git a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/propagation/PropagationManagerImpl.java
b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/propagation/PropagationManagerImpl.java
index 5f66a2f..1aedfa4 100644
--- a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/propagation/PropagationManagerImpl.java
+++ b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/propagation/PropagationManagerImpl.java
@@ -262,11 +262,18 @@ public class PropagationManagerImpl implements PropagationManager {
             final Collection<AttrTO> vAttrs,
             final Collection<String> noPropResourceNames) {
 
-        if (noPropResourceNames != null) {
+        if (noPropResourceNames != null && propByRes != null) {
             propByRes.removeAll(noPropResourceNames);
         }
 
-        return createTasks(any, password, changePwd, enable, false, propByRes, vAttrs);
+        return createTasks(
+                any,
+                password,
+                changePwd,
+                enable,
+                false,
+                propByRes == null ? new PropagationByResource() : propByRes,
+                vAttrs);
     }
 
     @Override


Mime
View raw message