Class ReportedMessagesExtractor

java.lang.Object
org.digidoc4j.impl.asic.validation.ReportedMessagesExtractor

public class ReportedMessagesExtractor extends Object
A helper class for extracting token validation messages from DSS SimpleReports.
  • Constructor Details

    • ReportedMessagesExtractor

      public ReportedMessagesExtractor(eu.europa.esig.dss.validation.reports.Reports reports)
      Construct an extractor from an instance of Reports.
      Parameters:
      reports - DSS reports
    • ReportedMessagesExtractor

      public ReportedMessagesExtractor(eu.europa.esig.dss.simplereport.SimpleReport simpleReport)
      Construct an extractor from an instance of SimpleReport.
      Parameters:
      simpleReport - DSS SimpleReport
  • Method Details

    • extractReportedTokenErrors

      public List<ReportedMessagesExtractor.Message> extractReportedTokenErrors(String tokenUniqueId)
      Extracts and returns the error messages of the specified token.
      Parameters:
      tokenUniqueId - DSS id of the token to extract error messages for.
      Returns:
      list of extracted error messages
    • extractReportedTokenWarnings

      public List<ReportedMessagesExtractor.Message> extractReportedTokenWarnings(String tokenUniqueId)
      Extracts and returns the warning messages of the specified token.
      Parameters:
      tokenUniqueId - DSS id of the token to extract warning messages for.
      Returns:
      list of extracted warning messages
    • extractReportedSignatureTimestampErrors

      public List<ReportedMessagesExtractor.Message> extractReportedSignatureTimestampErrors(String signatureUniqueId)
      Extracts and returns the error messages of signature timestamps of the specified signature.
      Parameters:
      signatureUniqueId - DSS id of the signature to extract error messages for.
      Returns:
      list of extracted error messages
    • extractReportedSignatureTimestampWarnings

      public List<ReportedMessagesExtractor.Message> extractReportedSignatureTimestampWarnings(String signatureUniqueId)
      Extracts and returns the warning messages of signature timestamps of the specified signature.
      Parameters:
      signatureUniqueId - DSS id of the signature to extract warning messages for.
      Returns:
      list of extracted warning messages
    • collectErrorsAsExceptions

      @SafeVarargs public static List<DigiDoc4JException> collectErrorsAsExceptions(List<ReportedMessagesExtractor.Message>... errorMessages)
      Collects extracted error messages as unique list and converts them to DigiDoc4JExceptions.
      Parameters:
      errorMessages - lists of error messages to collect and convert to exceptions
      Returns:
      list of exceptions collected from unique error messages
    • collectWarningsAsExceptions

      @SafeVarargs public static List<DigiDoc4JException> collectWarningsAsExceptions(List<ReportedMessagesExtractor.Message>... warningMessages)
      Collects extracted warning messages as unique list and converts them to DigiDoc4JExceptions.
      Parameters:
      warningMessages - lists of warning messages to collect and convert to exceptions
      Returns:
      list of exceptions collected from unique warning messages