http://git-wip-us.apache.org/repos/asf/syncope/blob/24a91259/client/cli/src/main/java/org/apache/syncope/client/cli/commands/question/QuestionDelete.java ---------------------------------------------------------------------- diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/question/QuestionDelete.java b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/question/QuestionDelete.java index 29cff9d..460f4a6 100644 --- a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/question/QuestionDelete.java +++ b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/question/QuestionDelete.java @@ -21,9 +21,13 @@ package org.apache.syncope.client.cli.commands.question; import javax.xml.ws.WebServiceException; import org.apache.syncope.client.cli.Input; import org.apache.syncope.common.lib.SyncopeClientException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class QuestionDelete extends AbstractQuestionCommand { + private static final Logger LOG = LoggerFactory.getLogger(QuestionDelete.class); + private static final String DELETE_HELP_MESSAGE = "question --delete {QUESTION-ID} {QUESTION-ID} [...]"; private final Input input; @@ -39,6 +43,7 @@ public class QuestionDelete extends AbstractQuestionCommand { questionSyncopeOperations.delete(parameter); questionResultManager.deletedMessage("security question", parameter); } catch (final SyncopeClientException | WebServiceException ex) { + LOG.error("Error deleting question", ex); if (ex.getMessage().startsWith("NotFound")) { questionResultManager.notFoundError("Security question", parameter); } else { @@ -46,6 +51,7 @@ public class QuestionDelete extends AbstractQuestionCommand { } break; } catch (final NumberFormatException ex) { + LOG.error("Error deleting question", ex); questionResultManager.numberFormatException("security question", parameter); } }
http://git-wip-us.apache.org/repos/asf/syncope/blob/24a91259/client/cli/src/main/java/org/apache/syncope/client/cli/commands/question/QuestionList.java ---------------------------------------------------------------------- diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/question/QuestionList.java b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/question/QuestionList.java index 8f90635..081d418 100644 --- a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/question/QuestionList.java +++ b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/question/QuestionList.java @@ -20,9 +20,13 @@ package org.apache.syncope.client.cli.commands.question; import org.apache.syncope.client.cli.Input; import org.apache.syncope.common.lib.SyncopeClientException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class QuestionList extends AbstractQuestionCommand { + private static final Logger LOG = LoggerFactory.getLogger(QuestionList.class); + private static final String LIST_HELP_MESSAGE = "question --list"; private final Input input; @@ -36,6 +40,7 @@ public class QuestionList extends AbstractQuestionCommand { try { questionResultManager.printQuestions(questionSyncopeOperations.list()); } catch (final SyncopeClientException ex) { + LOG.error("Error listing question", ex); questionResultManager.genericError(ex.getMessage()); } } else { http://git-wip-us.apache.org/repos/asf/syncope/blob/24a91259/client/cli/src/main/java/org/apache/syncope/client/cli/commands/question/QuestionRead.java ---------------------------------------------------------------------- diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/question/QuestionRead.java b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/question/QuestionRead.java index 8df4708..cfc99a5 100644 --- a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/question/QuestionRead.java +++ b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/question/QuestionRead.java @@ -24,9 +24,13 @@ 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.SecurityQuestionTO; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class QuestionRead extends AbstractQuestionCommand { + private static final Logger LOG = LoggerFactory.getLogger(QuestionRead.class); + private static final String READ_HELP_MESSAGE = "question --read {QUESTION-ID} {QUESTION-ID} [...]"; private final Input input; @@ -42,6 +46,7 @@ public class QuestionRead extends AbstractQuestionCommand { try { questionTOs.add(questionSyncopeOperations.read(parameter)); } catch (final SyncopeClientException | WebServiceException ex) { + LOG.error("Error reading question", ex); if (ex.getMessage().startsWith("NotFound")) { questionResultManager.notFoundError("Security question", parameter); } else { @@ -49,6 +54,7 @@ public class QuestionRead extends AbstractQuestionCommand { } break; } catch (final NumberFormatException ex) { + LOG.error("Error reading question", ex); questionResultManager.numberFormatException("security question", parameter); } } http://git-wip-us.apache.org/repos/asf/syncope/blob/24a91259/client/cli/src/main/java/org/apache/syncope/client/cli/commands/realm/RealmDetails.java ---------------------------------------------------------------------- diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/realm/RealmDetails.java b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/realm/RealmDetails.java index b68a7b4..b1007c2 100644 --- a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/realm/RealmDetails.java +++ b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/realm/RealmDetails.java @@ -22,9 +22,13 @@ import java.util.Map; import org.apache.commons.collections4.map.LinkedMap; import org.apache.syncope.client.cli.Input; import org.apache.syncope.common.lib.SyncopeClientException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class RealmDetails extends AbstractRealmCommand { + private static final Logger LOG = LoggerFactory.getLogger(RealmDetails.class); + private static final String DETAILS_HELP_MESSAGE = "realm --details"; private final Input input; @@ -40,6 +44,7 @@ public class RealmDetails extends AbstractRealmCommand { details.put("Total number", String.valueOf(realmSyncopeOperations.list().size())); realmResultManager.printDetails(details); } catch (final SyncopeClientException ex) { + LOG.error("Error reading details about realm", ex); realmResultManager.genericError(ex.getMessage()); } } else { http://git-wip-us.apache.org/repos/asf/syncope/blob/24a91259/client/cli/src/main/java/org/apache/syncope/client/cli/commands/realm/RealmList.java ---------------------------------------------------------------------- diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/realm/RealmList.java b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/realm/RealmList.java index b41c31f..8a444ac 100644 --- a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/realm/RealmList.java +++ b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/realm/RealmList.java @@ -20,9 +20,13 @@ package org.apache.syncope.client.cli.commands.realm; import org.apache.syncope.client.cli.Input; import org.apache.syncope.common.lib.SyncopeClientException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class RealmList extends AbstractRealmCommand { + private static final Logger LOG = LoggerFactory.getLogger(RealmList.class); + private static final String LIST_HELP_MESSAGE = "realm --list"; private final Input input; @@ -36,6 +40,7 @@ public class RealmList extends AbstractRealmCommand { try { realmResultManager.printRealms(realmSyncopeOperations.list()); } catch (final SyncopeClientException ex) { + LOG.error("Error listing realm", ex); realmResultManager.genericError(ex.getMessage()); } } else { http://git-wip-us.apache.org/repos/asf/syncope/blob/24a91259/client/cli/src/main/java/org/apache/syncope/client/cli/commands/report/ReportDelete.java ---------------------------------------------------------------------- diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/report/ReportDelete.java b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/report/ReportDelete.java index 52850bd..c20ccc2 100644 --- a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/report/ReportDelete.java +++ b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/report/ReportDelete.java @@ -21,9 +21,13 @@ package org.apache.syncope.client.cli.commands.report; import javax.xml.ws.WebServiceException; import org.apache.syncope.client.cli.Input; import org.apache.syncope.common.lib.SyncopeClientException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class ReportDelete extends AbstractReportCommand { + private static final Logger LOG = LoggerFactory.getLogger(ReportDelete.class); + private static final String DELETE_HELP_MESSAGE = "report --delete {REPORT-ID} {REPORT-ID} [...]"; private final Input input; @@ -39,6 +43,7 @@ public class ReportDelete extends AbstractReportCommand { reportSyncopeOperations.delete(parameter); reportResultManager.deletedMessage("Report", parameter); } catch (final WebServiceException | SyncopeClientException ex) { + LOG.error("Error deleting report", ex); if (ex.getMessage().startsWith("NotFound")) { reportResultManager.notFoundError("Report", parameter); } else if (ex.getMessage().startsWith("DataIntegrityViolation")) { @@ -47,6 +52,7 @@ public class ReportDelete extends AbstractReportCommand { reportResultManager.genericError(ex.getMessage()); } } catch (final NumberFormatException ex) { + LOG.error("Error deleting report", ex); reportResultManager.numberFormatException("report", parameter); } } http://git-wip-us.apache.org/repos/asf/syncope/blob/24a91259/client/cli/src/main/java/org/apache/syncope/client/cli/commands/report/ReportDeleteExecution.java ---------------------------------------------------------------------- diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/report/ReportDeleteExecution.java b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/report/ReportDeleteExecution.java index 3ae7bb7..653a475 100644 --- a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/report/ReportDeleteExecution.java +++ b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/report/ReportDeleteExecution.java @@ -21,9 +21,13 @@ package org.apache.syncope.client.cli.commands.report; import javax.xml.ws.WebServiceException; import org.apache.syncope.client.cli.Input; import org.apache.syncope.common.lib.SyncopeClientException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class ReportDeleteExecution extends AbstractReportCommand { + private static final Logger LOG = LoggerFactory.getLogger(ReportDeleteExecution.class); + private static final String DELETE_EXECUTION_HELP_MESSAGE = "report --delete-execution {EXECUTION-ID} {EXECUTION-ID} [...]"; @@ -40,6 +44,7 @@ public class ReportDeleteExecution extends AbstractReportCommand { reportSyncopeOperations.deleteExecution(parameter); reportResultManager.deletedMessage("Report execution", parameter); } catch (final WebServiceException | SyncopeClientException ex) { + LOG.error("Error deleting execution", ex); if (ex.getMessage().startsWith("NotFound")) { reportResultManager.notFoundError("Report", parameter); } else if (ex.getMessage().startsWith("DataIntegrityViolation")) { @@ -48,6 +53,7 @@ public class ReportDeleteExecution extends AbstractReportCommand { reportResultManager.genericError(ex.getMessage()); } } catch (final NumberFormatException ex) { + LOG.error("Error deleting execution", ex); reportResultManager.numberFormatException("report", parameter); } } http://git-wip-us.apache.org/repos/asf/syncope/blob/24a91259/client/cli/src/main/java/org/apache/syncope/client/cli/commands/report/ReportDetails.java ---------------------------------------------------------------------- diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/report/ReportDetails.java b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/report/ReportDetails.java index 05fb901..e7cff76 100644 --- a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/report/ReportDetails.java +++ b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/report/ReportDetails.java @@ -24,9 +24,13 @@ import org.apache.commons.collections4.map.LinkedMap; import org.apache.syncope.client.cli.Input; import org.apache.syncope.common.lib.SyncopeClientException; import org.apache.syncope.common.lib.to.ReportTO; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class ReportDetails extends AbstractReportCommand { + private static final Logger LOG = LoggerFactory.getLogger(ReportDetails.class); + private static final String LIST_HELP_MESSAGE = "report --details"; private final Input input; @@ -50,6 +54,7 @@ public class ReportDetails extends AbstractReportCommand { details.put("Never executed", String.valueOf(withoutExecutions)); reportResultManager.printDetails(details); } catch (final SyncopeClientException ex) { + LOG.error("Error reading details about report", ex); reportResultManager.genericError(ex.getMessage()); } } else { http://git-wip-us.apache.org/repos/asf/syncope/blob/24a91259/client/cli/src/main/java/org/apache/syncope/client/cli/commands/report/ReportExecute.java ---------------------------------------------------------------------- diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/report/ReportExecute.java b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/report/ReportExecute.java index f8a4f6d..284ede1 100644 --- a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/report/ReportExecute.java +++ b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/report/ReportExecute.java @@ -24,9 +24,13 @@ 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.ReportExecTO; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class ReportExecute extends AbstractReportCommand { + private static final Logger LOG = LoggerFactory.getLogger(ReportExecute.class); + private static final String EXECUTE_HELP_MESSAGE = "report --execute {REPORT-ID}"; private final Input input; @@ -44,6 +48,7 @@ public class ReportExecute extends AbstractReportCommand { final ReportExecTO lastExecution = executionList.get(executionList.size() - 1); reportResultManager.printReportExecution(Arrays.asList(lastExecution)); } catch (final WebServiceException | SyncopeClientException ex) { + LOG.error("Error executin report", ex); if (ex.getMessage().startsWith("NotFound")) { reportResultManager.notFoundError("Report", input.firstParameter()); } else if (ex.getMessage().startsWith("DataIntegrityViolation")) { @@ -52,6 +57,7 @@ public class ReportExecute extends AbstractReportCommand { reportResultManager.genericError(ex.getMessage()); } } catch (final NumberFormatException ex) { + LOG.error("Error executin report", ex); reportResultManager.numberFormatException("report", input.firstParameter()); } } else { http://git-wip-us.apache.org/repos/asf/syncope/blob/24a91259/client/cli/src/main/java/org/apache/syncope/client/cli/commands/report/ReportExportExecution.java ---------------------------------------------------------------------- diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/report/ReportExportExecution.java b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/report/ReportExportExecution.java index e7aca1e..eadcbbc 100644 --- a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/report/ReportExportExecution.java +++ b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/report/ReportExportExecution.java @@ -29,10 +29,14 @@ import org.apache.syncope.client.cli.util.CommandUtils; import org.apache.syncope.client.cli.util.XMLUtils; import org.apache.syncope.common.lib.SyncopeClientException; import org.apache.syncope.common.lib.types.ReportExecExportFormat; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.xml.sax.SAXException; public class ReportExportExecution extends AbstractReportCommand { + private static final Logger LOG = LoggerFactory.getLogger(ReportExportExecution.class); + private static final String EXPORT_EXECUTION_HELP_MESSAGE = "report --export-execution-result {EXECUTION-ID} {EXECUTION-ID} [...] {FORMAT}\n" + " Format: CSV / HTML / PDF / XML / RTF"; @@ -74,17 +78,21 @@ public class ReportExportExecution extends AbstractReportCommand { break; } } catch (final WebServiceException | SyncopeClientException ex) { + LOG.error("Error exporting execution", ex); if (ex.getMessage().startsWith("NotFound")) { reportResultManager.notFoundError("Report", parameter); } else { reportResultManager.genericError(ex.getMessage()); } } catch (final NumberFormatException ex) { + LOG.error("Error exporting execution", ex); reportResultManager.numberFormatException("report", parameter); } catch (IOException | ParserConfigurationException | SAXException | TransformerException e) { + LOG.error("Error exporting execution", e); reportResultManager.genericError( " - Error creating " + "export_" + parameter + " " + e.getMessage()); } catch (final IllegalArgumentException ex) { + LOG.error("Error exporting execution", ex); reportResultManager.typeNotValidError( "format", input.firstParameter(), CommandUtils.fromEnumToArray(ReportExecExportFormat.class)); http://git-wip-us.apache.org/repos/asf/syncope/blob/24a91259/client/cli/src/main/java/org/apache/syncope/client/cli/commands/report/ReportList.java ---------------------------------------------------------------------- diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/report/ReportList.java b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/report/ReportList.java index 1aced78..719e1dc 100644 --- a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/report/ReportList.java +++ b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/report/ReportList.java @@ -20,9 +20,13 @@ package org.apache.syncope.client.cli.commands.report; import org.apache.syncope.client.cli.Input; import org.apache.syncope.common.lib.SyncopeClientException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class ReportList extends AbstractReportCommand { + private static final Logger LOG = LoggerFactory.getLogger(ReportList.class); + private static final String LIST_HELP_MESSAGE = "report --list"; private final Input input; @@ -36,6 +40,7 @@ public class ReportList extends AbstractReportCommand { try { reportResultManager.printReports(reportSyncopeOperations.list()); } catch (final SyncopeClientException ex) { + LOG.error("Error listing report", ex); reportResultManager.genericError(ex.getMessage()); } } else { http://git-wip-us.apache.org/repos/asf/syncope/blob/24a91259/client/cli/src/main/java/org/apache/syncope/client/cli/commands/report/ReportListJobs.java ---------------------------------------------------------------------- diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/report/ReportListJobs.java b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/report/ReportListJobs.java index 2735f85..d9ce475 100644 --- a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/report/ReportListJobs.java +++ b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/report/ReportListJobs.java @@ -21,9 +21,13 @@ package org.apache.syncope.client.cli.commands.report; import org.apache.syncope.client.cli.Input; import org.apache.syncope.common.lib.SyncopeClientException; import org.apache.syncope.common.lib.types.JobStatusType; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class ReportListJobs extends AbstractReportCommand { + private static final Logger LOG = LoggerFactory.getLogger(ReportListJobs.class); + private static final String LIST_HELP_MESSAGE = "report --list-jobs"; private final Input input; @@ -39,6 +43,7 @@ public class ReportListJobs extends AbstractReportCommand { reportResultManager.printReportExecution(reportSyncopeOperations.listJobs(jobStatusType)); } } catch (final SyncopeClientException ex) { + LOG.error("Error listing report", ex); reportResultManager.genericError(ex.getMessage()); } } else { http://git-wip-us.apache.org/repos/asf/syncope/blob/24a91259/client/cli/src/main/java/org/apache/syncope/client/cli/commands/report/ReportRead.java ---------------------------------------------------------------------- diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/report/ReportRead.java b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/report/ReportRead.java index bf21e65..9ccebc8 100644 --- a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/report/ReportRead.java +++ b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/report/ReportRead.java @@ -24,9 +24,13 @@ 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.ReportTO; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class ReportRead extends AbstractReportCommand { + private static final Logger LOG = LoggerFactory.getLogger(ReportRead.class); + private static final String READ_HELP_MESSAGE = "report --read {REPORT-ID} {REPORT-ID} [...]"; private final Input input; @@ -42,8 +46,10 @@ public class ReportRead extends AbstractReportCommand { try { reportTOs.add(reportSyncopeOperations.read(parameter)); } catch (final NumberFormatException ex) { + LOG.error("Error reading report", ex); reportResultManager.numberFormatException("report", parameter); } catch (final WebServiceException | SyncopeClientException ex) { + LOG.error("Error reading report", ex); if (ex.getMessage().startsWith("NotFound")) { reportResultManager.notFoundError("Report", parameter); } else { http://git-wip-us.apache.org/repos/asf/syncope/blob/24a91259/client/cli/src/main/java/org/apache/syncope/client/cli/commands/report/ReportReadExecution.java ---------------------------------------------------------------------- diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/report/ReportReadExecution.java b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/report/ReportReadExecution.java index f7c9ec3..2c1ec07 100644 --- a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/report/ReportReadExecution.java +++ b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/report/ReportReadExecution.java @@ -24,9 +24,13 @@ 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.ReportExecTO; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class ReportReadExecution extends AbstractReportCommand { + private static final Logger LOG = LoggerFactory.getLogger(ReportReadExecution.class); + private static final String READ_EXECUTION_HELP_MESSAGE = "report --read-execution {EXECUTION-ID} {EXECUTION-ID} [...]"; @@ -43,12 +47,14 @@ public class ReportReadExecution extends AbstractReportCommand { try { reportExecTOs.add(reportSyncopeOperations.readExecution(parameter)); } catch (final WebServiceException | SyncopeClientException ex) { + LOG.error("Error reading report execution", ex); if (ex.getMessage().startsWith("NotFound")) { reportResultManager.notFoundError("Report", parameter); } else { reportResultManager.genericError(ex.getMessage()); } } catch (final NumberFormatException ex) { + LOG.error("Error reading report execution", ex); reportResultManager.numberFormatException("report", parameter); } } http://git-wip-us.apache.org/repos/asf/syncope/blob/24a91259/client/cli/src/main/java/org/apache/syncope/client/cli/commands/resource/ResourceDelete.java ---------------------------------------------------------------------- diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/resource/ResourceDelete.java b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/resource/ResourceDelete.java index 3b94ecb..a36ec6c 100644 --- a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/resource/ResourceDelete.java +++ b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/resource/ResourceDelete.java @@ -17,12 +17,17 @@ * under the License. */ package org.apache.syncope.client.cli.commands.resource; + import javax.xml.ws.WebServiceException; import org.apache.syncope.client.cli.Input; import org.apache.syncope.common.lib.SyncopeClientException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class ResourceDelete extends AbstractResourceCommand { + private static final Logger LOG = LoggerFactory.getLogger(ResourceDelete.class); + private static final String DELETE_HELP_MESSAGE = "resource --delete {RESOURCE-NAME} {RESOURCE-NAME} [...]"; private final Input input; @@ -38,8 +43,10 @@ public class ResourceDelete extends AbstractResourceCommand { resourceSyncopeOperations.delete(parameter); resourceResultManager.deletedMessage("resource", parameter); } catch (final NumberFormatException ex) { + LOG.error("Error deleting resource", ex); resourceResultManager.numberFormatException("resource", parameter); } catch (final SyncopeClientException | WebServiceException ex) { + LOG.error("Error deleting resource", ex); if (ex.getMessage().startsWith("NotFound")) { resourceResultManager.notFoundError("Resource", parameter); } else { http://git-wip-us.apache.org/repos/asf/syncope/blob/24a91259/client/cli/src/main/java/org/apache/syncope/client/cli/commands/resource/ResourceDetails.java ---------------------------------------------------------------------- diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/resource/ResourceDetails.java b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/resource/ResourceDetails.java index 25d3de7..5d0f90b 100644 --- a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/resource/ResourceDetails.java +++ b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/resource/ResourceDetails.java @@ -24,9 +24,13 @@ import org.apache.commons.collections4.map.LinkedMap; import org.apache.syncope.client.cli.Input; import org.apache.syncope.common.lib.SyncopeClientException; import org.apache.syncope.common.lib.to.ResourceTO; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class ResourceDetails extends AbstractResourceCommand { + private static final Logger LOG = LoggerFactory.getLogger(ResourceDetails.class); + private static final String DETAILS_HELP_MESSAGE = "resource --details"; private final Input input; @@ -43,6 +47,7 @@ public class ResourceDetails extends AbstractResourceCommand { details.put("Total numbers", String.valueOf(resourceTOs.size())); resourceResultManager.printDetails(details); } catch (final SyncopeClientException ex) { + LOG.error("Error reading details about resource", ex); resourceResultManager.genericError(ex.getMessage()); } } else { http://git-wip-us.apache.org/repos/asf/syncope/blob/24a91259/client/cli/src/main/java/org/apache/syncope/client/cli/commands/resource/ResourceList.java ---------------------------------------------------------------------- diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/resource/ResourceList.java b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/resource/ResourceList.java index de0e3b4..2032543 100644 --- a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/resource/ResourceList.java +++ b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/resource/ResourceList.java @@ -20,9 +20,13 @@ package org.apache.syncope.client.cli.commands.resource; import org.apache.syncope.client.cli.Input; import org.apache.syncope.common.lib.SyncopeClientException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class ResourceList extends AbstractResourceCommand { + private static final Logger LOG = LoggerFactory.getLogger(ResourceList.class); + private static final String LIST_HELP_MESSAGE = "resource --list"; private final Input input; @@ -36,6 +40,7 @@ public class ResourceList extends AbstractResourceCommand { try { resourceResultManager.printResources(resourceSyncopeOperations.list()); } catch (final SyncopeClientException ex) { + LOG.error("Error listing resource", ex); resourceResultManager.genericError(ex.getMessage()); } } else { http://git-wip-us.apache.org/repos/asf/syncope/blob/24a91259/client/cli/src/main/java/org/apache/syncope/client/cli/commands/resource/ResourceRead.java ---------------------------------------------------------------------- diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/resource/ResourceRead.java b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/resource/ResourceRead.java index 6a16528..fb0f133 100644 --- a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/resource/ResourceRead.java +++ b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/resource/ResourceRead.java @@ -17,15 +17,20 @@ * under the License. */ package org.apache.syncope.client.cli.commands.resource; + 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.ResourceTO; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class ResourceRead extends AbstractResourceCommand { + private static final Logger LOG = LoggerFactory.getLogger(ResourceRead.class); + private static final String READ_HELP_MESSAGE = "resource --read {RESOURCE-NAME} {RESOURCE-NAME} [...]"; private final Input input; @@ -41,8 +46,10 @@ public class ResourceRead extends AbstractResourceCommand { try { resourceTOs.add(resourceSyncopeOperations.read(parameter)); } catch (final NumberFormatException ex) { + LOG.error("Error reading resource", ex); resourceResultManager.numberFormatException("resource", parameter); } catch (final SyncopeClientException | WebServiceException ex) { + LOG.error("Error reading resource", ex); if (ex.getMessage().startsWith("NotFound")) { resourceResultManager.notFoundError("Resource", parameter); } else { http://git-wip-us.apache.org/repos/asf/syncope/blob/24a91259/client/cli/src/main/java/org/apache/syncope/client/cli/commands/role/RoleDelete.java ---------------------------------------------------------------------- diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/role/RoleDelete.java b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/role/RoleDelete.java index 4691312..a16392c 100644 --- a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/role/RoleDelete.java +++ b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/role/RoleDelete.java @@ -21,9 +21,13 @@ package org.apache.syncope.client.cli.commands.role; import javax.xml.ws.WebServiceException; import org.apache.syncope.client.cli.Input; import org.apache.syncope.common.lib.SyncopeClientException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class RoleDelete extends AbstractRoleCommand { + private static final Logger LOG = LoggerFactory.getLogger(RoleDelete.class); + private static final String DELETE_HELP_MESSAGE = "role --delete {ROLE-ID} {ROLE-ID} [...]"; private final Input input; @@ -39,6 +43,7 @@ public class RoleDelete extends AbstractRoleCommand { roleSyncopeOperations.delete(parameter); roleResultManager.deletedMessage("role", parameter); } catch (final SyncopeClientException | WebServiceException ex) { + LOG.error("Error deleting role", ex); if (ex.getMessage().startsWith("NotFound")) { roleResultManager.notFoundError("Role", parameter); } else { @@ -46,6 +51,7 @@ public class RoleDelete extends AbstractRoleCommand { } break; } catch (final NumberFormatException ex) { + LOG.error("Error deleting role", ex); roleResultManager.numberFormatException("role", parameter); } } http://git-wip-us.apache.org/repos/asf/syncope/blob/24a91259/client/cli/src/main/java/org/apache/syncope/client/cli/commands/role/RoleDetails.java ---------------------------------------------------------------------- diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/role/RoleDetails.java b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/role/RoleDetails.java index 879d449..1206adf 100644 --- a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/role/RoleDetails.java +++ b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/role/RoleDetails.java @@ -24,9 +24,13 @@ import org.apache.commons.collections4.map.LinkedMap; import org.apache.syncope.client.cli.Input; import org.apache.syncope.common.lib.SyncopeClientException; import org.apache.syncope.common.lib.to.RoleTO; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class RoleDetails extends AbstractRoleCommand { + private static final Logger LOG = LoggerFactory.getLogger(RoleDetails.class); + private static final String DETAILS_HELP_MESSAGE = "role --details"; private final Input input; @@ -50,6 +54,7 @@ public class RoleDetails extends AbstractRoleCommand { details.put("Without entitlements", String.valueOf(withoutEntitlements)); roleResultManager.printDetails(details); } catch (final SyncopeClientException ex) { + LOG.error("Error reading details about role", ex); roleResultManager.genericError(ex.getMessage()); } } else { http://git-wip-us.apache.org/repos/asf/syncope/blob/24a91259/client/cli/src/main/java/org/apache/syncope/client/cli/commands/role/RoleList.java ---------------------------------------------------------------------- diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/role/RoleList.java b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/role/RoleList.java index 363a018..9aaabab 100644 --- a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/role/RoleList.java +++ b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/role/RoleList.java @@ -20,9 +20,13 @@ package org.apache.syncope.client.cli.commands.role; import org.apache.syncope.client.cli.Input; import org.apache.syncope.common.lib.SyncopeClientException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class RoleList extends AbstractRoleCommand { + private static final Logger LOG = LoggerFactory.getLogger(RoleList.class); + private static final String LIST_HELP_MESSAGE = "role --list"; private final Input input; @@ -36,6 +40,7 @@ public class RoleList extends AbstractRoleCommand { try { roleResultManager.printRoles(roleSyncopeOperations.list()); } catch (final SyncopeClientException ex) { + LOG.error("Error listing role", ex); roleResultManager.genericError(ex.getMessage()); } } else { http://git-wip-us.apache.org/repos/asf/syncope/blob/24a91259/client/cli/src/main/java/org/apache/syncope/client/cli/commands/role/RoleRead.java ---------------------------------------------------------------------- diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/role/RoleRead.java b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/role/RoleRead.java index b38614f..75ecc76 100644 --- a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/role/RoleRead.java +++ b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/role/RoleRead.java @@ -24,9 +24,13 @@ 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.RoleTO; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class RoleRead extends AbstractRoleCommand { + private static final Logger LOG = LoggerFactory.getLogger(RoleRead.class); + private static final String READ_HELP_MESSAGE = "role --read {ROLE-ID} {ROLE-ID} [...]"; private final Input input; @@ -42,6 +46,7 @@ public class RoleRead extends AbstractRoleCommand { try { roleTOs.add(roleSyncopeOperations.read(parameter)); } catch (final SyncopeClientException | WebServiceException ex) { + LOG.error("Error reading role", ex); if (ex.getMessage().startsWith("NotFound")) { roleResultManager.notFoundError("Role", parameter); } else { @@ -49,6 +54,7 @@ public class RoleRead extends AbstractRoleCommand { } break; } catch (final NumberFormatException ex) { + LOG.error("Error reading role", ex); roleResultManager.numberFormatException("user", parameter); } } http://git-wip-us.apache.org/repos/asf/syncope/blob/24a91259/client/cli/src/main/java/org/apache/syncope/client/cli/commands/schema/SchemaDelete.java ---------------------------------------------------------------------- diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/schema/SchemaDelete.java b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/schema/SchemaDelete.java index d3d5314..5b33f93 100644 --- a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/schema/SchemaDelete.java +++ b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/schema/SchemaDelete.java @@ -24,9 +24,13 @@ import org.apache.syncope.client.cli.Input; import org.apache.syncope.client.cli.util.CommandUtils; import org.apache.syncope.common.lib.SyncopeClientException; import org.apache.syncope.common.lib.types.SchemaType; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class SchemaDelete extends AbstractSchemaCommand { + private static final Logger LOG = LoggerFactory.getLogger(SchemaDelete.class); + private static final String DELETE_HELP_MESSAGE = "schema --delete {SCHEMA-TYPE} {SCHEMA-KEY}\n" + " Schema type: PLAIN / DERIVED / VIRTUAL"; @@ -45,6 +49,7 @@ public class SchemaDelete extends AbstractSchemaCommand { schemaResultManager.deletedMessage("Schema", parameter); } } catch (final SyncopeClientException | WebServiceException ex) { + LOG.error("Error deleting schema", ex); if (ex.getMessage().startsWith("NotFound")) { schemaResultManager.notFoundError("Schema", parameters[0]); } else if (ex.getMessage().startsWith("DataIntegrityViolation")) { @@ -53,6 +58,7 @@ public class SchemaDelete extends AbstractSchemaCommand { schemaResultManager.genericError(ex.getMessage()); } } catch (final IllegalArgumentException ex) { + LOG.error("Error deleting schema", ex); schemaResultManager.typeNotValidError( "schema", input.firstParameter(), CommandUtils.fromEnumToArray(SchemaType.class)); } http://git-wip-us.apache.org/repos/asf/syncope/blob/24a91259/client/cli/src/main/java/org/apache/syncope/client/cli/commands/schema/SchemaDetails.java ---------------------------------------------------------------------- diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/schema/SchemaDetails.java b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/schema/SchemaDetails.java index 7a76836..bfdcdd6 100644 --- a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/schema/SchemaDetails.java +++ b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/schema/SchemaDetails.java @@ -23,9 +23,13 @@ import javax.xml.ws.WebServiceException; import org.apache.commons.collections4.map.LinkedMap; import org.apache.syncope.client.cli.Input; import org.apache.syncope.common.lib.SyncopeClientException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class SchemaDetails extends AbstractSchemaCommand { + private static final Logger LOG = LoggerFactory.getLogger(SchemaDetails.class); + private static final String DETAILS_HELP_MESSAGE = "schema --details"; private final Input input; @@ -49,6 +53,7 @@ public class SchemaDetails extends AbstractSchemaCommand { details.put("virtual schema", String.valueOf(virtualSchemaSize)); schemaResultManager.printDetails(details); } catch (final SyncopeClientException | WebServiceException ex) { + LOG.error("Error reading details about schema", ex); schemaResultManager.genericError(ex.getMessage()); } } else { http://git-wip-us.apache.org/repos/asf/syncope/blob/24a91259/client/cli/src/main/java/org/apache/syncope/client/cli/commands/schema/SchemaList.java ---------------------------------------------------------------------- diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/schema/SchemaList.java b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/schema/SchemaList.java index 14e129b..3b2bc83 100644 --- a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/schema/SchemaList.java +++ b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/schema/SchemaList.java @@ -24,9 +24,13 @@ import org.apache.syncope.client.cli.util.CommandUtils; import org.apache.syncope.common.lib.SyncopeClientException; import org.apache.syncope.common.lib.to.AbstractSchemaTO; import org.apache.syncope.common.lib.types.SchemaType; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class SchemaList extends AbstractSchemaCommand { + private static final Logger LOG = LoggerFactory.getLogger(SchemaList.class); + private static final String LIST_HELP_MESSAGE = "schema --list {SCHEMA-TYPE}\n" + " Schema type: PLAIN / DERIVED / VIRTUAL"; @@ -58,8 +62,10 @@ public class SchemaList extends AbstractSchemaCommand { break; } } catch (final SyncopeClientException ex) { + LOG.error("Error listing schema", ex); schemaResultManager.genericError(ex.getMessage()); } catch (final IllegalArgumentException ex) { + LOG.error("Error listing schema", ex); schemaResultManager.typeNotValidError( "schema", input.firstParameter(), CommandUtils.fromEnumToArray(SchemaType.class)); } http://git-wip-us.apache.org/repos/asf/syncope/blob/24a91259/client/cli/src/main/java/org/apache/syncope/client/cli/commands/schema/SchemaListAll.java ---------------------------------------------------------------------- diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/schema/SchemaListAll.java b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/schema/SchemaListAll.java index e94e3c4..490eab0 100644 --- a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/schema/SchemaListAll.java +++ b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/schema/SchemaListAll.java @@ -24,9 +24,13 @@ import org.apache.syncope.client.cli.Input; import org.apache.syncope.common.lib.SyncopeClientException; import org.apache.syncope.common.lib.to.AbstractSchemaTO; import org.apache.syncope.common.lib.types.SchemaType; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class SchemaListAll extends AbstractSchemaCommand { + private static final Logger LOG = LoggerFactory.getLogger(SchemaListAll.class); + private static final String LIST_HELP_MESSAGE = "schema --list-all"; private final Input input; @@ -58,6 +62,7 @@ public class SchemaListAll extends AbstractSchemaCommand { } } } catch (final SyncopeClientException | WebServiceException ex) { + LOG.error("Error listing schema", ex); schemaResultManager.genericError(ex.getMessage()); } } else { http://git-wip-us.apache.org/repos/asf/syncope/blob/24a91259/client/cli/src/main/java/org/apache/syncope/client/cli/commands/schema/SchemaListDerived.java ---------------------------------------------------------------------- diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/schema/SchemaListDerived.java b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/schema/SchemaListDerived.java index fa76684..c47af9f 100644 --- a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/schema/SchemaListDerived.java +++ b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/schema/SchemaListDerived.java @@ -23,9 +23,13 @@ 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.AbstractSchemaTO; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class SchemaListDerived extends AbstractSchemaCommand { + private static final Logger LOG = LoggerFactory.getLogger(SchemaListDerived.class); + private static final String LIST_HELP_MESSAGE = "schema --list-derived"; private final Input input; @@ -43,6 +47,7 @@ public class SchemaListDerived extends AbstractSchemaCommand { } schemaResultManager.fromListDerived(schemaTOs); } catch (final SyncopeClientException | WebServiceException ex) { + LOG.error("Error listing schema", ex); schemaResultManager.genericError(ex.getMessage()); } } else { http://git-wip-us.apache.org/repos/asf/syncope/blob/24a91259/client/cli/src/main/java/org/apache/syncope/client/cli/commands/schema/SchemaListPlain.java ---------------------------------------------------------------------- diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/schema/SchemaListPlain.java b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/schema/SchemaListPlain.java index 8793be4..cbb6f77 100644 --- a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/schema/SchemaListPlain.java +++ b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/schema/SchemaListPlain.java @@ -23,9 +23,13 @@ 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.AbstractSchemaTO; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class SchemaListPlain extends AbstractSchemaCommand { + private static final Logger LOG = LoggerFactory.getLogger(SchemaListPlain.class); + private static final String LIST_HELP_MESSAGE = "schema --list-plain"; private final Input input; @@ -43,6 +47,7 @@ public class SchemaListPlain extends AbstractSchemaCommand { } schemaResultManager.printSchemas(schemaTOs); } catch (final SyncopeClientException | WebServiceException ex) { + LOG.error("Error listing schema", ex); schemaResultManager.genericError(ex.getMessage()); } } else { http://git-wip-us.apache.org/repos/asf/syncope/blob/24a91259/client/cli/src/main/java/org/apache/syncope/client/cli/commands/schema/SchemaListVirtual.java ---------------------------------------------------------------------- diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/schema/SchemaListVirtual.java b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/schema/SchemaListVirtual.java index d7da8c8..31d3657 100644 --- a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/schema/SchemaListVirtual.java +++ b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/schema/SchemaListVirtual.java @@ -23,9 +23,13 @@ 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.AbstractSchemaTO; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class SchemaListVirtual extends AbstractSchemaCommand { + private static final Logger LOG = LoggerFactory.getLogger(SchemaListVirtual.class); + private static final String LIST_HELP_MESSAGE = "schema --list-virtual"; private final Input input; @@ -43,6 +47,7 @@ public class SchemaListVirtual extends AbstractSchemaCommand { } schemaResultManager.fromListVirtual(schemaTOs); } catch (final SyncopeClientException | WebServiceException ex) { + LOG.error("Error listing schema", ex); schemaResultManager.genericError(ex.getMessage()); } } else { http://git-wip-us.apache.org/repos/asf/syncope/blob/24a91259/client/cli/src/main/java/org/apache/syncope/client/cli/commands/schema/SchemaRead.java ---------------------------------------------------------------------- diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/schema/SchemaRead.java b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/schema/SchemaRead.java index 267c551..599148e 100644 --- a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/schema/SchemaRead.java +++ b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/schema/SchemaRead.java @@ -26,9 +26,13 @@ import org.apache.syncope.client.cli.util.CommandUtils; import org.apache.syncope.common.lib.SyncopeClientException; import org.apache.syncope.common.lib.to.AbstractSchemaTO; import org.apache.syncope.common.lib.types.SchemaType; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class SchemaRead extends AbstractSchemaCommand { + private static final Logger LOG = LoggerFactory.getLogger(SchemaRead.class); + private static final String READ_HELP_MESSAGE = "schema --read {SCHEMA-TYPE} {SCHEMA-KEY}\n" + " Schema type: PLAIN / DERIVED / VIRTUAL"; @@ -61,12 +65,14 @@ public class SchemaRead extends AbstractSchemaCommand { break; } } catch (final SyncopeClientException | WebServiceException ex) { + LOG.error("Error reading schema", ex); if (ex.getMessage().startsWith("NotFound")) { schemaResultManager.notFoundError("Schema", parameters[0]); } else { schemaResultManager.genericError(ex.getMessage()); } } catch (final IllegalArgumentException ex) { + LOG.error("Error reading schema", ex); schemaResultManager.typeNotValidError( "schema", input.firstParameter(), CommandUtils.fromEnumToArray(SchemaType.class)); } http://git-wip-us.apache.org/repos/asf/syncope/blob/24a91259/client/cli/src/main/java/org/apache/syncope/client/cli/commands/self/AbstractWorkflowCommand.java ---------------------------------------------------------------------- diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/self/AbstractWorkflowCommand.java b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/self/AbstractWorkflowCommand.java index c48eb8c..b21abf3 100644 --- a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/self/AbstractWorkflowCommand.java +++ b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/self/AbstractWorkflowCommand.java @@ -18,7 +18,7 @@ */ package org.apache.syncope.client.cli.commands.self; -public class AbstractWorkflowCommand { +public abstract class AbstractWorkflowCommand { protected final WorkflowResultManager workflowResultManager = new WorkflowResultManager(); http://git-wip-us.apache.org/repos/asf/syncope/blob/24a91259/client/cli/src/main/java/org/apache/syncope/client/cli/commands/self/WorkflowExportDefinition.java ---------------------------------------------------------------------- diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/self/WorkflowExportDefinition.java b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/self/WorkflowExportDefinition.java index aa1d8a3..25d326a 100644 --- a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/self/WorkflowExportDefinition.java +++ b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/self/WorkflowExportDefinition.java @@ -23,9 +23,13 @@ import org.apache.syncope.client.cli.Input; import org.apache.syncope.client.cli.util.CommandUtils; import org.apache.syncope.common.lib.SyncopeClientException; import org.apache.syncope.common.lib.types.AnyTypeKind; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class WorkflowExportDefinition extends AbstractWorkflowCommand { + private static final Logger LOG = LoggerFactory.getLogger(WorkflowExportDefinition.class); + private static final String EXPORT_HELP_MESSAGE = "workflow --export-definition {ANY-TYPE-KIND}\n"; private final Input input; @@ -40,12 +44,14 @@ public class WorkflowExportDefinition extends AbstractWorkflowCommand { final AnyTypeKind anyTypeKind = AnyTypeKind.valueOf(input.firstParameter()); System.out.println(" > > > > " + workflowSyncopeOperations.exportDefinition(anyTypeKind).getEntity()); } catch (final SyncopeClientException | WebServiceException ex) { + LOG.error("Error", ex); if (ex.getMessage().startsWith("NotFound")) { workflowResultManager.notFoundError("Workflow", input.firstParameter()); } else { workflowResultManager.genericError(ex.getMessage()); } } catch (final IllegalArgumentException ex) { + LOG.error("Error", ex); workflowResultManager.typeNotValidError( "workflow", input.firstParameter(), CommandUtils.fromEnumToArray(AnyTypeKind.class)); } http://git-wip-us.apache.org/repos/asf/syncope/blob/24a91259/client/cli/src/main/java/org/apache/syncope/client/cli/commands/task/TaskDelete.java ---------------------------------------------------------------------- diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/task/TaskDelete.java b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/task/TaskDelete.java index c5089ff..d5fbfef 100644 --- a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/task/TaskDelete.java +++ b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/task/TaskDelete.java @@ -21,9 +21,13 @@ package org.apache.syncope.client.cli.commands.task; import javax.xml.ws.WebServiceException; import org.apache.syncope.client.cli.Input; import org.apache.syncope.common.lib.SyncopeClientException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class TaskDelete extends AbstractTaskCommand { + private static final Logger LOG = LoggerFactory.getLogger(TaskDelete.class); + private static final String DELETE_HELP_MESSAGE = "task --delete {TASK-ID} {TASK-ID} [...]"; private final Input input; @@ -40,6 +44,7 @@ public class TaskDelete extends AbstractTaskCommand { taskSyncopeOperations.delete(parameter); taskResultManager.deletedMessage("Task", parameter); } catch (final WebServiceException | SyncopeClientException ex) { + LOG.error("Error deleting task", ex); if (ex.getMessage().startsWith("NotFound")) { taskResultManager.notFoundError("Task", parameter); } else if (ex.getMessage().startsWith("DataIntegrityViolation")) { @@ -48,6 +53,7 @@ public class TaskDelete extends AbstractTaskCommand { taskResultManager.genericError(ex.getMessage()); } } catch (final NumberFormatException ex) { + LOG.error("Error deleting task", ex); taskResultManager.notBooleanDeletedError("task", parameter); } } http://git-wip-us.apache.org/repos/asf/syncope/blob/24a91259/client/cli/src/main/java/org/apache/syncope/client/cli/commands/task/TaskDetails.java ---------------------------------------------------------------------- diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/task/TaskDetails.java b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/task/TaskDetails.java index 0eba187..e4a325e 100644 --- a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/task/TaskDetails.java +++ b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/task/TaskDetails.java @@ -32,9 +32,13 @@ import org.apache.syncope.common.lib.to.SchedTaskTO; import org.apache.syncope.common.lib.to.SyncTaskTO; import org.apache.syncope.common.lib.to.TaskExecTO; import org.apache.syncope.common.lib.types.TaskType; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class TaskDetails extends AbstractTaskCommand { + private static final Logger LOG = LoggerFactory.getLogger(TaskDetails.class); + private static final String DETAILS_HELP_MESSAGE = "task --details"; private final Input input; @@ -125,8 +129,10 @@ public class TaskDetails extends AbstractTaskCommand { details.put("scheduled jobs", String.valueOf(scheduledJobsSize)); taskResultManager.printDetails(details); } catch (final SyncopeClientException ex) { + LOG.error("Error reading details about task", ex); taskResultManager.genericError(ex.getMessage()); } catch (final IllegalArgumentException ex) { + LOG.error("Error reading details about task", ex); taskResultManager.typeNotValidError( "task", input.firstParameter(), CommandUtils.fromEnumToArray(TaskType.class)); } http://git-wip-us.apache.org/repos/asf/syncope/blob/24a91259/client/cli/src/main/java/org/apache/syncope/client/cli/commands/task/TaskExecute.java ---------------------------------------------------------------------- diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/task/TaskExecute.java b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/task/TaskExecute.java index a501905..7c97de4 100644 --- a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/task/TaskExecute.java +++ b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/task/TaskExecute.java @@ -22,9 +22,13 @@ import java.util.Arrays; import javax.xml.ws.WebServiceException; import org.apache.syncope.client.cli.Input; import org.apache.syncope.common.lib.SyncopeClientException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class TaskExecute extends AbstractTaskCommand { + private static final Logger LOG = LoggerFactory.getLogger(TaskExecute.class); + private static final String EXECUTE_HELP_MESSAGE = "task --execute {TASK-ID} {DRY-RUN}\n" + " Dry run: true / false"; @@ -48,6 +52,7 @@ public class TaskExecute extends AbstractTaskCommand { taskResultManager.printTaskExecTO(Arrays.asList( taskSyncopeOperations.execute(input.firstParameter(), dryRun))); } catch (final WebServiceException | SyncopeClientException ex) { + LOG.error("Error executing task", ex); if (ex.getMessage().startsWith("NotFound")) { taskResultManager.notFoundError("Task", input.firstParameter()); } else if (ex.getMessage().startsWith("DataIntegrityViolation")) { @@ -56,6 +61,7 @@ public class TaskExecute extends AbstractTaskCommand { taskResultManager.genericError(ex.getMessage()); } } catch (final NumberFormatException ex) { + LOG.error("Error executing task", ex); taskResultManager.notBooleanDeletedError("task", input.firstParameter()); } } else { http://git-wip-us.apache.org/repos/asf/syncope/blob/24a91259/client/cli/src/main/java/org/apache/syncope/client/cli/commands/task/TaskExecutionDelete.java ---------------------------------------------------------------------- diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/task/TaskExecutionDelete.java b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/task/TaskExecutionDelete.java index 30cbf42..a39ba6a 100644 --- a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/task/TaskExecutionDelete.java +++ b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/task/TaskExecutionDelete.java @@ -21,9 +21,13 @@ package org.apache.syncope.client.cli.commands.task; import javax.xml.ws.WebServiceException; import org.apache.syncope.client.cli.Input; import org.apache.syncope.common.lib.SyncopeClientException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class TaskExecutionDelete extends AbstractTaskCommand { + private static final Logger LOG = LoggerFactory.getLogger(TaskExecutionDelete.class); + private static final String DELETE_HELP_MESSAGE = "task --delete-execution " + "{TASK-EXEC-ID} {TASK-EXEC-ID} [...]"; @@ -40,6 +44,7 @@ public class TaskExecutionDelete extends AbstractTaskCommand { taskSyncopeOperations.deleteExecution(parameter); taskResultManager.deletedMessage("Task execution", parameter); } catch (final WebServiceException | SyncopeClientException ex) { + LOG.error("Error deleting execution", ex); if (ex.getMessage().startsWith("NotFound")) { taskResultManager.notFoundError("Task execution", parameter); } else if (ex.getMessage().startsWith("DataIntegrityViolation")) { @@ -48,6 +53,7 @@ public class TaskExecutionDelete extends AbstractTaskCommand { taskResultManager.genericError(ex.getMessage()); } } catch (final NumberFormatException ex) { + LOG.error("Error deleting execution", ex); taskResultManager.notBooleanDeletedError("task execution", parameter); } } http://git-wip-us.apache.org/repos/asf/syncope/blob/24a91259/client/cli/src/main/java/org/apache/syncope/client/cli/commands/task/TaskExecutionRead.java ---------------------------------------------------------------------- diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/task/TaskExecutionRead.java b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/task/TaskExecutionRead.java index c234028..be17d25 100644 --- a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/task/TaskExecutionRead.java +++ b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/task/TaskExecutionRead.java @@ -22,9 +22,13 @@ import java.util.Arrays; import javax.xml.ws.WebServiceException; import org.apache.syncope.client.cli.Input; import org.apache.syncope.common.lib.SyncopeClientException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class TaskExecutionRead extends AbstractTaskCommand { + private static final Logger LOG = LoggerFactory.getLogger(TaskExecutionRead.class); + private static final String EXECUTION_READ_HELP_MESSAGE = "task --read-execution {TASK-ID} {TASK-ID} [...]"; private final Input input; @@ -40,8 +44,10 @@ public class TaskExecutionRead extends AbstractTaskCommand { taskResultManager.printTaskExecTO( Arrays.asList(taskSyncopeOperations.readExecution(parameter))); } catch (final NumberFormatException ex) { + LOG.error("Error reading task", ex); taskResultManager.notBooleanDeletedError("task execution", parameter); } catch (final SyncopeClientException | WebServiceException ex) { + LOG.error("Error reading task", ex); if (ex.getMessage().startsWith("NotFound")) { taskResultManager.notFoundError("Task execution", parameter); } else { http://git-wip-us.apache.org/repos/asf/syncope/blob/24a91259/client/cli/src/main/java/org/apache/syncope/client/cli/commands/task/TaskList.java ---------------------------------------------------------------------- diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/task/TaskList.java b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/task/TaskList.java index 7078746..699b287 100644 --- a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/task/TaskList.java +++ b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/task/TaskList.java @@ -24,9 +24,13 @@ import org.apache.syncope.client.cli.util.CommandUtils; import org.apache.syncope.common.lib.SyncopeClientException; import org.apache.syncope.common.lib.to.AbstractTaskTO; import org.apache.syncope.common.lib.types.TaskType; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class TaskList extends AbstractTaskCommand { + private static final Logger LOG = LoggerFactory.getLogger(TaskList.class); + private static final String LIST_HELP_MESSAGE = "task --list-task {TASK-TYPE}\n" + " Task type: NOTIFICATION / PROPAGATION / PUSH / SCHEDULED / SYNCHRONIZATION"; @@ -46,8 +50,10 @@ public class TaskList extends AbstractTaskCommand { } taskResultManager.printTasksType(taskType, taskTOs); } catch (final SyncopeClientException ex) { + LOG.error("Error listing task", ex); taskResultManager.genericError(ex.getMessage()); } catch (final IllegalArgumentException ex) { + LOG.error("Error listing task", ex); taskResultManager.typeNotValidError( "task", input.firstParameter(), CommandUtils.fromEnumToArray(TaskType.class)); } http://git-wip-us.apache.org/repos/asf/syncope/blob/24a91259/client/cli/src/main/java/org/apache/syncope/client/cli/commands/task/TaskListRunningJobs.java ---------------------------------------------------------------------- diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/task/TaskListRunningJobs.java b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/task/TaskListRunningJobs.java index 931cfef..928af35 100644 --- a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/task/TaskListRunningJobs.java +++ b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/task/TaskListRunningJobs.java @@ -20,9 +20,13 @@ package org.apache.syncope.client.cli.commands.task; import org.apache.syncope.client.cli.Input; import org.apache.syncope.common.lib.SyncopeClientException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class TaskListRunningJobs extends AbstractTaskCommand { + private static final Logger LOG = LoggerFactory.getLogger(TaskListRunningJobs.class); + private static final String READ_HELP_MESSAGE = "task --list-running-jobs"; private final Input input; @@ -36,6 +40,7 @@ public class TaskListRunningJobs extends AbstractTaskCommand { try { taskResultManager.printTaskExecTO(taskSyncopeOperations.listRunningJobs()); } catch (final SyncopeClientException ex) { + LOG.error("Error listing jobs", ex); taskResultManager.genericError(ex.getMessage()); } } else { http://git-wip-us.apache.org/repos/asf/syncope/blob/24a91259/client/cli/src/main/java/org/apache/syncope/client/cli/commands/task/TaskListScheduledJobs.java ---------------------------------------------------------------------- diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/task/TaskListScheduledJobs.java b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/task/TaskListScheduledJobs.java index ec2cab1..1710d79 100644 --- a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/task/TaskListScheduledJobs.java +++ b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/task/TaskListScheduledJobs.java @@ -20,9 +20,13 @@ package org.apache.syncope.client.cli.commands.task; import org.apache.syncope.client.cli.Input; import org.apache.syncope.common.lib.SyncopeClientException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class TaskListScheduledJobs extends AbstractTaskCommand { + private static final Logger LOG = LoggerFactory.getLogger(TaskListScheduledJobs.class); + private static final String READ_HELP_MESSAGE = "task --list-scheduled-jobs"; private final Input input; @@ -36,6 +40,7 @@ public class TaskListScheduledJobs extends AbstractTaskCommand { try { taskResultManager.printTaskExecTO(taskSyncopeOperations.listScheduledJobs()); } catch (final SyncopeClientException ex) { + LOG.error("Error listing task", ex); taskResultManager.genericError(ex.getMessage()); } } else { http://git-wip-us.apache.org/repos/asf/syncope/blob/24a91259/client/cli/src/main/java/org/apache/syncope/client/cli/commands/task/TaskRead.java ---------------------------------------------------------------------- diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/task/TaskRead.java b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/task/TaskRead.java index 08aa79b..f50f1f7 100644 --- a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/task/TaskRead.java +++ b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/task/TaskRead.java @@ -23,9 +23,13 @@ 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.AbstractTaskTO; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class TaskRead extends AbstractTaskCommand { + private static final Logger LOG = LoggerFactory.getLogger(TaskRead.class); + private static final String READ_HELP_MESSAGE = "task --read {TASK-ID} {TASK-ID} [...]"; private final Input input; @@ -41,8 +45,10 @@ public class TaskRead extends AbstractTaskCommand { try { taskTOs.add(taskSyncopeOperations.read(parameter)); } catch (final NumberFormatException ex) { + LOG.error("Error reading task", ex); taskResultManager.notBooleanDeletedError("task", parameter); } catch (final SyncopeClientException | WebServiceException ex) { + LOG.error("Error reading task", ex); if (ex.getMessage().startsWith("NotFound")) { taskResultManager.notFoundError("Task", parameter); } else { http://git-wip-us.apache.org/repos/asf/syncope/blob/24a91259/client/cli/src/main/java/org/apache/syncope/client/cli/commands/user/UserDelete.java ---------------------------------------------------------------------- diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/user/UserDelete.java b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/user/UserDelete.java index 80195f8..f338844 100644 --- a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/user/UserDelete.java +++ b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/user/UserDelete.java @@ -21,9 +21,13 @@ package org.apache.syncope.client.cli.commands.user; import javax.xml.ws.WebServiceException; import org.apache.syncope.client.cli.Input; import org.apache.syncope.common.lib.SyncopeClientException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class UserDelete extends AbstractUserCommand { + private static final Logger LOG = LoggerFactory.getLogger(UserDelete.class); + private static final String DELETE_HELP_MESSAGE = "user --delete {USER-ID} {USER-ID} [...]"; private final Input input; @@ -39,12 +43,14 @@ public class UserDelete extends AbstractUserCommand { userSyncopeOperations.delete(parameter); userResultManager.deletedMessage("User", parameter); } catch (final WebServiceException | SyncopeClientException ex) { + LOG.error("Error deleting user", ex); if (ex.getMessage().startsWith("NotFound")) { userResultManager.notFoundError("User", parameter); } else { userResultManager.genericError(ex.getMessage()); } } catch (final NumberFormatException ex) { + LOG.error("Error deleting user", ex); userResultManager.numberFormatException("user", parameter); } } http://git-wip-us.apache.org/repos/asf/syncope/blob/24a91259/client/cli/src/main/java/org/apache/syncope/client/cli/commands/user/UserDetails.java ---------------------------------------------------------------------- diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/user/UserDetails.java b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/user/UserDetails.java index f09b4ad..c4df03e 100644 --- a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/user/UserDetails.java +++ b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/user/UserDetails.java @@ -24,9 +24,13 @@ import org.apache.commons.collections4.map.LinkedMap; import org.apache.syncope.client.cli.Input; import org.apache.syncope.common.lib.SyncopeClientException; import org.apache.syncope.common.lib.to.UserTO; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class UserDetails extends AbstractUserCommand { + private static final Logger LOG = LoggerFactory.getLogger(UserDetails.class); + private static final String COUNT_HELP_MESSAGE = "user --details"; private final Input input; @@ -64,6 +68,7 @@ public class UserDetails extends AbstractUserCommand { details.put("Without roles", String.valueOf(withoutRole)); userResultManager.printDetails(details); } catch (final SyncopeClientException ex) { + LOG.error("Error reading details about user", ex); userResultManager.genericError(ex.getMessage()); } } else { http://git-wip-us.apache.org/repos/asf/syncope/blob/24a91259/client/cli/src/main/java/org/apache/syncope/client/cli/commands/user/UserGetKey.java ---------------------------------------------------------------------- diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/user/UserGetKey.java b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/user/UserGetKey.java index d11c9c8..ed46ad1 100644 --- a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/user/UserGetKey.java +++ b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/user/UserGetKey.java @@ -20,9 +20,13 @@ package org.apache.syncope.client.cli.commands.user; import org.apache.syncope.client.cli.Input; import org.apache.syncope.common.lib.SyncopeClientException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class UserGetKey extends AbstractUserCommand { + private static final Logger LOG = LoggerFactory.getLogger(UserGetKey.class); + private static final String GET_HELP_MESSAGE = "user --get-user-key {USERNAME}"; private final Input input; @@ -36,6 +40,7 @@ public class UserGetKey extends AbstractUserCommand { try { userResultManager.genericMessage(userSyncopeOperations.getIdFromUsername(input.firstParameter())); } catch (final SyncopeClientException ex) { + LOG.error("Error getting user", ex); userResultManager.genericError(ex.getMessage()); } } else { http://git-wip-us.apache.org/repos/asf/syncope/blob/24a91259/client/cli/src/main/java/org/apache/syncope/client/cli/commands/user/UserGetUsername.java ---------------------------------------------------------------------- diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/user/UserGetUsername.java b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/user/UserGetUsername.java index 6686663..d705a83 100644 --- a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/user/UserGetUsername.java +++ b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/user/UserGetUsername.java @@ -20,9 +20,13 @@ package org.apache.syncope.client.cli.commands.user; import org.apache.syncope.client.cli.Input; import org.apache.syncope.common.lib.SyncopeClientException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class UserGetUsername extends AbstractUserCommand { + private static final Logger LOG = LoggerFactory.getLogger(UserGetUsername.class); + private static final String GET_HELP_MESSAGE = "user --get-username {USER-ID}"; private final Input input; @@ -36,6 +40,7 @@ public class UserGetUsername extends AbstractUserCommand { try { userResultManager.genericMessage(userSyncopeOperations.getUsernameFromId(input.firstParameter())); } catch (final SyncopeClientException ex) { + LOG.error("Error getting user", ex); userResultManager.genericError(ex.getMessage()); } } else { http://git-wip-us.apache.org/repos/asf/syncope/blob/24a91259/client/cli/src/main/java/org/apache/syncope/client/cli/commands/user/UserList.java ---------------------------------------------------------------------- diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/user/UserList.java b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/user/UserList.java index d918cad..e498747 100644 --- a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/user/UserList.java +++ b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/user/UserList.java @@ -24,9 +24,13 @@ import org.apache.syncope.client.cli.Input; import org.apache.syncope.common.lib.SyncopeClientException; import org.apache.syncope.common.lib.to.PagedResult; import org.apache.syncope.common.lib.to.UserTO; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class UserList extends AbstractUserCommand { + private static final Logger LOG = LoggerFactory.getLogger(UserList.class); + private static final String LIST_HELP_MESSAGE = "user --list"; private final Input input; @@ -52,6 +56,7 @@ public class UserList extends AbstractUserCommand { userResultManager.genericError("Invalid parameter, please use [yes/no]"); } } catch (final SyncopeClientException ex) { + LOG.error("Error listing user", ex); userResultManager.genericError(ex.getMessage()); } } else { http://git-wip-us.apache.org/repos/asf/syncope/blob/24a91259/client/cli/src/main/java/org/apache/syncope/client/cli/commands/user/UserRead.java ---------------------------------------------------------------------- diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/user/UserRead.java b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/user/UserRead.java index 14987a2..6192135 100644 --- a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/user/UserRead.java +++ b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/user/UserRead.java @@ -24,9 +24,13 @@ 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.UserTO; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class UserRead extends AbstractUserCommand { + private static final Logger LOG = LoggerFactory.getLogger(UserRead.class); + private static final String READ_HELP_MESSAGE = "user --read {USER-ID} {USER-ID} [...]"; private final Input input; @@ -42,6 +46,7 @@ public class UserRead extends AbstractUserCommand { try { userTOs.add(userSyncopeOperations.read(parameter)); } catch (final SyncopeClientException | WebServiceException ex) { + LOG.error("Error reading user", ex); if (ex.getMessage().startsWith("NotFound")) { userResultManager.notFoundError("User", parameter); } else { @@ -49,6 +54,7 @@ public class UserRead extends AbstractUserCommand { } break; } catch (final NumberFormatException ex) { + LOG.error("Error reading user", ex); userResultManager.numberFormatException("user", parameter); } } http://git-wip-us.apache.org/repos/asf/syncope/blob/24a91259/client/cli/src/main/java/org/apache/syncope/client/cli/commands/user/UserSearchByAttribute.java ---------------------------------------------------------------------- diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/user/UserSearchByAttribute.java b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/user/UserSearchByAttribute.java index e4b6df6..874c6a4 100644 --- a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/user/UserSearchByAttribute.java +++ b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/user/UserSearchByAttribute.java @@ -24,9 +24,13 @@ import org.apache.syncope.client.cli.Input; import org.apache.syncope.client.cli.commands.realm.RealmSyncopeOperations; import org.apache.syncope.common.lib.SyncopeClientException; import org.apache.syncope.common.lib.to.UserTO; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class UserSearchByAttribute extends AbstractUserCommand { + private static final Logger LOG = LoggerFactory.getLogger(UserSearchByAttribute.class); + private static final String SEARCH_HELP_MESSAGE = "user --search-by-attribute {REALM} {ATTR-NAME}={ATTR-VALUE}"; private final Input input; @@ -55,12 +59,14 @@ public class UserSearchByAttribute extends AbstractUserCommand { userResultManager.printUsers(userTOs); } } catch (final WebServiceException | SyncopeClientException ex) { + LOG.error("Error searching user", ex); if (ex.getMessage().startsWith("NotFound")) { userResultManager.notFoundError("User with " + pairParameter.getKey(), pairParameter.getValue()); } else { userResultManager.genericError(ex.getMessage()); } } catch (final IllegalArgumentException ex) { + LOG.error("Error searching user", ex); userResultManager.genericError(ex.getMessage()); userResultManager.genericError(SEARCH_HELP_MESSAGE); }