Class ReportedMessagesExtractor
java.lang.Object
org.digidoc4j.impl.asic.validation.ReportedMessagesExtractor
A helper class for extracting token validation messages from DSS SimpleReports.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classAn immutable encapsulation for the key (message tag) and the value (message text) of a single error/warning message, and the ID of the token where this message originated from. -
Constructor Summary
ConstructorsConstructorDescriptionReportedMessagesExtractor(eu.europa.esig.dss.simplereport.SimpleReport simpleReport) Construct an extractor from an instance ofSimpleReport.ReportedMessagesExtractor(eu.europa.esig.dss.validation.reports.Reports reports) Construct an extractor from an instance ofReports. -
Method Summary
Modifier and TypeMethodDescriptionstatic List<DigiDoc4JException> collectErrorsAsExceptions(List<ReportedMessagesExtractor.Message>... errorMessages) Collects extracted error messages as unique list and converts them toDigiDoc4JExceptions.static List<DigiDoc4JException> collectWarningsAsExceptions(List<ReportedMessagesExtractor.Message>... warningMessages) Collects extracted warning messages as unique list and converts them toDigiDoc4JExceptions.extractReportedSignatureTimestampErrors(String signatureUniqueId) Extracts and returns the error messages of signature timestamps of the specified signature.extractReportedSignatureTimestampWarnings(String signatureUniqueId) Extracts and returns the warning messages of signature timestamps of the specified signature.extractReportedTokenErrors(String tokenUniqueId) Extracts and returns the error messages of the specified token.extractReportedTokenWarnings(String tokenUniqueId) Extracts and returns the warning messages of the specified token.
-
Constructor Details
-
ReportedMessagesExtractor
public ReportedMessagesExtractor(eu.europa.esig.dss.validation.reports.Reports reports) Construct an extractor from an instance ofReports.- Parameters:
reports- DSS reports
-
ReportedMessagesExtractor
public ReportedMessagesExtractor(eu.europa.esig.dss.simplereport.SimpleReport simpleReport) Construct an extractor from an instance ofSimpleReport.- Parameters:
simpleReport- DSS SimpleReport
-
-
Method Details
-
extractReportedTokenErrors
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
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 toDigiDoc4JExceptions.- 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 toDigiDoc4JExceptions.- Parameters:
warningMessages- lists of warning messages to collect and convert to exceptions- Returns:
- list of exceptions collected from unique warning messages
-