syncope-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdisabat...@apache.org
Subject syncope git commit: [SYNCOPE-1083] Normalizing ConnInstance location
Date Wed, 17 May 2017 11:22:47 GMT
Repository: syncope
Updated Branches:
  refs/heads/2_0_X aa93a35f7 -> eda4574ec


[SYNCOPE-1083] Normalizing ConnInstance location


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

Branch: refs/heads/2_0_X
Commit: eda4574ec956d8498dfe96100907e4fb91ff1875
Parents: aa93a35
Author: Marco Di Sabatino Di Diodoro <marco.disabatino@tirasa.net>
Authored: Wed May 17 13:19:54 2017 +0200
Committer: Marco Di Sabatino Di Diodoro <marco.disabatino@tirasa.net>
Committed: Wed May 17 13:19:54 2017 +0200

----------------------------------------------------------------------
 .../core/provisioning/api/ConnIdBundleManager.java        |  3 ++-
 .../core/provisioning/java/ConnIdBundleManagerImpl.java   |  5 +++--
 .../core/provisioning/java/ConnectorFacadeProxy.java      |  2 +-
 .../java/data/ConnInstanceDataBinderImpl.java             | 10 +++++++---
 4 files changed, 13 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/syncope/blob/eda4574e/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/ConnIdBundleManager.java
----------------------------------------------------------------------
diff --git a/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/ConnIdBundleManager.java
b/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/ConnIdBundleManager.java
index 242202f..1913e68 100644
--- a/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/ConnIdBundleManager.java
+++ b/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/ConnIdBundleManager.java
@@ -21,6 +21,7 @@ package org.apache.syncope.core.provisioning.api;
 import java.net.URI;
 import java.util.List;
 import java.util.Map;
+import org.apache.commons.lang3.tuple.Pair;
 import org.apache.syncope.core.persistence.api.entity.ConnInstance;
 import org.identityconnectors.framework.api.ConfigurationProperties;
 import org.identityconnectors.framework.api.ConnectorInfo;
@@ -35,7 +36,7 @@ public interface ConnIdBundleManager {
 
     Map<URI, ConnectorInfoManager> getConnManagers();
 
-    ConnectorInfo getConnectorInfo(ConnInstance connInstance);
+    Pair<URI, ConnectorInfo> getConnectorInfo(ConnInstance connInstance);
 
     Map<URI, ConnectorInfoManager> getConnInfoManagers();
 

http://git-wip-us.apache.org/repos/asf/syncope/blob/eda4574e/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/ConnIdBundleManagerImpl.java
----------------------------------------------------------------------
diff --git a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/ConnIdBundleManagerImpl.java
b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/ConnIdBundleManagerImpl.java
index 7e103bb..69e1049 100644
--- a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/ConnIdBundleManagerImpl.java
+++ b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/ConnIdBundleManagerImpl.java
@@ -32,6 +32,7 @@ import java.util.Map;
 import javax.net.ssl.TrustManager;
 import javax.net.ssl.X509TrustManager;
 import org.apache.commons.lang3.StringUtils;
+import org.apache.commons.lang3.tuple.Pair;
 import org.apache.syncope.core.persistence.api.dao.NotFoundException;
 import org.apache.syncope.core.persistence.api.entity.ConnInstance;
 import org.apache.syncope.core.provisioning.api.ConnIdBundleManager;
@@ -224,7 +225,7 @@ public class ConnIdBundleManagerImpl implements ConnIdBundleManager {
     }
 
     @Override
-    public ConnectorInfo getConnectorInfo(final ConnInstance connInstance) {
+    public Pair<URI, ConnectorInfo> getConnectorInfo(final ConnInstance connInstance)
{
         // check ConnIdLocation
         URI uriLocation = null;
         try {
@@ -252,7 +253,7 @@ public class ConnIdBundleManagerImpl implements ConnIdBundleManager {
             throw new NotFoundException("ConnectorInfo for location " + connInstance.getLocation()
+ " and key " + key);
         }
 
-        return info;
+        return Pair.of(uriLocation, info);
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/syncope/blob/eda4574e/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/ConnectorFacadeProxy.java
----------------------------------------------------------------------
diff --git a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/ConnectorFacadeProxy.java
b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/ConnectorFacadeProxy.java
index a62444e..a8024f2 100644
--- a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/ConnectorFacadeProxy.java
+++ b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/ConnectorFacadeProxy.java
@@ -101,7 +101,7 @@ public class ConnectorFacadeProxy implements Connector {
 
         ConnIdBundleManager connIdBundleManager = ApplicationContextProvider.getBeanFactory().getBean(
                 ConnIdBundleManager.class);
-        ConnectorInfo info = connIdBundleManager.getConnectorInfo(connInstance);
+        ConnectorInfo info = connIdBundleManager.getConnectorInfo(connInstance).getRight();
 
         // create default configuration
         APIConfiguration apiConfig = info.createDefaultAPIConfiguration();

http://git-wip-us.apache.org/repos/asf/syncope/blob/eda4574e/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/ConnInstanceDataBinderImpl.java
----------------------------------------------------------------------
diff --git a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/ConnInstanceDataBinderImpl.java
b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/ConnInstanceDataBinderImpl.java
index 689df6b..63cb084 100644
--- a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/ConnInstanceDataBinderImpl.java
+++ b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/ConnInstanceDataBinderImpl.java
@@ -18,11 +18,13 @@
  */
 package org.apache.syncope.core.provisioning.java.data;
 
+import java.net.URI;
 import org.apache.syncope.core.provisioning.api.data.ConnInstanceDataBinder;
 import java.util.Arrays;
 import java.util.Collection;
 import org.apache.commons.collections4.IterableUtils;
 import org.apache.commons.collections4.Predicate;
+import org.apache.commons.lang3.tuple.Pair;
 import org.apache.syncope.common.lib.SyncopeClientException;
 import org.apache.syncope.common.lib.to.ConnInstanceTO;
 import org.apache.syncope.common.lib.to.ConnPoolConfTO;
@@ -38,13 +40,14 @@ import org.identityconnectors.framework.api.ConfigurationProperties;
 import org.identityconnectors.framework.api.ConfigurationProperty;
 import org.identityconnectors.framework.impl.api.ConfigurationPropertyImpl;
 import org.apache.syncope.core.spring.BeanUtils;
+import org.identityconnectors.framework.api.ConnectorInfo;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
 @Component
 public class ConnInstanceDataBinderImpl implements ConnInstanceDataBinder {
 
-    private static final String[] IGNORE_PROPERTIES = { "poolConf" };
+    private static final String[] IGNORE_PROPERTIES = { "poolConf", "location" };
 
     @Autowired
     private ConnIdBundleManager connIdBundleManager;
@@ -181,11 +184,12 @@ public class ConnInstanceDataBinderImpl implements ConnInstanceDataBinder
{
     public ConnInstanceTO getConnInstanceTO(final ConnInstance connInstance) {
         ConnInstanceTO connInstanceTO = new ConnInstanceTO();
 
+        Pair<URI, ConnectorInfo> info = connIdBundleManager.getConnectorInfo(connInstance);
         BeanUtils.copyProperties(connInstance, connInstanceTO, IGNORE_PROPERTIES);
-
+        connInstanceTO.setLocation(info.getLeft().toASCIIString());
         // refresh stored properties in the given connInstance with direct information from
underlying connector
         ConfigurationProperties properties =
-                connIdBundleManager.getConfigurationProperties(connIdBundleManager.getConnectorInfo(connInstance));
+                connIdBundleManager.getConfigurationProperties(info.getRight());
         for (final String propName : properties.getPropertyNames()) {
             ConnConfPropSchema schema = build(properties.getProperty(propName));
 


Mime
View raw message