diff --git a/Core/src/org/sleuthkit/autopsy/ingest/DataSourceIngestJob.java b/Core/src/org/sleuthkit/autopsy/ingest/DataSourceIngestJob.java index a1408ef6c2..97f082cce3 100644 --- a/Core/src/org/sleuthkit/autopsy/ingest/DataSourceIngestJob.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/DataSourceIngestJob.java @@ -19,10 +19,12 @@ package org.sleuthkit.autopsy.ingest; import java.util.ArrayList; +import java.util.Collections; import java.util.Date; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.concurrent.CopyOnWriteArrayList; import java.util.concurrent.LinkedBlockingQueue; import java.util.concurrent.atomic.AtomicLong; import java.util.logging.Level; @@ -116,7 +118,8 @@ final class DataSourceIngestJob { */ private volatile boolean currentDataSourceIngestModuleCancelled; private volatile boolean cancelled; - + private final List cancelledDataSourceIngestModules = new CopyOnWriteArrayList<>(); + /** * A data source ingest job uses the task scheduler singleton to create and * queue the ingest tasks that make up the job. @@ -841,10 +844,13 @@ final class DataSourceIngestJob { /** * Rescind a temporary cancellation of data source level ingest that was - * used to stop a single data source level ingest module fro this job. + * used to stop a single data source level ingest module for this job. + * + * @param moduleDisplayName The display name of the module that was stopped. */ - void currentDataSourceIngestModuleCancellationCompleted() { + void currentDataSourceIngestModuleCancellationCompleted(String moduleDisplayName) { this.currentDataSourceIngestModuleCancelled = false; + this.cancelledDataSourceIngestModules.add(moduleDisplayName); if (this.runInteractively) { /** @@ -976,6 +982,8 @@ final class DataSourceIngestJob { private final long processedFiles; private final long estimatedFilesToProcess; private final IngestTasksScheduler.IngestJobTasksSnapshot tasksSnapshot; + private final boolean jobCancelled; + private final List cancelledDataSourceModules; /** * Constructs an object to store basic diagnostic statistics for a data @@ -1015,6 +1023,9 @@ final class DataSourceIngestJob { * Get a snapshot of the tasks currently in progress for this job. */ this.tasksSnapshot = DataSourceIngestJob.taskScheduler.getTasksSnapshotForJob(this.jobId); + + this.jobCancelled = cancelled; + this.cancelledDataSourceModules = new ArrayList<>(DataSourceIngestJob.this.cancelledDataSourceIngestModules); } /** @@ -1118,6 +1129,21 @@ final class DataSourceIngestJob { return this.tasksSnapshot.getRunningListSize(); } + boolean getCancelled() { + return this.jobCancelled; + } + + /** + * Gets a list of the display names of any canceled data source level ingest + * modules + * + * @return A list of canceled data source level ingest module display names, + * possibly empty. + */ + List getCancelledDataSourceIngestModules() { + return Collections.unmodifiableList(this.cancelledDataSourceModules); + } + } } diff --git a/Core/src/org/sleuthkit/autopsy/ingest/DataSourceIngestPipeline.java b/Core/src/org/sleuthkit/autopsy/ingest/DataSourceIngestPipeline.java index 0838abe2bc..76abb180bd 100755 --- a/Core/src/org/sleuthkit/autopsy/ingest/DataSourceIngestPipeline.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/DataSourceIngestPipeline.java @@ -109,7 +109,7 @@ final class DataSourceIngestPipeline { if (this.job.isCancelled()) { break; } else if (this.job.currentDataSourceIngestModuleIsCancelled()) { - this.job.currentDataSourceIngestModuleCancellationCompleted(); + this.job.currentDataSourceIngestModuleCancellationCompleted(currentModule.getDisplayName()); } } this.currentModule = null;