19 package org.sleuthkit.autopsy.casemodule;
21 import org.openide.util.NbBundle;
31 class IntervalErrorReportData {
33 private final Case currentCase;
34 private long newProblems;
35 private long totalProblems;
36 private long lastReportedDate;
37 private final int milliSecondsBetweenReports;
38 private final String message;
51 IntervalErrorReportData(Case currentCase,
int secondsBetweenReports, String message) {
53 this.totalProblems = 0;
54 this.lastReportedDate = 0;
55 this.milliSecondsBetweenReports = secondsBetweenReports * 1000;
56 this.message = message;
57 this.currentCase = currentCase;
58 this.currentCase.getSleuthkitCase().addErrorObserver(this.currentCase);
65 this.currentCase.getSleuthkitCase().removeErrorObserver(this.currentCase);
76 void addProblems(String context, String errorMessage) {
77 this.newProblems += 1;
78 this.totalProblems += newProblems;
80 long currentTimeStamp = System.currentTimeMillis();
81 if ((currentTimeStamp - lastReportedDate) > milliSecondsBetweenReports) {
82 this.lastReportedDate = currentTimeStamp;
83 MessageNotifyUtil.
Notify.
error(message, context +
", " + errorMessage +
" "
84 + this.newProblems +
" "
85 + NbBundle.getMessage(IntervalErrorReportData.class,
"IntervalErrorReport.NewIssues")
86 +
" " + this.totalProblems +
" "
87 + NbBundle.getMessage(IntervalErrorReportData.class,
"IntervalErrorReport.TotalIssues")
static void error(String title, String message)