Interface ErrorsReportService

All Known Implementing Classes:
CSVErrorsReportService

public interface ErrorsReportService
This service is used to generate and retrieve the import errors.
Author:
Dima Myroniuk (dmyroniuk)
  • Method Summary

    Modifier and Type
    Method
    Description
    Optional<org.springframework.core.io.Resource>
    Returns the import errors.
    boolean
    A simple method that examines the given metadata object to determine whether an errors report can be created for it.
  • Method Details

    • getErrorsReport

      Optional<org.springframework.core.io.Resource> getErrorsReport(String importId)
      Returns the import errors. If it cannot be found for this import id, it generates a new report.
      Parameters:
      importId - the id of the import
      Returns:
      the resource, or an empty optional if an errors report cannot be generated for the given import (either because the result of isEligibleForErrorsDownload(Import) is false, or if there are no errors to build the report from)
      Throws:
      ErrorsReportException - if there was a critical error when performing the operation
      See Also:
    • isEligibleForErrorsDownload

      boolean isEligibleForErrorsDownload(Import metadata)
      A simple method that examines the given metadata object to determine whether an errors report can be created for it.

      The default implementation is simply to check that the import has a non-zero errors count and has a finished Import.status.

      Parameters:
      metadata - the import which should be checked for errors report eligibility
      Returns:
      true if an errors report can be generated for the given import, false otherwise
      See Also: