syncope-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ilgro...@apache.org
Subject svn commit: r1300549 [1/3] - in /incubator/syncope/trunk: client/src/main/java/org/syncope/client/to/ client/src/main/java/org/syncope/types/ console/src/main/java/org/syncope/console/pages/ console/src/main/java/org/syncope/console/rest/ console/src/m...
Date Wed, 14 Mar 2012 14:03:38 GMT
Author: ilgrosso
Date: Wed Mar 14 14:03:36 2012
New Revision: 1300549

URL: http://svn.apache.org/viewvc?rev=1300549&view=rev
Log:
[SYNCOPE-20] First elements and mechanism in place: now it's time to disseminate code with audit statements

Added:
    incubator/syncope/trunk/client/src/main/java/org/syncope/types/AuditElements.java   (with props)
    incubator/syncope/trunk/client/src/main/java/org/syncope/types/SyncopeLoggerLevel.java
      - copied, changed from r1299592, incubator/syncope/trunk/client/src/main/java/org/syncope/types/LoggerLevel.java
    incubator/syncope/trunk/client/src/main/java/org/syncope/types/SyncopeLoggerType.java   (with props)
    incubator/syncope/trunk/core/src/main/java/org/syncope/core/audit/
    incubator/syncope/trunk/core/src/main/java/org/syncope/core/audit/AuditManager.java   (with props)
    incubator/syncope/trunk/core/src/main/java/org/syncope/core/audit/JNDIFallbackConnectionSource.java   (with props)
    incubator/syncope/trunk/core/src/main/resources/audit.xml   (with props)
    incubator/syncope/trunk/core/src/main/resources/logback/
    incubator/syncope/trunk/core/src/main/resources/logback/h2.sql   (with props)
    incubator/syncope/trunk/core/src/main/resources/logback/hsqldb.sql   (with props)
    incubator/syncope/trunk/core/src/main/resources/logback/mysql.sql   (with props)
    incubator/syncope/trunk/core/src/main/resources/logback/oracle.sql   (with props)
    incubator/syncope/trunk/core/src/main/resources/logback/postgresql.sql   (with props)
Removed:
    incubator/syncope/trunk/client/src/main/java/org/syncope/types/LoggerLevel.java
    incubator/syncope/trunk/core/src/main/java/org/syncope/core/init/AbstractLoader.java
Modified:
    incubator/syncope/trunk/client/src/main/java/org/syncope/client/to/LoggerTO.java
    incubator/syncope/trunk/client/src/main/java/org/syncope/types/IntMappingType.java
    incubator/syncope/trunk/client/src/main/java/org/syncope/types/SyncopeClientExceptionType.java
    incubator/syncope/trunk/client/src/main/java/org/syncope/types/UserRequestType.java
    incubator/syncope/trunk/console/src/main/java/org/syncope/console/pages/Configuration.java
    incubator/syncope/trunk/console/src/main/java/org/syncope/console/pages/ConfigurationModalPage.java
    incubator/syncope/trunk/console/src/main/java/org/syncope/console/pages/ConnectorModalPage.java
    incubator/syncope/trunk/console/src/main/java/org/syncope/console/rest/ConfigurationRestClient.java
    incubator/syncope/trunk/console/src/main/resources/authorizations.xml
    incubator/syncope/trunk/core/src/main/java/org/syncope/core/connid/SLF4JLogger.java
    incubator/syncope/trunk/core/src/main/java/org/syncope/core/init/ActivitiWorkflowLoader.java
    incubator/syncope/trunk/core/src/main/java/org/syncope/core/init/ConnInstanceLoader.java
    incubator/syncope/trunk/core/src/main/java/org/syncope/core/init/ContentLoader.java
    incubator/syncope/trunk/core/src/main/java/org/syncope/core/init/JobInstanceLoader.java
    incubator/syncope/trunk/core/src/main/java/org/syncope/core/init/LoggerLoader.java
    incubator/syncope/trunk/core/src/main/java/org/syncope/core/init/SpringContextInitializer.java
    incubator/syncope/trunk/core/src/main/java/org/syncope/core/notification/NotificationManager.java
    incubator/syncope/trunk/core/src/main/java/org/syncope/core/persistence/beans/SyncopeLogger.java
    incubator/syncope/trunk/core/src/main/java/org/syncope/core/persistence/dao/LoggerDAO.java
    incubator/syncope/trunk/core/src/main/java/org/syncope/core/persistence/dao/impl/LoggerDAOImpl.java
    incubator/syncope/trunk/core/src/main/java/org/syncope/core/rest/controller/AuthenticationController.java
    incubator/syncope/trunk/core/src/main/java/org/syncope/core/rest/controller/LoggerController.java
    incubator/syncope/trunk/core/src/main/java/org/syncope/core/security/SyncopeAuthenticationProvider.java
    incubator/syncope/trunk/core/src/main/java/org/syncope/core/util/ApplicationContextManager.java
    incubator/syncope/trunk/core/src/main/java/org/syncope/core/util/ApplicationContextProvider.java
    incubator/syncope/trunk/core/src/main/java/org/syncope/core/util/EntitlementUtil.java
    incubator/syncope/trunk/core/src/main/java/org/syncope/core/workflow/activiti/AbstractActivitiDelegate.java
    incubator/syncope/trunk/core/src/main/resources/content.xml
    incubator/syncope/trunk/core/src/main/resources/logback.xml
    incubator/syncope/trunk/core/src/main/resources/persistence.properties
    incubator/syncope/trunk/core/src/main/resources/persistenceContext.xml
    incubator/syncope/trunk/core/src/main/resources/quartz/tables_h2.sql
    incubator/syncope/trunk/core/src/main/resources/quartz/tables_hsqldb.sql
    incubator/syncope/trunk/core/src/main/resources/quartz/tables_mysql.sql
    incubator/syncope/trunk/core/src/main/resources/quartz/tables_mysql_innodb.sql
    incubator/syncope/trunk/core/src/main/resources/quartz/tables_oracle.sql
    incubator/syncope/trunk/core/src/main/resources/quartz/tables_postgres.sql
    incubator/syncope/trunk/core/src/main/resources/schedulingContext.xml
    incubator/syncope/trunk/core/src/main/resources/syncopeContext.xml
    incubator/syncope/trunk/core/src/main/webapp/syncopeClientError.jsp
    incubator/syncope/trunk/core/src/test/java/org/syncope/core/persistence/dao/EntitlementTest.java
    incubator/syncope/trunk/core/src/test/java/org/syncope/core/rest/LoggerTestITCase.java
    incubator/syncope/trunk/core/src/test/resources/content.xml
    incubator/syncope/trunk/core/src/test/resources/mysql/persistence.properties
    incubator/syncope/trunk/core/src/test/resources/oracle/persistence.properties
    incubator/syncope/trunk/core/src/test/resources/persistence.properties
    incubator/syncope/trunk/core/src/test/resources/postgres/persistence.properties
    incubator/syncope/trunk/parent/pom.xml

Modified: incubator/syncope/trunk/client/src/main/java/org/syncope/client/to/LoggerTO.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/client/src/main/java/org/syncope/client/to/LoggerTO.java?rev=1300549&r1=1300548&r2=1300549&view=diff
==============================================================================
--- incubator/syncope/trunk/client/src/main/java/org/syncope/client/to/LoggerTO.java (original)
+++ incubator/syncope/trunk/client/src/main/java/org/syncope/client/to/LoggerTO.java Wed Mar 14 14:03:36 2012
@@ -19,7 +19,7 @@
 package org.syncope.client.to;
 
 import org.syncope.client.AbstractBaseBean;
-import org.syncope.types.LoggerLevel;
+import org.syncope.types.SyncopeLoggerLevel;
 
 public class LoggerTO extends AbstractBaseBean {
 
@@ -27,13 +27,13 @@ public class LoggerTO extends AbstractBa
 
     private String name;
 
-    private LoggerLevel level;
+    private SyncopeLoggerLevel level;
 
-    public LoggerLevel getLevel() {
+    public SyncopeLoggerLevel getLevel() {
         return level;
     }
 
-    public void setLevel(final LoggerLevel level) {
+    public void setLevel(final SyncopeLoggerLevel level) {
         this.level = level;
     }
 

Added: incubator/syncope/trunk/client/src/main/java/org/syncope/types/AuditElements.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/client/src/main/java/org/syncope/types/AuditElements.java?rev=1300549&view=auto
==============================================================================
--- incubator/syncope/trunk/client/src/main/java/org/syncope/types/AuditElements.java (added)
+++ incubator/syncope/trunk/client/src/main/java/org/syncope/types/AuditElements.java Wed Mar 14 14:03:36 2012
@@ -0,0 +1,71 @@
+/*
+ * 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.syncope.types;
+
+import java.util.EnumSet;
+
+public class AuditElements {
+
+    public enum Category {
+
+        authentication,
+        configuration,
+        connector,
+        logger,
+        notification,
+        policy,
+        report,
+        resource,
+        role,
+        schema,
+        task,
+        user,
+        userRequest,
+        workflow
+
+    }
+
+    public enum Result {
+
+        success,
+        failure
+
+    }
+
+    public static EnumSet<? extends Enum> getSubCategories(final Category category) {
+        EnumSet<? extends Enum> result;
+        switch (category) {
+            case authentication:
+                result = EnumSet.allOf(AuthenticationSubCategory.class);
+                break;
+
+            default:
+                result = null;
+        }
+
+        return result;
+    }
+
+    public enum AuthenticationSubCategory {
+
+        login,
+        getEntitlements
+
+    }
+}

Propchange: incubator/syncope/trunk/client/src/main/java/org/syncope/types/AuditElements.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/syncope/trunk/client/src/main/java/org/syncope/types/AuditElements.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: incubator/syncope/trunk/client/src/main/java/org/syncope/types/AuditElements.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: incubator/syncope/trunk/client/src/main/java/org/syncope/types/IntMappingType.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/client/src/main/java/org/syncope/types/IntMappingType.java?rev=1300549&r1=1300548&r2=1300549&view=diff
==============================================================================
--- incubator/syncope/trunk/client/src/main/java/org/syncope/types/IntMappingType.java (original)
+++ incubator/syncope/trunk/client/src/main/java/org/syncope/types/IntMappingType.java Wed Mar 14 14:03:36 2012
@@ -96,7 +96,7 @@ public enum IntMappingType {
     /**
      * User attribute types.
      */
-    enum UserMappingType {
+    private enum UserMappingType {
 
         UserSchema,
         UserDerivedSchema,
@@ -104,6 +104,7 @@ public enum IntMappingType {
         SyncopeUserId,
         Password,
         Username;
+
     }
 
     /**
@@ -114,6 +115,7 @@ public enum IntMappingType {
         RoleSchema,
         RoleDerivedSchema,
         RoleVirtualSchema;
+
     }
 
     /**
@@ -124,5 +126,6 @@ public enum IntMappingType {
         MembershipSchema,
         MembershipDerivedSchema,
         MembershipVirtualSchema;
+
     }
 }

Modified: incubator/syncope/trunk/client/src/main/java/org/syncope/types/SyncopeClientExceptionType.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/client/src/main/java/org/syncope/types/SyncopeClientExceptionType.java?rev=1300549&r1=1300548&r2=1300549&view=diff
==============================================================================
--- incubator/syncope/trunk/client/src/main/java/org/syncope/types/SyncopeClientExceptionType.java (original)
+++ incubator/syncope/trunk/client/src/main/java/org/syncope/types/SyncopeClientExceptionType.java Wed Mar 14 14:03:36 2012
@@ -29,6 +29,9 @@ public enum SyncopeClientExceptionType {
     GenericPersistence(
     "Syncope.GenericPersistence",
     "Syncope.GenericPersistence.cause"),
+    InvalidLogger(
+    "Syncope.InvalidLogger",
+    "Syncope.InvalidLogger.message"),
     InvalidConnInstance(
     "Syncope.InvalidConnInstance",
     "Syncope.InvalidConnInstance.message"),

Copied: incubator/syncope/trunk/client/src/main/java/org/syncope/types/SyncopeLoggerLevel.java (from r1299592, incubator/syncope/trunk/client/src/main/java/org/syncope/types/LoggerLevel.java)
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/client/src/main/java/org/syncope/types/SyncopeLoggerLevel.java?p2=incubator/syncope/trunk/client/src/main/java/org/syncope/types/SyncopeLoggerLevel.java&p1=incubator/syncope/trunk/client/src/main/java/org/syncope/types/LoggerLevel.java&r1=1299592&r2=1300549&rev=1300549&view=diff
==============================================================================
--- incubator/syncope/trunk/client/src/main/java/org/syncope/types/LoggerLevel.java (original)
+++ incubator/syncope/trunk/client/src/main/java/org/syncope/types/SyncopeLoggerLevel.java Wed Mar 14 14:03:36 2012
@@ -20,7 +20,7 @@ package org.syncope.types;
 
 import ch.qos.logback.classic.Level;
 
-public enum LoggerLevel {
+public enum SyncopeLoggerLevel {
 
     OFF(Level.OFF),
     ERROR(Level.ERROR),
@@ -32,7 +32,7 @@ public enum LoggerLevel {
 
     private Level level;
 
-    LoggerLevel(final Level level) {
+    SyncopeLoggerLevel(final Level level) {
         this.level = level;
     }
 
@@ -40,8 +40,8 @@ public enum LoggerLevel {
         return level;
     }
 
-    public static LoggerLevel fromLevel(final Level level) {
-        LoggerLevel result;
+    public static SyncopeLoggerLevel fromLevel(final Level level) {
+        SyncopeLoggerLevel result;
         if (level.equals(Level.OFF)) {
             result = OFF;
         } else if (level.equals(Level.ERROR)) {

Added: incubator/syncope/trunk/client/src/main/java/org/syncope/types/SyncopeLoggerType.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/client/src/main/java/org/syncope/types/SyncopeLoggerType.java?rev=1300549&view=auto
==============================================================================
--- incubator/syncope/trunk/client/src/main/java/org/syncope/types/SyncopeLoggerType.java (added)
+++ incubator/syncope/trunk/client/src/main/java/org/syncope/types/SyncopeLoggerType.java Wed Mar 14 14:03:36 2012
@@ -0,0 +1,35 @@
+/*
+ * 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.syncope.types;
+
+public enum SyncopeLoggerType {
+
+    LOG(""),
+    AUDIT("syncope.audit");
+
+    private String prefix;
+
+    SyncopeLoggerType(final String prefix) {
+        this.prefix = prefix;
+    }
+
+    public String getPrefix() {
+        return prefix;
+    }
+}

Propchange: incubator/syncope/trunk/client/src/main/java/org/syncope/types/SyncopeLoggerType.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/syncope/trunk/client/src/main/java/org/syncope/types/SyncopeLoggerType.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: incubator/syncope/trunk/client/src/main/java/org/syncope/types/SyncopeLoggerType.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: incubator/syncope/trunk/client/src/main/java/org/syncope/types/UserRequestType.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/client/src/main/java/org/syncope/types/UserRequestType.java?rev=1300549&r1=1300548&r2=1300549&view=diff
==============================================================================
--- incubator/syncope/trunk/client/src/main/java/org/syncope/types/UserRequestType.java (original)
+++ incubator/syncope/trunk/client/src/main/java/org/syncope/types/UserRequestType.java Wed Mar 14 14:03:36 2012
@@ -24,4 +24,4 @@ public enum UserRequestType {
     UPDATE,
     DELETE
 
-}
\ No newline at end of file
+}

Modified: incubator/syncope/trunk/console/src/main/java/org/syncope/console/pages/Configuration.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/console/src/main/java/org/syncope/console/pages/Configuration.java?rev=1300549&r1=1300548&r2=1300549&view=diff
==============================================================================
--- incubator/syncope/trunk/console/src/main/java/org/syncope/console/pages/Configuration.java (original)
+++ incubator/syncope/trunk/console/src/main/java/org/syncope/console/pages/Configuration.java Wed Mar 14 14:03:36 2012
@@ -76,8 +76,8 @@ import org.syncope.console.rest.Notifica
 import org.syncope.console.rest.WorkflowRestClient;
 import org.syncope.console.wicket.markup.html.form.ActionLink;
 import org.syncope.console.wicket.markup.html.form.ActionLinksPanel;
-import org.syncope.types.LoggerLevel;
 import org.syncope.types.PolicyType;
+import org.syncope.types.SyncopeLoggerLevel;
 
 /**
  * Configurations WebPage.
@@ -146,26 +146,21 @@ public class Configuration extends BaseP
         // Workflow definition stuff
         final WorkflowDefinitionTO workflowDef = wfRestClient.getDefinition();
 
-        WebMarkupContainer workflowDefContainer =
-                new WebMarkupContainer("workflowDefContainer");
+        WebMarkupContainer workflowDefContainer = new WebMarkupContainer("workflowDefContainer");
 
-        Form wfForm = new Form("workflowDefForm",
-                new CompoundPropertyModel(workflowDef));
+        Form wfForm = new Form("workflowDefForm", new CompoundPropertyModel(workflowDef));
 
         TextArea<WorkflowDefinitionTO> workflowDefArea =
                 new TextArea<WorkflowDefinitionTO>("workflowDefArea",
-                new PropertyModel<WorkflowDefinitionTO>(
-                workflowDef, "xmlDefinition"));
+                new PropertyModel<WorkflowDefinitionTO>(workflowDef, "xmlDefinition"));
         wfForm.add(workflowDefArea);
 
-        IndicatingAjaxButton submit = new IndicatingAjaxButton(
-                "apply", new Model<String>(getString("submit"))) {
+        IndicatingAjaxButton submit = new IndicatingAjaxButton("apply", new Model<String>(getString("submit"))) {
 
             private static final long serialVersionUID = -958724007591692537L;
 
             @Override
-            protected void onSubmit(final AjaxRequestTarget target,
-                    final Form form) {
+            protected void onSubmit(final AjaxRequestTarget target, final Form form) {
 
                 try {
                     wfRestClient.updateDefinition(workflowDef);
@@ -177,74 +172,54 @@ public class Configuration extends BaseP
             }
 
             @Override
-            protected void onError(final AjaxRequestTarget target,
-                    final Form form) {
+            protected void onError(final AjaxRequestTarget target, final Form form) {
 
                 target.add(feedbackPanel);
             }
         };
 
-        MetaDataRoleAuthorizationStrategy.authorize(
-                submit, ENABLE, xmlRolesReader.getAllAllowedRoles(
-                "Configuration", "workflowDefUpdate"));
+        MetaDataRoleAuthorizationStrategy.authorize(submit, ENABLE,
+                xmlRolesReader.getAllAllowedRoles("Configuration", "workflowDefUpdate"));
         wfForm.add(submit);
 
         workflowDefContainer.add(wfForm);
 
-        MetaDataRoleAuthorizationStrategy.authorize(
-                workflowDefContainer, ENABLE, xmlRolesReader.getAllAllowedRoles(
-                "Configuration", "workflowDefRead"));
+        MetaDataRoleAuthorizationStrategy.authorize(workflowDefContainer, ENABLE,
+                xmlRolesReader.getAllAllowedRoles("Configuration", "workflowDefRead"));
         add(workflowDefContainer);
 
         // Logger stuff
-        PropertyListView coreLoggerList =
-                new LoggerPropertyList(null,
-                "corelogger",
-                confRestClient.getLoggers());
-        WebMarkupContainer coreLoggerContainer =
-                new WebMarkupContainer("coreLoggerContainer");
+        PropertyListView coreLoggerList = new LoggerPropertyList(null, "corelogger", confRestClient.listLogs());
+        WebMarkupContainer coreLoggerContainer = new WebMarkupContainer("coreLoggerContainer");
         coreLoggerContainer.add(coreLoggerList);
         coreLoggerContainer.setOutputMarkupId(true);
 
-        MetaDataRoleAuthorizationStrategy.authorize(
-                coreLoggerContainer, ENABLE,
-                xmlRolesReader.getAllAllowedRoles(
-                "Configuration", "loggerList"));
+        MetaDataRoleAuthorizationStrategy.authorize(coreLoggerContainer, ENABLE,
+                xmlRolesReader.getAllAllowedRoles("Configuration", "logList"));
         add(coreLoggerContainer);
 
-        ConsoleLoggerController consoleLoggerController =
-                new ConsoleLoggerController();
-        PropertyListView consoleLoggerList =
-                new LoggerPropertyList(
-                consoleLoggerController,
-                "consolelogger",
+        ConsoleLoggerController consoleLoggerController = new ConsoleLoggerController();
+        PropertyListView consoleLoggerList = new LoggerPropertyList(consoleLoggerController, "consolelogger",
                 consoleLoggerController.getLoggers());
-        WebMarkupContainer consoleLoggerContainer =
-                new WebMarkupContainer("consoleLoggerContainer");
+        WebMarkupContainer consoleLoggerContainer = new WebMarkupContainer("consoleLoggerContainer");
         consoleLoggerContainer.add(consoleLoggerList);
         consoleLoggerContainer.setOutputMarkupId(true);
 
-        MetaDataRoleAuthorizationStrategy.authorize(
-                consoleLoggerContainer, ENABLE,
-                xmlRolesReader.getAllAllowedRoles(
-                "Configuration", "loggerList"));
+        MetaDataRoleAuthorizationStrategy.authorize(consoleLoggerContainer, ENABLE,
+                xmlRolesReader.getAllAllowedRoles("Configuration", "logList"));
         add(consoleLoggerContainer);
     }
 
     private void setupSyncopeConf() {
-        confPaginatorRows = prefMan.getPaginatorRows(getRequest(),
-                Constants.PREF_CONFIGURATION_PAGINATOR_ROWS);
+        confPaginatorRows = prefMan.getPaginatorRows(getRequest(), Constants.PREF_CONFIGURATION_PAGINATOR_ROWS);
 
         List<IColumn> confColumns = new ArrayList<IColumn>();
 
-        confColumns.add(new PropertyColumn(new ResourceModel("key"),
-                "key", "key"));
+        confColumns.add(new PropertyColumn(new ResourceModel("key"), "key", "key"));
 
-        confColumns.add(new PropertyColumn(new ResourceModel("value"),
-                "value", "value"));
+        confColumns.add(new PropertyColumn(new ResourceModel("value"), "value", "value"));
 
-        confColumns.add(new AbstractColumn<ConfigurationTO>(
-                new ResourceModel("actions", "")) {
+        confColumns.add(new AbstractColumn<ConfigurationTO>(new ResourceModel("actions", "")) {
 
             private static final long serialVersionUID = 2054811145491901166L;
 
@@ -254,39 +229,31 @@ public class Configuration extends BaseP
             }
 
             @Override
-            public void populateItem(
-                    final Item<ICellPopulator<ConfigurationTO>> cellItem,
-                    final String componentId,
-                    final IModel<ConfigurationTO> model) {
+            public void populateItem(final Item<ICellPopulator<ConfigurationTO>> cellItem,
+                    final String componentId, final IModel<ConfigurationTO> model) {
 
                 final ConfigurationTO configurationTO = model.getObject();
 
-                final ActionLinksPanel panel =
-                        new ActionLinksPanel(componentId, model);
+                final ActionLinksPanel panel = new ActionLinksPanel(componentId, model);
 
                 panel.add(new ActionLink() {
 
-                    private static final long serialVersionUID =
-                            -3722207913631435501L;
+                    private static final long serialVersionUID = -3722207913631435501L;
 
                     @Override
                     public void onClick(final AjaxRequestTarget target) {
 
-                        editConfigWin.setPageCreator(
-                                new ModalWindow.PageCreator() {
+                        editConfigWin.setPageCreator(new ModalWindow.PageCreator() {
 
-                                    private static final long serialVersionUID =
-                                            -7834632442532690940L;
+                            private static final long serialVersionUID =
+                                    -7834632442532690940L;
 
-                                    @Override
-                                    public Page createPage() {
-                                        return new ConfigurationModalPage(
-                                                Configuration.this.
-                                                getPageReference(),
-                                                editConfigWin,
-                                                configurationTO, false);
-                                    }
-                                });
+                            @Override
+                            public Page createPage() {
+                                return new ConfigurationModalPage(Configuration.this.getPageReference(),
+                                        editConfigWin, configurationTO, false);
+                            }
+                        });
 
                         editConfigWin.show(target);
                     }
@@ -294,14 +261,12 @@ public class Configuration extends BaseP
 
                 panel.add(new ActionLink() {
 
-                    private static final long serialVersionUID =
-                            -3722207913631435501L;
+                    private static final long serialVersionUID = -3722207913631435501L;
 
                     @Override
                     public void onClick(final AjaxRequestTarget target) {
                         try {
-                            confRestClient.deleteConfiguration(
-                                    configurationTO.getKey());
+                            confRestClient.deleteConfiguration(configurationTO.getKey());
                         } catch (SyncopeClientCompositeErrorException e) {
                             LOG.error("While deleting a conf key", e);
                             error(e.getMessage());
@@ -319,8 +284,7 @@ public class Configuration extends BaseP
             }
         });
 
-        final AjaxFallbackDefaultDataTable confTable =
-                new AjaxFallbackDefaultDataTable("syncopeconf", confColumns,
+        final AjaxFallbackDefaultDataTable confTable = new AjaxFallbackDefaultDataTable("syncopeconf", confColumns,
                 new SyncopeConfProvider(), confPaginatorRows);
 
         confContainer = new WebMarkupContainer("confContainer");
@@ -352,13 +316,11 @@ public class Configuration extends BaseP
 
                 createConfigWin.setPageCreator(new ModalWindow.PageCreator() {
 
-                    private static final long serialVersionUID =
-                            -7834632442532690940L;
+                    private static final long serialVersionUID = -7834632442532690940L;
 
                     @Override
                     public Page createPage() {
-                        return new ConfigurationModalPage(
-                                Configuration.this.getPageReference(),
+                        return new ConfigurationModalPage(Configuration.this.getPageReference(),
                                 createConfigWin, new ConfigurationTO(), true);
                     }
                 });
@@ -367,8 +329,7 @@ public class Configuration extends BaseP
             }
         };
 
-        MetaDataRoleAuthorizationStrategy.authorize(
-                createConfigurationLink, ENABLE,
+        MetaDataRoleAuthorizationStrategy.authorize(createConfigurationLink, ENABLE,
                 xmlRolesReader.getAllAllowedRoles("Configuration", "create"));
         add(createConfigurationLink);
 
@@ -382,10 +343,8 @@ public class Configuration extends BaseP
                     HttpResourceStream stream = new HttpResourceStream(
                             baseURL + "configuration/dbexport", restTemplate);
 
-                    ResourceStreamRequestHandler rsrh =
-                            new ResourceStreamRequestHandler(stream);
-                    rsrh.setFileName(stream.getFilename() == null
-                            ? "content.xml" : stream.getFilename());
+                    ResourceStreamRequestHandler rsrh = new ResourceStreamRequestHandler(stream);
+                    rsrh.setFileName(stream.getFilename() == null ? "content.xml" : stream.getFilename());
                     rsrh.setContentDisposition(ContentDisposition.ATTACHMENT);
 
                     getRequestCycle().scheduleRequestHandlerAfterCurrent(rsrh);
@@ -395,16 +354,14 @@ public class Configuration extends BaseP
             }
         };
 
-        MetaDataRoleAuthorizationStrategy.authorize(
-                dbExportLink, ENABLE,
+        MetaDataRoleAuthorizationStrategy.authorize(dbExportLink, ENABLE,
                 xmlRolesReader.getAllAllowedRoles("Configuration", "read"));
         add(dbExportLink);
 
         Form confPaginatorForm = new Form("confPaginatorForm");
 
         final DropDownChoice rowsChooser = new DropDownChoice("rowsChooser",
-                new PropertyModel(this, "confPaginatorRows"),
-                prefMan.getPaginatorChoices());
+                new PropertyModel(this, "confPaginatorRows"), prefMan.getPaginatorChoices());
 
         rowsChooser.add(new AjaxFormComponentUpdatingBehavior("onchange") {
 
@@ -412,9 +369,7 @@ public class Configuration extends BaseP
 
             @Override
             protected void onUpdate(final AjaxRequestTarget target) {
-                prefMan.set(getRequest(),
-                        getResponse(),
-                        Constants.PREF_CONFIGURATION_PAGINATOR_ROWS,
+                prefMan.set(getRequest(), getResponse(), Constants.PREF_CONFIGURATION_PAGINATOR_ROWS,
                         String.valueOf(confPaginatorRows));
                 confTable.setItemsPerPage(confPaginatorRows);
 
@@ -431,19 +386,13 @@ public class Configuration extends BaseP
                 Constants.PREF_NOTIFICATION_PAGINATOR_ROWS);
 
         List<IColumn> notificationCols = new ArrayList<IColumn>();
-        notificationCols.add(new PropertyColumn(new ResourceModel("id"),
-                "id", "id"));
-        notificationCols.add(new PropertyColumn(new ResourceModel("events"),
-                "events", "events"));
-        notificationCols.add(new PropertyColumn(new ResourceModel("subject"),
-                "subject", "subject"));
-        notificationCols.add(new PropertyColumn(new ResourceModel("template"),
-                "template", "template"));
-        notificationCols.add(new PropertyColumn(new ResourceModel("traceLevel"),
-                "traceLevel", "traceLevel"));
+        notificationCols.add(new PropertyColumn(new ResourceModel("id"), "id", "id"));
+        notificationCols.add(new PropertyColumn(new ResourceModel("events"), "events", "events"));
+        notificationCols.add(new PropertyColumn(new ResourceModel("subject"), "subject", "subject"));
+        notificationCols.add(new PropertyColumn(new ResourceModel("template"), "template", "template"));
+        notificationCols.add(new PropertyColumn(new ResourceModel("traceLevel"), "traceLevel", "traceLevel"));
 
-        notificationCols.add(new AbstractColumn<NotificationTO>(
-                new ResourceModel("actions", "")) {
+        notificationCols.add(new AbstractColumn<NotificationTO>(new ResourceModel("actions", "")) {
 
             private static final long serialVersionUID = 2054811145491901166L;
 
@@ -453,39 +402,31 @@ public class Configuration extends BaseP
             }
 
             @Override
-            public void populateItem(
-                    final Item<ICellPopulator<NotificationTO>> cellItem,
-                    final String componentId,
+            public void populateItem(final Item<ICellPopulator<NotificationTO>> cellItem, final String componentId,
                     final IModel<NotificationTO> model) {
 
                 final NotificationTO notificationTO = model.getObject();
 
-                final ActionLinksPanel panel =
-                        new ActionLinksPanel(componentId, model);
+                final ActionLinksPanel panel = new ActionLinksPanel(componentId, model);
 
                 panel.add(new ActionLink() {
 
-                    private static final long serialVersionUID =
-                            -3722207913631435501L;
+                    private static final long serialVersionUID = -3722207913631435501L;
 
                     @Override
                     public void onClick(final AjaxRequestTarget target) {
 
-                        editNotificationWin.setPageCreator(
-                                new ModalWindow.PageCreator() {
+                        editNotificationWin.setPageCreator(new ModalWindow.PageCreator() {
 
-                                    private static final long serialVersionUID =
-                                            -7834632442532690940L;
+                            private static final long serialVersionUID =
+                                    -7834632442532690940L;
 
-                                    @Override
-                                    public Page createPage() {
-                                        return new NotificationModalPage(
-                                                Configuration.this.
-                                                getPageReference(),
-                                                editNotificationWin,
-                                                notificationTO, false);
-                                    }
-                                });
+                            @Override
+                            public Page createPage() {
+                                return new NotificationModalPage(Configuration.this.getPageReference(),
+                                        editNotificationWin, notificationTO, false);
+                            }
+                        });
 
                         editNotificationWin.show(target);
                     }
@@ -493,14 +434,12 @@ public class Configuration extends BaseP
 
                 panel.add(new ActionLink() {
 
-                    private static final long serialVersionUID =
-                            -3722207913631435501L;
+                    private static final long serialVersionUID = -3722207913631435501L;
 
                     @Override
                     public void onClick(final AjaxRequestTarget target) {
                         try {
-                            notificationRestClient.deleteNotification(
-                                    notificationTO.getId());
+                            notificationRestClient.deleteNotification(notificationTO.getId());
                         } catch (SyncopeClientCompositeErrorException e) {
                             LOG.error("While deleting a notification", e);
                             error(e.getMessage());
@@ -518,10 +457,8 @@ public class Configuration extends BaseP
             }
         });
 
-        final AjaxFallbackDefaultDataTable notificationTable =
-                new AjaxFallbackDefaultDataTable("notificationTable",
-                notificationCols,
-                new NotificationProvider(), notificationPaginatorRows);
+        final AjaxFallbackDefaultDataTable notificationTable = new AjaxFallbackDefaultDataTable("notificationTable",
+                notificationCols, new NotificationProvider(), notificationPaginatorRows);
 
         notificationContainer = new WebMarkupContainer("notificationContainer");
         notificationContainer.add(notificationTable);
@@ -542,37 +479,29 @@ public class Configuration extends BaseP
         setWindowClosedCallback(createNotificationWin, notificationContainer);
         setWindowClosedCallback(editNotificationWin, notificationContainer);
 
-        AjaxLink createNotificationLink =
-                new AjaxLink("createNotificationLink") {
-
-                    private static final long serialVersionUID =
-                            -7978723352517770644L;
+        AjaxLink createNotificationLink = new AjaxLink("createNotificationLink") {
 
-                    @Override
-                    public void onClick(final AjaxRequestTarget target) {
+            private static final long serialVersionUID = -7978723352517770644L;
 
-                        createNotificationWin.setPageCreator(
-                                new ModalWindow.PageCreator() {
+            @Override
+            public void onClick(final AjaxRequestTarget target) {
 
-                                    private static final long serialVersionUID =
-                                            -7834632442532690940L;
+                createNotificationWin.setPageCreator(new ModalWindow.PageCreator() {
 
-                                    @Override
-                                    public Page createPage() {
-                                        return new NotificationModalPage(
-                                                Configuration.this.
-                                                getPageReference(),
-                                                createNotificationWin,
-                                                new NotificationTO(), true);
-                                    }
-                                });
+                    private static final long serialVersionUID = -7834632442532690940L;
 
-                        createNotificationWin.show(target);
+                    @Override
+                    public Page createPage() {
+                        return new NotificationModalPage(Configuration.this.getPageReference(),
+                                createNotificationWin, new NotificationTO(), true);
                     }
-                };
+                });
 
-        MetaDataRoleAuthorizationStrategy.authorize(
-                createNotificationLink, ENABLE,
+                createNotificationWin.show(target);
+            }
+        };
+
+        MetaDataRoleAuthorizationStrategy.authorize(createNotificationLink, ENABLE,
                 xmlRolesReader.getAllAllowedRoles("Notification", "create"));
         add(createNotificationLink);
 
@@ -588,9 +517,7 @@ public class Configuration extends BaseP
 
             @Override
             protected void onUpdate(final AjaxRequestTarget target) {
-                prefMan.set(getRequest(),
-                        getResponse(),
-                        Constants.PREF_NOTIFICATION_PAGINATOR_ROWS,
+                prefMan.set(getRequest(), getResponse(), Constants.PREF_NOTIFICATION_PAGINATOR_ROWS,
                         String.valueOf(notificationPaginatorRows));
                 notificationTable.setItemsPerPage(notificationPaginatorRows);
 
@@ -612,14 +539,11 @@ public class Configuration extends BaseP
         public SyncopeConfProvider() {
             //Default sorting
             setSort("key", SortOrder.ASCENDING);
-            comparator =
-                    new SortableDataProviderComparator<ConfigurationTO>(this);
+            comparator = new SortableDataProviderComparator<ConfigurationTO>(this);
         }
 
         @Override
-        public Iterator<ConfigurationTO> iterator(final int first,
-                final int count) {
-
+        public Iterator<ConfigurationTO> iterator(final int first, final int count) {
             List<ConfigurationTO> list = confRestClient.getAllConfigurations();
 
             Collections.sort(list, comparator);
@@ -633,13 +557,11 @@ public class Configuration extends BaseP
         }
 
         @Override
-        public IModel<ConfigurationTO> model(
-                final ConfigurationTO configuration) {
+        public IModel<ConfigurationTO> model(final ConfigurationTO configuration) {
 
             return new AbstractReadOnlyModel<ConfigurationTO>() {
 
-                private static final long serialVersionUID =
-                        774694801558497248L;
+                private static final long serialVersionUID = 774694801558497248L;
 
                 @Override
                 public ConfigurationTO getObject() {
@@ -659,16 +581,12 @@ public class Configuration extends BaseP
         public NotificationProvider() {
             //Default sorting
             setSort("id", SortOrder.ASCENDING);
-            comparator =
-                    new SortableDataProviderComparator<NotificationTO>(this);
+            comparator = new SortableDataProviderComparator<NotificationTO>(this);
         }
 
         @Override
-        public Iterator<NotificationTO> iterator(final int first,
-                final int count) {
-
-            List<NotificationTO> list =
-                    notificationRestClient.getAllNotifications();
+        public Iterator<NotificationTO> iterator(final int first, final int count) {
+            List<NotificationTO> list = notificationRestClient.getAllNotifications();
 
             Collections.sort(list, comparator);
 
@@ -681,13 +599,11 @@ public class Configuration extends BaseP
         }
 
         @Override
-        public IModel<NotificationTO> model(
-                final NotificationTO notification) {
+        public IModel<NotificationTO> model(final NotificationTO notification) {
 
             return new AbstractReadOnlyModel<NotificationTO>() {
 
-                private static final long serialVersionUID =
-                        774694801558497248L;
+                private static final long serialVersionUID = 774694801558497248L;
 
                 @Override
                 public NotificationTO getObject() {
@@ -703,8 +619,7 @@ public class Configuration extends BaseP
 
         private final ConsoleLoggerController consoleLoggerController;
 
-        public LoggerPropertyList(
-                final ConsoleLoggerController consoleLoggerController,
+        public LoggerPropertyList(final ConsoleLoggerController consoleLoggerController,
                 final String id, final List<? extends LoggerTO> list) {
 
             super(id, list);
@@ -715,20 +630,18 @@ public class Configuration extends BaseP
         protected void populateItem(final ListItem<LoggerTO> item) {
             item.add(new Label("name"));
 
-            DropDownChoice<LoggerLevel> level =
-                    new DropDownChoice<LoggerLevel>("level");
-            level.setModel(new IModel<LoggerLevel>() {
+            DropDownChoice<SyncopeLoggerLevel> level = new DropDownChoice<SyncopeLoggerLevel>("level");
+            level.setModel(new IModel<SyncopeLoggerLevel>() {
 
-                private static final long serialVersionUID =
-                        -2350428186089596562L;
+                private static final long serialVersionUID = -2350428186089596562L;
 
                 @Override
-                public LoggerLevel getObject() {
+                public SyncopeLoggerLevel getObject() {
                     return item.getModelObject().getLevel();
                 }
 
                 @Override
-                public void setObject(final LoggerLevel object) {
+                public void setObject(final SyncopeLoggerLevel object) {
                     item.getModelObject().setLevel(object);
                 }
 
@@ -736,29 +649,26 @@ public class Configuration extends BaseP
                 public void detach() {
                 }
             });
-            level.setChoices(Arrays.asList(LoggerLevel.values()));
+            level.setChoices(Arrays.asList(SyncopeLoggerLevel.values()));
             level.setOutputMarkupId(true);
-            level.add(new AjaxFormComponentUpdatingBehavior(
-                    "onchange") {
+            level.add(new AjaxFormComponentUpdatingBehavior("onchange") {
 
-                private static final long serialVersionUID =
-                        -1107858522700306810L;
+                private static final long serialVersionUID = -1107858522700306810L;
 
                 @Override
                 protected void onUpdate(final AjaxRequestTarget target) {
-                    boolean result = getId().equals("corelogger")
-                            ? confRestClient.setLoggerLevel(
-                            item.getModelObject().getName(),
-                            item.getModelObject().getLevel())
-                            : consoleLoggerController.setLoggerLevel(
-                            item.getModelObject().getName(),
-                            item.getModelObject().getLevel());
+                    try {
+                        if (getId().equals("corelogger")) {
+                            confRestClient.setLogLevel(item.getModelObject().getName(),
+                                    item.getModelObject().getLevel());
+                        } else {
+                            consoleLoggerController.setLogLevel(item.getModelObject().getName(),
+                                    item.getModelObject().getLevel());
+                        }
 
-                    if (result) {
                         info(getString("operation_succeded"));
-                    } else {
+                    } catch (SyncopeClientCompositeErrorException e) {
                         info(getString("operation_error"));
-
                     }
 
                     target.add(feedbackPanel);
@@ -766,8 +676,7 @@ public class Configuration extends BaseP
             });
 
             MetaDataRoleAuthorizationStrategy.authorize(level, ENABLE,
-                    xmlRolesReader.getAllAllowedRoles(
-                    "Configuration", "loggerSetLevel"));
+                    xmlRolesReader.getAllAllowedRoles("Configuration", "logSetLevel"));
 
             item.add(level);
         }
@@ -778,16 +687,13 @@ public class Configuration extends BaseP
         private static final long serialVersionUID = -1550459341476431714L;
 
         public List<LoggerTO> getLoggers() {
-            LoggerContext lc =
-                    (LoggerContext) LoggerFactory.getILoggerFactory();
-            List<LoggerTO> result =
-                    new ArrayList<LoggerTO>(lc.getLoggerList().size());
-            LoggerTO loggerTO;
+            LoggerContext lc = (LoggerContext) LoggerFactory.getILoggerFactory();
+            List<LoggerTO> result = new ArrayList<LoggerTO>(lc.getLoggerList().size());
             for (Logger logger : lc.getLoggerList()) {
                 if (logger.getLevel() != null) {
-                    loggerTO = new LoggerTO();
+                    LoggerTO loggerTO = new LoggerTO();
                     loggerTO.setName(logger.getName());
-                    loggerTO.setLevel(LoggerLevel.fromLevel(logger.getLevel()));
+                    loggerTO.setLevel(SyncopeLoggerLevel.fromLevel(logger.getLevel()));
                     result.add(loggerTO);
                 }
             }
@@ -795,11 +701,8 @@ public class Configuration extends BaseP
             return result;
         }
 
-        public boolean setLoggerLevel(final String name,
-                final LoggerLevel level) {
-
-            LoggerContext lc =
-                    (LoggerContext) LoggerFactory.getILoggerFactory();
+        public boolean setLogLevel(final String name, final SyncopeLoggerLevel level) {
+            LoggerContext lc = (LoggerContext) LoggerFactory.getILoggerFactory();
             Logger logger = lc.getLogger(name);
             if (logger != null) {
                 logger.setLevel(level.getLevel());

Modified: incubator/syncope/trunk/console/src/main/java/org/syncope/console/pages/ConfigurationModalPage.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/console/src/main/java/org/syncope/console/pages/ConfigurationModalPage.java?rev=1300549&r1=1300548&r2=1300549&view=diff
==============================================================================
--- incubator/syncope/trunk/console/src/main/java/org/syncope/console/pages/ConfigurationModalPage.java (original)
+++ incubator/syncope/trunk/console/src/main/java/org/syncope/console/pages/ConfigurationModalPage.java Wed Mar 14 14:03:36 2012
@@ -30,6 +30,7 @@ import org.apache.wicket.model.Model;
 import org.apache.wicket.model.PropertyModel;
 import org.apache.wicket.spring.injection.annot.SpringBean;
 import org.syncope.client.to.ConfigurationTO;
+import org.syncope.client.validation.SyncopeClientCompositeErrorException;
 import org.syncope.console.rest.ConfigurationRestClient;
 import org.syncope.console.wicket.markup.html.form.AjaxTextFieldPanel;
 
@@ -53,13 +54,10 @@ public class ConfigurationModalPage exte
      * @param configurationTO
      * @param createFlag true for CREATE and false for UPDATE operation
      */
-    public ConfigurationModalPage(final PageReference callPageRef,
-            final ModalWindow window,
-            final ConfigurationTO configurationTO,
-            final boolean createFlag) {
+    public ConfigurationModalPage(final PageReference callPageRef, final ModalWindow window,
+            final ConfigurationTO configurationTO, final boolean createFlag) {
 
-        Form form = new Form("form", new CompoundPropertyModel(
-                configurationTO));
+        Form form = new Form("form", new CompoundPropertyModel(configurationTO));
 
         final AjaxTextFieldPanel key = new AjaxTextFieldPanel("key", "key", new PropertyModel(configurationTO, "key"));
         form.add(key);
@@ -71,46 +69,36 @@ public class ConfigurationModalPage exte
         form.add(value);
         value.addRequiredLabel();
 
-        submit = new IndicatingAjaxButton(
-                "apply", new Model<String>(getString("submit"))) {
+        submit = new IndicatingAjaxButton("apply", new Model<String>(getString("submit"))) {
 
             private static final long serialVersionUID = -958724007591692537L;
 
             @Override
-            protected void onSubmit(final AjaxRequestTarget target,
-                    final Form form) {
-
-                boolean res = false;
-
-                if (createFlag) {
-                    res = configurationsRestClient.createConfiguration(
-                            configurationTO);
-
-                    if (!res) {
-                        error(getString("error_insert"));
-                    }
-                } else {
-                    res = configurationsRestClient.updateConfiguration(
-                            configurationTO);
-
-                    if (!res) {
-                        error(getString("error_updating"));
+            protected void onSubmit(final AjaxRequestTarget target, final Form form) {
+                try {
+                    if (createFlag) {
+                        configurationsRestClient.createConfiguration(configurationTO);
+                    } else {
+                        configurationsRestClient.updateConfiguration(configurationTO);
                     }
-                }
 
-                if (res) {
-                    Configuration callerPage =
-                            (Configuration) callPageRef.getPage();
+                    Configuration callerPage = (Configuration) callPageRef.getPage();
                     callerPage.setModalResult(true);
 
                     window.close(target);
+                } catch (SyncopeClientCompositeErrorException e) {
+                    if (createFlag) {
+                        error(getString("error_insert"));
+                    } else {
+                        error(getString("error_updating"));
+                    }
+                    target.add(feedbackPanel);
+                    LOG.error("While creating or updating configuration {}", configurationTO, e);
                 }
             }
 
             @Override
-            protected void onError(final AjaxRequestTarget target,
-                    final Form form) {
-
+            protected void onError(final AjaxRequestTarget target, final Form form) {
                 target.add(feedbackPanel);
             }
         };
@@ -119,8 +107,7 @@ public class ConfigurationModalPage exte
                 ? xmlRolesReader.getAllAllowedRoles("Configuration", "create")
                 : xmlRolesReader.getAllAllowedRoles("Configuration", "update");
 
-        MetaDataRoleAuthorizationStrategy.authorize(submit, ENABLE,
-                allowedRoles);
+        MetaDataRoleAuthorizationStrategy.authorize(submit, ENABLE, allowedRoles);
 
         form.add(submit);
 

Modified: incubator/syncope/trunk/console/src/main/java/org/syncope/console/pages/ConnectorModalPage.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/console/src/main/java/org/syncope/console/pages/ConnectorModalPage.java?rev=1300549&r1=1300548&r2=1300549&view=diff
==============================================================================
--- incubator/syncope/trunk/console/src/main/java/org/syncope/console/pages/ConnectorModalPage.java (original)
+++ incubator/syncope/trunk/console/src/main/java/org/syncope/console/pages/ConnectorModalPage.java Wed Mar 14 14:03:36 2012
@@ -369,7 +369,7 @@ public class ConnectorModalPage extends 
                     error(getString("error") + ":" + e.getMessage());
                     target.add(feedbackPanel);
                     ((Resources) callerPageRef.getPage()).setModalResult(false);
-                    LOG.error("While creating or updating connector {}", conn);
+                    LOG.error("While creating or updating connector {}", conn, e);
                 }
             }
 

Modified: incubator/syncope/trunk/console/src/main/java/org/syncope/console/rest/ConfigurationRestClient.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/console/src/main/java/org/syncope/console/rest/ConfigurationRestClient.java?rev=1300549&r1=1300548&r2=1300549&view=diff
==============================================================================
--- incubator/syncope/trunk/console/src/main/java/org/syncope/console/rest/ConfigurationRestClient.java (original)
+++ incubator/syncope/trunk/console/src/main/java/org/syncope/console/rest/ConfigurationRestClient.java Wed Mar 14 14:03:36 2012
@@ -23,8 +23,7 @@ import java.util.List;
 import org.springframework.stereotype.Component;
 import org.syncope.client.to.ConfigurationTO;
 import org.syncope.client.to.LoggerTO;
-import org.syncope.client.validation.SyncopeClientCompositeErrorException;
-import org.syncope.types.LoggerLevel;
+import org.syncope.types.SyncopeLoggerLevel;
 
 @Component
 public class ConfigurationRestClient extends AbstractBaseRestClient {
@@ -35,84 +34,43 @@ public class ConfigurationRestClient ext
      * @return ConfigurationTOs
      */
     public List<ConfigurationTO> getAllConfigurations() {
-        return Arrays.asList(
-                restTemplate.getForObject(baseURL
-                + "configuration/list.json", ConfigurationTO[].class));
+        return Arrays.asList(restTemplate.getForObject(baseURL + "configuration/list.json", ConfigurationTO[].class));
     }
 
-    public ConfigurationTO readConfiguration(String key) {
-
-        return restTemplate.getForObject(
-                baseURL + "configuration/read/{key}.json",
-                ConfigurationTO.class, key);
+    public ConfigurationTO readConfiguration(final String key) {
+        return restTemplate.getForObject(baseURL + "configuration/read/{key}.json", ConfigurationTO.class, key);
     }
 
     /**
      * Create a new configuration.
      *
      * @param configurationTO
-     * @return true if the operation ends succesfully, false otherwise
      */
-    public boolean createConfiguration(ConfigurationTO configurationTO) {
-
-        ConfigurationTO newConfigurationTO =
-                restTemplate.postForObject(baseURL
-                + "configuration/create",
-                configurationTO, ConfigurationTO.class);
-
-        return configurationTO.equals(newConfigurationTO);
+    public void createConfiguration(ConfigurationTO configurationTO) {
+        restTemplate.postForObject(baseURL + "configuration/create", configurationTO, ConfigurationTO.class);
     }
 
     /**
-     * Update an existent configuration.
+     * Update an existing configuration.
      *
      * @param configurationTO
-     * @return true if the operation ends succesfully, false otherwise
      */
-    public boolean updateConfiguration(ConfigurationTO configurationTO) {
-        ConfigurationTO newConfigurationTO = null;
-
-        try {
-            newConfigurationTO = restTemplate.postForObject(baseURL
-                    + "configuration/update", configurationTO,
-                    ConfigurationTO.class);
-        } catch (SyncopeClientCompositeErrorException e) {
-            LOG.error("While updating a configuration", e);
-            return false;
-        }
-        return configurationTO.equals(newConfigurationTO);
+    public void updateConfiguration(final ConfigurationTO configurationTO) {
+        restTemplate.postForObject(baseURL + "configuration/update", configurationTO, ConfigurationTO.class);
     }
 
     /**
      * Deelete a configuration by key.
      */
     public void deleteConfiguration(final String key) {
-        restTemplate.delete(baseURL
-                + "configuration/delete/{key}.json", key);
+        restTemplate.delete(baseURL + "configuration/delete/{key}.json", key);
     }
 
-    /**
-     * Get all loggers.
-     *
-     * @return LoggerTOs
-     */
-    public List<LoggerTO> getLoggers() {
-        return Arrays.asList(restTemplate.getForObject(
-                baseURL + "logger/list", LoggerTO[].class));
-    }
-
-    public boolean setLoggerLevel(final String name, final LoggerLevel level) {
-        boolean result;
-        try {
-            restTemplate.postForObject(
-                    baseURL + "logger/set/{name}/{level}",
-                    null, LoggerTO.class, name, level);
-            result = true;
-        } catch (SyncopeClientCompositeErrorException e) {
-            LOG.error("While setting a logger's level", e);
-            result = false;
-        }
+    public List<LoggerTO> listLogs() {
+        return Arrays.asList(restTemplate.getForObject(baseURL + "logger/log/list", LoggerTO[].class));
+    }
 
-        return result;
+    public void setLogLevel(final String name, final SyncopeLoggerLevel level) {
+        restTemplate.postForObject(baseURL + "logger/log/{name}/{level}", null, LoggerTO.class, name, level);
     }
 }

Modified: incubator/syncope/trunk/console/src/main/resources/authorizations.xml
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/console/src/main/resources/authorizations.xml?rev=1300549&r1=1300548&r2=1300549&view=diff
==============================================================================
--- incubator/syncope/trunk/console/src/main/resources/authorizations.xml (original)
+++ incubator/syncope/trunk/console/src/main/resources/authorizations.xml Wed Mar 14 14:03:36 2012
@@ -124,6 +124,20 @@ under the License.
       <entitlement>REPORT_EXECUTE</entitlement>
     </action>
   </page>
+  
+  <page id="Audit">
+    <action id="list">
+      <entitlement>AUDIT_LIST</entitlement>
+    </action>
+        
+    <action id="setLevel">
+      <entitlement>AUDIT_SET_LEVEL</entitlement>
+    </action>
+
+    <action id="delete">
+      <entitlement>AUDIT_DELETE</entitlement>
+    </action>
+  </page>
 
   <page id="Connectors">
     <action id="list">
@@ -195,12 +209,16 @@ under the License.
       <entitlement>CONFIGURATION_DELETE</entitlement>
     </action>
 
-    <action id="loggerList">
-      <entitlement>LOGGER_LIST</entitlement>
+    <action id="logList">
+      <entitlement>LOG_LIST</entitlement>
     </action>
         
-    <action id="loggerSetLevel">
-      <entitlement>LOGGER_SET_LEVEL</entitlement>
+    <action id="logSetLevel">
+      <entitlement>LOG_SET_LEVEL</entitlement>
+    </action>
+
+    <action id="logDelete">
+      <entitlement>LOG_DELETE</entitlement>
     </action>
         
     <action id="workflowDefRead">

Added: incubator/syncope/trunk/core/src/main/java/org/syncope/core/audit/AuditManager.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/core/src/main/java/org/syncope/core/audit/AuditManager.java?rev=1300549&view=auto
==============================================================================
--- incubator/syncope/trunk/core/src/main/java/org/syncope/core/audit/AuditManager.java (added)
+++ incubator/syncope/trunk/core/src/main/java/org/syncope/core/audit/AuditManager.java Wed Mar 14 14:03:36 2012
@@ -0,0 +1,74 @@
+/*
+ * 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.syncope.core.audit;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.security.core.context.SecurityContext;
+import org.springframework.security.core.context.SecurityContextHolder;
+import org.syncope.types.AuditElements;
+import org.syncope.types.SyncopeLoggerType;
+
+public class AuditManager {
+
+    /**
+     * Logger.
+     */
+    private static final Logger LOG = LoggerFactory.getLogger(AuditManager.class);
+
+    private String getLoggerName(final AuditElements.Category category, final Enum<?> subcategory,
+            final AuditElements.Result result) {
+
+        StringBuilder loggerName = new StringBuilder();
+        loggerName.append(SyncopeLoggerType.AUDIT.getPrefix()).append('.').
+                append(category.name()).append('.').append(subcategory.name()).append('.').append(result.name());
+        return loggerName.toString();
+    }
+
+    public void audit(final AuditElements.Category category, final Enum<?> subcategory,
+            final AuditElements.Result result, final String message) {
+
+        audit(category, subcategory, result, message, null);
+    }
+
+    public void audit(final AuditElements.Category category, final Enum<?> subcategory,
+            final AuditElements.Result result, final String message, final Throwable t) {
+
+        if (category == null || subcategory == null || result == null) {
+            LOG.error("Invalid request: some null items {} {} {}", new Object[]{category, subcategory, result});
+        } else if (!AuditElements.getSubCategories(category).contains(subcategory)) {
+            LOG.error("Invalid request: {} does not belong to {}", new Object[]{subcategory, category});
+        } else {
+            StringBuilder auditMessage = new StringBuilder();
+
+            final SecurityContext ctx = SecurityContextHolder.getContext();
+            if (ctx != null && ctx.getAuthentication() != null) {
+                auditMessage.append('[').append(ctx.getAuthentication().getName()).append(']').append(' ');
+            }
+            auditMessage.append(message);
+
+            Logger logger = LoggerFactory.getLogger(getLoggerName(category, subcategory, result));
+            if (t == null) {
+                logger.debug(auditMessage.toString());
+            } else {
+                logger.debug(auditMessage.toString(), t);
+            }
+        }
+    }
+}

Propchange: incubator/syncope/trunk/core/src/main/java/org/syncope/core/audit/AuditManager.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/syncope/trunk/core/src/main/java/org/syncope/core/audit/AuditManager.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: incubator/syncope/trunk/core/src/main/java/org/syncope/core/audit/AuditManager.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: incubator/syncope/trunk/core/src/main/java/org/syncope/core/audit/JNDIFallbackConnectionSource.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/core/src/main/java/org/syncope/core/audit/JNDIFallbackConnectionSource.java?rev=1300549&view=auto
==============================================================================
--- incubator/syncope/trunk/core/src/main/java/org/syncope/core/audit/JNDIFallbackConnectionSource.java (added)
+++ incubator/syncope/trunk/core/src/main/java/org/syncope/core/audit/JNDIFallbackConnectionSource.java Wed Mar 14 14:03:36 2012
@@ -0,0 +1,159 @@
+/*
+ * 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.syncope.core.audit;
+
+import ch.qos.logback.core.db.ConnectionSource;
+import ch.qos.logback.core.db.ConnectionSourceBase;
+import ch.qos.logback.core.db.DataSourceConnectionSource;
+import ch.qos.logback.core.db.JNDIConnectionSource;
+import ch.qos.logback.core.db.dialect.SQLDialectCode;
+import ch.qos.logback.core.spi.ContextAwareBase;
+import java.sql.Connection;
+import java.sql.SQLException;
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+import javax.rmi.PortableRemoteObject;
+import javax.sql.DataSource;
+
+/**
+ * The <id>FallbackConnectionSource</id> is an implementation of
+ * {@link ConnectionSource} that attempts at first to obtain a {@link javax.sql.DataSource} from a JNDI provider and, if
+ * not found, from a provided {@link javax.sql.DataSource DataSource}.
+ *
+ * @author <a href="mailto:rdecampo@twcny.rr.com">Ray DeCampo</a>
+ */
+public class JNDIFallbackConnectionSource extends ContextAwareBase implements ConnectionSource {
+
+    private String jndiLocation;
+
+    private DataSource dataSource;
+
+    private ConnectionSourceBase delegate;
+
+    public String getJndiLocation() {
+        return jndiLocation;
+    }
+
+    public void setJndiLocation(final String jndiLocation) {
+        this.jndiLocation = jndiLocation;
+    }
+
+    public DataSource getDataSource() {
+        return dataSource;
+    }
+
+    public void setDataSource(final DataSource dataSource) {
+        this.dataSource = dataSource;
+    }
+
+    private void chooseDelegate() {
+        if (delegate != null) {
+            return;
+        }
+
+        JNDIConnectionSource jndiCS = new JNDIConnectionSource();
+        jndiCS.setJndiLocation(jndiLocation);
+        try {
+            Context ctx = new InitialContext();
+            Object obj = ctx.lookup(jndiCS.getJndiLocation());
+
+            PortableRemoteObject.narrow(obj, DataSource.class);
+
+            delegate = jndiCS;
+            addInfo("DataSource obtained from " + jndiLocation);
+        } catch (NamingException e) {
+            addError("During lookup of " + jndiLocation);
+        } catch (ClassCastException e) {
+            addError("Object at " + jndiLocation + " does not seem to be a DataSource instance", e);
+        }
+
+        if (delegate == null) {
+            addInfo("Could not obtain DataSource via JNDI");
+
+            DataSourceConnectionSource dataSourceCS = new DataSourceConnectionSource();
+            dataSourceCS.setDataSource(dataSource);
+            Connection conn = null;
+            try {
+                conn = dataSourceCS.getConnection();
+
+                delegate = dataSourceCS;
+                addInfo("Provided DataSource successfully reported");
+            } catch (SQLException e) {
+                addError("While trying to get connection from DataSource " + dataSource, e);
+            } finally {
+                if (conn != null) {
+                    try {
+                        conn.close();
+                    } catch (SQLException sqle) {
+                        addError("Could not close connection", sqle);
+                    }
+                }
+            }
+        }
+
+        if (delegate != null) {
+            delegate.setContext(context);
+        }
+    }
+
+    @Override
+    public boolean isStarted() {
+        chooseDelegate();
+        return delegate.isStarted();
+    }
+
+    @Override
+    public void start() {
+        chooseDelegate();
+        delegate.start();
+    }
+
+    @Override
+    public void stop() {
+        chooseDelegate();
+        delegate.stop();
+    }
+
+    @Override
+    public Connection getConnection()
+            throws SQLException {
+
+        chooseDelegate();
+        return delegate.getConnection();
+    }
+
+    @Override
+    public SQLDialectCode getSQLDialectCode() {
+        chooseDelegate();
+        return delegate.getSQLDialectCode();
+    }
+
+    @Override
+    public boolean supportsGetGeneratedKeys() {
+        chooseDelegate();
+        return delegate.supportsGetGeneratedKeys();
+    }
+
+    @Override
+    public boolean supportsBatchUpdates() {
+        chooseDelegate();
+        return delegate.supportsBatchUpdates();
+    }
+}

Propchange: incubator/syncope/trunk/core/src/main/java/org/syncope/core/audit/JNDIFallbackConnectionSource.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/syncope/trunk/core/src/main/java/org/syncope/core/audit/JNDIFallbackConnectionSource.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: incubator/syncope/trunk/core/src/main/java/org/syncope/core/audit/JNDIFallbackConnectionSource.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: incubator/syncope/trunk/core/src/main/java/org/syncope/core/connid/SLF4JLogger.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/core/src/main/java/org/syncope/core/connid/SLF4JLogger.java?rev=1300549&r1=1300548&r2=1300549&view=diff
==============================================================================
--- incubator/syncope/trunk/core/src/main/java/org/syncope/core/connid/SLF4JLogger.java (original)
+++ incubator/syncope/trunk/core/src/main/java/org/syncope/core/connid/SLF4JLogger.java Wed Mar 14 14:03:36 2012
@@ -31,8 +31,7 @@ public class SLF4JLogger implements LogS
     /**
      * Logger.
      */
-    private static final Logger LOG = LoggerFactory.getLogger(
-            SLF4JLogger.class);
+    private static final Logger LOG = LoggerFactory.getLogger(SLF4JLogger.class);
 
     @Override
     public final void log(final Class<?> clazz,

Modified: incubator/syncope/trunk/core/src/main/java/org/syncope/core/init/ActivitiWorkflowLoader.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/core/src/main/java/org/syncope/core/init/ActivitiWorkflowLoader.java?rev=1300549&r1=1300548&r2=1300549&view=diff
==============================================================================
--- incubator/syncope/trunk/core/src/main/java/org/syncope/core/init/ActivitiWorkflowLoader.java (original)
+++ incubator/syncope/trunk/core/src/main/java/org/syncope/core/init/ActivitiWorkflowLoader.java Wed Mar 14 14:03:36 2012
@@ -32,18 +32,15 @@ import org.syncope.core.workflow.Activit
 @Component
 public class ActivitiWorkflowLoader {
 
-    private static final Logger LOG = LoggerFactory.getLogger(
-            ActivitiWorkflowLoader.class);
+    private static final Logger LOG = LoggerFactory.getLogger(ActivitiWorkflowLoader.class);
 
     @Autowired
     private RepositoryService repositoryService;
 
     public void load() {
-        List<ProcessDefinition> processes = repositoryService.
-                createProcessDefinitionQuery().processDefinitionKey(
-                ActivitiUserWorkflowAdapter.WF_PROCESS_ID).list();
-        LOG.debug(ActivitiUserWorkflowAdapter.WF_PROCESS_ID
-                + " Activiti processes in repository: {}", processes);
+        List<ProcessDefinition> processes = repositoryService.createProcessDefinitionQuery().
+                processDefinitionKey(ActivitiUserWorkflowAdapter.WF_PROCESS_ID).list();
+        LOG.debug(ActivitiUserWorkflowAdapter.WF_PROCESS_ID + " Activiti processes in repository: {}", processes);
 
         // Only loads process definition from file if not found in repository
         if (processes.isEmpty()) {
@@ -53,16 +50,15 @@ public class ActivitiWorkflowLoader {
                         + ActivitiUserWorkflowAdapter.WF_PROCESS_RESOURCE);
 
                 repositoryService.createDeployment().addInputStream(
-                        ActivitiUserWorkflowAdapter.WF_PROCESS_RESOURCE,
-                        wfDefinitionStream).deploy();
+                        ActivitiUserWorkflowAdapter.WF_PROCESS_RESOURCE, wfDefinitionStream).deploy();
             } finally {
-                try {
-                    if (wfDefinitionStream != null) {
+                if (wfDefinitionStream != null) {
+                    try {
                         wfDefinitionStream.close();
+                    } catch (IOException e) {
+                        LOG.error("While closing input stream for {}",
+                                ActivitiUserWorkflowAdapter.WF_PROCESS_RESOURCE, e);
                     }
-                } catch (IOException e) {
-                    LOG.error("While closing input stream for {}",
-                            ActivitiUserWorkflowAdapter.WF_PROCESS_RESOURCE, e);
                 }
             }
         }

Modified: incubator/syncope/trunk/core/src/main/java/org/syncope/core/init/ConnInstanceLoader.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/core/src/main/java/org/syncope/core/init/ConnInstanceLoader.java?rev=1300549&r1=1300548&r2=1300549&view=diff
==============================================================================
--- incubator/syncope/trunk/core/src/main/java/org/syncope/core/init/ConnInstanceLoader.java (original)
+++ incubator/syncope/trunk/core/src/main/java/org/syncope/core/init/ConnInstanceLoader.java Wed Mar 14 14:03:36 2012
@@ -28,12 +28,15 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.BeansException;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.support.DefaultListableBeanFactory;
+import org.springframework.context.ConfigurableApplicationContext;
 import org.springframework.stereotype.Component;
 import org.springframework.transaction.annotation.Transactional;
 import org.syncope.core.persistence.beans.ConnInstance;
 import org.syncope.core.persistence.beans.ExternalResource;
 import org.syncope.core.persistence.dao.ResourceDAO;
 import org.syncope.core.propagation.ConnectorFacadeProxy;
+import org.syncope.core.util.ApplicationContextManager;
 import org.syncope.core.util.ConnBundleManager;
 import org.syncope.types.ConnConfProperty;
 
@@ -41,10 +44,9 @@ import org.syncope.types.ConnConfPropert
  * Load ConnId connector instances.
  */
 @Component
-public class ConnInstanceLoader extends AbstractLoader {
+public class ConnInstanceLoader {
 
-    private static final Logger LOG = LoggerFactory.getLogger(
-            ConnInstanceLoader.class);
+    private static final Logger LOG = LoggerFactory.getLogger(ConnInstanceLoader.class);
 
     @Autowired
     private ResourceDAO resourceDAO;
@@ -52,9 +54,14 @@ public class ConnInstanceLoader extends 
     @Autowired
     private ConnBundleManager connBundleManager;
 
+    private DefaultListableBeanFactory getBeanFactory() {
+        ConfigurableApplicationContext context = ApplicationContextManager.getApplicationContext();
+
+        return (DefaultListableBeanFactory) context.getBeanFactory();
+    }
+
     private String getBeanName(final ExternalResource resource) {
-        return String.format("connInstance-%d-%s",
-                resource.getConnector().getId(), resource.getName());
+        return String.format("connInstance-%d-%s", resource.getConnector().getId(), resource.getName());
     }
 
     /**
@@ -62,8 +69,7 @@ public class ConnInstanceLoader extends 
      *
      * @param resource the resource.
      * @return live connector bran for given resource
-     * @throws BeansException in case the connector is not registered in the
-     * context
+     * @throws BeansException in case the connector is not registered in the context
      */
     public ConnectorFacadeProxy getConnector(final ExternalResource resource)
             throws BeansException, NotFoundException {
@@ -74,16 +80,13 @@ public class ConnInstanceLoader extends 
             registerConnector(resource);
         }
 
-        return (ConnectorFacadeProxy) getBeanFactory().getBean(
-                getBeanName(resource));
+        return (ConnectorFacadeProxy) getBeanFactory().getBean(getBeanName(resource));
     }
 
-    public ConnectorFacadeProxy createConnectorBean(
-            final ExternalResource resource)
+    public ConnectorFacadeProxy createConnectorBean(final ExternalResource resource)
             throws NotFoundException {
 
-        final Set<ConnConfProperty> configuration =
-                new HashSet<ConnConfProperty>();
+        final Set<ConnConfProperty> configuration = new HashSet<ConnConfProperty>();
 
         // to be used to control managed prop (needed by overridden mechanism)
         final Set<String> propertyNames = new HashSet<String>();
@@ -110,21 +113,19 @@ public class ConnInstanceLoader extends 
     }
 
     /**
-     * Create connector bean starting from connector instance and configuration
-     * properties. This method has to be used to create a connector instance
-     * without any linked external resource.
+     * Create connector bean starting from connector instance and configuration properties. This method must be used to
+     * create a connector instance without any linked external resource.
+     *
      * @param connInstance connector instance.
      * @param configuration configuration properties.
      * @return connector facade proxy.
      * @throws NotFoundException when not able to fetch all the required data.
      */
-    public ConnectorFacadeProxy createConnectorBean(
-            final ConnInstance connInstance,
+    public ConnectorFacadeProxy createConnectorBean(final ConnInstance connInstance,
             final Set<ConnConfProperty> configuration)
             throws NotFoundException {
 
-        final ConnInstance connInstanceClone =
-                (ConnInstance) SerializationUtils.clone(connInstance);
+        final ConnInstance connInstanceClone = (ConnInstance) SerializationUtils.clone(connInstance);
 
         connInstanceClone.setConfiguration(configuration);
 
@@ -151,7 +152,6 @@ public class ConnInstanceLoader extends 
         getBeanFactory().destroySingleton(id);
     }
 
-    @Override
     @Transactional(readOnly = true)
     public void load() {
         // This is needed to avoid encoding problems when sending error
@@ -161,21 +161,14 @@ public class ConnInstanceLoader extends 
         // Next load all resource-specific connectors.
         for (ExternalResource resource : resourceDAO.findAll()) {
             try {
-                LOG.info("Registering resource-connector pair {}-{}",
-                        resource, resource.getConnector());
+                LOG.info("Registering resource-connector pair {}-{}", resource, resource.getConnector());
                 registerConnector(resource);
-            } catch (NotFoundException e) {
-                LOG.error(String.format(
-                        "While registering resource-connector pair %s-%s",
-                        resource, resource.getConnector()), e);
-            } catch (RuntimeException e) {
-                LOG.error(String.format(
-                        "While registering resource-connector pair %s-%s",
-                        resource, resource.getConnector()), e);
+            } catch (Exception e) {
+                LOG.error("While registering resource-connector pair {}-{}",
+                        new Object[]{resource, resource.getConnector(), e});
             }
         }
 
-        LOG.info("Done loading {} connectors.", getBeanFactory().getBeansOfType(
-                ConnectorFacadeProxy.class).size());
+        LOG.info("Done loading {} connectors.", getBeanFactory().getBeansOfType(ConnectorFacadeProxy.class).size());
     }
 }

Modified: incubator/syncope/trunk/core/src/main/java/org/syncope/core/init/ContentLoader.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/core/src/main/java/org/syncope/core/init/ContentLoader.java?rev=1300549&r1=1300548&r2=1300549&view=diff
==============================================================================
--- incubator/syncope/trunk/core/src/main/java/org/syncope/core/init/ContentLoader.java (original)
+++ incubator/syncope/trunk/core/src/main/java/org/syncope/core/init/ContentLoader.java Wed Mar 14 14:03:36 2012
@@ -18,7 +18,6 @@
  */
 package org.syncope.core.init;
 
-import org.syncope.core.util.ImportExport;
 import java.io.InputStream;
 import java.sql.Connection;
 import java.sql.ResultSet;
@@ -35,6 +34,7 @@ import org.springframework.jdbc.datasour
 import org.springframework.stereotype.Component;
 import org.springframework.transaction.annotation.Transactional;
 import org.syncope.core.persistence.beans.SyncopeConf;
+import org.syncope.core.util.ImportExport;
 
 /**
  * If empty, load default content to Syncope database by reading from
@@ -46,8 +46,7 @@ public class ContentLoader {
     /**
      * Logger.
      */
-    private static final Logger LOG = LoggerFactory.getLogger(
-            ContentLoader.class);
+    private static final Logger LOG = LoggerFactory.getLogger(ContentLoader.class);
 
     @Autowired
     private DataSource dataSource;
@@ -65,9 +64,7 @@ public class ContentLoader {
         ResultSet resultSet = null;
         boolean existingData = false;
         try {
-            statement = conn.createStatement(
-                    ResultSet.TYPE_SCROLL_SENSITIVE,
-                    ResultSet.CONCUR_READ_ONLY);
+            statement = conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_READ_ONLY);
 
             resultSet = statement.executeQuery("SELECT * FROM " + SyncopeConf.class.getSimpleName());
             resultSet.last();



Mime
View raw message