syncope-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ilgro...@apache.org
Subject svn commit: r1425660 - in /syncope/trunk/core/src/main/java/org/apache/syncope/core: init/ persistence/dao/ propagation/ rest/controller/ util/
Date Mon, 24 Dec 2012 15:43:17 GMT
Author: ilgrosso
Date: Mon Dec 24 15:43:17 2012
New Revision: 1425660

URL: http://svn.apache.org/viewvc?rev=1425660&view=rev
Log:
Minor formatting, interface cleanup and missing @Override

Modified:
    syncope/trunk/core/src/main/java/org/apache/syncope/core/init/ConnInstanceLoader.java
    syncope/trunk/core/src/main/java/org/apache/syncope/core/persistence/dao/ConnectorRegistry.java
    syncope/trunk/core/src/main/java/org/apache/syncope/core/propagation/ConnectorFacadeProxy.java
    syncope/trunk/core/src/main/java/org/apache/syncope/core/propagation/ConnectorFactory.java
    syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/controller/ResourceController.java
    syncope/trunk/core/src/main/java/org/apache/syncope/core/util/ConnBundleManager.java

Modified: syncope/trunk/core/src/main/java/org/apache/syncope/core/init/ConnInstanceLoader.java
URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/main/java/org/apache/syncope/core/init/ConnInstanceLoader.java?rev=1425660&r1=1425659&r2=1425660&view=diff
==============================================================================
--- syncope/trunk/core/src/main/java/org/apache/syncope/core/init/ConnInstanceLoader.java
(original)
+++ syncope/trunk/core/src/main/java/org/apache/syncope/core/init/ConnInstanceLoader.java
Mon Dec 24 15:43:17 2012
@@ -62,14 +62,13 @@ class ConnInstanceLoader implements Conn
     }
 
     /* (non-Javadoc)
-     * @see org.apache.syncope.core.init.ConnectorFactory#getConnector(org.apache.syncope.core.persistence.beans.ExternalResource)
+     * @see ConnectorFactory#getConnector(org.apache.syncope.core.persistence.beans.ExternalResource)
      */
     @Override
     public ConnectorFacadeProxy getConnector(final ExternalResource resource)
             throws BeansException, NotFoundException {
 
-        // Try to re-create connector bean from underlying resource
-        // (useful for managing failover scenarios)
+        // Try to re-create connector bean from underlying resource (useful for managing
failover scenarios)
         if (!ApplicationContextProvider.getBeanFactory().containsBean(getBeanName(resource)))
{
             registerConnector(resource);
         }
@@ -93,6 +92,7 @@ class ConnInstanceLoader implements Conn
      * @return connector facade proxy.
      * @throws NotFoundException when not able to fetch all the required data.
      */
+    @Override
     public ConnectorFacadeProxy createConnectorBean(final ConnInstance connInstance,
             final Set<ConnConfProperty> configuration)
             throws NotFoundException {
@@ -105,7 +105,7 @@ class ConnInstanceLoader implements Conn
     }
 
     /* (non-Javadoc)
-     * @see org.apache.syncope.core.init.ConnectorRegistry#registerConnector(org.apache.syncope.core.persistence.beans.ExternalResource)
+     * @see ConnectorRegistry#registerConnector(org.apache.syncope.core.persistence.beans.ExternalResource)
      */
     @Override
     public void registerConnector(final ExternalResource resource)
@@ -133,6 +133,7 @@ class ConnInstanceLoader implements Conn
     }
 
     @Transactional(readOnly = true)
+    @Override
     public void load() {
         // This is needed to avoid encoding problems when sending error messages via REST
         CurrentLocale.set(Locale.ENGLISH);
@@ -148,7 +149,7 @@ class ConnInstanceLoader implements Conn
             }
         }
 
-        LOG.info("Done loading {} connectors.", ApplicationContextProvider.getBeanFactory().
-                getBeansOfType(ConnectorFacadeProxy.class).size());
+        LOG.info("Done loading {} connectors.",
+                ApplicationContextProvider.getBeanFactory().getBeansOfType(ConnectorFacadeProxy.class).size());
     }
 }

Modified: syncope/trunk/core/src/main/java/org/apache/syncope/core/persistence/dao/ConnectorRegistry.java
URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/main/java/org/apache/syncope/core/persistence/dao/ConnectorRegistry.java?rev=1425660&r1=1425659&r2=1425660&view=diff
==============================================================================
--- syncope/trunk/core/src/main/java/org/apache/syncope/core/persistence/dao/ConnectorRegistry.java
(original)
+++ syncope/trunk/core/src/main/java/org/apache/syncope/core/persistence/dao/ConnectorRegistry.java
Mon Dec 24 15:43:17 2012
@@ -23,9 +23,8 @@ import org.apache.syncope.core.util.NotF
 
 public interface ConnectorRegistry {
 
-    public abstract void registerConnector(ExternalResource resource)
+    void registerConnector(ExternalResource resource)
             throws NotFoundException;
 
-    public abstract void unregisterConnector(String id);
-
+    void unregisterConnector(String id);
 }
\ No newline at end of file

Modified: syncope/trunk/core/src/main/java/org/apache/syncope/core/propagation/ConnectorFacadeProxy.java
URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/main/java/org/apache/syncope/core/propagation/ConnectorFacadeProxy.java?rev=1425660&r1=1425659&r2=1425660&view=diff
==============================================================================
--- syncope/trunk/core/src/main/java/org/apache/syncope/core/propagation/ConnectorFacadeProxy.java
(original)
+++ syncope/trunk/core/src/main/java/org/apache/syncope/core/propagation/ConnectorFacadeProxy.java
Mon Dec 24 15:43:17 2012
@@ -125,14 +125,12 @@ public class ConnectorFacadeProxy {
 
         // create default configuration
         APIConfiguration apiConfig = info.createDefaultAPIConfiguration();
-
         if (apiConfig == null) {
             throw new NotFoundException("Default API configuration");
         }
 
         // retrieve the ConfigurationProperties.
         final ConfigurationProperties properties = apiConfig.getConfigurationProperties();
-
         if (properties == null) {
             throw new NotFoundException("Configuration properties");
         }
@@ -153,10 +151,8 @@ public class ConnectorFacadeProxy {
             }
         }
 
-        // Use the ConnectorFacadeFactory's newInstance() method to get
-        // a new connector.
+        // Use the ConnectorFacadeFactory's newInstance() method to get a new connector.
         connector = ConnectorFacadeFactory.getInstance().newInstance(apiConfig);
-
         if (connector == null) {
             throw new NotFoundException("Connector");
         }

Modified: syncope/trunk/core/src/main/java/org/apache/syncope/core/propagation/ConnectorFactory.java
URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/main/java/org/apache/syncope/core/propagation/ConnectorFactory.java?rev=1425660&r1=1425659&r2=1425660&view=diff
==============================================================================
--- syncope/trunk/core/src/main/java/org/apache/syncope/core/propagation/ConnectorFactory.java
(original)
+++ syncope/trunk/core/src/main/java/org/apache/syncope/core/propagation/ConnectorFactory.java
Mon Dec 24 15:43:17 2012
@@ -19,7 +19,6 @@
 package org.apache.syncope.core.propagation;
 
 import java.util.Set;
-
 import org.apache.syncope.core.persistence.beans.ConnInstance;
 import org.apache.syncope.core.persistence.beans.ExternalResource;
 import org.apache.syncope.core.util.NotFoundException;
@@ -27,8 +26,8 @@ import org.apache.syncope.types.ConnConf
 import org.springframework.beans.BeansException;
 
 public interface ConnectorFactory {
-    public ConnectorFacadeProxy createConnectorBean(final ConnInstance connInstance,
-            final Set<ConnConfProperty> configuration)
+
+    ConnectorFacadeProxy createConnectorBean(ConnInstance connInstance, Set<ConnConfProperty>
configuration)
             throws NotFoundException;
 
     /**
@@ -39,9 +38,8 @@ public interface ConnectorFactory {
      * @throws BeansException if there is any problem with Spring
      * @throws NotFoundException if the connector is not registered in the context
      */
-    public abstract ConnectorFacadeProxy getConnector(ExternalResource resource)
+    ConnectorFacadeProxy getConnector(ExternalResource resource)
             throws BeansException, NotFoundException;
 
-    public void load();
-
+    void load();
 }
\ 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=1425660&r1=1425659&r2=1425660&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
Mon Dec 24 15:43:17 2012
@@ -251,8 +251,7 @@ public class ResourceController extends 
 
         final ConnInstance connInstance = binder.getConnInstance(resourceTO);
 
-        final ConnectorFacadeProxy connector =
-                new ConnectorFacadeProxy(connInstance, bundleManager);
+        final ConnectorFacadeProxy connector = new ConnectorFacadeProxy(connInstance, bundleManager);
 
         boolean result;
         try {
@@ -261,11 +260,11 @@ public class ResourceController extends 
 
             auditManager.audit(Category.connector, AuditElements.ConnectorSubCategory.check,
Result.success,
                     "Successfully checked connector: " + resourceTO);
-        } catch (Exception ex) {
+        } catch (Exception e) {
             auditManager.audit(Category.connector, AuditElements.ConnectorSubCategory.check,
Result.failure,
-                    "Unsuccessful check for connector: " + resourceTO, ex);
+                    "Unsuccessful check for connector: " + resourceTO, e);
 
-            LOG.error("Test connection failure {}", ex);
+            LOG.error("Test connection failure {}", e);
             result = false;
         }
 

Modified: 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/ConnBundleManager.java?rev=1425660&r1=1425659&r2=1425660&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/ConnBundleManager.java Mon
Dec 24 15:43:17 2012
@@ -46,7 +46,6 @@ public class ConnBundleManager {
     private ConfDAO confDAO;
 
     public ConnectorInfoManager getConnectorManager() throws NotFoundException, MissingConfKeyException
{
-
         // 1. Bundles directory
         SyncopeConf connectorBundleDir = confDAO.find("connid.bundles.directory");
 
@@ -76,7 +75,7 @@ public class ConnBundleManager {
 
         // 3. Get connector info manager
         ConnectorInfoManager manager = ConnectorInfoManagerFactory.getInstance().getLocalManager(
-                bundleFileURLs.toArray(new URL[0]));
+                bundleFileURLs.toArray(new URL[bundleFileURLs.size()]));
         if (manager == null) {
             throw new NotFoundException("Connector Info Manager");
         }
@@ -114,21 +113,18 @@ public class ConnBundleManager {
     }
 
     public ConfigurationProperties getConfigurationProperties(final ConnectorInfo info) throws
NotFoundException {
-
         if (info == null) {
             throw new NotFoundException("Invalid: connector info is null");
         }
 
         // create default configuration
         final APIConfiguration apiConfig = info.createDefaultAPIConfiguration();
-
         if (apiConfig == null) {
             throw new NotFoundException("Default API configuration");
         }
 
         // retrieve the ConfigurationProperties.
         final ConfigurationProperties properties = apiConfig.getConfigurationProperties();
-
         if (properties == null) {
             throw new NotFoundException("Configuration properties");
         }



Mime
View raw message