syncope-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject [3/3] syncope git commit: message refactoring, SYNCOPE-158
Date Thu, 29 Oct 2015 12:28:19 GMT
message refactoring, SYNCOPE-158


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

Branch: refs/heads/master
Commit: 6d368c8b264e11e35d709365e39e663ede7bc57e
Parents: e486aaf
Author: massi <massimiliano.perrone@tirasa.net>
Authored: Thu Oct 29 13:27:57 2015 +0100
Committer: massi <massimiliano.perrone@tirasa.net>
Committed: Thu Oct 29 13:27:57 2015 +0100

----------------------------------------------------------------------
 .../apache/syncope/client/cli/SyncopeAdm.java   |   7 +-
 .../cli/commands/CommonsResultManager.java      |  13 +-
 .../configuration/ConfigurationCommand.java     |   2 +-
 .../configuration/ConfigurationDelete.java      |   5 +-
 .../configuration/ConfigurationExport.java      |  12 +-
 .../configuration/ConfigurationGet.java         |  21 ++-
 .../configuration/ConfigurationRead.java        |   3 +-
 .../configuration/ConfigurationUpdate.java      |   7 +-
 .../commands/connector/ConnectorCommand.java    |   4 +-
 .../cli/commands/connector/ConnectorDelete.java |   5 +-
 .../cli/commands/connector/ConnectorList.java   |  21 ++-
 .../connector/ConnectorListBundles.java         |  21 ++-
 .../ConnectorListConfigurationProperties.java   |   8 +-
 .../cli/commands/connector/ConnectorRead.java   |  11 +-
 .../connector/ConnectorReadByResource.java      |  11 +-
 .../connector/ConnectorResultManager.java       |  39 +++---
 .../connector/ConnectorSyncopeOperations.java   |   2 +-
 .../cli/commands/domain/DomainCommand.java      |   4 +-
 .../cli/commands/domain/DomainDelete.java       |   5 +-
 .../client/cli/commands/domain/DomainList.java  |  22 ++-
 .../client/cli/commands/domain/DomainRead.java  |   6 +-
 .../commands/domain/DomainResultManager.java    |  12 ++
 .../entitlement/AbstractEntitlementCommand.java |   2 +-
 .../entitlement/EntitlementCommand.java         |   5 +-
 .../commands/entitlement/EntitlementList.java   |  16 ++-
 .../entitlement/EntitlementListRole.java        |   5 +-
 .../entitlement/EntitlementReadByUserId.java    |   2 +-
 .../entitlement/EntitlementReadByUsername.java  |   2 +-
 .../entitlement/EntitlementResultManager.java   |   1 -
 .../entitlement/EntitlementSearchByRole.java    |   3 +-
 .../syncope/client/cli/commands/help/Help.java  |   6 +-
 .../cli/commands/help/HelpResultManager.java    |   3 +
 .../syncope/client/cli/commands/info/Info.java  | 133 +++++++------------
 .../cli/commands/info/InfoResultManager.java    | 126 ++++++++++++++++++
 .../cli/commands/install/InstallCommand.java    |  13 +-
 .../commands/install/InstallResultManager.java  |  10 ++
 .../cli/commands/install/InstallSetup.java      |  20 +--
 .../cli/commands/logger/LoggerCommand.java      |   3 +-
 .../cli/commands/logger/LoggerCreate.java       |   1 -
 .../cli/commands/logger/LoggerDelete.java       |   3 +-
 .../client/cli/commands/logger/LoggerList.java  |  20 ++-
 .../client/cli/commands/logger/LoggerRead.java  |   2 +-
 .../commands/logger/LoggerResultManager.java    |   1 -
 .../cli/commands/logger/LoggerUpdate.java       |   6 +-
 .../cli/commands/logger/LoggerUpdateAll.java    |   3 +-
 .../notification/NotificationCommand.java       |   3 +-
 .../notification/NotificationDelete.java        |   3 +-
 .../commands/notification/NotificationList.java |  23 +++-
 .../commands/notification/NotificationRead.java |   2 +-
 .../cli/commands/policy/PolicyCommand.java      |   1 -
 .../cli/commands/policy/PolicyDelete.java       |   6 +-
 .../client/cli/commands/policy/PolicyList.java  |   2 +-
 .../client/cli/commands/policy/PolicyRead.java  |   4 +-
 .../cli/commands/question/QuestionCommand.java  |   3 +-
 .../cli/commands/question/QuestionDelete.java   |   3 +-
 .../cli/commands/question/QuestionList.java     |  21 ++-
 .../cli/commands/question/QuestionRead.java     |   3 +-
 .../question/QuestionSyncopeOperations.java     |   1 -
 .../client/cli/commands/realm/RealmCommand.java |   3 +-
 .../client/cli/commands/realm/RealmList.java    |  21 ++-
 .../commands/realm/RealmSyncopeOperations.java  |   1 -
 .../cli/commands/report/ReportCommand.java      |   5 +-
 .../cli/commands/report/ReportDelete.java       |   5 +-
 .../commands/report/ReportDeleteExecution.java  |   7 +-
 .../cli/commands/report/ReportExecute.java      |   6 +-
 .../commands/report/ReportExportExecution.java  |  18 +--
 .../client/cli/commands/report/ReportList.java  |  22 ++-
 .../cli/commands/report/ReportListJobs.java     |  23 +++-
 .../client/cli/commands/report/ReportRead.java  |   2 +-
 .../commands/report/ReportReadExecution.java    |   4 +-
 .../cli/commands/resource/ResourceCommand.java  |   3 +-
 .../cli/commands/resource/ResourceDelete.java   |   3 +-
 .../cli/commands/resource/ResourceList.java     |  21 ++-
 .../cli/commands/resource/ResourceRead.java     |   3 +-
 .../resource/ResourceResultManager.java         |   2 -
 .../client/cli/commands/role/RoleCommand.java   |   3 +-
 .../client/cli/commands/role/RoleDelete.java    |   2 +-
 .../client/cli/commands/role/RoleList.java      |  21 ++-
 .../client/cli/commands/role/RoleRead.java      |   3 +-
 .../commands/role/RoleSyncopeOperations.java    |   1 -
 .../cli/commands/schema/SchemaCommand.java      |   8 +-
 .../cli/commands/schema/SchemaDelete.java       |   5 +-
 .../client/cli/commands/schema/SchemaList.java  |   2 +-
 .../cli/commands/schema/SchemaListAll.java      |  54 +++++---
 .../cli/commands/schema/SchemaListDerived.java  |  27 +++-
 .../cli/commands/schema/SchemaListPlain.java    |  27 +++-
 .../cli/commands/schema/SchemaListVirtual.java  |  27 +++-
 .../client/cli/commands/schema/SchemaRead.java  |   3 +-
 .../cli/commands/self/WorkflowCommand.java      |   1 -
 .../commands/self/WorkflowExportDefinition.java |   2 +-
 .../commands/self/WorkflowExportDiagram.java    |   6 +-
 .../self/WorkflowSyncopeOperations.java         |   1 -
 .../client/cli/commands/task/TaskCommand.java   |   5 +-
 .../client/cli/commands/task/TaskDelete.java    |   4 +-
 .../client/cli/commands/task/TaskExecute.java   |   5 +-
 .../cli/commands/task/TaskExecutionDelete.java  |   4 +-
 .../cli/commands/task/TaskExecutionRead.java    |   3 +-
 .../client/cli/commands/task/TaskList.java      |   2 +-
 .../cli/commands/task/TaskListRunningJobs.java  |  46 +++++++
 .../commands/task/TaskListScheduledJobs.java    |  45 +++++++
 .../client/cli/commands/task/TaskRead.java      |   3 +-
 .../cli/commands/task/TaskRunningJobs.java      |  33 -----
 .../cli/commands/task/TaskScheduledJobs.java    |  33 -----
 .../client/cli/commands/user/UserCommand.java   |   3 +-
 .../client/cli/commands/user/UserCount.java     |   8 +-
 .../client/cli/commands/user/UserDelete.java    |   2 +-
 .../client/cli/commands/user/UserGetKey.java    |   4 +-
 .../cli/commands/user/UserGetUsername.java      |   4 +-
 .../client/cli/commands/user/UserList.java      |  43 +++---
 .../client/cli/commands/user/UserRead.java      |   3 +-
 .../cli/commands/user/UserResultManager.java    |   1 -
 .../commands/user/UserSearchByAttribute.java    |  11 +-
 .../cli/commands/user/UserSearchByResource.java |   9 +-
 .../cli/commands/user/UserSearchByRole.java     |   9 +-
 .../syncope/client/cli/util/CommandUtils.java   |   1 -
 .../client/cli/util/FileSystemUtils.java        |   9 +-
 .../syncope/client/cli/util/JasyptUtils.java    |   1 -
 .../syncope/client/cli/view/Messages.java       |   7 +-
 118 files changed, 835 insertions(+), 507 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/syncope/blob/6d368c8b/client/cli/src/main/java/org/apache/syncope/client/cli/SyncopeAdm.java
----------------------------------------------------------------------
diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/SyncopeAdm.java b/client/cli/src/main/java/org/apache/syncope/client/cli/SyncopeAdm.java
index 7308c57..8b6150a 100644
--- a/client/cli/src/main/java/org/apache/syncope/client/cli/SyncopeAdm.java
+++ b/client/cli/src/main/java/org/apache/syncope/client/cli/SyncopeAdm.java
@@ -50,12 +50,13 @@ public final class SyncopeAdm {
             System.out.println(helpMessage());
         } catch (final IllegalArgumentException ex) {
             LOG.error("Error in main", ex);
-            RESULT_MANAGER.generic(ex.getMessage());
+            RESULT_MANAGER.genericError(ex.getMessage());
             if (!ex.getMessage().startsWith("It seems you")) {
                 System.out.println(helpMessage());
             }
         } catch (final ProcessingException e) {
-            RESULT_MANAGER.generic("Syncope server offline", e.getCause().getMessage());
+            RESULT_MANAGER.genericError("Syncope server offline");
+            RESULT_MANAGER.genericError(e.getCause().getMessage());
         }
 
     }
@@ -73,7 +74,7 @@ public final class SyncopeAdm {
                 helpMessageBuilder.append("\n");
             }
         } catch (final IllegalAccessException | IllegalArgumentException | InstantiationException ex) {
-            RESULT_MANAGER.generic(ex.getMessage());
+            RESULT_MANAGER.genericError(ex.getMessage());
         }
 
         return helpMessageBuilder.toString();

http://git-wip-us.apache.org/repos/asf/syncope/blob/6d368c8b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/CommonsResultManager.java
----------------------------------------------------------------------
diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/CommonsResultManager.java b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/CommonsResultManager.java
index 39c32e6..4764d4d 100644
--- a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/CommonsResultManager.java
+++ b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/CommonsResultManager.java
@@ -18,6 +18,7 @@
  */
 package org.apache.syncope.client.cli.commands;
 
+import java.util.List;
 import java.util.Set;
 import org.apache.syncope.client.cli.view.Messages;
 import org.apache.syncope.common.lib.types.ConnConfProperty;
@@ -28,6 +29,10 @@ public abstract class CommonsResultManager {
         Messages.printIdNotNumberDeletedMessage(what, key);
     }
 
+    public void unnecessaryParameters(final List<String> parameters, final String helpMessage) {
+        Messages.printUnnecessaryParameters(parameters, helpMessage);
+    }
+
     public void deletedMessage(final String what, final String key) {
         Messages.printDeletedMessage(what, key);
     }
@@ -52,10 +57,14 @@ public abstract class CommonsResultManager {
         Messages.printDefaultMessage(option, helpMessage);
     }
 
-    public void generic(final String... messages) {
+    public void genericMessage(final String... messages) {
         Messages.printMessage(messages);
     }
-    
+
+    public void genericError(final String error) {
+        Messages.printMessage("Error: " + error);
+    }
+
     protected void printConfiguration(final Set<ConnConfProperty> configurationPropertys) {
         for (final ConnConfProperty configuration : configurationPropertys) {
             System.out.println("       name: " + configuration.getSchema().getName());

http://git-wip-us.apache.org/repos/asf/syncope/blob/6d368c8b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/configuration/ConfigurationCommand.java
----------------------------------------------------------------------
diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/configuration/ConfigurationCommand.java b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/configuration/ConfigurationCommand.java
index 00fe6fa..28cebf4 100644
--- a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/configuration/ConfigurationCommand.java
+++ b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/configuration/ConfigurationCommand.java
@@ -49,7 +49,7 @@ public class ConfigurationCommand extends AbstractCommand {
 
         switch (Options.fromName(input.getOption())) {
             case GET:
-                new ConfigurationGet().get();
+                new ConfigurationGet(input).get();
                 break;
             case READ:
                 new ConfigurationRead(input).read();

http://git-wip-us.apache.org/repos/asf/syncope/blob/6d368c8b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/configuration/ConfigurationDelete.java
----------------------------------------------------------------------
diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/configuration/ConfigurationDelete.java b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/configuration/ConfigurationDelete.java
index 870cb27..79b679b 100644
--- a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/configuration/ConfigurationDelete.java
+++ b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/configuration/ConfigurationDelete.java
@@ -42,9 +42,9 @@ public class ConfigurationDelete extends AbstractConfigurationCommand {
                     if (ex.getMessage().startsWith("NotFound")) {
                         configurationResultManager.notFoundError("Configuration", parameter);
                     } else if (ex.getMessage().startsWith("DataIntegrityViolation")) {
-                        configurationResultManager.generic("You cannot delete configuration", parameter);
+                        configurationResultManager.genericError("You cannot delete configuration " + parameter);
                     } else {
-                        configurationResultManager.generic(ex.getMessage());
+                        configurationResultManager.genericError(ex.getMessage());
                     }
                     break;
                 }
@@ -53,5 +53,4 @@ public class ConfigurationDelete extends AbstractConfigurationCommand {
             configurationResultManager.commandOptionError(DELETE_HELP_MESSAGE);
         }
     }
-
 }

http://git-wip-us.apache.org/repos/asf/syncope/blob/6d368c8b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/configuration/ConfigurationExport.java
----------------------------------------------------------------------
diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/configuration/ConfigurationExport.java b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/configuration/ConfigurationExport.java
index d08677a..2eaeb75 100644
--- a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/configuration/ConfigurationExport.java
+++ b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/configuration/ConfigurationExport.java
@@ -47,22 +47,22 @@ public class ConfigurationExport extends AbstractConfigurationCommand {
                 XMLUtils.createXMLFile(
                         (SequenceInputStream) configurationSyncopeOperations.export().getEntity(),
                         input.firstParameter() + EXPORT_FILE_NAME);
-                configurationResultManager.generic(
+                configurationResultManager.genericMessage(
                         input.firstParameter() + EXPORT_FILE_NAME + " successfully created");
             } catch (final IOException ex) {
-                configurationResultManager.generic(ex.getMessage());
+                configurationResultManager.genericError(ex.getMessage());
             } catch (ParserConfigurationException | SAXException | TransformerConfigurationException ex) {
-                configurationResultManager.generic(
+                configurationResultManager.genericError(
                         "Error creating " + input.firstParameter() + EXPORT_FILE_NAME + " " + ex.getMessage());
             } catch (final TransformerException ex) {
                 if (ex.getCause() instanceof FileNotFoundException) {
-                    configurationResultManager.generic("Permission denied on " + input.firstParameter());
+                    configurationResultManager.genericError("Permission denied on " + input.firstParameter());
                 } else {
-                    configurationResultManager.generic(
+                    configurationResultManager.genericError(
                             "Error creating " + input.firstParameter() + EXPORT_FILE_NAME + " " + ex.getMessage());
                 }
             } catch (final SyncopeClientException ex) {
-                configurationResultManager.generic("Error calling configuration service " + ex.getMessage());
+                configurationResultManager.genericError("Error calling configuration service " + ex.getMessage());
             }
         } else {
             configurationResultManager.commandOptionError(EXPORT_HELP_MESSAGE);

http://git-wip-us.apache.org/repos/asf/syncope/blob/6d368c8b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/configuration/ConfigurationGet.java
----------------------------------------------------------------------
diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/configuration/ConfigurationGet.java b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/configuration/ConfigurationGet.java
index 3cad82d..f0b7682 100644
--- a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/configuration/ConfigurationGet.java
+++ b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/configuration/ConfigurationGet.java
@@ -19,18 +19,27 @@
 package org.apache.syncope.client.cli.commands.configuration;
 
 import java.util.LinkedList;
+import org.apache.syncope.client.cli.Input;
 
 public class ConfigurationGet extends AbstractConfigurationCommand {
 
-    public ConfigurationGet() {
+    private static final String GET_HELP_MESSAGE = "configuration --get";
+
+    private final Input input;
+
+    public ConfigurationGet(final Input input) {
+        this.input = input;
     }
 
     public void get() {
-        try {
-            configurationResultManager.fromGet(new LinkedList<>(configurationSyncopeOperations.list()));
-        } catch (final Exception ex) {
-            configurationResultManager.generic(ex.getMessage());
+        if (input.parameterNumber() == 0) {
+            try {
+                configurationResultManager.fromGet(new LinkedList<>(configurationSyncopeOperations.list()));
+            } catch (final Exception ex) {
+                configurationResultManager.genericError(ex.getMessage());
+            }
+        } else {
+            configurationResultManager.unnecessaryParameters(input.listParameters(), GET_HELP_MESSAGE);
         }
     }
-
 }

http://git-wip-us.apache.org/repos/asf/syncope/blob/6d368c8b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/configuration/ConfigurationRead.java
----------------------------------------------------------------------
diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/configuration/ConfigurationRead.java b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/configuration/ConfigurationRead.java
index 5bccb3f..e315f33 100644
--- a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/configuration/ConfigurationRead.java
+++ b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/configuration/ConfigurationRead.java
@@ -45,7 +45,7 @@ public class ConfigurationRead extends AbstractConfigurationCommand {
                     if (ex.getMessage().startsWith("NotFound")) {
                         configurationResultManager.notFoundError("Configuration", parameter);
                     } else {
-                        configurationResultManager.generic(ex.getMessage());
+                        configurationResultManager.genericError(ex.getMessage());
                     }
                     failed = true;
                     break;
@@ -58,5 +58,4 @@ public class ConfigurationRead extends AbstractConfigurationCommand {
             configurationResultManager.commandOptionError(READ_HELP_MESSAGE);
         }
     }
-
 }

http://git-wip-us.apache.org/repos/asf/syncope/blob/6d368c8b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/configuration/ConfigurationUpdate.java
----------------------------------------------------------------------
diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/configuration/ConfigurationUpdate.java b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/configuration/ConfigurationUpdate.java
index 2f85ffa..e3aff4e 100644
--- a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/configuration/ConfigurationUpdate.java
+++ b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/configuration/ConfigurationUpdate.java
@@ -50,17 +50,18 @@ public class ConfigurationUpdate extends AbstractConfigurationCommand {
                     configurationSyncopeOperations.set(attrTO);
                     attrList.add(attrTO);
                 } catch (final IllegalArgumentException ex) {
-                    configurationResultManager.generic(ex.getMessage(), UPDATE_HELP_MESSAGE);
+                    configurationResultManager.genericError(ex.getMessage());
+                    configurationResultManager.genericError(UPDATE_HELP_MESSAGE);
                     failed = true;
                     break;
                 } catch (final SyncopeClientException | WebServiceException ex) {
                     if (ex.getMessage().startsWith("NotFound")) {
                         configurationResultManager.notFoundError("Configuration", pairParameter.getKey());
                     } else if (ex.getMessage().startsWith("InvalidValues")) {
-                        configurationResultManager.generic(
+                        configurationResultManager.genericError(
                                 pairParameter.getValue() + " is not a valid value for " + pairParameter.getKey());
                     } else {
-                        configurationResultManager.generic(ex.getMessage());
+                        configurationResultManager.genericError(ex.getMessage());
                     }
                     failed = true;
                     break;

http://git-wip-us.apache.org/repos/asf/syncope/blob/6d368c8b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/connector/ConnectorCommand.java
----------------------------------------------------------------------
diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/connector/ConnectorCommand.java b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/connector/ConnectorCommand.java
index 83a03cb..c87055c 100644
--- a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/connector/ConnectorCommand.java
+++ b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/connector/ConnectorCommand.java
@@ -48,10 +48,10 @@ public class ConnectorCommand extends AbstractCommand {
 
         switch (ConnectorOptions.fromName(input.getOption())) {
             case LIST:
-                new ConnectorList().list();
+                new ConnectorList(input).list();
                 break;
             case LIST_BUNDLES:
-                new ConnectorListBundles().list();
+                new ConnectorListBundles(input).list();
                 break;
             case LIST_CONFIGURATION:
                 new ConnectorListConfigurationProperties(input).list();

http://git-wip-us.apache.org/repos/asf/syncope/blob/6d368c8b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/connector/ConnectorDelete.java
----------------------------------------------------------------------
diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/connector/ConnectorDelete.java b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/connector/ConnectorDelete.java
index 6e26b9b..1454d28 100644
--- a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/connector/ConnectorDelete.java
+++ b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/connector/ConnectorDelete.java
@@ -48,15 +48,14 @@ public class ConnectorDelete extends AbstractConnectorCommand {
                     if (ex.getMessage().startsWith("NotFound")) {
                         connectorResultManager.notFoundError("Connector", parameter);
                     } else {
-                        connectorResultManager.generic(ex.getMessage());
+                        connectorResultManager.genericError(ex.getMessage());
                     }
                     break;
                 }
             }
-            connectorResultManager.toView(connInstanceTOs);
+            connectorResultManager.printConnectors(connInstanceTOs);
         } else {
             connectorResultManager.commandOptionError(DELETE_HELP_MESSAGE);
         }
     }
-
 }

http://git-wip-us.apache.org/repos/asf/syncope/blob/6d368c8b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/connector/ConnectorList.java
----------------------------------------------------------------------
diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/connector/ConnectorList.java b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/connector/ConnectorList.java
index f063228..1c86bbb 100644
--- a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/connector/ConnectorList.java
+++ b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/connector/ConnectorList.java
@@ -18,15 +18,28 @@
  */
 package org.apache.syncope.client.cli.commands.connector;
 
+import org.apache.syncope.client.cli.Input;
 import org.apache.syncope.common.lib.SyncopeClientException;
 
 public class ConnectorList extends AbstractConnectorCommand {
 
+    private static final String LIST_HELP_MESSAGE = "connector --list";
+
+    private final Input input;
+
+    public ConnectorList(final Input input) {
+        this.input = input;
+    }
+
     public void list() {
-        try {
-            connectorResultManager.toView(connectorSyncopeOperations.list());
-        } catch (final SyncopeClientException ex) {
-            connectorResultManager.generic(ex.getMessage());
+        if (input.parameterNumber() == 0) {
+            try {
+                connectorResultManager.printConnectors(connectorSyncopeOperations.list());
+            } catch (final SyncopeClientException ex) {
+                connectorResultManager.genericError(ex.getMessage());
+            }
+        } else {
+            connectorResultManager.unnecessaryParameters(input.listParameters(), LIST_HELP_MESSAGE);
         }
     }
 }

http://git-wip-us.apache.org/repos/asf/syncope/blob/6d368c8b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/connector/ConnectorListBundles.java
----------------------------------------------------------------------
diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/connector/ConnectorListBundles.java b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/connector/ConnectorListBundles.java
index d77cd83..293fa13 100644
--- a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/connector/ConnectorListBundles.java
+++ b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/connector/ConnectorListBundles.java
@@ -18,15 +18,28 @@
  */
 package org.apache.syncope.client.cli.commands.connector;
 
+import org.apache.syncope.client.cli.Input;
 import org.apache.syncope.common.lib.SyncopeClientException;
 
 public class ConnectorListBundles extends AbstractConnectorCommand {
 
+    private static final String LIST_HELP_MESSAGE = "connector --list-bundles";
+
+    private final Input input;
+
+    public ConnectorListBundles(final Input input) {
+        this.input = input;
+    }
+
     public void list() {
-        try {
-            connectorResultManager.fromListBundles(connectorSyncopeOperations.getBundles());
-        } catch (final SyncopeClientException ex) {
-            connectorResultManager.generic(ex.getMessage());
+        if (input.parameterNumber() == 0) {
+            try {
+                connectorResultManager.printBundles(connectorSyncopeOperations.getBundles());
+            } catch (final SyncopeClientException ex) {
+                connectorResultManager.genericError(ex.getMessage());
+            }
+        } else {
+            connectorResultManager.unnecessaryParameters(input.listParameters(), LIST_HELP_MESSAGE);
         }
     }
 }

http://git-wip-us.apache.org/repos/asf/syncope/blob/6d368c8b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/connector/ConnectorListConfigurationProperties.java
----------------------------------------------------------------------
diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/connector/ConnectorListConfigurationProperties.java b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/connector/ConnectorListConfigurationProperties.java
index 91a0021..5f5197c 100644
--- a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/connector/ConnectorListConfigurationProperties.java
+++ b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/connector/ConnectorListConfigurationProperties.java
@@ -24,7 +24,7 @@ import org.apache.syncope.common.lib.SyncopeClientException;
 
 public class ConnectorListConfigurationProperties extends AbstractConnectorCommand {
 
-    private static final String LIST_CONFIGURATION_HELP_MESSAGE 
+    private static final String LIST_CONFIGURATION_HELP_MESSAGE
             = "connector --list-configuration-properties {CONNECTOR-ID} {CONNECTOR-ID} [...]";
 
     private final Input input;
@@ -37,7 +37,7 @@ public class ConnectorListConfigurationProperties extends AbstractConnectorComma
         if (input.getParameters().length >= 1) {
             for (final String parameter : input.getParameters()) {
                 try {
-                    connectorResultManager.fromConfigurationProperties(
+                    connectorResultManager.printConfigurationProperties(
                             connectorSyncopeOperations.read(parameter).getConf());
                 } catch (final NumberFormatException ex) {
                     connectorResultManager.numberFormatException("connector", parameter);
@@ -45,14 +45,12 @@ public class ConnectorListConfigurationProperties extends AbstractConnectorComma
                     if (ex.getMessage().startsWith("NotFound")) {
                         connectorResultManager.notFoundError("Connector", parameter);
                     } else {
-                        connectorResultManager.generic(ex.getMessage());
+                        connectorResultManager.genericError(ex.getMessage());
                     }
-                    break;
                 }
             }
         } else {
             connectorResultManager.commandOptionError(LIST_CONFIGURATION_HELP_MESSAGE);
         }
     }
-
 }

http://git-wip-us.apache.org/repos/asf/syncope/blob/6d368c8b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/connector/ConnectorRead.java
----------------------------------------------------------------------
diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/connector/ConnectorRead.java b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/connector/ConnectorRead.java
index e2dca1e..dc29d74 100644
--- a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/connector/ConnectorRead.java
+++ b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/connector/ConnectorRead.java
@@ -18,12 +18,9 @@
  */
 package org.apache.syncope.client.cli.commands.connector;
 
-import java.util.ArrayList;
-import java.util.List;
 import javax.xml.ws.WebServiceException;
 import org.apache.syncope.client.cli.Input;
 import org.apache.syncope.common.lib.SyncopeClientException;
-import org.apache.syncope.common.lib.to.ConnInstanceTO;
 
 public class ConnectorRead extends AbstractConnectorCommand {
 
@@ -37,25 +34,21 @@ public class ConnectorRead extends AbstractConnectorCommand {
 
     public void read() {
         if (input.getParameters().length >= 1) {
-            final List<ConnInstanceTO> connInstanceTOs = new ArrayList<>();
             for (final String parameter : input.getParameters()) {
                 try {
-                    connInstanceTOs.add(connectorSyncopeOperations.read(parameter));
+                    connectorResultManager.printConnector(connectorSyncopeOperations.read(parameter));
                 } catch (final NumberFormatException ex) {
                     connectorResultManager.numberFormatException("connector", parameter);
                 } catch (final SyncopeClientException | WebServiceException ex) {
                     if (ex.getMessage().startsWith("NotFound")) {
                         connectorResultManager.notFoundError("Connector", parameter);
                     } else {
-                        connectorResultManager.generic(ex.getMessage());
+                        connectorResultManager.genericError(ex.getMessage());
                     }
-                    break;
                 }
             }
-            connectorResultManager.toView(connInstanceTOs);
         } else {
             connectorResultManager.commandOptionError(READ_HELP_MESSAGE);
         }
     }
-
 }

http://git-wip-us.apache.org/repos/asf/syncope/blob/6d368c8b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/connector/ConnectorReadByResource.java
----------------------------------------------------------------------
diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/connector/ConnectorReadByResource.java b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/connector/ConnectorReadByResource.java
index d062077..cc8bbac 100644
--- a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/connector/ConnectorReadByResource.java
+++ b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/connector/ConnectorReadByResource.java
@@ -18,12 +18,9 @@
  */
 package org.apache.syncope.client.cli.commands.connector;
 
-import java.util.ArrayList;
-import java.util.List;
 import javax.xml.ws.WebServiceException;
 import org.apache.syncope.client.cli.Input;
 import org.apache.syncope.common.lib.SyncopeClientException;
-import org.apache.syncope.common.lib.to.ConnInstanceTO;
 
 public class ConnectorReadByResource extends AbstractConnectorCommand {
 
@@ -38,23 +35,19 @@ public class ConnectorReadByResource extends AbstractConnectorCommand {
 
     public void read() {
         if (input.getParameters().length >= 1) {
-            final List<ConnInstanceTO> connInstanceTOs = new ArrayList<>();
             for (final String parameter : input.getParameters()) {
                 try {
-                    connInstanceTOs.add(connectorSyncopeOperations.readByResource(parameter));
+                    connectorResultManager.printConnector(connectorSyncopeOperations.readByResource(parameter));
                 } catch (final SyncopeClientException | WebServiceException ex) {
                     if (ex.getMessage().startsWith("NotFound")) {
                         connectorResultManager.notFoundError("Resource", parameter);
                     } else {
-                        connectorResultManager.generic(ex.getMessage());
+                        connectorResultManager.genericError(ex.getMessage());
                     }
-                    break;
                 }
             }
-            connectorResultManager.toView(connInstanceTOs);
         } else {
             connectorResultManager.commandOptionError(READ_HELP_MESSAGE);
         }
     }
-
 }

http://git-wip-us.apache.org/repos/asf/syncope/blob/6d368c8b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/connector/ConnectorResultManager.java
----------------------------------------------------------------------
diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/connector/ConnectorResultManager.java b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/connector/ConnectorResultManager.java
index 7c72349..4ff92ed 100644
--- a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/connector/ConnectorResultManager.java
+++ b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/connector/ConnectorResultManager.java
@@ -30,30 +30,13 @@ import org.apache.syncope.common.lib.types.ConnectorCapability;
 
 public class ConnectorResultManager extends CommonsResultManager {
 
-    public void toView(final List<ConnInstanceTO> connInstanceTOs) {
+    public void printConnectors(final List<ConnInstanceTO> connInstanceTOs) {
         for (final ConnInstanceTO connInstanceTO : connInstanceTOs) {
             printConnector(connInstanceTO);
         }
     }
 
-    public void fromListBundles(final List<ConnBundleTO> connBundleTOs) {
-        for (final ConnBundleTO connBundleTO : connBundleTOs) {
-            System.out.println(" > BUNDLE NAME: " + connBundleTO.getBundleName());
-            System.out.println("    connector name: " + connBundleTO.getConnectorName());
-            System.out.println("    display name: " + connBundleTO.getDisplayName());
-            System.out.println("    location: " + connBundleTO.getLocation());
-            System.out.println("    version: " + connBundleTO.getVersion());
-            System.out.println("    PROPERTIES:");
-            printConfPropSchema(connBundleTO.getProperties());
-        }
-    }
-
-    public void fromConfigurationProperties(final Set<ConnConfProperty> connConfPropertys) {
-        printConfiguration(connConfPropertys);
-
-    }
-
-    private void printConnector(final ConnInstanceTO connInstanceTO) {
+    public void printConnector(final ConnInstanceTO connInstanceTO) {
         System.out.println(" > CONNECTOR ID: " + connInstanceTO.getKey());
         System.out.println("    bundle name: " + connInstanceTO.getBundleName());
         System.out.println("    connector name: " + connInstanceTO.getConnectorName());
@@ -67,6 +50,7 @@ public class ConnectorResultManager extends CommonsResultManager {
         printConfiguration(connInstanceTO.getConf());
         System.out.println("    POOL CONFIGURATION:");
         printConfPool(connInstanceTO.getPoolConf());
+        System.out.println("");
     }
 
     private void printCapabilities(final Set<ConnectorCapability> capabilities) {
@@ -83,6 +67,18 @@ public class ConnectorResultManager extends CommonsResultManager {
         System.out.println("       max wait: " + connPoolConfTO.getMaxWait());
     }
 
+    public void printBundles(final List<ConnBundleTO> connBundleTOs) {
+        for (final ConnBundleTO connBundleTO : connBundleTOs) {
+            System.out.println(" > BUNDLE NAME: " + connBundleTO.getBundleName());
+            System.out.println("    connector name: " + connBundleTO.getConnectorName());
+            System.out.println("    display name: " + connBundleTO.getDisplayName());
+            System.out.println("    location: " + connBundleTO.getLocation());
+            System.out.println("    version: " + connBundleTO.getVersion());
+            System.out.println("    PROPERTIES:");
+            printConfPropSchema(connBundleTO.getProperties());
+        }
+    }
+
     private void printConfPropSchema(final List<ConnConfPropSchema> connConfPropSchemas) {
         for (final ConnConfPropSchema connConfPropSchema : connConfPropSchemas) {
             System.out.println("       name: " + connConfPropSchema.getName());
@@ -94,4 +90,9 @@ public class ConnectorResultManager extends CommonsResultManager {
             System.out.println("");
         }
     }
+
+    public void printConfigurationProperties(final Set<ConnConfProperty> connConfPropertys) {
+        printConfiguration(connConfPropertys);
+
+    }
 }

http://git-wip-us.apache.org/repos/asf/syncope/blob/6d368c8b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/connector/ConnectorSyncopeOperations.java
----------------------------------------------------------------------
diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/connector/ConnectorSyncopeOperations.java b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/connector/ConnectorSyncopeOperations.java
index b496063..11ac036 100644
--- a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/connector/ConnectorSyncopeOperations.java
+++ b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/connector/ConnectorSyncopeOperations.java
@@ -26,7 +26,7 @@ import org.apache.syncope.common.rest.api.service.ConnectorService;
 
 public class ConnectorSyncopeOperations {
 
-    protected final ConnectorService connectorService = SyncopeServices.get(ConnectorService.class);
+    private final ConnectorService connectorService = SyncopeServices.get(ConnectorService.class);
 
     public ConnInstanceTO readByResource(final String resourceName) {
         return connectorService.readByResource(resourceName, null);

http://git-wip-us.apache.org/repos/asf/syncope/blob/6d368c8b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/domain/DomainCommand.java
----------------------------------------------------------------------
diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/domain/DomainCommand.java b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/domain/DomainCommand.java
index e709b81..adda76b 100644
--- a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/domain/DomainCommand.java
+++ b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/domain/DomainCommand.java
@@ -33,7 +33,7 @@ public class DomainCommand extends AbstractCommand {
             + "    --help \n"
             + "    --list \n"
             + "    --delete \n"
-            + "       Syntax: --delete {DOMAIN-KEY} {DOMAIN-KEY} [...]\n";
+            + "       Syntax: --delete {DOMAIN-NAME} {DOMAIN-NAME} [...]\n";
 
     @Override
     public void execute(final Input input) {
@@ -42,7 +42,7 @@ public class DomainCommand extends AbstractCommand {
         }
         switch (Options.fromName(input.getOption())) {
             case LIST:
-                new DomainList().list();
+                new DomainList(input).list();
                 break;
             case DELETE:
                 new DomainDelete(input).delete();

http://git-wip-us.apache.org/repos/asf/syncope/blob/6d368c8b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/domain/DomainDelete.java
----------------------------------------------------------------------
diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/domain/DomainDelete.java b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/domain/DomainDelete.java
index f85d3c9..06e733a 100644
--- a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/domain/DomainDelete.java
+++ b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/domain/DomainDelete.java
@@ -23,7 +23,7 @@ import org.apache.syncope.common.lib.SyncopeClientException;
 
 public class DomainDelete extends AbstractDomainCommand {
 
-    private static final String DELETE_HELP_MESSAGE = "domain --delete {DOMAIN-KEY} {DOMAIN-KEY} [...]";
+    private static final String DELETE_HELP_MESSAGE = "domain --delete {DOMAIN-NAME} {DOMAIN-NAME} [...]";
 
     private final Input input;
 
@@ -41,7 +41,7 @@ public class DomainDelete extends AbstractDomainCommand {
                     if (ex.getMessage().startsWith("NotFound")) {
                         domainResultManager.notFoundError("Domain", parameter);
                     } else {
-                        domainResultManager.generic(ex.getMessage());
+                        domainResultManager.genericError(ex.getMessage());
                     }
                 }
             }
@@ -49,5 +49,4 @@ public class DomainDelete extends AbstractDomainCommand {
             domainResultManager.commandOptionError(DELETE_HELP_MESSAGE);
         }
     }
-
 }

http://git-wip-us.apache.org/repos/asf/syncope/blob/6d368c8b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/domain/DomainList.java
----------------------------------------------------------------------
diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/domain/DomainList.java b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/domain/DomainList.java
index 6cf7b7d..7c60844 100644
--- a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/domain/DomainList.java
+++ b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/domain/DomainList.java
@@ -18,21 +18,29 @@
  */
 package org.apache.syncope.client.cli.commands.domain;
 
+import org.apache.syncope.client.cli.Input;
 import org.apache.syncope.common.lib.SyncopeClientException;
-import org.apache.syncope.common.lib.to.DomainTO;
 
 public class DomainList extends AbstractDomainCommand {
 
-    public DomainList() {
+    private static final String LIST_HELP_MESSAGE = "domain --list";
+
+    private final Input input;
+
+    public DomainList(final Input input) {
+        this.input = input;
     }
 
     public void list() {
-        try {
-            for (final DomainTO domainTO : domainSyncopeOperations.list()) {
-                domainResultManager.generic(domainTO.getKey());
+        if (input.parameterNumber() == 0) {
+            try {
+                domainResultManager.toView(domainSyncopeOperations.list());
+            } catch (final SyncopeClientException ex) {
+                domainResultManager.genericError(ex.getMessage());
             }
-        } catch (final SyncopeClientException ex) {
-            domainResultManager.generic("Error: " + ex.getMessage());
+        } else {
+            domainResultManager.unnecessaryParameters(input.listParameters(), LIST_HELP_MESSAGE);
         }
+
     }
 }

http://git-wip-us.apache.org/repos/asf/syncope/blob/6d368c8b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/domain/DomainRead.java
----------------------------------------------------------------------
diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/domain/DomainRead.java b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/domain/DomainRead.java
index 2eaa75a..94989ff 100644
--- a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/domain/DomainRead.java
+++ b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/domain/DomainRead.java
@@ -23,7 +23,7 @@ import org.apache.syncope.common.lib.SyncopeClientException;
 
 public class DomainRead extends AbstractDomainCommand {
 
-    private static final String READ_HELP_MESSAGE = "domain --read {DOMAIN-KEY} {DOMAIN-KEY} [...]";
+    private static final String READ_HELP_MESSAGE = "domain --read {DOMAIN-NAME} {DOMAIN-NAME} [...]";
 
     private final Input input;
 
@@ -35,12 +35,12 @@ public class DomainRead extends AbstractDomainCommand {
         if (input.parameterNumber() >= 1) {
             for (final String parameter : input.getParameters()) {
                 try {
-                    domainResultManager.generic(domainSyncopeOperations.read(parameter).getKey());
+                    domainResultManager.printDomain(domainSyncopeOperations.read(parameter));
                 } catch (final SyncopeClientException ex) {
                     if (ex.getMessage().startsWith("NotFound")) {
                         domainResultManager.notFoundError("Domain", parameter);
                     } else {
-                        domainResultManager.generic(ex.getMessage());
+                        domainResultManager.genericError(ex.getMessage());
                     }
                 }
             }

http://git-wip-us.apache.org/repos/asf/syncope/blob/6d368c8b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/domain/DomainResultManager.java
----------------------------------------------------------------------
diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/domain/DomainResultManager.java b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/domain/DomainResultManager.java
index 6066c5d..d0b28ed 100644
--- a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/domain/DomainResultManager.java
+++ b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/domain/DomainResultManager.java
@@ -18,8 +18,20 @@
  */
 package org.apache.syncope.client.cli.commands.domain;
 
+import java.util.List;
 import org.apache.syncope.client.cli.commands.CommonsResultManager;
+import org.apache.syncope.common.lib.to.DomainTO;
 
 public class DomainResultManager extends CommonsResultManager {
 
+    public void toView(final List<DomainTO> domainTOs) {
+        for (final DomainTO domainTO : domainTOs) {
+            printDomain(domainTO);
+        }
+    }
+
+    public void printDomain(final DomainTO domainTO) {
+        System.out.println(" > DOIMAIN NAME: " + domainTO.getKey());
+        System.out.println("    chiper algorithm: " + domainTO.getAdminCipherAlgorithm());
+    }
 }

http://git-wip-us.apache.org/repos/asf/syncope/blob/6d368c8b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/entitlement/AbstractEntitlementCommand.java
----------------------------------------------------------------------
diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/entitlement/AbstractEntitlementCommand.java b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/entitlement/AbstractEntitlementCommand.java
index acc8aa5..f09665d 100644
--- a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/entitlement/AbstractEntitlementCommand.java
+++ b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/entitlement/AbstractEntitlementCommand.java
@@ -18,7 +18,7 @@
  */
 package org.apache.syncope.client.cli.commands.entitlement;
 
-public class AbstractEntitlementCommand {
+public abstract class AbstractEntitlementCommand {
 
     protected final EntitlementSyncopeOperations entitlementSyncopeOperations = new EntitlementSyncopeOperations();
 

http://git-wip-us.apache.org/repos/asf/syncope/blob/6d368c8b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/entitlement/EntitlementCommand.java
----------------------------------------------------------------------
diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/entitlement/EntitlementCommand.java b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/entitlement/EntitlementCommand.java
index 5ca478c..1dc4966 100644
--- a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/entitlement/EntitlementCommand.java
+++ b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/entitlement/EntitlementCommand.java
@@ -37,7 +37,7 @@ public class EntitlementCommand extends AbstractCommand {
             + "    --read-by-username\n"
             + "       Syntax: --read-by-username {USERNAME}\n"
             + "    --read-by-userid\n"
-            + "       Syntax: --read-by-userid {USERID}\n"
+            + "       Syntax: --read-by-userid {USER-ID}\n"
             + "    --search-by-role\n"
             + "       Syntax: --search-by-role {ROLE-ID}";
 
@@ -49,7 +49,7 @@ public class EntitlementCommand extends AbstractCommand {
 
         switch (EntitlementOptions.fromName(input.getOption())) {
             case LIST:
-                new EntitlementList().list();
+                new EntitlementList(input).list();
                 break;
             case READ_BY_USERNAME:
                 new EntitlementReadByUsername(input).read();
@@ -117,5 +117,4 @@ public class EntitlementCommand extends AbstractCommand {
             return options;
         }
     }
-
 }

http://git-wip-us.apache.org/repos/asf/syncope/blob/6d368c8b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/entitlement/EntitlementList.java
----------------------------------------------------------------------
diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/entitlement/EntitlementList.java b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/entitlement/EntitlementList.java
index d0c532c..e204823 100644
--- a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/entitlement/EntitlementList.java
+++ b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/entitlement/EntitlementList.java
@@ -18,9 +18,23 @@
  */
 package org.apache.syncope.client.cli.commands.entitlement;
 
+import org.apache.syncope.client.cli.Input;
+
 public class EntitlementList extends AbstractEntitlementCommand {
 
+    private static final String READ_HELP_MESSAGE = "entitlement --list";
+
+    private final Input input;
+
+    public EntitlementList(final Input input) {
+        this.input = input;
+    }
+
     public void list() {
-        entitlementResultManager.toView(entitlementSyncopeOperations.list());
+        if (input.parameterNumber() == 0) {
+            entitlementResultManager.toView(entitlementSyncopeOperations.list());
+        } else {
+            entitlementResultManager.unnecessaryParameters(input.listParameters(), READ_HELP_MESSAGE);
+        }
     }
 }

http://git-wip-us.apache.org/repos/asf/syncope/blob/6d368c8b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/entitlement/EntitlementListRole.java
----------------------------------------------------------------------
diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/entitlement/EntitlementListRole.java b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/entitlement/EntitlementListRole.java
index f65757c..0b4144e 100644
--- a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/entitlement/EntitlementListRole.java
+++ b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/entitlement/EntitlementListRole.java
@@ -43,13 +43,13 @@ public class EntitlementListRole extends AbstractEntitlementCommand {
                 } else if (roleTOs != null && !roleTOs.isEmpty()) {
                     entitlementResultManager.rolesToView(roleTOs);
                 } else {
-                    entitlementResultManager.generic("No roles found for entitlement " + input.firstParameter());
+                    entitlementResultManager.genericMessage("No roles found for entitlement " + input.firstParameter());
                 }
             } catch (final SyncopeClientException | WebServiceException ex) {
                 if (ex.getMessage().startsWith("NotFound")) {
                     entitlementResultManager.notFoundError("User", input.firstParameter());
                 } else {
-                    entitlementResultManager.generic("Error: " + ex.getMessage());
+                    entitlementResultManager.genericError(ex.getMessage());
                 }
             } catch (final NumberFormatException ex) {
                 entitlementResultManager.numberFormatException("user", input.firstParameter());
@@ -58,5 +58,4 @@ public class EntitlementListRole extends AbstractEntitlementCommand {
             entitlementResultManager.commandOptionError(READ_HELP_MESSAGE);
         }
     }
-
 }

http://git-wip-us.apache.org/repos/asf/syncope/blob/6d368c8b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/entitlement/EntitlementReadByUserId.java
----------------------------------------------------------------------
diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/entitlement/EntitlementReadByUserId.java b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/entitlement/EntitlementReadByUserId.java
index 99f6305..3cd41cb 100644
--- a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/entitlement/EntitlementReadByUserId.java
+++ b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/entitlement/EntitlementReadByUserId.java
@@ -41,7 +41,7 @@ public class EntitlementReadByUserId extends AbstractEntitlementCommand {
                 if (ex.getMessage().startsWith("NotFound")) {
                     entitlementResultManager.notFoundError("User", input.firstParameter());
                 } else {
-                    entitlementResultManager.generic("Error: " + ex.getMessage());
+                    entitlementResultManager.genericError(ex.getMessage());
                 }
             } catch (final NumberFormatException ex) {
                 entitlementResultManager.numberFormatException("user", input.firstParameter());

http://git-wip-us.apache.org/repos/asf/syncope/blob/6d368c8b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/entitlement/EntitlementReadByUsername.java
----------------------------------------------------------------------
diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/entitlement/EntitlementReadByUsername.java b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/entitlement/EntitlementReadByUsername.java
index bfcec00..40a73fc 100644
--- a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/entitlement/EntitlementReadByUsername.java
+++ b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/entitlement/EntitlementReadByUsername.java
@@ -41,7 +41,7 @@ public class EntitlementReadByUsername extends AbstractEntitlementCommand {
                 if (ex.getMessage().startsWith("NotFound")) {
                     entitlementResultManager.notFoundError("User", input.firstParameter());
                 } else {
-                    entitlementResultManager.generic("Error: " + ex.getMessage());
+                    entitlementResultManager.genericError(ex.getMessage());
                 }
             } catch (final NumberFormatException ex) {
                 entitlementResultManager.numberFormatException("user", input.firstParameter());

http://git-wip-us.apache.org/repos/asf/syncope/blob/6d368c8b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/entitlement/EntitlementResultManager.java
----------------------------------------------------------------------
diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/entitlement/EntitlementResultManager.java b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/entitlement/EntitlementResultManager.java
index 01585d2..e6003ad 100644
--- a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/entitlement/EntitlementResultManager.java
+++ b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/entitlement/EntitlementResultManager.java
@@ -50,5 +50,4 @@ public class EntitlementResultManager extends CommonsResultManager {
             System.out.println("       - " + realm);
         }
     }
-
 }

http://git-wip-us.apache.org/repos/asf/syncope/blob/6d368c8b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/entitlement/EntitlementSearchByRole.java
----------------------------------------------------------------------
diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/entitlement/EntitlementSearchByRole.java b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/entitlement/EntitlementSearchByRole.java
index 6d756f0..91f9828 100644
--- a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/entitlement/EntitlementSearchByRole.java
+++ b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/entitlement/EntitlementSearchByRole.java
@@ -41,7 +41,7 @@ public class EntitlementSearchByRole extends AbstractEntitlementCommand {
                 if (ex.getMessage().startsWith("NotFound")) {
                     entitlementResultManager.notFoundError("User", input.firstParameter());
                 } else {
-                    entitlementResultManager.generic("Error: " + ex.getMessage());
+                    entitlementResultManager.genericError(ex.getMessage());
                 }
             } catch (final NumberFormatException ex) {
                 entitlementResultManager.numberFormatException("user", input.firstParameter());
@@ -50,5 +50,4 @@ public class EntitlementSearchByRole extends AbstractEntitlementCommand {
             entitlementResultManager.commandOptionError(READ_HELP_MESSAGE);
         }
     }
-    
 }

http://git-wip-us.apache.org/repos/asf/syncope/blob/6d368c8b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/help/Help.java
----------------------------------------------------------------------
diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/help/Help.java b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/help/Help.java
index c658beb..0492a26 100644
--- a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/help/Help.java
+++ b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/help/Help.java
@@ -24,6 +24,8 @@ import org.apache.syncope.client.cli.util.CommandUtils;
 
 public class Help {
 
+    private final HelpResultManager helpResultManager = new HelpResultManager();
+
     public void help() {
         final StringBuilder generalHelpBuilder = new StringBuilder("General help\n");
         try {
@@ -35,9 +37,9 @@ public class Help {
                         .append("\n")
                         .append(" \n");
             }
-            System.out.println(generalHelpBuilder.toString());
+            helpResultManager.toView(generalHelpBuilder.toString());
         } catch (final IllegalAccessException | IllegalArgumentException | InstantiationException e) {
-            new HelpResultManager().generic(e.getMessage());
+            helpResultManager.genericMessage(e.getMessage());
         }
     }
 }

http://git-wip-us.apache.org/repos/asf/syncope/blob/6d368c8b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/help/HelpResultManager.java
----------------------------------------------------------------------
diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/help/HelpResultManager.java b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/help/HelpResultManager.java
index 7a67943..b70664d 100644
--- a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/help/HelpResultManager.java
+++ b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/help/HelpResultManager.java
@@ -22,4 +22,7 @@ import org.apache.syncope.client.cli.commands.CommonsResultManager;
 
 public class HelpResultManager extends CommonsResultManager {
 
+    public void toView(final String generalHelp) {
+        System.out.println(generalHelp);
+    }
 }

http://git-wip-us.apache.org/repos/asf/syncope/blob/6d368c8b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/info/Info.java
----------------------------------------------------------------------
diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/info/Info.java b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/info/Info.java
index ccf9170..4fa0163 100644
--- a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/info/Info.java
+++ b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/info/Info.java
@@ -25,219 +25,188 @@ import org.apache.syncope.common.rest.api.service.SyncopeService;
 public class Info {
 
     private final SyncopeTO syncopeTO = SyncopeServices.get(SyncopeService.class).info();
-    
+
     private final InfoResultManager infoResultManager = new InfoResultManager();
 
     public void version() {
         try {
-            infoResultManager.generic("Syncope version: " + syncopeTO.getVersion());
+            infoResultManager.printVersion(syncopeTO.getVersion());
         } catch (final Exception ex) {
-            infoResultManager.generic(ex.getMessage());
+            infoResultManager.genericError(ex.getMessage());
         }
     }
 
     public void pwdResetAllowed() {
         try {
-            infoResultManager.generic("Password reset allowed: " + syncopeTO.isPwdResetAllowed());
+            infoResultManager.printPwdResetAllowed(syncopeTO.isPwdResetAllowed());
         } catch (final Exception ex) {
-            infoResultManager.generic(ex.getMessage());
+            infoResultManager.genericError(ex.getMessage());
         }
     }
 
     public void resetWithSecurityQuestion() {
         try {
-            infoResultManager.generic("Password reset requiring security question: "
-                    + syncopeTO.isPwdResetRequiringSecurityQuestions());
+            infoResultManager.printPwdResetRequiringSecurityQuestions(syncopeTO.isPwdResetRequiringSecurityQuestions());
         } catch (final Exception ex) {
-            infoResultManager.generic(ex.getMessage());
+            infoResultManager.genericError(ex.getMessage());
         }
     }
 
     public void selfRegistrationAllowed() {
         try {
-            infoResultManager.generic("Self registration allowed: " + syncopeTO.isSelfRegAllowed());
+            infoResultManager.printSelfRegistrationAllowed(syncopeTO.isSelfRegAllowed());
         } catch (final Exception ex) {
-            infoResultManager.generic(ex.getMessage());
+            infoResultManager.genericError(ex.getMessage());
         }
     }
 
     public void provisioningManager() {
         try {
-            infoResultManager.generic(
-                    "Any object provisioning manager class: " + syncopeTO.getAnyObjectProvisioningManager(),
-                    "User       provisioning manager class: " + syncopeTO.getUserProvisioningManager(),
-                    "Group      provisioning manager class: " + syncopeTO.getGroupProvisioningManager());
+            infoResultManager.printProvisioningManager(
+                    syncopeTO.getAnyObjectProvisioningManager(),
+                    syncopeTO.getUserProvisioningManager(),
+                    syncopeTO.getGroupProvisioningManager());
         } catch (final Exception ex) {
-            infoResultManager.generic(ex.getMessage());
+            infoResultManager.genericError(ex.getMessage());
         }
     }
 
     public void workflowAdapter() {
         try {
-            infoResultManager.generic(
-                    "Any object workflow adapter class: " + syncopeTO.getAnyObjectWorkflowAdapter(),
-                    "User       workflow adapter class: " + syncopeTO.getUserWorkflowAdapter(),
-                    "Group      workflow adapter class: " + syncopeTO.getGroupWorkflowAdapter());
+            infoResultManager.printWorkflowAdapter(
+                    syncopeTO.getAnyObjectWorkflowAdapter(),
+                    syncopeTO.getUserWorkflowAdapter(),
+                    syncopeTO.getGroupWorkflowAdapter());
         } catch (final Exception ex) {
-            infoResultManager.generic(ex.getMessage());
+            infoResultManager.genericError(ex.getMessage());
         }
     }
 
     public void accountRules() {
         try {
-            for (final String accountRule : syncopeTO.getAccountRules()) {
-                infoResultManager.generic("Account rule: " + accountRule);
-            }
+            infoResultManager.printAccountRules(syncopeTO.getAccountRules());
         } catch (final Exception ex) {
-            infoResultManager.generic(ex.getMessage());
+            infoResultManager.genericError(ex.getMessage());
         }
     }
 
     public void connidLocation() {
         try {
-            for (final String location : syncopeTO.getConnIdLocations()) {
-                infoResultManager.generic("ConnId location: " + location);
-            }
+            infoResultManager.printConnidLocations(syncopeTO.getConnIdLocations());
         } catch (final Exception ex) {
-            infoResultManager.generic(ex.getMessage());
+            infoResultManager.genericError(ex.getMessage());
         }
     }
 
     public void logicActions() {
         try {
-            for (final String logic : syncopeTO.getLogicActions()) {
-                infoResultManager.generic("Logic action: " + logic);
-            }
+            infoResultManager.printLogicActions(syncopeTO.getLogicActions());
         } catch (final Exception ex) {
-            infoResultManager.generic(ex.getMessage());
+            infoResultManager.genericError(ex.getMessage());
         }
     }
 
     public void mailTemplates() {
         try {
-            for (final String template : syncopeTO.getMailTemplates()) {
-                infoResultManager.generic("Mail template: " + template);
-            }
+            infoResultManager.printMailTemplates(syncopeTO.getMailTemplates());
         } catch (final Exception ex) {
-            infoResultManager.generic(ex.getMessage());
+            infoResultManager.genericError(ex.getMessage());
         }
     }
 
     public void mappingItemTransformers() {
         try {
-            for (final String tranformer : syncopeTO.getMappingItemTransformers()) {
-                infoResultManager.generic("Mapping item tranformer: " + tranformer);
-            }
+            infoResultManager.printMappingItemTransformers(syncopeTO.getMappingItemTransformers());
         } catch (final Exception ex) {
-            infoResultManager.generic(ex.getMessage());
+            infoResultManager.genericError(ex.getMessage());
         }
     }
 
     public void passwordRules() {
         try {
-            for (final String rules : syncopeTO.getPasswordRules()) {
-                infoResultManager.generic("Password rule: " + rules);
-            }
+            infoResultManager.printPasswordRules(syncopeTO.getPasswordRules());
         } catch (final Exception ex) {
-            infoResultManager.generic(ex.getMessage());
+            infoResultManager.genericError(ex.getMessage());
         }
     }
 
     public void propagationActions() {
         try {
-            for (final String action : syncopeTO.getPropagationActions()) {
-                infoResultManager.generic("Propagation action: " + action);
-            }
+            infoResultManager.printPropagationActions(syncopeTO.getPropagationActions());
         } catch (final Exception ex) {
-            infoResultManager.generic(ex.getMessage());
+            infoResultManager.genericError(ex.getMessage());
         }
     }
 
     public void pushActions() {
         try {
-            for (final String action : syncopeTO.getPushActions()) {
-                infoResultManager.generic("Push action: " + action);
-            }
+            infoResultManager.printPushActions(syncopeTO.getPushActions());
         } catch (final Exception ex) {
-            infoResultManager.generic(ex.getMessage());
+            infoResultManager.genericError(ex.getMessage());
         }
     }
 
     public void pushCorrelationActions() {
         try {
-            for (final String rule : syncopeTO.getPushCorrelationRules()) {
-                infoResultManager.generic("Push correlation rule: " + rule);
-            }
+            infoResultManager.printCorrelationActions(syncopeTO.getPushCorrelationRules());
         } catch (final Exception ex) {
-            infoResultManager.generic(ex.getMessage());
+            infoResultManager.genericError(ex.getMessage());
         }
     }
 
     public void reportlets() {
         try {
-            for (final String reportlet : syncopeTO.getReportlets()) {
-                infoResultManager.generic("Reportlet: " + reportlet);
-            }
+            infoResultManager.printReportlets(syncopeTO.getReportlets());
         } catch (final Exception ex) {
-            infoResultManager.generic(ex.getMessage());
+            infoResultManager.genericError(ex.getMessage());
         }
     }
 
     public void syncActions() {
         try {
-            for (final String action : syncopeTO.getSyncActions()) {
-                infoResultManager.generic("Sync action: " + action);
-            }
+            infoResultManager.printSyncActions(syncopeTO.getSyncActions());
         } catch (final Exception ex) {
-            infoResultManager.generic(ex.getMessage());
+            infoResultManager.genericError(ex.getMessage());
         }
     }
 
     public void syncCorrelationRules() {
         try {
-            for (final String rule : syncopeTO.getSyncCorrelationRules()) {
-                infoResultManager.generic("Sync correlation rule: " + rule);
-            }
+            infoResultManager.printCorrelationRules(syncopeTO.getSyncCorrelationRules());
         } catch (final Exception ex) {
-            infoResultManager.generic(ex.getMessage());
+            infoResultManager.genericError(ex.getMessage());
         }
     }
 
     public void taskJobs() {
         try {
-            for (final String job : syncopeTO.getTaskJobs()) {
-                infoResultManager.generic("Task job: " + job);
-            }
+            infoResultManager.printJobs(syncopeTO.getTaskJobs());
         } catch (final Exception ex) {
-            infoResultManager.generic(ex.getMessage());
+            infoResultManager.genericError(ex.getMessage());
         }
     }
 
     public void validators() {
         try {
-            for (final String validator : syncopeTO.getValidators()) {
-                infoResultManager.generic("Validator: " + validator);
-            }
+            infoResultManager.printValidators(syncopeTO.getValidators());
         } catch (final Exception ex) {
-            infoResultManager.generic(ex.getMessage());
+            infoResultManager.genericError(ex.getMessage());
         }
     }
 
     public void passwordGenerators() {
         try {
-            infoResultManager.generic(
-                    "Password generator class: " + syncopeTO.getPasswordGenerator());
+            infoResultManager.printPasswordGenerator(syncopeTO.getPasswordGenerator());
         } catch (final Exception ex) {
-            infoResultManager.generic(ex.getMessage());
+            infoResultManager.genericError(ex.getMessage());
         }
     }
 
     public void virAttrCache() {
         try {
-            infoResultManager.generic(
-                    "Virtual attribute cache class: " + syncopeTO.getVirAttrCache());
+            infoResultManager.printVirtualAttributeCacheClass(syncopeTO.getVirAttrCache());
         } catch (final Exception ex) {
-            infoResultManager.generic(ex.getMessage());
+            infoResultManager.genericError(ex.getMessage());
         }
     }
 }

http://git-wip-us.apache.org/repos/asf/syncope/blob/6d368c8b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/info/InfoResultManager.java
----------------------------------------------------------------------
diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/info/InfoResultManager.java b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/info/InfoResultManager.java
index 237af64..6ea04f7 100644
--- a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/info/InfoResultManager.java
+++ b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/info/InfoResultManager.java
@@ -18,8 +18,134 @@
  */
 package org.apache.syncope.client.cli.commands.info;
 
+import java.util.List;
 import org.apache.syncope.client.cli.commands.CommonsResultManager;
 
 public class InfoResultManager extends CommonsResultManager {
 
+    public void printVersion(final String version) {
+        genericMessage(" - Syncope version: " + version);
+    }
+
+    public void printPwdResetAllowed(final boolean pwdResetAllowed) {
+        genericMessage("Password reset allowed: " + pwdResetAllowed);
+    }
+
+    public void printPwdResetRequiringSecurityQuestions(final boolean pwdResetRequiringSecurityQuestions) {
+        genericMessage("Password reset requiring security question: " + pwdResetRequiringSecurityQuestions);
+    }
+
+    public void printSelfRegistrationAllowed(final boolean selfRegAllowed) {
+        genericMessage("Self registration allowed: " + selfRegAllowed);
+    }
+
+    public void printProvisioningManager(final String anyObjectProvisioningManager,
+            final String getUserProvisioningManager,
+            final String getGroupProvisioningManager) {
+        genericMessage(
+                "Any object provisioning manager class: " + anyObjectProvisioningManager,
+                "User provisioning manager class: " + getUserProvisioningManager,
+                "Group provisioning manager class: " + getGroupProvisioningManager);
+    }
+
+    public void printWorkflowAdapter(final String anyObjectWorkflowAdapter,
+            final String userWorkflowAdapter,
+            final String groupWorkflowAdapter) {
+        genericMessage(
+                "Any object workflow adapter class: " + anyObjectWorkflowAdapter,
+                "User       workflow adapter class: " + userWorkflowAdapter,
+                "Group      workflow adapter class: " + groupWorkflowAdapter);
+    }
+
+    public void printAccountRules(final List<String> rules) {
+        for (final String accountRule : rules) {
+            genericMessage("Account rule: " + accountRule);
+        }
+    }
+
+    public void printConnidLocations(final List<String> locations) {
+        for (final String location : locations) {
+            genericMessage("ConnId location: " + location);
+        }
+    }
+
+    public void printLogicActions(final List<String> actions) {
+        for (final String action : actions) {
+            genericMessage("Logic action: " + action);
+        }
+    }
+
+    public void printMailTemplates(final List<String> mailTemplates) {
+        for (final String template : mailTemplates) {
+            genericMessage("Mail template: " + template);
+        }
+    }
+
+    public void printMappingItemTransformers(final List<String> transformers) {
+        for (final String tranformer : transformers) {
+            genericMessage("Mapping item tranformer: " + tranformer);
+        }
+    }
+
+    public void printPasswordRules(final List<String> rules) {
+        for (final String rule : rules) {
+            genericMessage("Password rule: " + rule);
+        }
+    }
+
+    public void printCorrelationRules(final List<String> rules) {
+        for (final String rule : rules) {
+            genericMessage("Correlation rule: " + rule);
+        }
+    }
+
+    public void printPropagationActions(final List<String> actions) {
+        for (final String action : actions) {
+            genericMessage("Propagation action: " + action);
+        }
+    }
+
+    public void printPushActions(final List<String> actions) {
+        for (final String action : actions) {
+            genericMessage("Push action: " + action);
+        }
+    }
+
+    public void printSyncActions(final List<String> actions) {
+        for (final String action : actions) {
+            genericMessage("Sync action: " + action);
+        }
+    }
+
+    public void printCorrelationActions(final List<String> actions) {
+        for (final String action : actions) {
+            genericMessage("Push correlation rule: " + action);
+        }
+    }
+
+    public void printReportlets(final List<String> reportlets) {
+        for (final String reportlet : reportlets) {
+            genericMessage("Reportlet: " + reportlet);
+        }
+    }
+
+    public void printJobs(final List<String> jobs) {
+        for (final String job : jobs) {
+            genericMessage("Task job: " + job);
+        }
+    }
+
+    public void printValidators(final List<String> validators) {
+        for (final String validator : validators) {
+            genericMessage("Validator: " + validator);
+        }
+    }
+
+    public void printPasswordGenerator(final String passwordGenerator) {
+        genericMessage("Password generator class: " + passwordGenerator);
+    }
+    
+    public void printVirtualAttributeCacheClass(final String virAttrCache) {
+        genericMessage("Virtual attribute cache class: " + virAttrCache);
+    }
 }

http://git-wip-us.apache.org/repos/asf/syncope/blob/6d368c8b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/install/InstallCommand.java
----------------------------------------------------------------------
diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/install/InstallCommand.java b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/install/InstallCommand.java
index 7ebd554..b9f4c83 100644
--- a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/install/InstallCommand.java
+++ b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/install/InstallCommand.java
@@ -18,6 +18,7 @@
  */
 package org.apache.syncope.client.cli.commands.install;
 
+import java.io.FileNotFoundException;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.syncope.client.cli.Command;
 import org.apache.syncope.client.cli.Input;
@@ -26,6 +27,8 @@ import org.apache.syncope.client.cli.commands.AbstractCommand;
 @Command(name = "install")
 public class InstallCommand extends AbstractCommand {
 
+    private final InstallResultManager installResultManager = new InstallResultManager();
+
     private static final String HELP_MESSAGE = "Usage: install [options]\n"
             + "  Options:\n"
             + "    --help \n"
@@ -39,13 +42,18 @@ public class InstallCommand extends AbstractCommand {
 
         switch (Options.fromName(input.getOption())) {
             case INSTALL:
-                new InstallSetup().setup();
+                try {
+                    new InstallSetup().setup();
+                } catch (final FileNotFoundException | IllegalAccessException ex) {
+                    installResultManager.genericError(ex.getMessage());
+                    break;
+                }
                 break;
             case HELP:
                 System.out.println(HELP_MESSAGE);
                 break;
             default:
-                new InstallResultManager().defaultError(input.getOption(), HELP_MESSAGE);
+                installResultManager.defaultError(input.getOption(), HELP_MESSAGE);
         }
     }
 
@@ -83,5 +91,4 @@ public class InstallCommand extends AbstractCommand {
             return optionToReturn;
         }
     }
-
 }

http://git-wip-us.apache.org/repos/asf/syncope/blob/6d368c8b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/install/InstallResultManager.java
----------------------------------------------------------------------
diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/install/InstallResultManager.java b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/install/InstallResultManager.java
index 8b96ae0..39837bf 100644
--- a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/install/InstallResultManager.java
+++ b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/install/InstallResultManager.java
@@ -26,6 +26,16 @@ import org.apache.syncope.client.cli.commands.CommonsResultManager;
 
 public class InstallResultManager extends CommonsResultManager {
 
+    public void printWelcome() {
+        System.out.println("");
+        System.out.println("###############################################");
+        System.out.println("#                                             #");
+        System.out.println("# Welcome to Syncope CLI installation process #");
+        System.out.println("#                                             #");
+        System.out.println("###############################################");
+        System.out.println("");
+    }
+
     public void installationSuccessful(final String version) {
         System.out.println("Installation parameters checked on Syncope core version: " + version);
         System.out.println("");

http://git-wip-us.apache.org/repos/asf/syncope/blob/6d368c8b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/install/InstallSetup.java
----------------------------------------------------------------------
diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/install/InstallSetup.java b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/install/InstallSetup.java
index 4d9a0ff..7e1eaec 100644
--- a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/install/InstallSetup.java
+++ b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/install/InstallSetup.java
@@ -44,23 +44,18 @@ public class InstallSetup {
 
     private String syncopeServerRestContext = "/syncope/rest/";
 
-    public InstallSetup() {
-    }
-
-    public void setup() {
-        System.out.println("");
-        System.out.println("###############################################");
-        System.out.println("#                                             #");
-        System.out.println("# Welcome to Syncope CLI installation process #");
-        System.out.println("#                                             #");
-        System.out.println("###############################################");
-        System.out.println("");
+    public void setup() throws FileNotFoundException, IllegalAccessException {
+        installResultManager.printWelcome();
 
         System.out.println("Path to config files of Syncope CLI client will be: "
                 + InstallConfigFileTemplate.DIR_PATH);
 
+        if (!FileSystemUtils.exists(InstallConfigFileTemplate.DIR_PATH)) {
+            throw new FileNotFoundException("Directory: " + InstallConfigFileTemplate.DIR_PATH + " does not exists!");
+        }
+
         if (!FileSystemUtils.canWrite(InstallConfigFileTemplate.DIR_PATH)) {
-            System.out.println("Permission denied on " + InstallConfigFileTemplate.DIR_PATH);
+            throw new IllegalAccessException("Permission denied on " + InstallConfigFileTemplate.DIR_PATH);
         }
         System.out.println("- File system permission checked");
         System.out.println("");
@@ -153,7 +148,6 @@ public class InstallSetup {
         scanIn.close();
 
         final JasyptUtils jasyptUtils = JasyptUtils.getJasyptUtils();
-
         try {
             FileSystemUtils.createNewDirectory(InstallConfigFileTemplate.DIR_PATH);
             final String contentCliPropertiesFile = InstallConfigFileTemplate.createFile(

http://git-wip-us.apache.org/repos/asf/syncope/blob/6d368c8b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/logger/LoggerCommand.java
----------------------------------------------------------------------
diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/logger/LoggerCommand.java b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/logger/LoggerCommand.java
index 134c294..4d2a55e 100644
--- a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/logger/LoggerCommand.java
+++ b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/logger/LoggerCommand.java
@@ -51,7 +51,7 @@ public class LoggerCommand extends AbstractCommand {
 
         switch (LoggerOptions.fromName(input.getOption())) {
             case LIST:
-                new LoggerList().list();
+                new LoggerList(input).list();
                 break;
             case READ:
                 new LoggerRead(input).read();
@@ -123,5 +123,4 @@ public class LoggerCommand extends AbstractCommand {
             return options;
         }
     }
-
 }

http://git-wip-us.apache.org/repos/asf/syncope/blob/6d368c8b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/logger/LoggerCreate.java
----------------------------------------------------------------------
diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/logger/LoggerCreate.java b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/logger/LoggerCreate.java
index 40b5e1b..2216295 100644
--- a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/logger/LoggerCreate.java
+++ b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/logger/LoggerCreate.java
@@ -65,5 +65,4 @@ public class LoggerCreate extends AbstractLoggerCommand {
             loggerResultManager.commandOptionError(CREATE_HELP_MESSAGE);
         }
     }
-
 }

http://git-wip-us.apache.org/repos/asf/syncope/blob/6d368c8b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/logger/LoggerDelete.java
----------------------------------------------------------------------
diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/logger/LoggerDelete.java b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/logger/LoggerDelete.java
index 8bdb3ab..88c30c5 100644
--- a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/logger/LoggerDelete.java
+++ b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/logger/LoggerDelete.java
@@ -42,7 +42,7 @@ public class LoggerDelete extends AbstractLoggerCommand {
                     if (ex.getMessage().startsWith("NotFound")) {
                         loggerResultManager.notFoundError("Logger", parameter);
                     } else {
-                        loggerResultManager.generic(ex.getMessage());
+                        loggerResultManager.genericError(ex.getMessage());
                     }
                 }
             }
@@ -50,5 +50,4 @@ public class LoggerDelete extends AbstractLoggerCommand {
             loggerResultManager.commandOptionError(DELETE_HELP_MESSAGE);
         }
     }
-
 }


Mime
View raw message