syncope-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fmarte...@apache.org
Subject [2/2] syncope git commit: [SYNCOPE-1383] fixes the class cast exception by using a real SearchResultHandler
Date Thu, 11 Oct 2018 08:32:20 GMT
[SYNCOPE-1383] fixes the class cast exception by using a real SearchResultHandler


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

Branch: refs/heads/2_1_X
Commit: 31595e4e7a522d9fcf912e73ca89d0123857cd59
Parents: 8705dac
Author: fmartelli <fabio.martelli@gmail.com>
Authored: Thu Oct 11 10:31:54 2018 +0200
Committer: fmartelli <fabio.martelli@gmail.com>
Committed: Thu Oct 11 10:31:54 2018 +0200

----------------------------------------------------------------------
 .../provisioning/java/AsyncConnectorFacade.java | 20 ++++++++++++++++----
 1 file changed, 16 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/syncope/blob/31595e4e/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/AsyncConnectorFacade.java
----------------------------------------------------------------------
diff --git a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/AsyncConnectorFacade.java
b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/AsyncConnectorFacade.java
index 22cc25d..e778639 100644
--- a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/AsyncConnectorFacade.java
+++ b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/AsyncConnectorFacade.java
@@ -28,9 +28,11 @@ import org.identityconnectors.framework.common.objects.ConnectorObject;
 import org.identityconnectors.framework.common.objects.ObjectClass;
 import org.identityconnectors.framework.common.objects.ObjectClassInfo;
 import org.identityconnectors.framework.common.objects.OperationOptions;
+import org.identityconnectors.framework.common.objects.SearchResult;
 import org.identityconnectors.framework.common.objects.SyncToken;
 import org.identityconnectors.framework.common.objects.Uid;
 import org.identityconnectors.framework.common.objects.filter.FilterBuilder;
+import org.identityconnectors.framework.spi.SearchResultsHandler;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.scheduling.annotation.Async;
@@ -107,10 +109,20 @@ public class AsyncConnectorFacade {
         connector.search(
                 objectClass,
                 ignoreCaseMatch ? FilterBuilder.equalsIgnoreCase(connObjectKey) : FilterBuilder.equalTo(connObjectKey),
-                connectorObject -> {
-                    objects[0] = connectorObject;
-                    return false;
-                }, options);
+                new SearchResultsHandler() {
+
+            @Override
+            public boolean handle(final ConnectorObject connectorObject) {
+                objects[0] = connectorObject;
+                return false;
+            }
+
+            @Override
+            public void handleResult(final SearchResult sr) {
+                // do nothing
+            }
+        },
+                options);
 
         return new AsyncResult<>(objects[0]);
     }


Mime
View raw message