syncope-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fmarte...@apache.org
Subject [06/50] [abbrv] syncope git commit: [SYNCOPE-714] Consolidating old buildSchemaNames and buildSupportedObjectClasses into new buildO bjectClassInfo
Date Fri, 30 Oct 2015 11:34:45 GMT
[SYNCOPE-714] Consolidating old buildSchemaNames and buildSupportedObjectClasses into new buildO
bjectClassInfo


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

Branch: refs/heads/SYNCOPE-156
Commit: 1347c1081dd9eb3e32ae0b0f39e47fa5498aa3c3
Parents: 9343981
Author: Francesco Chicchiriccò <ilgrosso@apache.org>
Authored: Mon Oct 26 10:55:14 2015 +0100
Committer: Francesco Chicchiriccò <ilgrosso@apache.org>
Committed: Mon Oct 26 10:55:14 2015 +0100

----------------------------------------------------------------------
 .../ConnectorListConfigurationProperties.java   |   4 +-
 .../connector/ConnectorResultManager.java       |   7 +-
 .../console/pages/ProvisioningModalPage.java    |  17 +-
 .../client/console/panels/ConnectorModal.java   |  14 +-
 .../console/panels/ResourceConnConfPanel.java   |  10 +-
 .../console/panels/ResourceMappingPanel.java    |  20 ++-
 .../console/rest/ConnectorRestClient.java       |  40 ++---
 .../client/console/rest/LoggerRestClient.java   |   4 +-
 .../client/console/rest/ResourceRestClient.java |  12 +-
 .../lib/patch/ResourceDeassociationPatch.java   |  80 +++++++++
 .../common/lib/to/ConnIdObjectClassTO.java      |  78 +++++++++
 .../syncope/common/lib/to/ConnInstanceTO.java   |  38 ++---
 .../syncope/common/lib/to/ResourceTO.java       |  31 +++-
 .../common/lib/wrap/AbstractWrappable.java      |  46 ------
 .../apache/syncope/common/lib/wrap/AnyKey.java  |  30 ----
 .../common/lib/wrap/ConnIdObjectClass.java      |  30 ----
 .../syncope/common/lib/wrap/package-info.java   |  23 ---
 .../common/rest/api/CollectionWrapper.java      |  80 ---------
 .../syncope/common/rest/api/LoggerWrapper.java  |  56 +++++++
 .../rest/api/service/ConnectorService.java      |  29 +---
 .../rest/api/service/ResourceService.java       |  14 +-
 .../syncope/core/logic/ConnectorLogic.java      |  76 +++------
 .../syncope/core/logic/ResourceLogic.java       |  21 ++-
 .../apache/syncope/core/misc/MappingUtils.java  |  33 +++-
 .../persistence/api/entity/ConnInstance.java    |  41 +++--
 .../api/entity/resource/ExternalResource.java   |  11 +-
 .../persistence/jpa/entity/JPAConnInstance.java |  33 +---
 .../entity/resource/JPAExternalResource.java    |  46 +++++-
 .../persistence/jpa/DummyConnectorRegistry.java |  13 +-
 .../persistence/jpa/inner/ConnInstanceTest.java |   6 +-
 .../persistence/jpa/outer/ConnInstanceTest.java |   2 +-
 .../test/resources/domains/MasterContent.xml    |  44 ++---
 .../provisioning/api/ConnIdBundleManager.java   |   2 +-
 .../core/provisioning/api/Connector.java        |  50 +-----
 .../core/provisioning/api/ConnectorFactory.java |  23 ++-
 .../provisioning/api/ConnectorRegistry.java     |  12 --
 .../api/data/ConnInstanceDataBinder.java        |  16 +-
 .../api/data/ResourceDataBinder.java            |   7 +-
 .../provisioning/java/AsyncConnectorFacade.java |  82 +---------
 .../provisioning/java/ConnectorFacadeProxy.java | 164 +++++--------------
 .../provisioning/java/ConnectorManager.java     |  76 +++++----
 .../provisioning/java/VirAttrHandlerImpl.java   |   2 +-
 .../java/data/ConnInstanceDataBinderImpl.java   |  47 +-----
 .../java/data/ResourceDataBinderImpl.java       |  29 ++--
 .../AbstractPropagationTaskExecutor.java        |   2 +-
 .../DBPasswordPropagationActions.java           |   2 +-
 .../LDAPPasswordPropagationActions.java         |   2 +-
 .../java/sync/AbstractPushResultHandler.java    |   2 +-
 .../java/sync/DBPasswordSyncActions.java        |   4 +-
 .../java/sync/LDAPMembershipSyncActions.java    |  10 +-
 .../provisioning/java/sync/SyncJobDelegate.java |   5 +-
 .../core/provisioning/java/sync/SyncUtils.java  |   2 +-
 .../rest/cxf/service/ConnectorServiceImpl.java  |  13 +-
 .../rest/cxf/service/LoggerServiceImpl.java     |   4 +-
 .../rest/cxf/service/ResourceServiceImpl.java   |  37 ++---
 .../fit/core/reference/AbstractITCase.java      |   2 +-
 .../fit/core/reference/ConnectorITCase.java     |  84 ++++------
 .../fit/core/reference/LoggerITCase.java        |   8 +-
 .../fit/core/reference/ResourceITCase.java      |   2 +-
 .../fit/core/reference/SyncTaskITCase.java      |   2 +-
 .../fit/core/reference/VirAttrITCase.java       |   4 +-
 61 files changed, 720 insertions(+), 964 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/syncope/blob/1347c108/client/cli/src/main/java/org/apache/syncope/client/cli/commands/connector/ConnectorListConfigurationProperties.java
----------------------------------------------------------------------
diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/connector/ConnectorListConfigurationProperties.java b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/connector/ConnectorListConfigurationProperties.java
index 6b80e8e..3e454d7 100644
--- a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/connector/ConnectorListConfigurationProperties.java
+++ b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/connector/ConnectorListConfigurationProperties.java
@@ -37,8 +37,8 @@ public class ConnectorListConfigurationProperties extends AbstractConnectorComma
         if (input.getParameters().length >= 1) {
             for (final String parameter : input.getParameters()) {
                 try {
-                    connectorResultManager.fromListConfigurationProperties(
-                            connectorService.getConfigurationProperties(Long.valueOf(parameter)));
+                    connectorResultManager.fromConfigurationProperties(
+                            connectorService.read(Long.valueOf(parameter), null).getConf());
                 } catch (final NumberFormatException ex) {
                     connectorResultManager.managerNumberFormatException("connector", parameter);
                 } catch (final SyncopeClientException | WebServiceException ex) {

http://git-wip-us.apache.org/repos/asf/syncope/blob/1347c108/client/cli/src/main/java/org/apache/syncope/client/cli/commands/connector/ConnectorResultManager.java
----------------------------------------------------------------------
diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/connector/ConnectorResultManager.java b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/connector/ConnectorResultManager.java
index b6edbc2..7c72349 100644
--- a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/connector/ConnectorResultManager.java
+++ b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/connector/ConnectorResultManager.java
@@ -18,7 +18,6 @@
  */
 package org.apache.syncope.client.cli.commands.connector;
 
-import java.util.HashSet;
 import java.util.List;
 import java.util.Set;
 import org.apache.syncope.client.cli.commands.CommonsResultManager;
@@ -49,8 +48,8 @@ public class ConnectorResultManager extends CommonsResultManager {
         }
     }
 
-    public void fromListConfigurationProperties(final List<ConnConfProperty> connConfPropertys) {
-        printConfiguration(new HashSet<>(connConfPropertys));
+    public void fromConfigurationProperties(final Set<ConnConfProperty> connConfPropertys) {
+        printConfiguration(connConfPropertys);
 
     }
 
@@ -65,7 +64,7 @@ public class ConnectorResultManager extends CommonsResultManager {
         System.out.println("    CAPABILITIES:");
         printCapabilities(connInstanceTO.getCapabilities());
         System.out.println("    CONFIGURATION:");
-        printConfiguration(connInstanceTO.getConfiguration());
+        printConfiguration(connInstanceTO.getConf());
         System.out.println("    POOL CONFIGURATION:");
         printConfPool(connInstanceTO.getPoolConf());
     }

http://git-wip-us.apache.org/repos/asf/syncope/blob/1347c108/client/console/src/main/java/org/apache/syncope/client/console/pages/ProvisioningModalPage.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/pages/ProvisioningModalPage.java b/client/console/src/main/java/org/apache/syncope/client/console/pages/ProvisioningModalPage.java
index c66d650..43944bd 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/pages/ProvisioningModalPage.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/pages/ProvisioningModalPage.java
@@ -37,8 +37,6 @@ import org.apache.syncope.common.lib.to.BulkActionResult;
 import org.apache.syncope.common.lib.to.ResourceTO;
 import org.apache.syncope.common.lib.types.AnyTypeKind;
 import org.apache.syncope.common.lib.types.ResourceDeassociationAction;
-import org.apache.syncope.common.lib.wrap.AbstractWrappable;
-import org.apache.syncope.common.lib.wrap.AnyKey;
 import org.apache.wicket.PageReference;
 import org.apache.wicket.ajax.AjaxRequestTarget;
 import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow;
@@ -227,26 +225,25 @@ public class ProvisioningModalPage<T extends AnyTO> extends AbstractStatusModalP
 
     private void bulkAssociationAction(
             final AjaxRequestTarget target,
-            final ResourceDeassociationAction type,
+            final ResourceDeassociationAction action,
             final ActionDataTablePanel<StatusBean, String> table,
             final List<IColumn<StatusBean, String>> columns) {
 
-        final List<StatusBean> beans = new ArrayList<>(table.getModelObject());
-        List<AnyKey> subjectKeys = new ArrayList<>();
+        List<StatusBean> beans = new ArrayList<>(table.getModelObject());
+        List<Long> anyKeys = new ArrayList<>();
         for (StatusBean bean : beans) {
-            LOG.debug("Selected bean {}", bean);
-            subjectKeys.add(AbstractWrappable.getInstance(AnyKey.class, bean.getAnyKey()));
+            anyKeys.add(bean.getAnyKey());
         }
 
         if (beans.isEmpty()) {
             window.close(target);
         } else {
-            final BulkActionResult res = resourceRestClient.bulkAssociationAction(
-                    resourceTO.getKey(), anyTypeKind.name(), type, subjectKeys);
+            BulkActionResult result =
+                    resourceRestClient.bulkAssociationAction(resourceTO.getKey(), anyTypeKind.name(), action, anyKeys);
 
             ((BasePage) pageRef.getPage()).setModalResult(true);
 
-            setResponsePage(new BulkActionResultModalPage<>(window, beans, columns, res, "anyKey"));
+            setResponsePage(new BulkActionResultModalPage<>(window, beans, columns, result, "anyKey"));
         }
     }
 }

http://git-wip-us.apache.org/repos/asf/syncope/blob/1347c108/client/console/src/main/java/org/apache/syncope/client/console/panels/ConnectorModal.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/panels/ConnectorModal.java b/client/console/src/main/java/org/apache/syncope/client/console/panels/ConnectorModal.java
index 4f5e8eb..f02cbe9 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/panels/ConnectorModal.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/panels/ConnectorModal.java
@@ -286,7 +286,7 @@ public class ConnectorModal extends AbstractResourceModal {
         // form - second tab (properties)
         final ListView<ConnConfProperty> connPropView = new ConnConfPropertyListView("connectorProperties",
                 new PropertyModel<List<ConnConfProperty>>(this, "properties"),
-                true, connInstanceTO.getConfiguration());
+                true, connInstanceTO.getConf());
         connPropView.setOutputMarkupId(true);
         connectorPropForm.add(connPropView);
 
@@ -353,8 +353,8 @@ public class ConnectorModal extends AbstractResourceModal {
                 conn.setConnectorName(bundleTO.getConnectorName());
                 conn.setBundleName(bundleTO.getBundleName());
                 conn.setVersion(bundleTO.getVersion());
-                conn.getConfiguration().clear();
-                conn.getConfiguration().addAll(connPropView.getModelObject());
+                conn.getConf().clear();
+                conn.getConf().addAll(connPropView.getModelObject());
 
                 // Set the model object's capabilities to capabilitiesPalette's converted Set
                 conn.getCapabilities().clear();
@@ -448,11 +448,11 @@ public class ConnectorModal extends AbstractResourceModal {
                 final ConnConfProperty property = new ConnConfProperty();
                 property.setSchema(key);
                 if (connInstanceTO.getKey() != 0
-                        && connInstanceTO.getConfigurationMap().containsKey(key.getName())
-                        && connInstanceTO.getConfigurationMap().get(key.getName()).getValues() != null) {
+                        && connInstanceTO.getConfMap().containsKey(key.getName())
+                        && connInstanceTO.getConfMap().get(key.getName()).getValues() != null) {
 
-                    property.getValues().addAll(connInstanceTO.getConfigurationMap().get(key.getName()).getValues());
-                    property.setOverridable(connInstanceTO.getConfigurationMap().get(key.getName()).isOverridable());
+                    property.getValues().addAll(connInstanceTO.getConfMap().get(key.getName()).getValues());
+                    property.setOverridable(connInstanceTO.getConfMap().get(key.getName()).isOverridable());
                 }
 
                 if (property.getValues().isEmpty() && !key.getDefaultValues().isEmpty()) {

http://git-wip-us.apache.org/repos/asf/syncope/blob/1347c108/client/console/src/main/java/org/apache/syncope/client/console/panels/ResourceConnConfPanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/panels/ResourceConnConfPanel.java b/client/console/src/main/java/org/apache/syncope/client/console/panels/ResourceConnConfPanel.java
index 246e0eb..fdb9f83 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/panels/ResourceConnConfPanel.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/panels/ResourceConnConfPanel.java
@@ -79,7 +79,7 @@ public class ResourceConnConfPanel extends Panel {
          */
         final ListView<ConnConfProperty> connPropView = new ConnConfPropertyListView("connectorProperties",
                 new PropertyModel<List<ConnConfProperty>>(this, "connConfProperties"),
-                false, resourceTO.getConnConfProperties());
+                false, resourceTO.getConfOverride());
         connPropView.setOutputMarkupId(true);
         connConfPropContainer.add(connPropView);
 
@@ -116,17 +116,17 @@ public class ResourceConnConfPanel extends Panel {
         List<ConnConfProperty> props = new ArrayList<>();
         Long connectorKey = resourceTO.getConnector();
         if (connectorKey != null && connectorKey > 0) {
-            for (ConnConfProperty property : restClient.read(connectorKey).getConfiguration()) {
+            for (ConnConfProperty property : restClient.read(connectorKey).getConf()) {
                 if (property.isOverridable()) {
                     props.add(property);
                 }
             }
         }
-        if (createFlag || resourceTO.getConnConfProperties().isEmpty()) {
-            resourceTO.getConnConfProperties().clear();
+        if (createFlag || resourceTO.getConfOverride().isEmpty()) {
+            resourceTO.getConfOverride().clear();
         } else {
             Map<String, ConnConfProperty> valuedProps = new HashMap<>();
-            for (ConnConfProperty prop : resourceTO.getConnConfProperties()) {
+            for (ConnConfProperty prop : resourceTO.getConfOverride()) {
                 valuedProps.put(prop.getSchema().getName(), prop);
             }
 

http://git-wip-us.apache.org/repos/asf/syncope/blob/1347c108/client/console/src/main/java/org/apache/syncope/client/console/panels/ResourceMappingPanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/panels/ResourceMappingPanel.java b/client/console/src/main/java/org/apache/syncope/client/console/panels/ResourceMappingPanel.java
index 40cc013..ceabd57 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/panels/ResourceMappingPanel.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/panels/ResourceMappingPanel.java
@@ -25,6 +25,8 @@ import java.util.Comparator;
 import java.util.HashSet;
 import java.util.List;
 import java.util.Set;
+import org.apache.commons.collections4.CollectionUtils;
+import org.apache.commons.collections4.Transformer;
 import org.apache.syncope.client.console.commons.Constants;
 import org.apache.syncope.client.console.commons.JexlHelpUtils;
 import org.apache.syncope.client.console.panels.ResourceConnConfPanel.ConnConfModEvent;
@@ -36,6 +38,7 @@ import org.apache.syncope.client.console.wicket.markup.html.form.AjaxDropDownCho
 import org.apache.syncope.client.console.wicket.markup.html.form.AjaxTextFieldPanel;
 import org.apache.syncope.client.console.wicket.markup.html.form.FieldPanel;
 import org.apache.syncope.client.console.wicket.markup.html.form.MappingPurposePanel;
+import org.apache.syncope.common.lib.to.ConnIdObjectClassTO;
 import org.apache.syncope.common.lib.to.ConnInstanceTO;
 import org.apache.syncope.common.lib.to.MappingItemTO;
 import org.apache.syncope.common.lib.to.MappingTO;
@@ -156,7 +159,7 @@ public class ResourceMappingPanel extends Panel {
         add(this.mappingContainer);
 
         if (resourceTO.getConnector() != null && resourceTO.getConnector() > 0) {
-            schemaNames = getSchemaNames(resourceTO.getConnector(), resourceTO.getConnConfProperties());
+            schemaNames = getSchemaNames(resourceTO.getConnector(), resourceTO.getConfOverride());
             setEnabled();
         } else {
             schemaNames = Collections.<String>emptyList();
@@ -441,15 +444,24 @@ public class ResourceMappingPanel extends Panel {
     private List<String> getSchemaNames(final Long connectorId, final Set<ConnConfProperty> conf) {
         final ConnInstanceTO connInstanceTO = new ConnInstanceTO();
         connInstanceTO.setKey(connectorId);
-        connInstanceTO.getConfiguration().addAll(conf);
+        connInstanceTO.getConf().addAll(conf);
 
-        return connRestClient.getSchemaNames(connInstanceTO);
+        // SYNCOPE-156: use provided info to give schema names (and type!) by ObjectClass
+        return CollectionUtils.collect(connRestClient.buildObjectClassInfo(connInstanceTO, true),
+                new Transformer<ConnIdObjectClassTO, String>() {
+
+                    @Override
+                    public String transform(final ConnIdObjectClassTO input) {
+                        return input.getType();
+                    }
+                },
+                new ArrayList<String>());
     }
 
     private void setEnabled() {
         ConnInstanceTO connInstanceTO = new ConnInstanceTO();
         connInstanceTO.setKey(resourceTO.getConnector());
-        connInstanceTO.getConfiguration().addAll(resourceTO.getConnConfProperties());
+        connInstanceTO.getConf().addAll(resourceTO.getConfOverride());
 
         boolean enabled = provisionTO != null;
 

http://git-wip-us.apache.org/repos/asf/syncope/blob/1347c108/client/console/src/main/java/org/apache/syncope/client/console/rest/ConnectorRestClient.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/rest/ConnectorRestClient.java b/client/console/src/main/java/org/apache/syncope/client/console/rest/ConnectorRestClient.java
index 8c84993..d483411 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/rest/ConnectorRestClient.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/rest/ConnectorRestClient.java
@@ -28,11 +28,10 @@ import org.apache.syncope.common.lib.SyncopeClientException;
 import org.apache.syncope.common.lib.to.BulkAction;
 import org.apache.syncope.common.lib.to.BulkActionResult;
 import org.apache.syncope.common.lib.to.ConnBundleTO;
+import org.apache.syncope.common.lib.to.ConnIdObjectClassTO;
 import org.apache.syncope.common.lib.to.ConnInstanceTO;
-import org.apache.syncope.common.lib.to.PlainSchemaTO;
 import org.apache.syncope.common.lib.to.ResourceTO;
 import org.apache.syncope.common.lib.types.ConnConfProperty;
-import org.apache.syncope.common.lib.wrap.ConnIdObjectClass;
 import org.apache.syncope.common.rest.api.service.ConnectorService;
 import org.apache.syncope.common.rest.api.service.ResourceService;
 import org.springframework.beans.BeanUtils;
@@ -57,9 +56,9 @@ public class ConnectorRestClient extends BaseRestClient {
     }
 
     public void create(final ConnInstanceTO connectorTO) {
-        Set<ConnConfProperty> filteredConf = filterProperties(connectorTO.getConfiguration());
-        connectorTO.getConfiguration().clear();
-        connectorTO.getConfiguration().addAll(filteredConf);
+        Set<ConnConfProperty> filteredConf = filterProperties(connectorTO.getConf());
+        connectorTO.getConf().clear();
+        connectorTO.getConf().addAll(filteredConf);
         getService(ConnectorService.class).create(connectorTO);
     }
 
@@ -83,9 +82,9 @@ public class ConnectorRestClient extends BaseRestClient {
     }
 
     public void update(final ConnInstanceTO connectorTO) {
-        Set<ConnConfProperty> filteredConf = filterProperties(connectorTO.getConfiguration());
-        connectorTO.getConfiguration().clear();
-        connectorTO.getConfiguration().addAll(filteredConf);
+        Set<ConnConfProperty> filteredConf = filterProperties(connectorTO.getConf());
+        connectorTO.getConf().clear();
+        connectorTO.getConf().addAll(filteredConf);
         getService(ConnectorService.class).update(connectorTO);
     }
 
@@ -139,7 +138,7 @@ public class ConnectorRestClient extends BaseRestClient {
     public boolean check(final ConnInstanceTO connectorTO) {
         ConnInstanceTO toBeChecked = new ConnInstanceTO();
         BeanUtils.copyProperties(connectorTO, toBeChecked, new String[] { "configuration", "configurationMap" });
-        toBeChecked.getConfiguration().addAll(filterProperties(connectorTO.getConfiguration()));
+        toBeChecked.getConf().addAll(filterProperties(connectorTO.getConf()));
 
         boolean check = false;
         try {
@@ -164,27 +163,12 @@ public class ConnectorRestClient extends BaseRestClient {
         return check;
     }
 
-    public List<String> getSchemaNames(final ConnInstanceTO connectorTO) {
-        List<String> schemaNames = new ArrayList<>();
-        try {
-            List<PlainSchemaTO> response = getService(ConnectorService.class).buildSchemaNames(connectorTO, false);
-            for (PlainSchemaTO schema : response) {
-                schemaNames.add(schema.getKey());
-            }
-        } catch (Exception e) {
-            LOG.error("While getting schema names", e);
-        } finally {
-            // re-order schema names list
-            Collections.sort(schemaNames);
-        }
-
-        return schemaNames;
-    }
+    public List<ConnIdObjectClassTO> buildObjectClassInfo(
+            final ConnInstanceTO connInstanceTO, final boolean includeSpecial) {
 
-    public List<ConnIdObjectClass> getSupportedObjectClasses(final ConnInstanceTO connectorTO) {
-        List<ConnIdObjectClass> result = Collections.emptyList();
+        List<ConnIdObjectClassTO> result = Collections.emptyList();
         try {
-            result = getService(ConnectorService.class).buildSupportedObjectClasses(connectorTO);
+            result = getService(ConnectorService.class).buildObjectClassInfo(connInstanceTO, includeSpecial);
         } catch (Exception e) {
             LOG.error("While getting supported object classes", e);
         }

http://git-wip-us.apache.org/repos/asf/syncope/blob/1347c108/client/console/src/main/java/org/apache/syncope/client/console/rest/LoggerRestClient.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/rest/LoggerRestClient.java b/client/console/src/main/java/org/apache/syncope/client/console/rest/LoggerRestClient.java
index 627e828..56283ab 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/rest/LoggerRestClient.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/rest/LoggerRestClient.java
@@ -29,7 +29,7 @@ import org.apache.syncope.common.lib.to.LoggerTO;
 import org.apache.syncope.common.lib.types.AuditLoggerName;
 import org.apache.syncope.common.lib.types.LoggerLevel;
 import org.apache.syncope.common.lib.types.LoggerType;
-import org.apache.syncope.common.rest.api.CollectionWrapper;
+import org.apache.syncope.common.rest.api.LoggerWrapper;
 import org.apache.syncope.common.rest.api.service.LoggerService;
 import org.springframework.stereotype.Component;
 
@@ -43,7 +43,7 @@ public class LoggerRestClient extends BaseRestClient {
     }
 
     public List<AuditLoggerName> listAudits() {
-        return CollectionWrapper.wrapLogger(getService(LoggerService.class).list(LoggerType.AUDIT));
+        return LoggerWrapper.wrap(getService(LoggerService.class).list(LoggerType.AUDIT));
     }
 
     public Map<String, Set<AuditLoggerName>> listAuditsByCategory() {

http://git-wip-us.apache.org/repos/asf/syncope/blob/1347c108/client/console/src/main/java/org/apache/syncope/client/console/rest/ResourceRestClient.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/rest/ResourceRestClient.java b/client/console/src/main/java/org/apache/syncope/client/console/rest/ResourceRestClient.java
index 5efa119..f5579cf 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/rest/ResourceRestClient.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/rest/ResourceRestClient.java
@@ -21,11 +21,11 @@ package org.apache.syncope.client.console.rest;
 import java.util.List;
 import org.apache.syncope.client.console.SyncopeConsoleSession;
 import org.apache.syncope.common.lib.SyncopeClientException;
+import org.apache.syncope.common.lib.patch.ResourceDeassociationPatch;
 import org.apache.syncope.common.lib.to.BulkAction;
 import org.apache.syncope.common.lib.to.BulkActionResult;
 import org.apache.syncope.common.lib.to.ResourceTO;
 import org.apache.syncope.common.lib.types.ResourceDeassociationAction;
-import org.apache.syncope.common.lib.wrap.AnyKey;
 import org.apache.syncope.common.rest.api.service.ResourceService;
 import org.springframework.stereotype.Component;
 
@@ -82,8 +82,14 @@ public class ResourceRestClient extends BaseRestClient {
 
     public BulkActionResult bulkAssociationAction(
             final String resourceName, final String anyTypeName,
-            final ResourceDeassociationAction type, final List<AnyKey> anyKeys) {
+            final ResourceDeassociationAction action, final List<Long> anyKeys) {
 
-        return getService(ResourceService.class).bulkDeassociation(resourceName, anyTypeName, type, anyKeys);
+        ResourceDeassociationPatch patch = new ResourceDeassociationPatch();
+        patch.setKey(resourceName);
+        patch.setAnyTypeKey(anyTypeName);
+        patch.setAction(action);
+        patch.getAnyKyes().addAll(anyKeys);
+
+        return getService(ResourceService.class).bulkDeassociation(patch);
     }
 }

http://git-wip-us.apache.org/repos/asf/syncope/blob/1347c108/common/lib/src/main/java/org/apache/syncope/common/lib/patch/ResourceDeassociationPatch.java
----------------------------------------------------------------------
diff --git a/common/lib/src/main/java/org/apache/syncope/common/lib/patch/ResourceDeassociationPatch.java b/common/lib/src/main/java/org/apache/syncope/common/lib/patch/ResourceDeassociationPatch.java
new file mode 100644
index 0000000..9738498
--- /dev/null
+++ b/common/lib/src/main/java/org/apache/syncope/common/lib/patch/ResourceDeassociationPatch.java
@@ -0,0 +1,80 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.common.lib.patch;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.util.ArrayList;
+import java.util.List;
+import javax.ws.rs.PathParam;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlElementWrapper;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+import org.apache.syncope.common.lib.AbstractBaseBean;
+import org.apache.syncope.common.lib.types.ResourceDeassociationAction;
+
+@XmlRootElement(name = "resourceDeassociationPatch")
+@XmlType
+public class ResourceDeassociationPatch extends AbstractBaseBean {
+
+    private static final long serialVersionUID = -9116268525079837276L;
+
+    private String key;
+
+    private String anyTypeKey;
+
+    private ResourceDeassociationAction action;
+
+    private final List<Long> anyKyes = new ArrayList<>();
+
+    public String getKey() {
+        return key;
+    }
+
+    @PathParam("key")
+    public void setKey(final String key) {
+        this.key = key;
+    }
+
+    public String getAnyTypeKey() {
+        return anyTypeKey;
+    }
+
+    @PathParam("anyTypeKey")
+    public void setAnyTypeKey(final String anyTypeKey) {
+        this.anyTypeKey = anyTypeKey;
+    }
+
+    public ResourceDeassociationAction getAction() {
+        return action;
+    }
+
+    @PathParam("action")
+    public void setAction(final ResourceDeassociationAction action) {
+        this.action = action;
+    }
+
+    @XmlElementWrapper(name = "anyKyes")
+    @XmlElement(name = "key")
+    @JsonProperty("anyKyes")
+    public List<Long> getAnyKyes() {
+        return anyKyes;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/1347c108/common/lib/src/main/java/org/apache/syncope/common/lib/to/ConnIdObjectClassTO.java
----------------------------------------------------------------------
diff --git a/common/lib/src/main/java/org/apache/syncope/common/lib/to/ConnIdObjectClassTO.java b/common/lib/src/main/java/org/apache/syncope/common/lib/to/ConnIdObjectClassTO.java
new file mode 100644
index 0000000..be1b6d6
--- /dev/null
+++ b/common/lib/src/main/java/org/apache/syncope/common/lib/to/ConnIdObjectClassTO.java
@@ -0,0 +1,78 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.common.lib.to;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.util.ArrayList;
+import java.util.List;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlElementWrapper;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+import org.apache.syncope.common.lib.AbstractBaseBean;
+
+/**
+ * Metadata description of ConnId ObjectClass.
+ */
+@XmlRootElement(name = "connIdObjectClass")
+@XmlType
+public class ConnIdObjectClassTO extends AbstractBaseBean {
+
+    private static final long serialVersionUID = -3719658595689434648L;
+
+    private String type;
+
+    private boolean container;
+
+    private boolean auxiliary;
+
+    private final List<String> attributes = new ArrayList<>();
+
+    public String getType() {
+        return type;
+    }
+
+    public void setType(final String type) {
+        this.type = type;
+    }
+
+    public boolean isContainer() {
+        return container;
+    }
+
+    public void setContainer(final boolean container) {
+        this.container = container;
+    }
+
+    public boolean isAuxiliary() {
+        return auxiliary;
+    }
+
+    public void setAuxiliary(final boolean auxiliary) {
+        this.auxiliary = auxiliary;
+    }
+
+    @XmlElementWrapper(name = "attributes")
+    @XmlElement(name = "attribute")
+    @JsonProperty("attributes")
+    public List<String> getAttributes() {
+        return attributes;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/1347c108/common/lib/src/main/java/org/apache/syncope/common/lib/to/ConnInstanceTO.java
----------------------------------------------------------------------
diff --git a/common/lib/src/main/java/org/apache/syncope/common/lib/to/ConnInstanceTO.java b/common/lib/src/main/java/org/apache/syncope/common/lib/to/ConnInstanceTO.java
index 2111570..257f2ed 100644
--- a/common/lib/src/main/java/org/apache/syncope/common/lib/to/ConnInstanceTO.java
+++ b/common/lib/src/main/java/org/apache/syncope/common/lib/to/ConnInstanceTO.java
@@ -51,9 +51,9 @@ public class ConnInstanceTO extends AbstractBaseBean {
 
     private String version;
 
-    private final Set<ConnConfProperty> configuration;
+    private final Set<ConnConfProperty> conf = new HashSet<>();
 
-    private final Set<ConnectorCapability> capabilities;
+    private final Set<ConnectorCapability> capabilities = EnumSet.noneOf(ConnectorCapability.class);
 
     private String displayName;
 
@@ -61,13 +61,6 @@ public class ConnInstanceTO extends AbstractBaseBean {
 
     private ConnPoolConfTO poolConf;
 
-    public ConnInstanceTO() {
-        super();
-
-        configuration = new HashSet<>();
-        capabilities = EnumSet.noneOf(ConnectorCapability.class);
-    }
-
     public long getKey() {
         return key;
     }
@@ -109,28 +102,23 @@ public class ConnInstanceTO extends AbstractBaseBean {
         this.version = version;
     }
 
-    @XmlElementWrapper(name = "configuration")
+    @XmlElementWrapper(name = "conf")
     @XmlElement(name = "property")
-    @JsonProperty("configuration")
-    public Set<ConnConfProperty> getConfiguration() {
-        return this.configuration;
+    @JsonProperty("conf")
+    public Set<ConnConfProperty> getConf() {
+        return this.conf;
     }
 
     @JsonIgnore
-    public Map<String, ConnConfProperty> getConfigurationMap() {
-        Map<String, ConnConfProperty> result;
-
-        if (getConfiguration() == null) {
-            result = Collections.<String, ConnConfProperty>emptyMap();
-        } else {
-            result = new HashMap<>();
-            for (ConnConfProperty prop : getConfiguration()) {
-                result.put(prop.getSchema().getName(), prop);
-            }
-            result = Collections.unmodifiableMap(result);
+    public Map<String, ConnConfProperty> getConfMap() {
+        Map<String, ConnConfProperty> result = new HashMap<>();
+
+        for (ConnConfProperty prop : getConf()) {
+            result.put(prop.getSchema().getName(), prop);
         }
+        result = Collections.unmodifiableMap(result);
 
-        return result;
+        return Collections.unmodifiableMap(result);
     }
 
     @XmlElementWrapper(name = "capabilities")

http://git-wip-us.apache.org/repos/asf/syncope/blob/1347c108/common/lib/src/main/java/org/apache/syncope/common/lib/to/ResourceTO.java
----------------------------------------------------------------------
diff --git a/common/lib/src/main/java/org/apache/syncope/common/lib/to/ResourceTO.java b/common/lib/src/main/java/org/apache/syncope/common/lib/to/ResourceTO.java
index 419b852..fc540a9 100644
--- a/common/lib/src/main/java/org/apache/syncope/common/lib/to/ResourceTO.java
+++ b/common/lib/src/main/java/org/apache/syncope/common/lib/to/ResourceTO.java
@@ -21,6 +21,7 @@ package org.apache.syncope.common.lib.to;
 import com.fasterxml.jackson.annotation.JsonIgnore;
 import com.fasterxml.jackson.annotation.JsonProperty;
 import java.util.ArrayList;
+import java.util.EnumSet;
 import java.util.HashSet;
 import java.util.List;
 import java.util.Set;
@@ -32,6 +33,7 @@ import javax.xml.bind.annotation.XmlType;
 import org.apache.commons.collections4.CollectionUtils;
 import org.apache.commons.collections4.Predicate;
 import org.apache.syncope.common.lib.types.ConnConfProperty;
+import org.apache.syncope.common.lib.types.ConnectorCapability;
 import org.apache.syncope.common.lib.types.TraceLevel;
 
 @XmlRootElement(name = "resource")
@@ -76,7 +78,11 @@ public class ResourceTO extends AbstractAnnotatedBean {
 
     private Long syncPolicy;
 
-    private final Set<ConnConfProperty> connConfProperties = new HashSet<>();
+    private final Set<ConnConfProperty> confOverride = new HashSet<>();
+
+    private boolean overrideCapabilities = false;
+
+    private final Set<ConnectorCapability> capabilitiesOverride = EnumSet.noneOf(ConnectorCapability.class);
 
     private final List<String> propagationActionsClassNames = new ArrayList<>();
 
@@ -203,11 +209,26 @@ public class ResourceTO extends AbstractAnnotatedBean {
         return provisions;
     }
 
-    @XmlElementWrapper(name = "connConfProperties")
+    @XmlElementWrapper(name = "confOverride")
     @XmlElement(name = "property")
-    @JsonProperty("connConfProperties")
-    public Set<ConnConfProperty> getConnConfProperties() {
-        return connConfProperties;
+    @JsonProperty("confOverride")
+    public Set<ConnConfProperty> getConfOverride() {
+        return confOverride;
+    }
+
+    public boolean isOverrideCapabilities() {
+        return overrideCapabilities;
+    }
+
+    public void setOverrideCapabilities(final boolean overrideCapabilities) {
+        this.overrideCapabilities = overrideCapabilities;
+    }
+
+    @XmlElementWrapper(name = "capabilitiesOverride")
+    @XmlElement(name = "capability")
+    @JsonProperty("capabilitiesOverride")
+    public Set<ConnectorCapability> getCapabilitiesOverride() {
+        return capabilitiesOverride;
     }
 
     public TraceLevel getSyncTraceLevel() {

http://git-wip-us.apache.org/repos/asf/syncope/blob/1347c108/common/lib/src/main/java/org/apache/syncope/common/lib/wrap/AbstractWrappable.java
----------------------------------------------------------------------
diff --git a/common/lib/src/main/java/org/apache/syncope/common/lib/wrap/AbstractWrappable.java b/common/lib/src/main/java/org/apache/syncope/common/lib/wrap/AbstractWrappable.java
deleted file mode 100644
index 7ba0afa..0000000
--- a/common/lib/src/main/java/org/apache/syncope/common/lib/wrap/AbstractWrappable.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.syncope.common.lib.wrap;
-
-import org.apache.syncope.common.lib.AbstractBaseBean;
-
-public abstract class AbstractWrappable<E> extends AbstractBaseBean {
-
-    private static final long serialVersionUID = 1712808704911635170L;
-
-    private E element;
-
-    public static <E, T extends AbstractWrappable<E>> T getInstance(final Class<T> reference, final E element) {
-        try {
-            T instance = reference.newInstance();
-            instance.setElement(element);
-            return instance;
-        } catch (Exception e) {
-            throw new IllegalArgumentException("Could not instantiate " + reference.getName(), e);
-        }
-    }
-
-    public E getElement() {
-        return element;
-    }
-
-    public void setElement(final E element) {
-        this.element = element;
-    }
-}

http://git-wip-us.apache.org/repos/asf/syncope/blob/1347c108/common/lib/src/main/java/org/apache/syncope/common/lib/wrap/AnyKey.java
----------------------------------------------------------------------
diff --git a/common/lib/src/main/java/org/apache/syncope/common/lib/wrap/AnyKey.java b/common/lib/src/main/java/org/apache/syncope/common/lib/wrap/AnyKey.java
deleted file mode 100644
index 0eb6eef..0000000
--- a/common/lib/src/main/java/org/apache/syncope/common/lib/wrap/AnyKey.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.syncope.common.lib.wrap;
-
-import javax.xml.bind.annotation.XmlRootElement;
-import javax.xml.bind.annotation.XmlType;
-
-@XmlRootElement(name = "anyKey")
-@XmlType
-public class AnyKey extends AbstractWrappable<Long> {
-
-    private static final long serialVersionUID = -8664228651057889297L;
-
-}

http://git-wip-us.apache.org/repos/asf/syncope/blob/1347c108/common/lib/src/main/java/org/apache/syncope/common/lib/wrap/ConnIdObjectClass.java
----------------------------------------------------------------------
diff --git a/common/lib/src/main/java/org/apache/syncope/common/lib/wrap/ConnIdObjectClass.java b/common/lib/src/main/java/org/apache/syncope/common/lib/wrap/ConnIdObjectClass.java
deleted file mode 100644
index 868b3f1..0000000
--- a/common/lib/src/main/java/org/apache/syncope/common/lib/wrap/ConnIdObjectClass.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.syncope.common.lib.wrap;
-
-import javax.xml.bind.annotation.XmlRootElement;
-import javax.xml.bind.annotation.XmlType;
-
-@XmlRootElement(name = "connIdObjectClass")
-@XmlType
-public class ConnIdObjectClass extends AbstractWrappable<String> {
-
-    private static final long serialVersionUID = 613925852330408531L;
-
-}

http://git-wip-us.apache.org/repos/asf/syncope/blob/1347c108/common/lib/src/main/java/org/apache/syncope/common/lib/wrap/package-info.java
----------------------------------------------------------------------
diff --git a/common/lib/src/main/java/org/apache/syncope/common/lib/wrap/package-info.java b/common/lib/src/main/java/org/apache/syncope/common/lib/wrap/package-info.java
deleted file mode 100644
index 397cb66..0000000
--- a/common/lib/src/main/java/org/apache/syncope/common/lib/wrap/package-info.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-@XmlSchema(namespace = SyncopeConstants.NAMESPACE)
-package org.apache.syncope.common.lib.wrap;
-
-import javax.xml.bind.annotation.XmlSchema;
-import org.apache.syncope.common.lib.SyncopeConstants;

http://git-wip-us.apache.org/repos/asf/syncope/blob/1347c108/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/CollectionWrapper.java
----------------------------------------------------------------------
diff --git a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/CollectionWrapper.java b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/CollectionWrapper.java
deleted file mode 100644
index 3cdf1fa..0000000
--- a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/CollectionWrapper.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.syncope.common.rest.api;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.List;
-import org.apache.syncope.common.lib.to.LoggerTO;
-import org.apache.syncope.common.lib.types.AuditLoggerName;
-import org.apache.syncope.common.lib.types.LoggerLevel;
-import org.apache.syncope.common.lib.wrap.AbstractWrappable;
-
-public final class CollectionWrapper {
-
-    private CollectionWrapper() {
-        // empty constructor for static utility class
-    }
-
-    public static <E, T extends AbstractWrappable<E>> List<T> wrap(final E element, final Class<T> reference) {
-        return Collections.singletonList(AbstractWrappable.getInstance(reference, element));
-    }
-
-    public static <E, T extends AbstractWrappable<E>> List<T> wrap(
-            final Collection<E> collection, final Class<T> reference) {
-
-        List<T> response = new ArrayList<>();
-        for (E element : collection) {
-            response.add(AbstractWrappable.getInstance(reference, element));
-        }
-        return response;
-    }
-
-    public static <T extends AbstractWrappable<String>> List<String> unwrap(final Collection<T> collection) {
-        List<String> response = new ArrayList<>();
-        for (T item : collection) {
-            response.add(item.getElement());
-        }
-        return response;
-    }
-
-    public static List<AuditLoggerName> wrapLogger(final Collection<LoggerTO> logger) {
-        List<AuditLoggerName> respons = new ArrayList<>();
-        for (LoggerTO loggerTO : logger) {
-            try {
-                respons.add(AuditLoggerName.fromLoggerName(loggerTO.getKey()));
-            } catch (Exception ignore) {
-                // ignore
-            }
-        }
-        return respons;
-    }
-
-    public static List<LoggerTO> unwrapLogger(final Collection<AuditLoggerName> auditNames) {
-        List<LoggerTO> respons = new ArrayList<>();
-        for (AuditLoggerName name : auditNames) {
-            LoggerTO loggerTO = new LoggerTO();
-            loggerTO.setKey(name.toLoggerName());
-            loggerTO.setLevel(LoggerLevel.DEBUG);
-            respons.add(loggerTO);
-        }
-        return respons;
-    }
-}

http://git-wip-us.apache.org/repos/asf/syncope/blob/1347c108/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/LoggerWrapper.java
----------------------------------------------------------------------
diff --git a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/LoggerWrapper.java b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/LoggerWrapper.java
new file mode 100644
index 0000000..9f9dfde
--- /dev/null
+++ b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/LoggerWrapper.java
@@ -0,0 +1,56 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.common.rest.api;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+import org.apache.syncope.common.lib.to.LoggerTO;
+import org.apache.syncope.common.lib.types.AuditLoggerName;
+import org.apache.syncope.common.lib.types.LoggerLevel;
+
+public final class LoggerWrapper {
+
+    private LoggerWrapper() {
+        // empty constructor for static utility class
+    }
+
+    public static List<AuditLoggerName> wrap(final Collection<LoggerTO> logger) {
+        List<AuditLoggerName> respons = new ArrayList<>();
+        for (LoggerTO loggerTO : logger) {
+            try {
+                respons.add(AuditLoggerName.fromLoggerName(loggerTO.getKey()));
+            } catch (Exception ignore) {
+                // ignore
+            }
+        }
+        return respons;
+    }
+
+    public static List<LoggerTO> unwrap(final Collection<AuditLoggerName> auditNames) {
+        List<LoggerTO> respons = new ArrayList<>();
+        for (AuditLoggerName name : auditNames) {
+            LoggerTO loggerTO = new LoggerTO();
+            loggerTO.setKey(name.toLoggerName());
+            loggerTO.setLevel(LoggerLevel.DEBUG);
+            respons.add(loggerTO);
+        }
+        return respons;
+    }
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/1347c108/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/ConnectorService.java
----------------------------------------------------------------------
diff --git a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/ConnectorService.java b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/ConnectorService.java
index ea63718..bc111ed 100644
--- a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/ConnectorService.java
+++ b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/ConnectorService.java
@@ -35,9 +35,8 @@ import javax.ws.rs.core.Response;
 import org.apache.syncope.common.lib.to.BulkAction;
 import org.apache.syncope.common.lib.to.BulkActionResult;
 import org.apache.syncope.common.lib.to.ConnBundleTO;
+import org.apache.syncope.common.lib.to.ConnIdObjectClassTO;
 import org.apache.syncope.common.lib.to.ConnInstanceTO;
-import org.apache.syncope.common.lib.to.PlainSchemaTO;
-import org.apache.syncope.common.lib.wrap.ConnIdObjectClass;
 
 /**
  * REST operations for connector bundles and instances.
@@ -57,38 +56,24 @@ public interface ConnectorService extends JAXRSService {
     List<ConnBundleTO> getBundles(@QueryParam("lang") String lang);
 
     /**
-     * Builds the list of schema names managed by the connector bundle matching the given connector instance key, with
-     * the provided configuration.
+     * Builds the list of ConnId object classes information for the connector bundle matching the given connector
+     * instance key, with the provided configuration.
      *
      * @param connInstanceTO connector instance object providing configuration properties
      * @param includeSpecial if set to true, special schema names (like '__PASSWORD__') will be included;
      * default is false
-     * @return schema names for the connector bundle matching the given connector instance key, with the provided
-     * configuration
+     * @return supported object classes info for the connector bundle matching the given connector instance key, with
+     * the provided configuration
      */
     @POST
-    @Path("{key}/schemaNames")
+    @Path("{key}/supportedObjectClasses")
     @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
     @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
-    List<PlainSchemaTO> buildSchemaNames(
+    List<ConnIdObjectClassTO> buildObjectClassInfo(
             @NotNull ConnInstanceTO connInstanceTO,
             @QueryParam("includeSpecial") @DefaultValue("false") boolean includeSpecial);
 
     /**
-     * Builds the list of supported ConnId object classes for the connector bundle matching the given connector instance
-     * key, with the provided configuration.
-     *
-     * @param connInstanceTO connector instance object providing configuration properties
-     * @return supported object classes for the connector bundle matching the given connector instance key, with the
-     * provided configuration
-     */
-    @POST
-    @Path("{key}/supportedObjectClasses")
-    @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
-    @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
-    List<ConnIdObjectClass> buildSupportedObjectClasses(@NotNull ConnInstanceTO connInstanceTO);
-
-    /**
      * Returns connector instance with matching key.
      *
      * @param key connector instance key to be read

http://git-wip-us.apache.org/repos/asf/syncope/blob/1347c108/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/ResourceService.java
----------------------------------------------------------------------
diff --git a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/ResourceService.java b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/ResourceService.java
index 7a3550b..d515268 100644
--- a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/ResourceService.java
+++ b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/ResourceService.java
@@ -31,13 +31,12 @@ import javax.ws.rs.PathParam;
 import javax.ws.rs.Produces;
 import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.Response;
+import org.apache.syncope.common.lib.patch.ResourceDeassociationPatch;
 import org.apache.syncope.common.lib.to.BulkAction;
 import org.apache.syncope.common.lib.to.BulkActionResult;
 import org.apache.syncope.common.lib.to.ConnObjectTO;
 import org.apache.syncope.common.lib.to.PagedConnObjectTOResult;
 import org.apache.syncope.common.lib.to.ResourceTO;
-import org.apache.syncope.common.lib.types.ResourceDeassociationAction;
-import org.apache.syncope.common.lib.wrap.AnyKey;
 import org.apache.syncope.common.rest.api.beans.ConnObjectTOListQuery;
 
 /**
@@ -143,19 +142,14 @@ public interface ResourceService extends JAXRSService {
     /**
      * De-associate any objects from the given resource.
      *
-     * @param key name of resource
-     * @param anyTypeKey any object kind
-     * @param type resource de-association action type
-     * @param keys any object keys against which the bulk action will be performed
-     * @return Response object featuring BulkActionResult as Entity
+     * @param patch any objects to be used for propagation-related operations
+     * @return Bulk action result
      */
     @POST
     @Path("{key}/bulkDeassociation/{anyTypeKey}/{action}")
     @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
     @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
-    BulkActionResult bulkDeassociation(@NotNull @PathParam("key") String key,
-            @NotNull @PathParam("anyTypeKey") String anyTypeKey,
-            @NotNull @PathParam("action") ResourceDeassociationAction type, @NotNull List<AnyKey> keys);
+    BulkActionResult bulkDeassociation(@NotNull ResourceDeassociationPatch patch);
 
     /**
      * Executes the provided bulk action.

http://git-wip-us.apache.org/repos/asf/syncope/blob/1347c108/core/logic/src/main/java/org/apache/syncope/core/logic/ConnectorLogic.java
----------------------------------------------------------------------
diff --git a/core/logic/src/main/java/org/apache/syncope/core/logic/ConnectorLogic.java b/core/logic/src/main/java/org/apache/syncope/core/logic/ConnectorLogic.java
index cc6aaed..77ef94c 100644
--- a/core/logic/src/main/java/org/apache/syncope/core/logic/ConnectorLogic.java
+++ b/core/logic/src/main/java/org/apache/syncope/core/logic/ConnectorLogic.java
@@ -32,10 +32,9 @@ import org.apache.commons.lang3.ArrayUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.syncope.common.lib.SyncopeClientException;
 import org.apache.syncope.common.lib.to.ConnBundleTO;
+import org.apache.syncope.common.lib.to.ConnIdObjectClassTO;
 import org.apache.syncope.common.lib.to.ConnInstanceTO;
-import org.apache.syncope.common.lib.to.PlainSchemaTO;
 import org.apache.syncope.common.lib.types.ClientExceptionType;
-import org.apache.syncope.common.lib.types.ConnConfProperty;
 import org.apache.syncope.common.lib.types.Entitlement;
 import org.apache.syncope.core.persistence.api.dao.ConnInstanceDAO;
 import org.apache.syncope.core.persistence.api.dao.ExternalResourceDAO;
@@ -43,7 +42,6 @@ import org.apache.syncope.core.persistence.api.dao.NotFoundException;
 import org.apache.syncope.core.persistence.api.entity.ConnInstance;
 import org.apache.syncope.core.persistence.api.entity.resource.ExternalResource;
 import org.apache.syncope.core.provisioning.api.ConnIdBundleManager;
-import org.apache.syncope.core.provisioning.api.Connector;
 import org.apache.syncope.core.provisioning.api.ConnectorFactory;
 import org.apache.syncope.core.provisioning.api.data.ConnInstanceDataBinder;
 import org.identityconnectors.common.l10n.CurrentLocale;
@@ -51,7 +49,9 @@ import org.identityconnectors.framework.api.ConfigurationProperties;
 import org.identityconnectors.framework.api.ConnectorInfo;
 import org.identityconnectors.framework.api.ConnectorInfoManager;
 import org.identityconnectors.framework.api.ConnectorKey;
-import org.identityconnectors.framework.common.objects.ObjectClass;
+import org.identityconnectors.framework.common.objects.AttributeInfo;
+import org.identityconnectors.framework.common.objects.AttributeUtil;
+import org.identityconnectors.framework.common.objects.ObjectClassInfo;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.stereotype.Component;
@@ -93,7 +93,7 @@ public class ConnectorLogic extends AbstractTransactionalLogic<ConnInstanceTO> {
 
     @PreAuthorize("hasRole('" + Entitlement.CONNECTOR_UPDATE + "')")
     public ConnInstanceTO update(final ConnInstanceTO connInstanceTO) {
-        ConnInstance connInstance = binder.updateConnInstance(connInstanceTO.getKey(), connInstanceTO);
+        ConnInstance connInstance = binder.update(connInstanceTO.getKey(), connInstanceTO);
         try {
             connInstance = connInstanceDAO.save(connInstance);
         } catch (SyncopeClientException e) {
@@ -193,7 +193,7 @@ public class ConnectorLogic extends AbstractTransactionalLogic<ConnInstanceTO> {
                 ConfigurationProperties properties = connIdBundleManager.getConfigurationProperties(bundle);
 
                 for (String propName : properties.getPropertyNames()) {
-                    connBundleTO.getProperties().add(binder.buildConnConfPropSchema(properties.getProperty(propName)));
+                    connBundleTO.getProperties().add(binder.build(properties.getProperty(propName)));
                 }
 
                 connectorBundleTOs.add(connBundleTO);
@@ -204,65 +204,41 @@ public class ConnectorLogic extends AbstractTransactionalLogic<ConnInstanceTO> {
     }
 
     @PreAuthorize("hasRole('" + Entitlement.CONNECTOR_READ + "')")
-    @Transactional(readOnly = true)
-    public List<PlainSchemaTO> buildSchemaNames(final ConnInstanceTO connInstanceTO, final boolean includeSpecial) {
+    public List<ConnIdObjectClassTO> buildObjectClassInfo(
+            final ConnInstanceTO connInstanceTO, final boolean includeSpecial) {
+
         ConnInstance connInstance = connInstanceDAO.find(connInstanceTO.getKey());
         if (connInstance == null) {
             throw new NotFoundException("Connector '" + connInstanceTO.getKey() + "'");
         }
 
-        // consider the possibility to receive overridden properties only
-        Set<ConnConfProperty> conf =
-                binder.mergeConnConfProperties(connInstanceTO.getConfiguration(), connInstance.getConfiguration());
+        Set<ObjectClassInfo> objectClassInfo = connFactory.createConnector(
+                connFactory.buildConnInstanceOverride(connInstance, connInstanceTO.getConf(), null)).
+                getObjectClassInfo();
 
-        // We cannot use Spring bean because this method could be used during resource definition or modification:
-        // bean couldn't exist or couldn't be updated.
-        // This is the reason why we should take a "not mature" connector facade proxy to ask for schema names.
-        Set<String> schemaNames = connFactory.createConnector(connInstance, conf).getSchemaNames(includeSpecial);
+        List<ConnIdObjectClassTO> result = new ArrayList<>(objectClassInfo.size());
+        for (ObjectClassInfo info : objectClassInfo) {
+            ConnIdObjectClassTO connIdObjectClassTO = new ConnIdObjectClassTO();
+            connIdObjectClassTO.setType(info.getType());
+            connIdObjectClassTO.setAuxiliary(info.isAuxiliary());
+            connIdObjectClassTO.setContainer(info.isContainer());
 
-        return CollectionUtils.collect(schemaNames, new Transformer<String, PlainSchemaTO>() {
-
-            @Override
-            public PlainSchemaTO transform(final String name) {
-                PlainSchemaTO schemaTO = new PlainSchemaTO();
-                schemaTO.setKey(name);
-                return schemaTO;
+            for (AttributeInfo attrInfo : info.getAttributeInfo()) {
+                if (includeSpecial || !AttributeUtil.isSpecialName(attrInfo.getName())) {
+                    connIdObjectClassTO.getAttributes().add(attrInfo.getName());
+                }
             }
-        }, new ArrayList<PlainSchemaTO>());
-    }
 
-    @PreAuthorize("hasRole('" + Entitlement.CONNECTOR_READ + "')")
-    @Transactional(readOnly = true)
-    public List<String> buildSupportedObjectClasses(final ConnInstanceTO connInstanceTO) {
-        ConnInstance connInstance = connInstanceDAO.find(connInstanceTO.getKey());
-        if (connInstance == null) {
-            throw new NotFoundException("Connector '" + connInstanceTO.getKey() + "'");
+            result.add(connIdObjectClassTO);
         }
 
-        // consider the possibility to receive overridden properties only
-        Set<ConnConfProperty> conf =
-                binder.mergeConnConfProperties(connInstanceTO.getConfiguration(), connInstance.getConfiguration());
-
-        // We cannot use Spring bean because this method could be used during resource definition or modification:
-        // bean couldn't exist or couldn't be updated.
-        // This is the reason why we should take a "not mature" connector facade proxy to ask for object classes.
-        Set<ObjectClass> objectClasses = connFactory.createConnector(connInstance, conf).getSupportedObjectClasses();
-
-        return CollectionUtils.collect(objectClasses, new Transformer<ObjectClass, String>() {
-
-            @Override
-            public String transform(final ObjectClass objectClass) {
-                return objectClass.getObjectClassValue();
-            }
-        }, new ArrayList<String>());
+        return result;
     }
 
     @PreAuthorize("hasRole('" + Entitlement.CONNECTOR_READ + "')")
     @Transactional(readOnly = true)
     public void check(final ConnInstanceTO connInstanceTO) {
-        Connector connector = connFactory.createConnector(
-                binder.getConnInstance(connInstanceTO), connInstanceTO.getConfiguration());
-        connector.test();
+        connFactory.createConnector(binder.getConnInstance(connInstanceTO)).test();
     }
 
     @PreAuthorize("hasRole('" + Entitlement.CONNECTOR_READ + "')")
@@ -274,7 +250,7 @@ public class ConnectorLogic extends AbstractTransactionalLogic<ConnInstanceTO> {
         if (resource == null) {
             throw new NotFoundException("Resource '" + resourceName + "'");
         }
-        return binder.getConnInstanceTO(connFactory.getConnector(resource).getActiveConnInstance());
+        return binder.getConnInstanceTO(connFactory.getConnector(resource).getConnInstance());
     }
 
     @PreAuthorize("hasRole('" + Entitlement.CONNECTOR_RELOAD + "')")

http://git-wip-us.apache.org/repos/asf/syncope/blob/1347c108/core/logic/src/main/java/org/apache/syncope/core/logic/ResourceLogic.java
----------------------------------------------------------------------
diff --git a/core/logic/src/main/java/org/apache/syncope/core/logic/ResourceLogic.java b/core/logic/src/main/java/org/apache/syncope/core/logic/ResourceLogic.java
index 44a5aa8..a6a2610 100644
--- a/core/logic/src/main/java/org/apache/syncope/core/logic/ResourceLogic.java
+++ b/core/logic/src/main/java/org/apache/syncope/core/logic/ResourceLogic.java
@@ -44,7 +44,6 @@ import org.apache.syncope.core.persistence.api.dao.ExternalResourceDAO;
 import org.apache.syncope.core.persistence.api.dao.NotFoundException;
 import org.apache.syncope.core.persistence.api.dao.GroupDAO;
 import org.apache.syncope.core.persistence.api.dao.UserDAO;
-import org.apache.syncope.core.persistence.api.entity.ConnInstance;
 import org.apache.syncope.core.persistence.api.entity.resource.ExternalResource;
 import org.apache.syncope.core.persistence.api.entity.resource.MappingItem;
 import org.apache.syncope.core.provisioning.api.Connector;
@@ -54,10 +53,12 @@ import org.apache.syncope.core.misc.ConnObjectUtils;
 import org.apache.syncope.core.misc.MappingUtils;
 import org.apache.syncope.core.persistence.api.dao.AnyObjectDAO;
 import org.apache.syncope.core.persistence.api.dao.AnyTypeDAO;
+import org.apache.syncope.core.persistence.api.dao.ConnInstanceDAO;
 import org.apache.syncope.core.persistence.api.dao.VirSchemaDAO;
 import org.apache.syncope.core.persistence.api.dao.search.OrderByClause;
 import org.apache.syncope.core.persistence.api.entity.Any;
 import org.apache.syncope.core.persistence.api.entity.AnyType;
+import org.apache.syncope.core.persistence.api.entity.ConnInstance;
 import org.apache.syncope.core.persistence.api.entity.VirSchema;
 import org.apache.syncope.core.persistence.api.entity.resource.Provision;
 import org.identityconnectors.framework.common.objects.Attribute;
@@ -85,6 +86,9 @@ public class ResourceLogic extends AbstractTransactionalLogic<ResourceTO> {
     private AnyObjectDAO anyObjectDAO;
 
     @Autowired
+    private ConnInstanceDAO connInstanceDAO;
+
+    @Autowired
     private UserDAO userDAO;
 
     @Autowired
@@ -245,7 +249,7 @@ public class ResourceLogic extends AbstractTransactionalLogic<ResourceTO> {
         ConnectorObject connectorObject = connector.getObject(
                 init.getRight().getObjectClass(),
                 new Uid(connObjectKeyValue),
-                connector.getOperationOptions(mapItems));
+                MappingUtils.buildOperationOptions(mapItems));
         if (connectorObject == null) {
             throw new NotFoundException(
                     "Object " + connObjectKeyValue + " with class " + init.getRight().getObjectClass()
@@ -303,10 +307,17 @@ public class ResourceLogic extends AbstractTransactionalLogic<ResourceTO> {
     @PreAuthorize("hasRole('" + Entitlement.CONNECTOR_READ + "')")
     @Transactional(readOnly = true)
     public void check(final ResourceTO resourceTO) {
-        ConnInstance connInstance = binder.getConnInstance(resourceTO);
-        Connector connector = connFactory.createConnector(connInstance, connInstance.getConfiguration());
+        ConnInstance connInstance = connInstanceDAO.find(resourceTO.getConnector());
+        if (connInstance == null) {
+            throw new NotFoundException("Connector '" + resourceTO.getConnector() + "'");
+        }
 
-        connector.test();
+        connFactory.createConnector(
+                connFactory.buildConnInstanceOverride(
+                        connInstance,
+                        resourceTO.getConfOverride(),
+                        resourceTO.isOverrideCapabilities() ? resourceTO.getCapabilitiesOverride() : null)).
+                test();
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/syncope/blob/1347c108/core/misc/src/main/java/org/apache/syncope/core/misc/MappingUtils.java
----------------------------------------------------------------------
diff --git a/core/misc/src/main/java/org/apache/syncope/core/misc/MappingUtils.java b/core/misc/src/main/java/org/apache/syncope/core/misc/MappingUtils.java
index 54a4428..aed2ee6 100644
--- a/core/misc/src/main/java/org/apache/syncope/core/misc/MappingUtils.java
+++ b/core/misc/src/main/java/org/apache/syncope/core/misc/MappingUtils.java
@@ -21,6 +21,7 @@ package org.apache.syncope.core.misc;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.HashSet;
+import java.util.Iterator;
 import java.util.List;
 import java.util.Set;
 import org.apache.commons.collections4.ListUtils;
@@ -75,7 +76,10 @@ import org.identityconnectors.framework.common.objects.Attribute;
 import org.identityconnectors.framework.common.objects.AttributeBuilder;
 import org.identityconnectors.framework.common.objects.AttributeUtil;
 import org.identityconnectors.framework.common.objects.Name;
+import org.identityconnectors.framework.common.objects.OperationOptions;
+import org.identityconnectors.framework.common.objects.OperationOptionsBuilder;
 import org.identityconnectors.framework.common.objects.OperationalAttributes;
+import org.identityconnectors.framework.common.objects.Uid;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -256,6 +260,34 @@ public class MappingUtils {
     }
 
     /**
+     * Build options for requesting all mapped connector attributes.
+     *
+     * @param mapItems mapping items
+     * @return options for requesting all mapped connector attributes
+     * @see OperationOptions
+     */
+    public static OperationOptions buildOperationOptions(final Iterator<? extends MappingItem> mapItems) {
+        OperationOptionsBuilder builder = new OperationOptionsBuilder();
+
+        Set<String> attrsToGet = new HashSet<>();
+        attrsToGet.add(Name.NAME);
+        attrsToGet.add(Uid.NAME);
+        attrsToGet.add(OperationalAttributes.ENABLE_NAME);
+
+        while (mapItems.hasNext()) {
+            MappingItem mapItem = mapItems.next();
+            if (mapItem.getPurpose() != MappingPurpose.NONE) {
+                attrsToGet.add(mapItem.getExtAttrName());
+            }
+        }
+
+        builder.setAttributesToGet(attrsToGet);
+        // -------------------------------------
+
+        return builder.build();
+    }
+
+    /**
      * Prepare attributes for sending to a connector instance.
      *
      * @param any given any object
@@ -796,5 +828,4 @@ public class MappingUtils {
             default:
         }
     }
-
 }

http://git-wip-us.apache.org/repos/asf/syncope/blob/1347c108/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/ConnInstance.java
----------------------------------------------------------------------
diff --git a/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/ConnInstance.java b/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/ConnInstance.java
index eb665ea..2019e8e 100644
--- a/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/ConnInstance.java
+++ b/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/ConnInstance.java
@@ -26,47 +26,44 @@ import org.apache.syncope.common.lib.types.ConnectorCapability;
 
 public interface ConnInstance extends Entity<Long> {
 
-    boolean addCapability(ConnectorCapability capabitily);
-
-    boolean addResource(ExternalResource resource);
-
-    String getBundleName();
-
-    Set<ConnectorCapability> getCapabilities();
-
-    Set<ConnConfProperty> getConfiguration();
-
-    Integer getConnRequestTimeout();
+    void setConnectorName(String connectorName);
 
     String getConnectorName();
 
+    void setDisplayName(String displayName);
+
     String getDisplayName();
 
+    void setLocation(String location);
+
     String getLocation();
 
+    void setPoolConf(ConnPoolConf poolConf);
+
     ConnPoolConf getPoolConf();
 
-    List<? extends ExternalResource> getResources();
+    void setVersion(String version);
 
     String getVersion();
 
-    boolean removeCapability(ConnectorCapability capabitily);
+    void setBundleName(String bundleName);
 
-    boolean removeResource(ExternalResource resource);
+    String getBundleName();
 
-    void setBundleName(String bundleName);
+    Set<ConnectorCapability> getCapabilities();
 
-    void setConfiguration(Set<ConnConfProperty> configuration);
+    boolean add(ExternalResource resource);
 
-    void setConnRequestTimeout(Integer timeout);
+    boolean remove(ExternalResource resource);
 
-    void setConnectorName(String connectorName);
+    List<? extends ExternalResource> getResources();
 
-    void setDisplayName(String displayName);
+    void setConf(Set<ConnConfProperty> conf);
 
-    void setLocation(String location);
+    Set<ConnConfProperty> getConf();
 
-    void setPoolConf(ConnPoolConf poolConf);
+    void setConnRequestTimeout(Integer timeout);
+
+    Integer getConnRequestTimeout();
 
-    void setVersion(String version);
 }

http://git-wip-us.apache.org/repos/asf/syncope/blob/1347c108/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/resource/ExternalResource.java
----------------------------------------------------------------------
diff --git a/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/resource/ExternalResource.java b/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/resource/ExternalResource.java
index 26aa9a1..0cc3c04 100644
--- a/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/resource/ExternalResource.java
+++ b/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/resource/ExternalResource.java
@@ -21,6 +21,7 @@ package org.apache.syncope.core.persistence.api.entity.resource;
 import java.util.List;
 import java.util.Set;
 import org.apache.syncope.common.lib.types.ConnConfProperty;
+import org.apache.syncope.common.lib.types.ConnectorCapability;
 import org.apache.syncope.common.lib.types.TraceLevel;
 import org.apache.syncope.core.persistence.api.entity.policy.AccountPolicy;
 import org.apache.syncope.core.persistence.api.entity.AnnotatedEntity;
@@ -38,9 +39,15 @@ public interface ExternalResource extends AnnotatedEntity<String> {
 
     void setConnector(ConnInstance connector);
 
-    Set<ConnConfProperty> getConnInstanceConfiguration();
+    Set<ConnConfProperty> getConfOverride();
 
-    void setConnInstanceConfiguration(Set<ConnConfProperty> properties);
+    void setConfOverride(Set<ConnConfProperty> confOverride);
+
+    boolean isOverrideCapabilities();
+
+    void setOverrideCapabilities(boolean overrideCapabilities);
+
+    Set<ConnectorCapability> getCapabilitiesOverride();
 
     AccountPolicy getAccountPolicy();
 

http://git-wip-us.apache.org/repos/asf/syncope/blob/1347c108/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/JPAConnInstance.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/JPAConnInstance.java b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/JPAConnInstance.java
index 054dd69..e31aaaa 100644
--- a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/JPAConnInstance.java
+++ b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/JPAConnInstance.java
@@ -99,8 +99,8 @@ public class JPAConnInstance extends AbstractEntity<Long> implements ConnInstanc
     @Column(name = "capability")
     @CollectionTable(name = "ConnInstance_capabilities",
             joinColumns =
-            @JoinColumn(name = "ConnInstance_id", referencedColumnName = "id"))
-    private Set<ConnectorCapability> capabilities;
+            @JoinColumn(name = "connInstance_id", referencedColumnName = "id"))
+    private Set<ConnectorCapability> capabilities = new HashSet<>();
 
     /**
      * The main configuration for the connector instance. This is directly implemented by the Configuration bean class
@@ -118,7 +118,7 @@ public class JPAConnInstance extends AbstractEntity<Long> implements ConnInstanc
      * External resources associated to the connector.
      */
     @OneToMany(cascade = { CascadeType.ALL }, mappedBy = "connector")
-    private List<JPAExternalResource> resources;
+    private List<JPAExternalResource> resources = new ArrayList<>();
 
     /**
      * Connector request timeout. It is not applied in case of sync, full reconciliation and search.
@@ -128,13 +128,6 @@ public class JPAConnInstance extends AbstractEntity<Long> implements ConnInstanc
 
     private JPAConnPoolConf poolConf;
 
-    public JPAConnInstance() {
-        super();
-
-        capabilities = new HashSet<>();
-        resources = new ArrayList<>();
-    }
-
     @Override
     public Long getKey() {
         return id;
@@ -181,7 +174,7 @@ public class JPAConnInstance extends AbstractEntity<Long> implements ConnInstanc
     }
 
     @Override
-    public Set<ConnConfProperty> getConfiguration() {
+    public Set<ConnConfProperty> getConf() {
         Set<ConnConfProperty> configuration = new HashSet<>();
         if (!StringUtils.isBlank(jsonConf)) {
             CollectionUtils.addAll(configuration, POJOHelper.deserialize(jsonConf, ConnConfProperty[].class));
@@ -191,8 +184,8 @@ public class JPAConnInstance extends AbstractEntity<Long> implements ConnInstanc
     }
 
     @Override
-    public void setConfiguration(final Set<ConnConfProperty> configuration) {
-        jsonConf = POJOHelper.serialize(new HashSet<>(configuration));
+    public void setConf(final Set<ConnConfProperty> conf) {
+        jsonConf = POJOHelper.serialize(new HashSet<>(conf));
     }
 
     @Override
@@ -211,29 +204,19 @@ public class JPAConnInstance extends AbstractEntity<Long> implements ConnInstanc
     }
 
     @Override
-    public boolean addResource(final ExternalResource resource) {
+    public boolean add(final ExternalResource resource) {
         checkType(resource, JPAExternalResource.class);
         return this.resources.contains((JPAExternalResource) resource)
                 || this.resources.add((JPAExternalResource) resource);
     }
 
     @Override
-    public boolean removeResource(final ExternalResource resource) {
+    public boolean remove(final ExternalResource resource) {
         checkType(resource, JPAExternalResource.class);
         return this.resources.remove((JPAExternalResource) resource);
     }
 
     @Override
-    public boolean addCapability(final ConnectorCapability capabitily) {
-        return capabilities.add(capabitily);
-    }
-
-    @Override
-    public boolean removeCapability(final ConnectorCapability capabitily) {
-        return capabilities.remove(capabitily);
-    }
-
-    @Override
     public Set<ConnectorCapability> getCapabilities() {
         return capabilities;
     }

http://git-wip-us.apache.org/repos/asf/syncope/blob/1347c108/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/resource/JPAExternalResource.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/resource/JPAExternalResource.java b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/resource/JPAExternalResource.java
index de3931e..393338b 100644
--- a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/resource/JPAExternalResource.java
+++ b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/resource/JPAExternalResource.java
@@ -44,6 +44,7 @@ import org.apache.commons.collections4.CollectionUtils;
 import org.apache.commons.collections4.Predicate;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.syncope.common.lib.types.ConnConfProperty;
+import org.apache.syncope.common.lib.types.ConnectorCapability;
 import org.apache.syncope.common.lib.types.TraceLevel;
 import org.apache.syncope.core.persistence.api.entity.policy.AccountPolicy;
 import org.apache.syncope.core.persistence.api.entity.ConnInstance;
@@ -153,6 +154,20 @@ public class JPAExternalResource extends AbstractAnnotatedEntity<String> impleme
     @Lob
     private String jsonConf;
 
+    @NotNull
+    @Basic
+    @Min(0)
+    @Max(1)
+    private Integer overrideCapabilities;
+
+    @ElementCollection(fetch = FetchType.EAGER)
+    @Enumerated(EnumType.STRING)
+    @Column(name = "capabilityOverride")
+    @CollectionTable(name = "ExternalResource_capabilitiesOverride",
+            joinColumns =
+            @JoinColumn(name = "resource_name", referencedColumnName = "name"))
+    private Set<ConnectorCapability> capabilitiesOverride = new HashSet<>();
+
     /**
      * (Optional) classes for PropagationAction.
      */
@@ -163,9 +178,6 @@ public class JPAExternalResource extends AbstractAnnotatedEntity<String> impleme
             @JoinColumn(name = "resource_name", referencedColumnName = "name"))
     private List<String> propagationActionsClassNames = new ArrayList<>();
 
-    /**
-     * Default constructor.
-     */
     public JPAExternalResource() {
         super();
 
@@ -173,6 +185,7 @@ public class JPAExternalResource extends AbstractAnnotatedEntity<String> impleme
         propagationPrimary = 0;
         propagationPriority = 0;
         randomPwdIfNotProvided = 0;
+        overrideCapabilities = 0;
 
         createTraceLevel = TraceLevel.FAILURES;
         updateTraceLevel = TraceLevel.FAILURES;
@@ -357,18 +370,33 @@ public class JPAExternalResource extends AbstractAnnotatedEntity<String> impleme
     }
 
     @Override
-    public Set<ConnConfProperty> getConnInstanceConfiguration() {
-        Set<ConnConfProperty> configuration = new HashSet<>();
+    public Set<ConnConfProperty> getConfOverride() {
+        Set<ConnConfProperty> confOverride = new HashSet<>();
         if (!StringUtils.isBlank(jsonConf)) {
-            CollectionUtils.addAll(configuration, POJOHelper.deserialize(jsonConf, ConnConfProperty[].class));
+            CollectionUtils.addAll(confOverride, POJOHelper.deserialize(jsonConf, ConnConfProperty[].class));
         }
 
-        return configuration;
+        return confOverride;
+    }
+
+    @Override
+    public void setConfOverride(final Set<ConnConfProperty> confOverride) {
+        jsonConf = POJOHelper.serialize(new HashSet<>(confOverride));
+    }
+
+    @Override
+    public boolean isOverrideCapabilities() {
+        return isBooleanAsInteger(overrideCapabilities);
+    }
+
+    @Override
+    public void setOverrideCapabilities(final boolean overrideCapabilities) {
+        this.overrideCapabilities = getBooleanAsInteger(overrideCapabilities);
     }
 
     @Override
-    public void setConnInstanceConfiguration(final Set<ConnConfProperty> properties) {
-        jsonConf = POJOHelper.serialize(new HashSet<>(properties));
+    public Set<ConnectorCapability> getCapabilitiesOverride() {
+        return capabilitiesOverride;
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/syncope/blob/1347c108/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/DummyConnectorRegistry.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/DummyConnectorRegistry.java b/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/DummyConnectorRegistry.java
index 91618d2..f0b892b 100644
--- a/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/DummyConnectorRegistry.java
+++ b/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/DummyConnectorRegistry.java
@@ -18,10 +18,7 @@
  */
 package org.apache.syncope.core.persistence.jpa;
 
-import java.util.Set;
-import org.apache.syncope.common.lib.types.ConnConfProperty;
 import org.apache.syncope.core.persistence.api.dao.NotFoundException;
-import org.apache.syncope.core.persistence.api.entity.ConnInstance;
 import org.apache.syncope.core.persistence.api.entity.resource.ExternalResource;
 import org.apache.syncope.core.provisioning.api.ConnectorRegistry;
 import org.springframework.stereotype.Component;
@@ -30,15 +27,7 @@ import org.springframework.stereotype.Component;
 public class DummyConnectorRegistry implements ConnectorRegistry {
 
     @Override
-    public ConnInstance getOverriddenConnInstance(
-            final ConnInstance connInstance, final Set<ConnConfProperty> overridden) {
-
-        return connInstance;
-    }
-
-    @Override
-    public void registerConnector(final ExternalResource resource)
-            throws NotFoundException {
+    public void registerConnector(final ExternalResource resource) throws NotFoundException {
     }
 
     @Override


Mime
View raw message