You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@syncope.apache.org by il...@apache.org on 2013/02/20 12:27:05 UTC

svn commit: r1448090 [2/2] - in /syncope/trunk: client/src/main/java/org/apache/syncope/client/services/proxy/ common/src/main/java/org/apache/syncope/common/services/ common/src/main/java/org/apache/syncope/common/types/ console/src/main/java/org/apac...

Modified: syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/controller/ConnInstanceController.java
URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/controller/ConnInstanceController.java?rev=1448090&r1=1448089&r2=1448090&view=diff
==============================================================================
--- syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/controller/ConnInstanceController.java (original)
+++ syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/controller/ConnInstanceController.java Wed Feb 20 11:27:04 2013
@@ -20,13 +20,10 @@ package org.apache.syncope.core.rest.con
 
 import java.util.ArrayList;
 import java.util.Collections;
-import java.util.HashSet;
 import java.util.List;
 import java.util.Locale;
 import java.util.Set;
-
 import javax.servlet.http.HttpServletResponse;
-
 import org.apache.commons.lang.StringUtils;
 import org.apache.syncope.common.to.ConnBundleTO;
 import org.apache.syncope.common.to.ConnInstanceTO;
@@ -42,13 +39,12 @@ import org.apache.syncope.core.audit.Aud
 import org.apache.syncope.core.persistence.beans.ConnInstance;
 import org.apache.syncope.core.persistence.beans.ExternalResource;
 import org.apache.syncope.core.persistence.dao.ConnInstanceDAO;
-import org.apache.syncope.core.persistence.dao.MissingConfKeyException;
 import org.apache.syncope.core.persistence.dao.NotFoundException;
 import org.apache.syncope.core.persistence.dao.ResourceDAO;
+import org.apache.syncope.core.propagation.Connector;
 import org.apache.syncope.core.propagation.ConnectorFactory;
-import org.apache.syncope.core.propagation.SyncopeConnector;
 import org.apache.syncope.core.rest.data.ConnInstanceDataBinder;
-import org.apache.syncope.core.util.ConnBundleManager;
+import org.apache.syncope.core.util.ConnIdBundleManager;
 import org.identityconnectors.common.l10n.CurrentLocale;
 import org.identityconnectors.framework.api.ConfigurationProperties;
 import org.identityconnectors.framework.api.ConnectorInfo;
@@ -84,29 +80,24 @@ public class ConnInstanceController exte
     private ConnInstanceDataBinder binder;
 
     @Autowired
-    private ConnBundleManager bundleManager;
-
-    @Autowired
-    private ConnectorFactory connLoader;
+    private ConnectorFactory connFactory;
 
     @PreAuthorize("hasRole('CONNECTOR_CREATE')")
     @RequestMapping(method = RequestMethod.POST, value = "/create")
-    public ConnInstanceTO create(final HttpServletResponse response, @RequestBody final ConnInstanceTO connectorTO)
-            throws SyncopeClientCompositeErrorException, NotFoundException {
-
-        LOG.debug("ConnInstance create called with configuration {}", connectorTO);
-
-        ConnInstance connInstance = binder.getConnInstance(connectorTO);
+    public ConnInstanceTO create(final HttpServletResponse response, @RequestBody final ConnInstanceTO connInstanceTO) {
+        LOG.debug("ConnInstance create called with configuration {}", connInstanceTO);
 
+        ConnInstance connInstance = binder.getConnInstance(connInstanceTO);
         try {
             connInstance = connInstanceDAO.save(connInstance);
             auditManager.audit(Category.connector, ConnectorSubCategory.create, Result.success,
                     "Successfully created connector instance: " + connInstance.getDisplayName());
         } catch (Exception e) {
             auditManager.audit(Category.connector, ConnectorSubCategory.create, Result.failure,
-                    "Could not create connector instance: " + connectorTO.getDisplayName(), e);
+                    "Could not create connector instance: " + connInstanceTO.getDisplayName(), e);
 
-            SyncopeClientCompositeErrorException scce = new SyncopeClientCompositeErrorException(HttpStatus.BAD_REQUEST);
+            SyncopeClientCompositeErrorException scce =
+                    new SyncopeClientCompositeErrorException(HttpStatus.BAD_REQUEST);
 
             SyncopeClientException invalidConnInstance = new SyncopeClientException(
                     SyncopeClientExceptionType.InvalidConnInstance);
@@ -122,22 +113,20 @@ public class ConnInstanceController exte
 
     @PreAuthorize("hasRole('CONNECTOR_UPDATE')")
     @RequestMapping(method = RequestMethod.POST, value = "/update")
-    public ConnInstanceTO update(@RequestBody final ConnInstanceTO connectorTO)
-            throws SyncopeClientCompositeErrorException, NotFoundException {
-
-        LOG.debug("Connector update called with configuration {}", connectorTO);
-
-        ConnInstance connInstance = binder.updateConnInstance(connectorTO.getId(), connectorTO);
+    public ConnInstanceTO update(@RequestBody final ConnInstanceTO connInstanceTO) {
+        LOG.debug("Connector update called with configuration {}", connInstanceTO);
 
+        ConnInstance connInstance = binder.updateConnInstance(connInstanceTO.getId(), connInstanceTO);
         try {
             connInstance = connInstanceDAO.save(connInstance);
             auditManager.audit(Category.connector, ConnectorSubCategory.update, Result.success,
                     "Successfully update connector instance: " + connInstance.getDisplayName());
         } catch (Exception e) {
             auditManager.audit(Category.connector, ConnectorSubCategory.create, Result.failure,
-                    "Could not update connector instance: " + connectorTO.getDisplayName(), e);
+                    "Could not update connector instance: " + connInstanceTO.getDisplayName(), e);
 
-            SyncopeClientCompositeErrorException scce = new SyncopeClientCompositeErrorException(HttpStatus.BAD_REQUEST);
+            SyncopeClientCompositeErrorException scce =
+                    new SyncopeClientCompositeErrorException(HttpStatus.BAD_REQUEST);
 
             SyncopeClientException invalidConnInstance = new SyncopeClientException(
                     SyncopeClientExceptionType.InvalidConnInstance);
@@ -151,17 +140,17 @@ public class ConnInstanceController exte
     }
 
     @PreAuthorize("hasRole('CONNECTOR_DELETE')")
-    @RequestMapping(method = RequestMethod.GET, value = "/delete/{connectorId}")
-    public ConnInstanceTO delete(@PathVariable("connectorId") Long connectorId)
-            throws NotFoundException {
+    @RequestMapping(method = RequestMethod.GET, value = "/delete/{connInstanceId}")
+    public ConnInstanceTO delete(@PathVariable("connInstanceId") final Long connInstanceId) {
 
-        ConnInstance connInstance = connInstanceDAO.find(connectorId);
+        ConnInstance connInstance = connInstanceDAO.find(connInstanceId);
         if (connInstance == null) {
-            throw new NotFoundException("Connector '" + connectorId + "'");
+            throw new NotFoundException("Connector '" + connInstanceId + "'");
         }
 
         if (!connInstance.getResources().isEmpty()) {
-            SyncopeClientCompositeErrorException scce = new SyncopeClientCompositeErrorException(HttpStatus.BAD_REQUEST);
+            SyncopeClientCompositeErrorException scce =
+                    new SyncopeClientCompositeErrorException(HttpStatus.BAD_REQUEST);
 
             SyncopeClientException invalidConnInstance = new SyncopeClientException(
                     SyncopeClientExceptionType.ExistingResource);
@@ -175,9 +164,9 @@ public class ConnInstanceController exte
 
         ConnInstanceTO connToDelete = binder.getConnInstanceTO(connInstance);
 
-        connInstanceDAO.delete(connectorId);
+        connInstanceDAO.delete(connInstanceId);
         auditManager.audit(Category.connector, ConnectorSubCategory.delete, Result.success,
-                "Successfully deleted connector instance: " + connectorId);
+                "Successfully deleted connector instance: " + connInstanceId);
 
         return connToDelete;
     }
@@ -211,14 +200,12 @@ public class ConnInstanceController exte
     }
 
     @PreAuthorize("hasRole('CONNECTOR_READ')")
-    @RequestMapping(method = RequestMethod.GET, value = "/read/{connectorId}")
+    @RequestMapping(method = RequestMethod.GET, value = "/read/{connInstanceId}")
     @Transactional(readOnly = true)
-    public ConnInstanceTO read(@PathVariable("connectorId") Long connectorId)
-            throws NotFoundException {
-
-        ConnInstance connInstance = connInstanceDAO.find(connectorId);
+    public ConnInstanceTO read(@PathVariable("connInstanceId") final Long connInstanceId) {
+        ConnInstance connInstance = connInstanceDAO.find(connInstanceId);
         if (connInstance == null) {
-            throw new NotFoundException("Connector '" + connectorId + "'");
+            throw new NotFoundException("Connector '" + connInstanceId + "'");
         }
 
         auditManager.audit(Category.connector, ConnectorSubCategory.read, Result.success,
@@ -230,16 +217,14 @@ public class ConnInstanceController exte
     @PreAuthorize("hasRole('CONNECTOR_READ')")
     @RequestMapping(method = RequestMethod.GET, value = "/bundle/list")
     @Transactional(readOnly = true)
-    public List<ConnBundleTO> getBundles(@RequestParam(value = "lang", required = false) final String lang)
-            throws NotFoundException, MissingConfKeyException {
-
+    public List<ConnBundleTO> getBundles(@RequestParam(value = "lang", required = false) final String lang) {
         if (StringUtils.isBlank(lang)) {
             CurrentLocale.set(Locale.ENGLISH);
         } else {
             CurrentLocale.set(new Locale(lang));
         }
 
-        ConnectorInfoManager manager = bundleManager.getConnectorManager();
+        ConnectorInfoManager manager = ConnIdBundleManager.getConnManager();
 
         List<ConnectorInfo> bundles = manager.getConnectorInfos();
 
@@ -259,14 +244,14 @@ public class ConnInstanceController exte
 
                 ConnectorKey key = bundle.getConnectorKey();
 
-                LOG.debug("\nBundle name: {}" + "\nBundle version: {}" + "\nBundle class: {}",
+                LOG.debug("Bundle name: {}\nBundle version: {}\nBundle class: {}",
                         key.getBundleName(), key.getBundleVersion(), key.getConnectorName());
 
                 connectorBundleTO.setBundleName(key.getBundleName());
                 connectorBundleTO.setConnectorName(key.getConnectorName());
                 connectorBundleTO.setVersion(key.getBundleVersion());
 
-                ConfigurationProperties properties = bundleManager.getConfigurationProperties(bundle);
+                ConfigurationProperties properties = ConnIdBundleManager.getConfProps(bundle);
 
                 for (String propName : properties.getPropertyNames()) {
                     ConnConfPropSchema connConfPropSchema = new ConnConfPropSchema();
@@ -313,25 +298,23 @@ public class ConnInstanceController exte
     @PreAuthorize("hasRole('CONNECTOR_READ')")
     @RequestMapping(method = RequestMethod.POST, value = "/schema/list")
     @Transactional(readOnly = true)
-    public List<String> getSchemaNames(final HttpServletResponse response,
-            @RequestBody final ConnInstanceTO connectorTO,
-            @RequestParam(required = false, value = "showall", defaultValue = "false") final boolean showall)
-            throws NotFoundException {
+    public List<String> getSchemaNames(@RequestBody final ConnInstanceTO connInstanceTO,
+            @RequestParam(required = false, value = "showall", defaultValue = "false") final boolean showall) {
 
-        final ConnInstance connInstance = connInstanceDAO.find(connectorTO.getId());
+        final ConnInstance connInstance = connInstanceDAO.find(connInstanceTO.getId());
         if (connInstance == null) {
-            throw new NotFoundException("Connector '" + connectorTO.getId() + "'");
+            throw new NotFoundException("Connector '" + connInstanceTO.getId() + "'");
         }
 
         // consider the possibility to receive overridden properties only
-        final Set<ConnConfProperty> conf = mergeConnConfProperties(connectorTO.getConfiguration(),
+        final 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 schema names.
-        final List<String> result = new ArrayList<String>(connLoader.createConnectorBean(connInstance, conf).
-                getSchema(showall));
+        final List<String> result =
+                new ArrayList<String>(connFactory.createConnector(connInstance, conf).getSchema(showall));
         Collections.sort(result);
 
         auditManager.audit(Category.connector, ConnectorSubCategory.getSchemaNames, Result.success,
@@ -342,14 +325,12 @@ public class ConnInstanceController exte
     }
 
     @PreAuthorize("hasRole('CONNECTOR_READ')")
-    @RequestMapping(method = RequestMethod.GET, value = "/{connectorId}/configurationProperty/list")
+    @RequestMapping(method = RequestMethod.GET, value = "/{connInstanceId}/configurationProperty/list")
     @Transactional(readOnly = true)
-    public List<ConnConfProperty> getConfigurationProperties(@PathVariable("connectorId") final Long connectorId)
-            throws NotFoundException {
-
-        final ConnInstance connInstance = connInstanceDAO.find(connectorId);
+    public List<ConnConfProperty> getConfigurationProperties(@PathVariable("connInstanceId") final Long connInstanceId) {
+        final ConnInstance connInstance = connInstanceDAO.find(connInstanceId);
         if (connInstance == null) {
-            throw new NotFoundException("Connector '" + connectorId + "'");
+            throw new NotFoundException("Connector '" + connInstanceId + "'");
         }
 
         List<ConnConfProperty> result = new ArrayList<ConnConfProperty>(connInstance.getConfiguration());
@@ -364,11 +345,9 @@ public class ConnInstanceController exte
     @PreAuthorize("hasRole('CONNECTOR_READ')")
     @RequestMapping(method = RequestMethod.POST, value = "/check")
     @Transactional(readOnly = true)
-    public ModelAndView check(final HttpServletResponse response, @RequestBody final ConnInstanceTO connectorTO)
-            throws SyncopeClientCompositeErrorException, NotFoundException {
-
-        final SyncopeConnector connector =
-                connLoader.createConnectorBean(binder.getConnInstance(connectorTO), connectorTO.getConfiguration());
+    public ModelAndView check(@RequestBody final ConnInstanceTO connInstanceTO) {
+        final Connector connector =
+                connFactory.createConnector(binder.getConnInstance(connInstanceTO), connInstanceTO.getConfiguration());
 
         boolean result;
         try {
@@ -376,10 +355,10 @@ public class ConnInstanceController exte
             result = true;
 
             auditManager.audit(Category.connector, ConnectorSubCategory.check, Result.success,
-                    "Successfully checked connector: " + connectorTO);
+                    "Successfully checked connector: " + connInstanceTO);
         } catch (Exception ex) {
             auditManager.audit(Category.connector, ConnectorSubCategory.check, Result.failure,
-                    "Unsuccessful check for connector: " + connectorTO, ex);
+                    "Unsuccessful check for connector: " + connInstanceTO, ex);
 
             LOG.error("Test connection failure {}", ex);
             result = false;
@@ -388,56 +367,31 @@ public class ConnInstanceController exte
         return new ModelAndView().addObject(result);
     }
 
-    /**
-     * Merge connector configuration properties avoiding repetition but giving priority to primary set.
-     *
-     * @param primary primary set.
-     * @param secondary secondary set.
-     * @return merged set.
-     */
-    private Set<ConnConfProperty> mergeConnConfProperties(final Set<ConnConfProperty> primary,
-            final Set<ConnConfProperty> secondary) {
-
-        final Set<ConnConfProperty> conf = new HashSet<ConnConfProperty>();
-
-        // to be used to control managed prop (needed by overridden mechanism)
-        final Set<String> propertyNames = new HashSet<String>();
-
-        // get overridden connector configuration properties
-        for (ConnConfProperty prop : primary) {
-            if (!propertyNames.contains(prop.getSchema().getName())) {
-                conf.add(prop);
-                propertyNames.add(prop.getSchema().getName());
-            }
-        }
-
-        // get connector configuration properties
-        for (ConnConfProperty prop : secondary) {
-            if (!propertyNames.contains(prop.getSchema().getName())) {
-                conf.add(prop);
-                propertyNames.add(prop.getSchema().getName());
-            }
-        }
-
-        return conf;
-    }
-
     @PreAuthorize("hasRole('CONNECTOR_READ')")
-    @RequestMapping(method = RequestMethod.GET, value = "/{resourceName}/connectorBean")
+    @RequestMapping(method = RequestMethod.GET, value = "/{resourceName}/readByResource")
     @Transactional(readOnly = true)
-    public ConnInstanceTO readConnectorBean(@PathVariable("resourceName") String resourceName)
-            throws NotFoundException {
-
+    public ConnInstanceTO readByResource(@PathVariable("resourceName") final String resourceName) {
         ExternalResource resource = resourceDAO.find(resourceName);
         if (resource == null) {
             throw new NotFoundException("Resource '" + resourceName + "'");
         }
 
-        final SyncopeConnector connector = connLoader.getConnector(resource);
+        final Connector connector = connFactory.getConnector(resource);
 
         auditManager.audit(Category.connector, ConnectorSubCategory.readConnectorBean, Result.success,
                 "Successfully read connector for resource: " + resourceName);
 
         return binder.getConnInstanceTO(connector.getActiveConnInstance());
     }
-}
+
+    @PreAuthorize("hasRole('CONNECTOR_RELOAD')")
+    @RequestMapping(method = RequestMethod.PUT, value = "/reload")
+    @Transactional(readOnly = true)
+    public void reload() {
+        connFactory.unload();
+        connFactory.load();
+
+        auditManager.audit(Category.connector, ConnectorSubCategory.reload, Result.success,
+                "Successfully reloaded all connector bundles and instances");
+    }
+}
\ No newline at end of file

Modified: syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/controller/ResourceController.java
URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/controller/ResourceController.java?rev=1448090&r1=1448089&r2=1448090&view=diff
==============================================================================
--- syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/controller/ResourceController.java (original)
+++ syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/controller/ResourceController.java Wed Feb 20 11:27:04 2013
@@ -39,7 +39,7 @@ import org.apache.syncope.core.persisten
 import org.apache.syncope.core.persistence.dao.NotFoundException;
 import org.apache.syncope.core.persistence.dao.ResourceDAO;
 import org.apache.syncope.core.propagation.ConnectorFactory;
-import org.apache.syncope.core.propagation.SyncopeConnector;
+import org.apache.syncope.core.propagation.Connector;
 import org.apache.syncope.core.rest.data.ResourceDataBinder;
 import org.apache.syncope.core.util.AttributableUtil;
 import org.identityconnectors.framework.common.objects.Attribute;
@@ -215,7 +215,7 @@ public class ResourceController extends 
         AttributableUtil attrUtil = AttributableUtil.getInstance(type);
         ObjectClass objectClass = AttributableType.USER == type ? ObjectClass.ACCOUNT : ObjectClass.GROUP;
 
-        final SyncopeConnector connector = connLoader.getConnector(resource);
+        final Connector connector = connLoader.getConnector(resource);
 
         final ConnectorObject connectorObject = connector.getObject(objectClass, new Uid(objectId),
                 connector.getOperationOptions(attrUtil.getMappingItems(resource, MappingPurpose.BOTH)));
@@ -245,7 +245,7 @@ public class ResourceController extends 
 
         final ConnInstance connInstance = binder.getConnInstance(resourceTO);
 
-        final SyncopeConnector connector = connLoader.createConnectorBean(connInstance, connInstance.getConfiguration());
+        final Connector connector = connLoader.createConnector(connInstance, connInstance.getConfiguration());
 
         boolean result;
         try {

Modified: syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/data/ConnInstanceDataBinder.java
URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/data/ConnInstanceDataBinder.java?rev=1448090&r1=1448089&r2=1448090&view=diff
==============================================================================
--- syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/data/ConnInstanceDataBinder.java (original)
+++ syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/data/ConnInstanceDataBinder.java Wed Feb 20 11:27:04 2013
@@ -18,8 +18,9 @@
  */
 package org.apache.syncope.core.rest.data;
 
+import java.util.HashSet;
 import java.util.Map;
-
+import java.util.Set;
 import org.apache.syncope.common.to.ConnInstanceTO;
 import org.apache.syncope.common.types.ConnConfPropSchema;
 import org.apache.syncope.common.types.ConnConfProperty;
@@ -28,8 +29,7 @@ import org.apache.syncope.common.validat
 import org.apache.syncope.common.validation.SyncopeClientException;
 import org.apache.syncope.core.persistence.beans.ConnInstance;
 import org.apache.syncope.core.persistence.dao.ConnInstanceDAO;
-import org.apache.syncope.core.persistence.dao.NotFoundException;
-import org.apache.syncope.core.util.ConnBundleManager;
+import org.apache.syncope.core.util.ConnIdBundleManager;
 import org.identityconnectors.framework.api.ConfigurationProperties;
 import org.identityconnectors.framework.impl.api.ConfigurationPropertyImpl;
 import org.springframework.beans.BeanUtils;
@@ -43,14 +43,43 @@ public class ConnInstanceDataBinder {
     private static final String[] IGNORE_PROPERTIES = {"id", "resources"};
 
     @Autowired
-    private ConnInstanceDAO connectorInstanceDAO;
+    private ConnInstanceDAO connInstanceDAO;
 
-    @Autowired
-    private ConnBundleManager connBundleManager;
+    /**
+     * Merge connector configuration properties avoiding repetition but giving priority to primary set.
+     *
+     * @param primary primary set.
+     * @param secondary secondary set.
+     * @return merged set.
+     */
+    public Set<ConnConfProperty> mergeConnConfProperties(final Set<ConnConfProperty> primary,
+            final Set<ConnConfProperty> secondary) {
+
+        final Set<ConnConfProperty> conf = new HashSet<ConnConfProperty>();
+
+        // to be used to control managed prop (needed by overridden mechanism)
+        final Set<String> propertyNames = new HashSet<String>();
+
+        // get overridden connector configuration properties
+        for (ConnConfProperty prop : primary) {
+            if (!propertyNames.contains(prop.getSchema().getName())) {
+                conf.add(prop);
+                propertyNames.add(prop.getSchema().getName());
+            }
+        }
 
-    public ConnInstance getConnInstance(final ConnInstanceTO connInstanceTO)
-            throws SyncopeClientCompositeErrorException {
+        // get connector configuration properties
+        for (ConnConfProperty prop : secondary) {
+            if (!propertyNames.contains(prop.getSchema().getName())) {
+                conf.add(prop);
+                propertyNames.add(prop.getSchema().getName());
+            }
+        }
+
+        return conf;
+    }
 
+    public ConnInstance getConnInstance(final ConnInstanceTO connInstanceTO) {
         SyncopeClientCompositeErrorException scee = new SyncopeClientCompositeErrorException(HttpStatus.BAD_REQUEST);
 
         SyncopeClientException requiredValuesMissing = new SyncopeClientException(
@@ -90,11 +119,8 @@ public class ConnInstanceDataBinder {
         return connectorInstance;
     }
 
-    public ConnInstance updateConnInstance(final long connInstanceId, final ConnInstanceTO connInstanceTO)
-            throws SyncopeClientCompositeErrorException {
-
-        SyncopeClientCompositeErrorException compositeErrorException = new SyncopeClientCompositeErrorException(
-                HttpStatus.BAD_REQUEST);
+    public ConnInstance updateConnInstance(final long connInstanceId, final ConnInstanceTO connInstanceTO) {
+        SyncopeClientCompositeErrorException scce = new SyncopeClientCompositeErrorException(HttpStatus.BAD_REQUEST);
 
         SyncopeClientException requiredValuesMissing = new SyncopeClientException(
                 SyncopeClientExceptionType.RequiredValuesMissing);
@@ -103,7 +129,7 @@ public class ConnInstanceDataBinder {
             requiredValuesMissing.addElement("connector id");
         }
 
-        ConnInstance connInstance = connectorInstanceDAO.find(connInstanceId);
+        ConnInstance connInstance = connInstanceDAO.find(connInstanceId);
 
         if (connInstanceTO.getBundleName() != null) {
             connInstance.setBundleName(connInstanceTO.getBundleName());
@@ -124,7 +150,7 @@ public class ConnInstanceDataBinder {
         if (connInstanceTO.getDisplayName() != null) {
             connInstance.setDisplayName(connInstanceTO.getDisplayName());
         }
-        
+
         if (connInstanceTO.getConnRequestTimeout() != null) {
             connInstance.setConnRequestTimeout(connInstanceTO.getConnRequestTimeout());
         }
@@ -132,26 +158,24 @@ public class ConnInstanceDataBinder {
         connInstance.setCapabilities(connInstanceTO.getCapabilities());
 
         if (!requiredValuesMissing.isEmpty()) {
-            compositeErrorException.addException(requiredValuesMissing);
+            scce.addException(requiredValuesMissing);
         }
 
         // Throw composite exception if there is at least one element set
         // in the composing exceptions
-        if (compositeErrorException.hasExceptions()) {
-            throw compositeErrorException;
+        if (scce.hasExceptions()) {
+            throw scce;
         }
 
         return connInstance;
     }
 
-    public ConnInstanceTO getConnInstanceTO(final ConnInstance connInstance)
-            throws NotFoundException {
-
+    public ConnInstanceTO getConnInstanceTO(final ConnInstance connInstance) {
         ConnInstanceTO connInstanceTO = new ConnInstanceTO();
-        connInstanceTO.setId(connInstance.getId() != null ? connInstance.getId().longValue() : 0L);
+        connInstanceTO.setId(connInstance.getId() == null ? 0L : connInstance.getId().longValue());
 
         // retrieve the ConfigurationProperties.
-        ConfigurationProperties properties = connBundleManager.getConfigurationProperties(
+        ConfigurationProperties properties = ConnIdBundleManager.getConfProps(
                 connInstance.getBundleName(), connInstance.getVersion(), connInstance.getConnectorName());
 
         BeanUtils.copyProperties(connInstance, connInstanceTO, IGNORE_PROPERTIES);
@@ -162,7 +186,10 @@ public class ConnInstanceDataBinder {
             ConfigurationPropertyImpl configurationProperty =
                     (ConfigurationPropertyImpl) properties.getProperty(propName);
 
-            if (!connInstanceToConfMap.containsKey(propName)) {
+            if (connInstanceToConfMap.containsKey(propName)) {
+                connInstanceToConfMap.get(propName).getSchema().setDisplayName(
+                        configurationProperty.getDisplayName(propName));
+            } else {
                 ConnConfPropSchema connConfPropSchema = new ConnConfPropSchema();
                 connConfPropSchema.setName(configurationProperty.getName());
                 connConfPropSchema.setDisplayName(configurationProperty.getDisplayName(propName));
@@ -175,9 +202,6 @@ public class ConnInstanceDataBinder {
                 ConnConfProperty property = new ConnConfProperty();
                 property.setSchema(connConfPropSchema);
                 connInstanceTO.addConfiguration(property);
-            } else {
-                connInstanceToConfMap.get(propName).getSchema().setDisplayName(
-                        configurationProperty.getDisplayName(propName));
             }
         }
         return connInstanceTO;

Modified: syncope/trunk/core/src/main/java/org/apache/syncope/core/services/ConnectorServiceImpl.java
URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/main/java/org/apache/syncope/core/services/ConnectorServiceImpl.java?rev=1448090&r1=1448089&r2=1448090&view=diff
==============================================================================
--- syncope/trunk/core/src/main/java/org/apache/syncope/core/services/ConnectorServiceImpl.java (original)
+++ syncope/trunk/core/src/main/java/org/apache/syncope/core/services/ConnectorServiceImpl.java Wed Feb 20 11:27:04 2013
@@ -21,10 +21,8 @@ package org.apache.syncope.core.services
 import java.net.URI;
 import java.util.ArrayList;
 import java.util.List;
-
 import javax.ws.rs.core.Response;
 import javax.ws.rs.core.UriInfo;
-
 import org.apache.syncope.common.SyncopeConstants;
 import org.apache.syncope.common.services.ConnectorService;
 import org.apache.syncope.common.to.ConnBundleTO;
@@ -39,37 +37,37 @@ import org.springframework.stereotype.Se
 public class ConnectorServiceImpl implements ConnectorService, ContextAware {
 
     @Autowired
-    private ConnInstanceController connectorController;
+    private ConnInstanceController connInstanceController;
 
     private UriInfo uriInfo;
 
     @Override
-    public Response create(final ConnInstanceTO connectorTO) {
-        ConnInstanceTO connector = connectorController.create(new DummyHTTPServletResponse(), connectorTO);
-        URI location = uriInfo.getAbsolutePathBuilder().path(connector.getId() + "").build();
-        return Response.created(location).header(SyncopeConstants.REST_HEADER_ID, connector.getId()).build();
+    public Response create(final ConnInstanceTO connInstanceTO) {
+        ConnInstanceTO connInstance = connInstanceController.create(new DummyHTTPServletResponse(), connInstanceTO);
+        URI location = uriInfo.getAbsolutePathBuilder().path(connInstance.getId() + "").build();
+        return Response.created(location).header(SyncopeConstants.REST_HEADER_ID, connInstance.getId()).build();
     }
 
     @Override
-    public void delete(final Long connectorId) {
-        connectorController.delete(connectorId);
+    public void delete(final Long connInstanceId) {
+        connInstanceController.delete(connInstanceId);
     }
 
     @Override
     public List<ConnBundleTO> getBundles(final String lang) {
-        return connectorController.getBundles(lang);
+        return connInstanceController.getBundles(lang);
     }
 
     @Override
-    public List<ConnConfProperty> getConfigurationProperties(final Long connectorId) {
-        return connectorController.getConfigurationProperties(connectorId);
+    public List<ConnConfProperty> getConfigurationProperties(final Long connInstanceId) {
+        return connInstanceController.getConfigurationProperties(connInstanceId);
     }
 
     @Override
-    public List<SchemaTO> getSchemaNames(final Long connectorId, final ConnInstanceTO connectorTO,
+    public List<SchemaTO> getSchemaNames(final Long connInstanceId, final ConnInstanceTO connInstanceTO,
             final boolean showall) {
-        List<String> schemaNames = connectorController.getSchemaNames(new DummyHTTPServletResponse(), connectorTO,
-                showall);
+
+        List<String> schemaNames = connInstanceController.getSchemaNames(connInstanceTO, showall);
         List<SchemaTO> schemas = new ArrayList<SchemaTO>();
         for (String name : schemaNames) {
             SchemaTO schemaTO = new SchemaTO();
@@ -81,32 +79,36 @@ public class ConnectorServiceImpl implem
 
     @Override
     public List<ConnInstanceTO> list(final String lang) {
-        return connectorController.list(lang);
+        return connInstanceController.list(lang);
     }
 
     @Override
-    public ConnInstanceTO read(final Long connectorId) {
-        return connectorController.read(connectorId);
+    public ConnInstanceTO read(final Long connInstanceId) {
+        return connInstanceController.read(connInstanceId);
     }
 
     @Override
-    public ConnInstanceTO readConnectorBean(final String resourceName) {
-        return connectorController.readConnectorBean(resourceName);
+    public ConnInstanceTO readByResource(final String resourceName) {
+        return connInstanceController.readByResource(resourceName);
     }
 
     @Override
-    public void update(final Long connectorId, final ConnInstanceTO connectorTO) {
-        connectorController.update(connectorTO);
+    public void update(final Long connInstanceId, final ConnInstanceTO connInstanceTO) {
+        connInstanceController.update(connInstanceTO);
     }
 
     @Override
-    public boolean check(final ConnInstanceTO connectorTO) {
-        return (Boolean) connectorController.check(new DummyHTTPServletResponse(), connectorTO).getModel().values()
-                .iterator().next();
+    public boolean check(final ConnInstanceTO connInstanceTO) {
+        return (Boolean) connInstanceController.check(connInstanceTO).getModel().values().iterator().next();
     }
 
     @Override
     public void setUriInfo(final UriInfo ui) {
         this.uriInfo = ui;
     }
+
+    @Override
+    public void reload() {
+        connInstanceController.reload();
+    }
 }

Modified: syncope/trunk/core/src/main/java/org/apache/syncope/core/sync/impl/LDAPMembershipSyncActions.java
URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/main/java/org/apache/syncope/core/sync/impl/LDAPMembershipSyncActions.java?rev=1448090&r1=1448089&r2=1448090&view=diff
==============================================================================
--- syncope/trunk/core/src/main/java/org/apache/syncope/core/sync/impl/LDAPMembershipSyncActions.java (original)
+++ syncope/trunk/core/src/main/java/org/apache/syncope/core/sync/impl/LDAPMembershipSyncActions.java Wed Feb 20 11:27:04 2013
@@ -37,7 +37,7 @@ import org.apache.syncope.core.persisten
 import org.apache.syncope.core.persistence.dao.RoleDAO;
 import org.apache.syncope.core.propagation.PropagationException;
 import org.apache.syncope.core.propagation.PropagationTaskExecutor;
-import org.apache.syncope.core.propagation.SyncopeConnector;
+import org.apache.syncope.core.propagation.Connector;
 import org.apache.syncope.core.propagation.impl.PropagationManager;
 import org.apache.syncope.core.sync.DefaultSyncActions;
 import org.apache.syncope.core.sync.SyncResult;
@@ -151,7 +151,7 @@ public class LDAPMembershipSyncActions e
      * @return value of attribute returned by getGroupMembershipAttrName()
      * @see getGroupMembershipAttrName()
      */
-    protected List<Object> getMembAttrValues(final SyncDelta delta, final SyncopeConnector connector) {
+    protected List<Object> getMembAttrValues(final SyncDelta delta, final Connector connector) {
         List<Object> result = Collections.<Object>emptyList();
 
         // first, try to read the configured attribute from delta, returned by the ongoing synchronization
@@ -212,7 +212,7 @@ public class LDAPMembershipSyncActions e
 
         final SyncTask task = handler.getSyncTask();
         final ExternalResource resource = task.getResource();
-        final SyncopeConnector connector = handler.getConnector();
+        final Connector connector = handler.getConnector();
 
         for (Object membValue : getMembAttrValues(delta, connector)) {
             Long userId = handler.findMatchingAttributableId(ObjectClass.ACCOUNT, membValue.toString());

Modified: syncope/trunk/core/src/main/java/org/apache/syncope/core/sync/impl/SyncJob.java
URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/main/java/org/apache/syncope/core/sync/impl/SyncJob.java?rev=1448090&r1=1448089&r2=1448090&view=diff
==============================================================================
--- syncope/trunk/core/src/main/java/org/apache/syncope/core/sync/impl/SyncJob.java (original)
+++ syncope/trunk/core/src/main/java/org/apache/syncope/core/sync/impl/SyncJob.java Wed Feb 20 11:27:04 2013
@@ -37,10 +37,8 @@ import org.apache.syncope.core.persisten
 import org.apache.syncope.core.persistence.dao.EntitlementDAO;
 import org.apache.syncope.core.persistence.dao.NotFoundException;
 import org.apache.syncope.core.persistence.dao.ResourceDAO;
-import org.apache.syncope.core.persistence.dao.RoleDAO;
-import org.apache.syncope.core.persistence.dao.UserDAO;
 import org.apache.syncope.core.propagation.ConnectorFactory;
-import org.apache.syncope.core.propagation.SyncopeConnector;
+import org.apache.syncope.core.propagation.Connector;
 import org.apache.syncope.core.quartz.AbstractTaskJob;
 import org.apache.syncope.core.rest.controller.UnauthorizedRoleException;
 import org.apache.syncope.core.sync.SyncActions;
@@ -72,7 +70,7 @@ public class SyncJob extends AbstractTas
      * ConnInstance loader.
      */
     @Autowired
-    private ConnectorFactory connInstanceLoader;
+    private ConnectorFactory connFactory;
 
     /**
      * Resource DAO.
@@ -87,18 +85,6 @@ public class SyncJob extends AbstractTas
     private EntitlementDAO entitlementDAO;
 
     /**
-     * Role DAO.
-     */
-    @Autowired
-    private UserDAO userDAO;
-
-    /**
-     * Role DAO.
-     */
-    @Autowired
-    private RoleDAO roleDAO;
-
-    /**
      * Role workflow adapter.
      */
     @Autowired
@@ -366,9 +352,9 @@ public class SyncJob extends AbstractTas
         }
         final SyncTask syncTask = (SyncTask) this.task;
 
-        SyncopeConnector connector;
+        Connector connector;
         try {
-            connector = connInstanceLoader.getConnector(syncTask.getResource());
+            connector = connFactory.getConnector(syncTask.getResource());
         } catch (Exception e) {
             final String msg = String.format("Connector instance bean for resource %s and connInstance %s not found",
                     syncTask.getResource(), syncTask.getResource().getConnector());

Modified: syncope/trunk/core/src/main/java/org/apache/syncope/core/sync/impl/SyncopeSyncResultHandler.java
URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/main/java/org/apache/syncope/core/sync/impl/SyncopeSyncResultHandler.java?rev=1448090&r1=1448089&r2=1448090&view=diff
==============================================================================
--- syncope/trunk/core/src/main/java/org/apache/syncope/core/sync/impl/SyncopeSyncResultHandler.java (original)
+++ syncope/trunk/core/src/main/java/org/apache/syncope/core/sync/impl/SyncopeSyncResultHandler.java Wed Feb 20 11:27:04 2013
@@ -63,7 +63,7 @@ import org.apache.syncope.core.persisten
 import org.apache.syncope.core.propagation.PropagationByResource;
 import org.apache.syncope.core.propagation.PropagationException;
 import org.apache.syncope.core.propagation.PropagationTaskExecutor;
-import org.apache.syncope.core.propagation.SyncopeConnector;
+import org.apache.syncope.core.propagation.Connector;
 import org.apache.syncope.core.propagation.impl.PropagationManager;
 import org.apache.syncope.core.rest.controller.UnauthorizedRoleException;
 import org.apache.syncope.core.rest.data.RoleDataBinder;
@@ -179,7 +179,7 @@ public class SyncopeSyncResultHandler im
     /**
      * Syncing connector.
      */
-    private SyncopeConnector connector;
+    private Connector connector;
 
     /**
      * SyncJob actions.
@@ -196,11 +196,11 @@ public class SyncopeSyncResultHandler im
 
     private Map<Long, String> roleOwnerMap = new HashMap<Long, String>();
 
-    public SyncopeConnector getConnector() {
+    public Connector getConnector() {
         return connector;
     }
 
-    public void setConnector(final SyncopeConnector connector) {
+    public void setConnector(final Connector connector) {
         this.connector = connector;
     }
 

Copied: syncope/trunk/core/src/main/java/org/apache/syncope/core/util/ConnIdBundleManager.java (from r1448015, syncope/trunk/core/src/main/java/org/apache/syncope/core/util/ConnBundleManager.java)
URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/main/java/org/apache/syncope/core/util/ConnIdBundleManager.java?p2=syncope/trunk/core/src/main/java/org/apache/syncope/core/util/ConnIdBundleManager.java&p1=syncope/trunk/core/src/main/java/org/apache/syncope/core/util/ConnBundleManager.java&r1=1448015&r2=1448090&rev=1448090&view=diff
==============================================================================
--- syncope/trunk/core/src/main/java/org/apache/syncope/core/util/ConnBundleManager.java (original)
+++ syncope/trunk/core/src/main/java/org/apache/syncope/core/util/ConnIdBundleManager.java Wed Feb 20 11:27:04 2013
@@ -19,13 +19,13 @@
 package org.apache.syncope.core.util;
 
 import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
 import java.net.URL;
 import java.util.ArrayList;
 import java.util.List;
-
-import org.apache.syncope.core.persistence.beans.SyncopeConf;
-import org.apache.syncope.core.persistence.dao.ConfDAO;
-import org.apache.syncope.core.persistence.dao.MissingConfKeyException;
+import java.util.Properties;
+import org.apache.commons.io.IOUtils;
 import org.apache.syncope.core.persistence.dao.NotFoundException;
 import org.identityconnectors.common.IOUtil;
 import org.identityconnectors.framework.api.APIConfiguration;
@@ -36,60 +36,95 @@ import org.identityconnectors.framework.
 import org.identityconnectors.framework.api.ConnectorKey;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Component;
-
-@Component
-public class ConnBundleManager {
 
-    private static final Logger LOG = LoggerFactory.getLogger(ConnBundleManager.class);
+/**
+ * Manage information about ConnId connector bundles.
+ */
+public final class ConnIdBundleManager {
+
+    private static final Logger LOG = LoggerFactory.getLogger(ConnIdBundleManager.class);
+
+    /**
+     * Where to find conf properties for ConnId.
+     */
+    public static final String CONNID_PROPS = "/connid.properties";
+
+    /**
+     * Directory path containing ConnId bundles.
+     */
+    private static String connIdBundlesDir;
+
+    /**
+     * Lock for operating on ConnectorInfoManager shared instance.
+     */
+    private static final Object LOCK = new Object();
+
+    /**
+     * ConnectorInfoManager shared instance.
+     */
+    private static ConnectorInfoManager connManager;
 
-    @Autowired
-    private ConfDAO confDAO;
-
-    public ConnectorInfoManager getConnectorManager() throws NotFoundException, MissingConfKeyException {
-        // 1. Bundles directory
-        SyncopeConf connectorBundleDir = confDAO.find("connid.bundles.directory");
+    static {
+        InputStream propStream = null;
+        try {
+            propStream = ConnIdBundleManager.class.getResourceAsStream(CONNID_PROPS);
+            Properties props = new Properties();
+            props.load(propStream);
+            connIdBundlesDir = props.getProperty("bundles.directory");
+        } catch (Exception e) {
+            LOG.error("Could not load {}", CONNID_PROPS, e);
+        } finally {
+            IOUtils.closeQuietly(propStream);
+        }
+    }
 
-        // 2. Find bundles inside that directory
-        File bundleDirectory = new File(connectorBundleDir.getValue());
+    private static void initConnManager() {
+        // 1. Find bundles inside connidBundlesDir
+        File bundleDirectory = new File(connIdBundlesDir);
         String[] bundleFiles = bundleDirectory.list();
         if (bundleFiles == null) {
-            throw new NotFoundException("Bundles from dir " + connectorBundleDir.getValue());
+            throw new NotFoundException("Connector bundles directory " + connIdBundlesDir);
         }
 
         List<URL> bundleFileURLs = new ArrayList<URL>();
         for (String file : bundleFiles) {
             try {
                 bundleFileURLs.add(IOUtil.makeURL(bundleDirectory, file));
-            } catch (Exception ignore) {
+            } catch (IOException ignore) {
                 // ignore exception and don't add bundle
-                if (LOG.isDebugEnabled()) {
-                    LOG.debug(bundleDirectory.toString() + "/" + file + "\"" + " is not a valid connector bundle.",
-                            ignore);
-                }
+                LOG.debug("{}/{} is not a valid connector bundle", bundleDirectory.toString(), file, ignore);
             }
         }
+
         if (bundleFileURLs.isEmpty()) {
-            throw new NotFoundException("Bundles from dir " + connectorBundleDir.getValue());
+            LOG.warn("No connector bundles found in {}", connIdBundlesDir);
         }
         LOG.debug("Bundle file URLs: {}", bundleFileURLs);
 
-        // 3. Get connector info manager
+        // 2. Get connector info manager
         ConnectorInfoManager manager = ConnectorInfoManagerFactory.getInstance().getLocalManager(
                 bundleFileURLs.toArray(new URL[bundleFileURLs.size()]));
         if (manager == null) {
             throw new NotFoundException("Connector Info Manager");
         }
 
-        return manager;
+        connManager = manager;
+    }
+
+    public static ConnectorInfoManager getConnManager() {
+        synchronized (LOCK) {
+            if (connManager == null) {
+                initConnManager();
+            }
+        }
+        return connManager;
     }
 
-    public ConfigurationProperties getConfigurationProperties(final String bundleName, final String version,
-            final String connectorName) throws NotFoundException {
+    public static ConfigurationProperties getConfProps(
+            final String bundleName, final String bundleVersion, final String connectorName) {
 
-        //Create key for search all properties
-        final ConnectorKey key = new ConnectorKey(bundleName, version, connectorName);
+        // create key for search all properties
+        final ConnectorKey key = new ConnectorKey(bundleName, bundleVersion, connectorName);
         if (key == null) {
             throw new NotFoundException("Connector Key");
         }
@@ -100,21 +135,16 @@ public class ConnBundleManager {
                     + "\nBundle class: " + key.getConnectorName());
         }
 
-        //get the specified connector.
-        ConnectorInfo info;
-        try {
-            info = getConnectorManager().findConnectorInfo(key);
-            if (info == null) {
-                throw new NotFoundException("Connector Info for key " + key);
-            }
-        } catch (MissingConfKeyException e) {
-            throw new NotFoundException("Connector Info for key " + key, e);
+        // get the specified connector
+        ConnectorInfo info = getConnManager().findConnectorInfo(key);
+        if (info == null) {
+            throw new NotFoundException("Connector Info for key " + key);
         }
 
-        return getConfigurationProperties(info);
+        return getConfProps(info);
     }
 
-    public ConfigurationProperties getConfigurationProperties(final ConnectorInfo info) throws NotFoundException {
+    public static ConfigurationProperties getConfProps(final ConnectorInfo info) {
         if (info == null) {
             throw new NotFoundException("Invalid: connector info is null");
         }
@@ -131,14 +161,17 @@ public class ConnBundleManager {
             throw new NotFoundException("Configuration properties");
         }
 
-        // Print out what the properties are (not necessary)
         if (LOG.isDebugEnabled()) {
             for (String propName : properties.getPropertyNames()) {
-                LOG.debug("\nProperty Name: " + properties.getProperty(propName).getName()
-                        + "\nProperty Type: " + properties.getProperty(propName).getType());
+                LOG.debug("Property Name: {}\nProperty Type: {}",
+                        properties.getProperty(propName).getName(), properties.getProperty(propName).getType());
             }
         }
 
         return properties;
     }
+
+    private ConnIdBundleManager() {
+        // Empty constructor for static utility class.
+    }
 }

Added: syncope/trunk/core/src/main/resources/connid.properties
URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/main/resources/connid.properties?rev=1448090&view=auto
==============================================================================
--- syncope/trunk/core/src/main/resources/connid.properties (added)
+++ syncope/trunk/core/src/main/resources/connid.properties Wed Feb 20 11:27:04 2013
@@ -0,0 +1,17 @@
+# 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.
+bundles.directory=${bundles.directory}

Propchange: syncope/trunk/core/src/main/resources/connid.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: syncope/trunk/core/src/main/resources/connid.properties
------------------------------------------------------------------------------
    svn:keywords = Date Revision Author HeadURL Id

Modified: syncope/trunk/core/src/main/resources/content.xml
URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/main/resources/content.xml?rev=1448090&r1=1448089&r2=1448090&view=diff
==============================================================================
--- syncope/trunk/core/src/main/resources/content.xml (original)
+++ syncope/trunk/core/src/main/resources/content.xml Wed Feb 20 11:27:04 2013
@@ -18,7 +18,6 @@ specific language governing permissions 
 under the License.
 -->
 <dataset>
-  <SyncopeConf confKey="connid.bundles.directory" confValue="${bundles.directory}"/>
   <SyncopeConf confKey="password.cipher.algorithm" confValue="SHA1"/>
   <SyncopeConf confKey="smtp.host" confValue="not-existing"/>
   <SyncopeConf confKey="smtp.port" confValue="25"/>
@@ -56,6 +55,7 @@ under the License.
   <Entitlement name="CONNECTOR_READ"/>
   <Entitlement name="CONNECTOR_UPDATE"/>
   <Entitlement name="CONNECTOR_DELETE"/>
+  <Entitlement name="CONNECTOR_RELOAD"/>
   <Entitlement name="CONFIGURATION_LIST"/>
   <Entitlement name="CONFIGURATION_CREATE"/>
   <Entitlement name="CONFIGURATION_READ"/>

Modified: syncope/trunk/core/src/test/java/org/apache/syncope/core/AbstractTest.java
URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/test/java/org/apache/syncope/core/AbstractTest.java?rev=1448090&r1=1448089&r2=1448090&view=diff
==============================================================================
--- syncope/trunk/core/src/test/java/org/apache/syncope/core/AbstractTest.java (original)
+++ syncope/trunk/core/src/test/java/org/apache/syncope/core/AbstractTest.java Wed Feb 20 11:27:04 2013
@@ -24,6 +24,7 @@ import java.io.IOException;
 import java.io.InputStream;
 import java.util.Properties;
 import org.apache.commons.io.IOUtils;
+import org.apache.syncope.core.util.ConnIdBundleManager;
 import org.junit.BeforeClass;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -40,20 +41,21 @@ public abstract class AbstractTest {
     protected static String bundlesDirectory;
 
     @BeforeClass
-    public static void setUpIdentityConnectorsBundles() throws IOException {
-        Properties props = new Properties();
+    public static void setUpConnIdBundles() throws IOException {
         InputStream propStream = null;
         try {
-            propStream = AbstractTest.class.getResourceAsStream("/bundles.properties");
+            propStream = AbstractTest.class.getResourceAsStream(ConnIdBundleManager.CONNID_PROPS);
+            Properties props = new Properties();
             props.load(propStream);
-            connidSoapVersion = props.getProperty("connid.soap.version");
+
             bundlesDirectory = props.getProperty("bundles.directory");
+            connidSoapVersion = props.getProperty("connid.soap.version");
         } catch (Exception e) {
-            LOG.error("Could not load bundles.properties", e);
+            LOG.error("Could not load {}", ConnIdBundleManager.CONNID_PROPS, e);
         } finally {
             IOUtils.closeQuietly(propStream);
         }
-        assertNotNull(connidSoapVersion);
         assertNotNull(bundlesDirectory);
+        assertNotNull(connidSoapVersion);
     }
 }

Modified: syncope/trunk/core/src/test/java/org/apache/syncope/core/init/ConnInstanceLoaderTest.java
URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/test/java/org/apache/syncope/core/init/ConnInstanceLoaderTest.java?rev=1448090&r1=1448089&r2=1448090&view=diff
==============================================================================
--- syncope/trunk/core/src/test/java/org/apache/syncope/core/init/ConnInstanceLoaderTest.java (original)
+++ syncope/trunk/core/src/test/java/org/apache/syncope/core/init/ConnInstanceLoaderTest.java Wed Feb 20 11:27:04 2013
@@ -22,10 +22,9 @@ import static org.junit.Assert.assertEqu
 
 import org.apache.syncope.core.AbstractNonDAOTest;
 import org.apache.syncope.core.persistence.dao.ResourceDAO;
-import org.apache.syncope.core.propagation.SyncopeConnector;
+import org.apache.syncope.core.propagation.Connector;
 import org.apache.syncope.core.rest.data.ResourceDataBinder;
 import org.apache.syncope.core.util.ApplicationContextProvider;
-import org.apache.syncope.core.util.ConnBundleManager;
 import org.junit.Before;
 import org.junit.Test;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -35,28 +34,24 @@ import org.springframework.transaction.a
 @Transactional
 public class ConnInstanceLoaderTest extends AbstractNonDAOTest {
 
-    private ConnInstanceLoader cil;
+    private ConnectorManager cil;
 
     @Autowired
     private ResourceDAO resourceDAO;
 
     @Autowired
-    private ConnBundleManager connBundleManager;
-
-    @Autowired
     private ResourceDataBinder resourceDataBinder;
 
     @Before
     public void before() {
-        cil = new ConnInstanceLoader();
+        cil = new ConnectorManager();
         ReflectionTestUtils.setField(cil, "resourceDAO", resourceDAO);
-        ReflectionTestUtils.setField(cil, "connBundleManager", connBundleManager);
         ReflectionTestUtils.setField(cil, "resourceDataBinder", resourceDataBinder);
 
         // Remove any other connector instance bean set up by
         // standard ConnInstanceLoader.load()
         for (String bean : ApplicationContextProvider.getApplicationContext().
-                getBeanNamesForType(SyncopeConnector.class)) {
+                getBeanNamesForType(Connector.class)) {
 
             cil.unregisterConnector(bean);
         }
@@ -68,6 +63,6 @@ public class ConnInstanceLoaderTest exte
 
         assertEquals(resourceDAO.findAll().size(),
                 ApplicationContextProvider.getApplicationContext().
-                getBeanNamesForType(SyncopeConnector.class, false, true).length);
+                getBeanNamesForType(Connector.class, false, true).length);
     }
 }

Modified: syncope/trunk/core/src/test/java/org/apache/syncope/core/persistence/dao/EntitlementTest.java
URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/test/java/org/apache/syncope/core/persistence/dao/EntitlementTest.java?rev=1448090&r1=1448089&r2=1448090&view=diff
==============================================================================
--- syncope/trunk/core/src/test/java/org/apache/syncope/core/persistence/dao/EntitlementTest.java (original)
+++ syncope/trunk/core/src/test/java/org/apache/syncope/core/persistence/dao/EntitlementTest.java Wed Feb 20 11:27:04 2013
@@ -23,7 +23,6 @@ import static org.junit.Assert.assertNot
 import static org.junit.Assert.assertTrue;
 
 import java.util.List;
-
 import org.apache.syncope.core.persistence.beans.Entitlement;
 import org.apache.syncope.core.persistence.beans.role.SyncopeRole;
 import org.junit.Test;
@@ -42,8 +41,7 @@ public class EntitlementTest extends Abs
     @Test
     public void findAll() {
         List<Entitlement> list = entitlementDAO.findAll();
-        // 69 real entitlements + 9 role entitlements
-        assertEquals("did not get expected number of entitlements ", 83, list.size());
+        assertEquals("did not get expected number of entitlements ", 84, list.size());
     }
 
     @Test

Modified: syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/ConnInstanceTestITCase.java
URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/ConnInstanceTestITCase.java?rev=1448090&r1=1448089&r2=1448090&view=diff
==============================================================================
--- syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/ConnInstanceTestITCase.java (original)
+++ syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/ConnInstanceTestITCase.java Wed Feb 20 11:27:04 2013
@@ -32,9 +32,8 @@ import java.util.List;
 import java.util.Map;
 import java.util.Properties;
 import java.util.Set;
-
 import javax.ws.rs.core.Response;
-
+import org.apache.commons.io.IOUtils;
 import org.apache.syncope.common.to.ConnBundleTO;
 import org.apache.syncope.common.to.ConnInstanceTO;
 import org.apache.syncope.common.to.MappingItemTO;
@@ -46,6 +45,7 @@ import org.apache.syncope.common.types.C
 import org.apache.syncope.common.types.ConnectorCapability;
 import org.apache.syncope.common.types.IntMappingType;
 import org.apache.syncope.common.validation.SyncopeClientCompositeErrorException;
+import org.apache.syncope.core.util.ConnIdBundleManager;
 import org.identityconnectors.common.security.GuardedString;
 import org.junit.BeforeClass;
 import org.junit.FixMethodOrder;
@@ -64,25 +64,25 @@ public class ConnInstanceTestITCase exte
     private static String bundlesDirectory;
 
     @BeforeClass
-    public static void init()
-            throws IOException {
-        Properties props = new Properties();
+    public static void setUpConnIdBundles() throws IOException {
         InputStream propStream = null;
         try {
-            propStream = ConnInstanceTestITCase.class.getResourceAsStream("/bundles.properties");
+            Properties props = new Properties();
+            propStream = org.apache.syncope.core.AbstractTest.class.
+                    getResourceAsStream(ConnIdBundleManager.CONNID_PROPS);
             props.load(propStream);
+
+            bundlesDirectory = props.getProperty("bundles.directory");
             connidSoapVersion = props.getProperty("connid.soap.version");
             connidDbTableVersion = props.getProperty("connid.db.table.version");
-            bundlesDirectory = props.getProperty("bundles.directory");
         } catch (Exception e) {
-            LOG.error("Could not load bundles.properties", e);
+            LOG.error("Could not load {}", ConnIdBundleManager.CONNID_PROPS, e);
         } finally {
-            if (propStream != null) {
-                propStream.close();
-            }
+            IOUtils.closeQuietly(propStream);
         }
-        assertNotNull(connidSoapVersion);
         assertNotNull(bundlesDirectory);
+        assertNotNull(connidSoapVersion);
+        assertNotNull(connidDbTableVersion);
     }
 
     @Test(expected = SyncopeClientCompositeErrorException.class)
@@ -155,7 +155,7 @@ public class ConnInstanceTestITCase exte
         assertEquals(actual.getConnectorName(), connectorTO.getConnectorName());
         assertEquals(actual.getVersion(), connectorTO.getVersion());
         assertEquals("Display name", actual.getDisplayName());
-        assertEquals(new Integer(15), actual.getConnRequestTimeout());
+        assertEquals(Integer.valueOf(15), actual.getConnRequestTimeout());
         assertEquals(connectorTO.getCapabilities(), actual.getCapabilities());
 
         Throwable t = null;
@@ -249,7 +249,7 @@ public class ConnInstanceTestITCase exte
         assertEquals(actual.getBundleName(), connectorTO.getBundleName());
         assertEquals(actual.getConnectorName(), connectorTO.getConnectorName());
         assertEquals(actual.getVersion(), connectorTO.getVersion());
-        assertEquals(new Integer(20), actual.getConnRequestTimeout());
+        assertEquals(Integer.valueOf(20), actual.getConnRequestTimeout());
     }
 
     @Test
@@ -313,7 +313,7 @@ public class ConnInstanceTestITCase exte
         // ----------------------------------
         // Check for spring bean.
         // ----------------------------------
-        ConnInstanceTO connInstanceBean = connectorService.readConnectorBean(resourceTO.getName());
+        ConnInstanceTO connInstanceBean = connectorService.readByResource(resourceTO.getName());
 
         assertNotNull(connInstanceBean);
         assertTrue(connInstanceBean.getCapabilities().isEmpty());
@@ -331,7 +331,7 @@ public class ConnInstanceTestITCase exte
         assertFalse(connInstanceTO.getCapabilities().isEmpty());
 
         // check for spring bean update
-        connInstanceBean = connectorService.readConnectorBean(resourceTO.getName());
+        connInstanceBean = connectorService.readByResource(resourceTO.getName());
 
         assertFalse(connInstanceBean.getCapabilities().isEmpty());
         // ----------------------------------
@@ -582,8 +582,8 @@ public class ConnInstanceTestITCase exte
         keyColumnSchema.setRequired(true);
         ConnConfProperty servicename = new ConnConfProperty();
         servicename.setSchema(keyColumnSchema);
-        servicename
-                .setValues(Collections.singletonList("org.connid.bundles.soap.provisioning.interfaces.Provisioning"));
+        servicename.setValues(
+                Collections.singletonList("org.connid.bundles.soap.provisioning.interfaces.Provisioning"));
         servicename.setOverridable(false);
 
         conf.add(endpoint);
@@ -641,4 +641,9 @@ public class ConnInstanceTestITCase exte
             connectorService.delete(connectorTO.getId());
         }
     }
+
+    @Test
+    public void reload() {
+        connectorService.reload();
+    }
 }

Modified: syncope/trunk/core/src/test/resources/content.xml
URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/test/resources/content.xml?rev=1448090&r1=1448089&r2=1448090&view=diff
==============================================================================
--- syncope/trunk/core/src/test/resources/content.xml (original)
+++ syncope/trunk/core/src/test/resources/content.xml Wed Feb 20 11:27:04 2013
@@ -18,7 +18,6 @@ specific language governing permissions 
 under the License.
 -->
 <dataset>
-  <SyncopeConf confKey="connid.bundles.directory" confValue="${bundles.directory}"/>
   <SyncopeConf confKey="password.cipher.algorithm" confValue="SHA1"/>
   <SyncopeConf confKey="smtp.host" confValue="not-existing"/>
   <SyncopeConf confKey="smtp.port" confValue="25"/>
@@ -688,6 +687,7 @@ under the License.
   <Entitlement name="CONNECTOR_READ"/>
   <Entitlement name="CONNECTOR_UPDATE"/>
   <Entitlement name="CONNECTOR_DELETE"/>
+  <Entitlement name="CONNECTOR_RELOAD"/>
   <Entitlement name="CONFIGURATION_LIST"/>
   <Entitlement name="CONFIGURATION_CREATE"/>
   <Entitlement name="CONFIGURATION_READ"/>