File tree Expand file tree Collapse file tree
core/src/main/java/org/verapdf Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2020 */
2121package org .verapdf .core .utils ;
2222
23+ import java .util .HashMap ;
24+ import java .util .Map ;
25+
2326public class ValidationProgress {
2427
2528 private static final int UPPER_LIMIT_POWER_OF_TEN = 6 ;
@@ -95,6 +98,15 @@ private String getCurrentValidationJobProgress() {
9598 + numberOfObjectsToBeProcessed + " in stack." ;
9699 }
97100
101+ public Map <String , Object > getCurrentValidationJobStats () {
102+ Map <String , Object > progressStats = new HashMap <>();
103+ progressStats .put ("checks" , numberOfChecks );
104+ progressStats .put ("failedChecks" , numberOfFailedChecks );
105+ progressStats .put ("processedObjects" , numberOfProcessedObjects );
106+ progressStats .put ("objectsToBeProcessed" , numberOfObjectsToBeProcessed );
107+ return progressStats ;
108+ }
109+
98110 private boolean checkCurrentNumberOfChecks () {
99111 return numberOfChecks % currentStep == 0 ;
100112 }
Original file line number Diff line number Diff line change 2727import org .verapdf .processor .reports .enums .JobEndStatus ;
2828
2929import java .util .List ;
30+ import java .util .Map ;
3031
3132/**
3233 * A PDFAValidator performs a series of checks on PDF/A documents to verify that
@@ -65,6 +66,8 @@ public interface PDFAValidator extends Component {
6566
6667 public List <ValidationResult > validateAll (PDFAParser toValidate ) throws ValidationException ;
6768
69+ public Map <String , Object > getValidationProgressStats ();
70+
6871 public String getValidationProgressString ();
6972
7073 public void cancelValidation (JobEndStatus endStatus );
Original file line number Diff line number Diff line change @@ -164,6 +164,11 @@ public String getValidationProgressString() {
164164 return validationProgress .getCurrentValidationJobProgressWithCommas ();
165165 }
166166
167+ @ Override
168+ public Map <String , java .lang .Object > getValidationProgressStats () {
169+ return validationProgress .getCurrentValidationJobStats ();
170+ }
171+
167172 @ Override
168173 public void cancelValidation (JobEndStatus endStatus ) {
169174 this .jobEndStatus = endStatus ;
You can’t perform that action at this time.
0 commit comments