From 7b4d8f262224533ec7c614e97cfb71075da0825f Mon Sep 17 00:00:00 2001 From: Richard Cordovano Date: Thu, 18 Mar 2021 16:44:51 -0400 Subject: [PATCH 01/12] Ingest progress snapshot fix for file ingest modules --- .../autopsy/ingest/FileIngestPipeline.java | 1 + .../autopsy/ingest/IngestManager.java | 120 +++++++++--------- 2 files changed, 59 insertions(+), 62 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/ingest/FileIngestPipeline.java b/Core/src/org/sleuthkit/autopsy/ingest/FileIngestPipeline.java index 1cc6ce05a4..3ba603a968 100644 --- a/Core/src/org/sleuthkit/autopsy/ingest/FileIngestPipeline.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/FileIngestPipeline.java @@ -118,6 +118,7 @@ final class FileIngestPipeline extends IngestTaskPipeline { ingestManager.setIngestTaskProgress(task, getDisplayName()); ingestJobPipeline.setCurrentFileIngestModule(getDisplayName(), file.getName()); ProcessResult result = module.process(file); + ingestManager.setIngestTaskProgress(task, getDisplayName()); if (result == ProcessResult.ERROR) { throw new IngestModuleException(String.format("%s experienced an error analyzing %s (file objId = %d)", getDisplayName(), file.getName(), file.getId())); //NON-NLS } diff --git a/Core/src/org/sleuthkit/autopsy/ingest/IngestManager.java b/Core/src/org/sleuthkit/autopsy/ingest/IngestManager.java index 791a45021c..f2cff38266 100644 --- a/Core/src/org/sleuthkit/autopsy/ingest/IngestManager.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/IngestManager.java @@ -287,15 +287,16 @@ public class IngestManager implements IngestProgressSnapshotProvider { caseIsOpen = false; clearIngestMessageBox(); } - + /** - * Creates an ingest stream from the given ingest settings for a data source. - * + * Creates an ingest stream from the given ingest settings for a data + * source. + * * @param dataSource The data source * @param settings The ingest job settings. - * + * * @return The newly created ingest stream. - * + * * @throws TskCoreException if there was an error starting the ingest job. */ public IngestStream openIngestStream(DataSource dataSource, IngestJobSettings settings) throws TskCoreException { @@ -313,7 +314,6 @@ public class IngestManager implements IngestProgressSnapshotProvider { } } - /** * Gets the number of file ingest threads the ingest manager is using to do * ingest jobs. @@ -519,10 +519,11 @@ public class IngestManager implements IngestProgressSnapshotProvider { public void addIngestJobEventListener(final PropertyChangeListener listener) { jobEventPublisher.addSubscriber(INGEST_JOB_EVENT_NAMES, listener); } - + /** - * Adds an ingest job event property change listener for the given event types. - * + * Adds an ingest job event property change listener for the given event + * types. + * * @param eventTypes The event types to listen for * @param listener The PropertyChangeListener to be added */ @@ -540,18 +541,18 @@ public class IngestManager implements IngestProgressSnapshotProvider { public void removeIngestJobEventListener(final PropertyChangeListener listener) { jobEventPublisher.removeSubscriber(INGEST_JOB_EVENT_NAMES, listener); } - + /** * Removes an ingest job event property change listener. * * @param eventTypes The event types to stop listening for - * @param listener The PropertyChangeListener to be removed. + * @param listener The PropertyChangeListener to be removed. */ public void removeIngestJobEventListener(Set eventTypes, final PropertyChangeListener listener) { eventTypes.forEach((IngestJobEvent event) -> { jobEventPublisher.removeSubscriber(event.toString(), listener); }); - } + } /** * Adds an ingest module event property change listener. @@ -563,8 +564,9 @@ public class IngestManager implements IngestProgressSnapshotProvider { } /** - * Adds an ingest module event property change listener for given event types. - * + * Adds an ingest module event property change listener for given event + * types. + * * @param eventTypes The event types to listen for * @param listener The PropertyChangeListener to be removed. */ @@ -573,7 +575,7 @@ public class IngestManager implements IngestProgressSnapshotProvider { moduleEventPublisher.addSubscriber(event.toString(), listener); }); } - + /** * Removes an ingest module event property change listener. * @@ -582,16 +584,16 @@ public class IngestManager implements IngestProgressSnapshotProvider { public void removeIngestModuleEventListener(final PropertyChangeListener listener) { moduleEventPublisher.removeSubscriber(INGEST_MODULE_EVENT_NAMES, listener); } - + /** * Removes an ingest module event property change listener. - * + * * @param eventTypes The event types to stop listening for * @param listener The PropertyChangeListener to be removed. */ public void removeIngestModuleEventListener(Set eventTypes, final PropertyChangeListener listener) { moduleEventPublisher.removeSubscriber(INGEST_MODULE_EVENT_NAMES, listener); - } + } /** * Publishes an ingest job event signifying an ingest job started. @@ -747,49 +749,21 @@ public class IngestManager implements IngestProgressSnapshotProvider { } /** - * Updates the ingest job snapshot when a data source level ingest job task - * starts to be processd by a data source ingest module in the data source - * ingest modules pipeline of an ingest job. + * Updates the ingest progress snapshot for an ingest job when a data source + * level ingest module starts processing a data source from a data source + * ingest task. * - * @param task The data source level ingest job task that - * was started. - * @param ingestModuleDisplayName The dislpay name of the data source level - * ingest module that has started processing - * the task. + * @param task The data source ingest task. + * @param currentModuleName The display name of the current data source + * level ingest module. */ - void setIngestTaskProgress(DataSourceIngestTask task, String ingestModuleDisplayName) { - ingestThreadActivitySnapshots.put(task.getThreadId(), new IngestThreadActivitySnapshot(task.getThreadId(), task.getIngestJobPipeline().getId(), ingestModuleDisplayName, task.getDataSource())); + void setIngestTaskProgress(DataSourceIngestTask task, String currentModuleName) { + ingestThreadActivitySnapshots.put(task.getThreadId(), new IngestThreadActivitySnapshot(task.getThreadId(), task.getIngestJobPipeline().getId(), currentModuleName, task.getDataSource())); } /** - * Updates the ingest job snapshot when a file source level ingest job task - * starts to be processed by a file level ingest module in the file ingest - * modules pipeline of an ingest job. - * - * @param task The file level ingest job task that was - * started. - * @param ingestModuleDisplayName The dislpay name of the file level ingest - * module that has started processing the - * task. - */ - void setIngestTaskProgress(FileIngestTask task, String ingestModuleDisplayName) { - IngestThreadActivitySnapshot prevSnap = ingestThreadActivitySnapshots.get(task.getThreadId()); - IngestThreadActivitySnapshot newSnap; - try { - newSnap = new IngestThreadActivitySnapshot(task.getThreadId(), task.getIngestJobPipeline().getId(), ingestModuleDisplayName, task.getDataSource(), task.getFile()); - } catch (TskCoreException ex) { - // In practice, this task would never have been enqueued or processed since the file - // lookup would have failed. - newSnap = new IngestThreadActivitySnapshot(task.getThreadId(), task.getIngestJobPipeline().getId(), ingestModuleDisplayName, task.getDataSource()); - } - ingestThreadActivitySnapshots.put(task.getThreadId(), newSnap); - incrementModuleRunTime(prevSnap.getActivity(), newSnap.getStartTime().getTime() - prevSnap.getStartTime().getTime()); - } - - /** - * Updates the ingest job snapshot when a data source level ingest job task - * is completed by the data source ingest modules in the data source ingest - * modules pipeline of an ingest job. + * Updates the ingest progress snapshot for an ingest job when a data source + * level ingest task is completed. * * @param task The data source level ingest job task that was completed. */ @@ -798,19 +772,41 @@ public class IngestManager implements IngestProgressSnapshotProvider { } /** - * Updates the ingest job snapshot when a file level ingest job task is - * completed by the file ingest modules in the file ingest modules pipeline - * of an ingest job. + * Updates the ingest progress snapshot for an ingest job when a file ingest + * module starts or finishes processing a file from a file ingest task. * - * @param task The file level ingest job task that was completed. + * @param task The file ingest task. + * @param currentModuleName The display name of the current file ingest + * module. */ - void setIngestTaskProgressCompleted(FileIngestTask task) { + void setIngestTaskProgress(FileIngestTask task, String currentModuleName) { IngestThreadActivitySnapshot prevSnap = ingestThreadActivitySnapshots.get(task.getThreadId()); - IngestThreadActivitySnapshot newSnap = new IngestThreadActivitySnapshot(task.getThreadId()); + IngestThreadActivitySnapshot newSnap; + try { + newSnap = new IngestThreadActivitySnapshot(task.getThreadId(), task.getIngestJobPipeline().getId(), currentModuleName, task.getDataSource(), task.getFile()); + } catch (TskCoreException ex) { + /* + * In practice, the file should have already been lazily looked up + * and cached when the task was enqueued by the ingest tasks + * scheduler. + */ + logger.log(Level.SEVERE, "Error getting file from file ingest task", ex); + newSnap = new IngestThreadActivitySnapshot(task.getThreadId(), task.getIngestJobPipeline().getId(), currentModuleName, task.getDataSource()); + } ingestThreadActivitySnapshots.put(task.getThreadId(), newSnap); incrementModuleRunTime(prevSnap.getActivity(), newSnap.getStartTime().getTime() - prevSnap.getStartTime().getTime()); } + /** + * Updates the ingest progress snapshot for an ingest job when a file ingest + * task is completed. + * + * @param task The file ingest task. + */ + void setIngestTaskProgressCompleted(FileIngestTask task) { + ingestThreadActivitySnapshots.put(task.getThreadId(), new IngestThreadActivitySnapshot(task.getThreadId())); + } + /** * Updates the cumulative run time for a given ingest module. * From 48cac65e037272834cf455ebb1b8c5e77bf6c9be Mon Sep 17 00:00:00 2001 From: Richard Cordovano Date: Thu, 18 Mar 2021 16:51:14 -0400 Subject: [PATCH 02/12] Ingest progress snapshot fix for file ingest modules --- .../autopsy/ingest/IngestManager.java | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/ingest/IngestManager.java b/Core/src/org/sleuthkit/autopsy/ingest/IngestManager.java index f2cff38266..88a1325e05 100644 --- a/Core/src/org/sleuthkit/autopsy/ingest/IngestManager.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/IngestManager.java @@ -761,16 +761,6 @@ public class IngestManager implements IngestProgressSnapshotProvider { ingestThreadActivitySnapshots.put(task.getThreadId(), new IngestThreadActivitySnapshot(task.getThreadId(), task.getIngestJobPipeline().getId(), currentModuleName, task.getDataSource())); } - /** - * Updates the ingest progress snapshot for an ingest job when a data source - * level ingest task is completed. - * - * @param task The data source level ingest job task that was completed. - */ - void setIngestTaskProgressCompleted(DataSourceIngestTask task) { - ingestThreadActivitySnapshots.put(task.getThreadId(), new IngestThreadActivitySnapshot(task.getThreadId())); - } - /** * Updates the ingest progress snapshot for an ingest job when a file ingest * module starts or finishes processing a file from a file ingest task. @@ -797,6 +787,16 @@ public class IngestManager implements IngestProgressSnapshotProvider { incrementModuleRunTime(prevSnap.getActivity(), newSnap.getStartTime().getTime() - prevSnap.getStartTime().getTime()); } + /** + * Updates the ingest progress snapshot for an ingest job when a data source + * level ingest task is completed. + * + * @param task The data source level ingest job task that was completed. + */ + void setIngestTaskProgressCompleted(DataSourceIngestTask task) { + ingestThreadActivitySnapshots.put(task.getThreadId(), new IngestThreadActivitySnapshot(task.getThreadId())); + } + /** * Updates the ingest progress snapshot for an ingest job when a file ingest * task is completed. From f3c8aeca91dc10a1448ae8e83075e443abb7e3ed Mon Sep 17 00:00:00 2001 From: Richard Cordovano Date: Thu, 18 Mar 2021 16:55:20 -0400 Subject: [PATCH 03/12] Ingest progress snapshot fix for file ingest modules --- Core/src/org/sleuthkit/autopsy/ingest/IngestManager.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/ingest/IngestManager.java b/Core/src/org/sleuthkit/autopsy/ingest/IngestManager.java index 88a1325e05..7705bbffd5 100644 --- a/Core/src/org/sleuthkit/autopsy/ingest/IngestManager.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/IngestManager.java @@ -777,8 +777,9 @@ public class IngestManager implements IngestProgressSnapshotProvider { } catch (TskCoreException ex) { /* * In practice, the file should have already been lazily looked up - * and cached when the task was enqueued by the ingest tasks - * scheduler. + * and cached in the file task when the task was enqueued by the + * ingest tasks scheduler. Therefore there is no case database query + * here and there should be no TskCoreException. */ logger.log(Level.SEVERE, "Error getting file from file ingest task", ex); newSnap = new IngestThreadActivitySnapshot(task.getThreadId(), task.getIngestJobPipeline().getId(), currentModuleName, task.getDataSource()); From e43bb45e774774a0c2537ad08424bc8d320eb95c Mon Sep 17 00:00:00 2001 From: Richard Cordovano Date: Fri, 19 Mar 2021 15:19:52 -0400 Subject: [PATCH 04/12] Ingest progress snapshot fix for file ingest modules --- .../autopsy/ingest/FileIngestPipeline.java | 8 ++++- .../autopsy/ingest/IngestManager.java | 36 +++++++++++++------ 2 files changed, 32 insertions(+), 12 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/ingest/FileIngestPipeline.java b/Core/src/org/sleuthkit/autopsy/ingest/FileIngestPipeline.java index 3ba603a968..3904ddd529 100644 --- a/Core/src/org/sleuthkit/autopsy/ingest/FileIngestPipeline.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/FileIngestPipeline.java @@ -61,10 +61,17 @@ final class FileIngestPipeline extends IngestTaskPipeline { @Override void completeTask(FileIngestTask task) throws IngestTaskPipelineException { + ingestManager.setIngestTaskProgress(task, "Saving Files"); //NON-NLS AbstractFile file = null; try { file = task.getFile(); } catch (TskCoreException ex) { + /* + * In practice, the file should have already been lazily looked up + * and cached in the file task when the task was enqueued by the + * ingest tasks scheduler. Therefore there is no case database query + * here and there should be no TskCoreException. + */ throw new IngestTaskPipelineException(String.format("Failed to get file (file objId = %d)", task.getFileId()), ex); //NON-NLS } try { @@ -118,7 +125,6 @@ final class FileIngestPipeline extends IngestTaskPipeline { ingestManager.setIngestTaskProgress(task, getDisplayName()); ingestJobPipeline.setCurrentFileIngestModule(getDisplayName(), file.getName()); ProcessResult result = module.process(file); - ingestManager.setIngestTaskProgress(task, getDisplayName()); if (result == ProcessResult.ERROR) { throw new IngestModuleException(String.format("%s experienced an error analyzing %s (file objId = %d)", getDisplayName(), file.getName(), file.getId())); //NON-NLS } diff --git a/Core/src/org/sleuthkit/autopsy/ingest/IngestManager.java b/Core/src/org/sleuthkit/autopsy/ingest/IngestManager.java index 7756b548c0..2f00900f20 100644 --- a/Core/src/org/sleuthkit/autopsy/ingest/IngestManager.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/IngestManager.java @@ -769,24 +769,33 @@ public class IngestManager implements IngestProgressSnapshotProvider { } /** - * Updates the ingest progress snapshot for an ingest job when a data source - * level ingest module starts processing a data source from a data source - * ingest task. + * Updates the ingest progress snapshot for data source ingest task. This + * method should be called every time a new ingest module starts working on + * the task. * * @param task The data source ingest task. - * @param currentModuleName The display name of the current data source - * level ingest module. + * @param currentModuleName The display name of the currently processing + * module. */ void setIngestTaskProgress(DataSourceIngestTask task, String currentModuleName) { - ingestThreadActivitySnapshots.put(task.getThreadId(), new IngestThreadActivitySnapshot(task.getThreadId(), task.getIngestJobPipeline().getId(), currentModuleName, task.getDataSource())); + IngestThreadActivitySnapshot prevSnap = ingestThreadActivitySnapshots.get(task.getThreadId()); + IngestThreadActivitySnapshot newSnap = new IngestThreadActivitySnapshot(task.getThreadId(), task.getIngestJobPipeline().getId(), currentModuleName, task.getDataSource()); + ingestThreadActivitySnapshots.put(task.getThreadId(), newSnap); + + /* + * Update the total run time for the PREVIOUS ingest module, which has + * now finished its processing for the task. + */ + incrementModuleRunTime(prevSnap.getActivity(), newSnap.getStartTime().getTime() - prevSnap.getStartTime().getTime()); } /** - * Updates the ingest progress snapshot for an ingest job when a file ingest - * module starts or finishes processing a file from a file ingest task. + * Updates the ingest progress snapshot for data source ingest task. This + * method should be called every time a new ingest module starts working on + * the task. * * @param task The file ingest task. - * @param currentModuleName The display name of the current file ingest + * @param currentModuleName The display name of the currently processing * module. */ void setIngestTaskProgress(FileIngestTask task, String currentModuleName) { @@ -805,6 +814,11 @@ public class IngestManager implements IngestProgressSnapshotProvider { newSnap = new IngestThreadActivitySnapshot(task.getThreadId(), task.getIngestJobPipeline().getId(), currentModuleName, task.getDataSource()); } ingestThreadActivitySnapshots.put(task.getThreadId(), newSnap); + + /* + * Update the total run time for the PREVIOUS ingest module, which has + * now finished its processing for the task. + */ incrementModuleRunTime(prevSnap.getActivity(), newSnap.getStartTime().getTime() - prevSnap.getStartTime().getTime()); } @@ -812,7 +826,7 @@ public class IngestManager implements IngestProgressSnapshotProvider { * Updates the ingest progress snapshot for an ingest job when a data source * level ingest task is completed. * - * @param task The data source level ingest job task that was completed. + * @param task The ingest task. */ void setIngestTaskProgressCompleted(DataSourceIngestTask task) { ingestThreadActivitySnapshots.put(task.getThreadId(), new IngestThreadActivitySnapshot(task.getThreadId())); @@ -822,7 +836,7 @@ public class IngestManager implements IngestProgressSnapshotProvider { * Updates the ingest progress snapshot for an ingest job when a file ingest * task is completed. * - * @param task The file ingest task. + * @param task The ingest task. */ void setIngestTaskProgressCompleted(FileIngestTask task) { ingestThreadActivitySnapshots.put(task.getThreadId(), new IngestThreadActivitySnapshot(task.getThreadId())); From e03e5bd3b6dc32d37ff7580bb609f303f4badacf Mon Sep 17 00:00:00 2001 From: Richard Cordovano Date: Fri, 19 Mar 2021 15:23:55 -0400 Subject: [PATCH 05/12] Ingest progress snapshot fix for file ingest modules --- .../sleuthkit/autopsy/ingest/FileIngestPipeline.java | 6 ------ .../org/sleuthkit/autopsy/ingest/IngestManager.java | 10 ++++------ 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/ingest/FileIngestPipeline.java b/Core/src/org/sleuthkit/autopsy/ingest/FileIngestPipeline.java index 3904ddd529..b7f2076c71 100644 --- a/Core/src/org/sleuthkit/autopsy/ingest/FileIngestPipeline.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/FileIngestPipeline.java @@ -66,12 +66,6 @@ final class FileIngestPipeline extends IngestTaskPipeline { try { file = task.getFile(); } catch (TskCoreException ex) { - /* - * In practice, the file should have already been lazily looked up - * and cached in the file task when the task was enqueued by the - * ingest tasks scheduler. Therefore there is no case database query - * here and there should be no TskCoreException. - */ throw new IngestTaskPipelineException(String.format("Failed to get file (file objId = %d)", task.getFileId()), ex); //NON-NLS } try { diff --git a/Core/src/org/sleuthkit/autopsy/ingest/IngestManager.java b/Core/src/org/sleuthkit/autopsy/ingest/IngestManager.java index 2f00900f20..37d0eab54f 100644 --- a/Core/src/org/sleuthkit/autopsy/ingest/IngestManager.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/IngestManager.java @@ -769,9 +769,8 @@ public class IngestManager implements IngestProgressSnapshotProvider { } /** - * Updates the ingest progress snapshot for data source ingest task. This - * method should be called every time a new ingest module starts working on - * the task. + * Updates the ingest progress snapshot for a data source level ingest task + * when a new ingest module starts working on the task. * * @param task The data source ingest task. * @param currentModuleName The display name of the currently processing @@ -790,9 +789,8 @@ public class IngestManager implements IngestProgressSnapshotProvider { } /** - * Updates the ingest progress snapshot for data source ingest task. This - * method should be called every time a new ingest module starts working on - * the task. + * Updates the ingest progress snapshot for a file ingest task when a new + * ingest module starts working on the task. * * @param task The file ingest task. * @param currentModuleName The display name of the currently processing From 10ecf666c4c04452d6ae666ff1a72891cf15190b Mon Sep 17 00:00:00 2001 From: Richard Cordovano Date: Fri, 19 Mar 2021 15:28:06 -0400 Subject: [PATCH 06/12] Ingest progress snapshot fix for file ingest modules --- .../autopsy/ingest/IngestManager.java | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/ingest/IngestManager.java b/Core/src/org/sleuthkit/autopsy/ingest/IngestManager.java index 37d0eab54f..2e6af7014f 100644 --- a/Core/src/org/sleuthkit/autopsy/ingest/IngestManager.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/IngestManager.java @@ -769,8 +769,8 @@ public class IngestManager implements IngestProgressSnapshotProvider { } /** - * Updates the ingest progress snapshot for a data source level ingest task - * when a new ingest module starts working on the task. + * Updates the ingest progress snapshot when a new ingest module starts + * working on a data source level ingest task. * * @param task The data source ingest task. * @param currentModuleName The display name of the currently processing @@ -789,8 +789,8 @@ public class IngestManager implements IngestProgressSnapshotProvider { } /** - * Updates the ingest progress snapshot for a file ingest task when a new - * ingest module starts working on the task. + * Updates the ingest progress snapshot when a new ingest module starts + * working on a file ingest task. * * @param task The file ingest task. * @param currentModuleName The display name of the currently processing @@ -802,12 +802,6 @@ public class IngestManager implements IngestProgressSnapshotProvider { try { newSnap = new IngestThreadActivitySnapshot(task.getThreadId(), task.getIngestJobPipeline().getId(), currentModuleName, task.getDataSource(), task.getFile()); } catch (TskCoreException ex) { - /* - * In practice, the file should have already been lazily looked up - * and cached in the file task when the task was enqueued by the - * ingest tasks scheduler. Therefore there is no case database query - * here and there should be no TskCoreException. - */ logger.log(Level.SEVERE, "Error getting file from file ingest task", ex); newSnap = new IngestThreadActivitySnapshot(task.getThreadId(), task.getIngestJobPipeline().getId(), currentModuleName, task.getDataSource()); } @@ -821,8 +815,8 @@ public class IngestManager implements IngestProgressSnapshotProvider { } /** - * Updates the ingest progress snapshot for an ingest job when a data source - * level ingest task is completed. + * Updates the ingest progress snapshot when a data source level ingest task + * is completed. * * @param task The ingest task. */ From bb93ccd9a6c03688e2248793cf5ace6f699998ff Mon Sep 17 00:00:00 2001 From: Richard Cordovano Date: Fri, 19 Mar 2021 16:45:40 -0400 Subject: [PATCH 07/12] Ingest progress snapshot fix for file ingest modules --- .../autopsy/ingest/IngestManager.java | 31 +++++++++---------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/ingest/IngestManager.java b/Core/src/org/sleuthkit/autopsy/ingest/IngestManager.java index 2e6af7014f..3576da6c71 100644 --- a/Core/src/org/sleuthkit/autopsy/ingest/IngestManager.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/IngestManager.java @@ -782,8 +782,8 @@ public class IngestManager implements IngestProgressSnapshotProvider { ingestThreadActivitySnapshots.put(task.getThreadId(), newSnap); /* - * Update the total run time for the PREVIOUS ingest module, which has - * now finished its processing for the task. + * Update the total run time for the PREVIOUS ingest module in teh + * pipeline, which has now finished its processing for the task. */ incrementModuleRunTime(prevSnap.getActivity(), newSnap.getStartTime().getTime() - prevSnap.getStartTime().getTime()); } @@ -808,30 +808,27 @@ public class IngestManager implements IngestProgressSnapshotProvider { ingestThreadActivitySnapshots.put(task.getThreadId(), newSnap); /* - * Update the total run time for the PREVIOUS ingest module, which has - * now finished its processing for the task. + * Update the total run time for the PREVIOUS ingest module in teh + * pipeline, which has now finished its processing for the task. */ incrementModuleRunTime(prevSnap.getActivity(), newSnap.getStartTime().getTime() - prevSnap.getStartTime().getTime()); } /** - * Updates the ingest progress snapshot when a data source level ingest task - * is completed. + * Updates the ingest progress snapshot when an ingest task is completed. * * @param task The ingest task. */ - void setIngestTaskProgressCompleted(DataSourceIngestTask task) { - ingestThreadActivitySnapshots.put(task.getThreadId(), new IngestThreadActivitySnapshot(task.getThreadId())); - } + void setIngestTaskProgressCompleted(IngestTask task) { + IngestThreadActivitySnapshot prevSnap = ingestThreadActivitySnapshots.get(task.getThreadId()); + IngestThreadActivitySnapshot newSnap = new IngestThreadActivitySnapshot(task.getThreadId()); + ingestThreadActivitySnapshots.put(task.getThreadId(), newSnap); - /** - * Updates the ingest progress snapshot for an ingest job when a file ingest - * task is completed. - * - * @param task The ingest task. - */ - void setIngestTaskProgressCompleted(FileIngestTask task) { - ingestThreadActivitySnapshots.put(task.getThreadId(), new IngestThreadActivitySnapshot(task.getThreadId())); + /* + * Update the total run time for the LAST ingest module in the pipeline, + * which has now finished its processing for the task. + */ + incrementModuleRunTime(prevSnap.getActivity(), newSnap.getStartTime().getTime() - prevSnap.getStartTime().getTime()); } /** From 39822f151d8e708ae6e810922795415d3601a9a7 Mon Sep 17 00:00:00 2001 From: Richard Cordovano Date: Mon, 22 Mar 2021 13:12:23 -0400 Subject: [PATCH 08/12] Ingest progress snapshot fix for file ingest modules --- .../autopsy/ingest/IngestManager.java | 43 ++++++------------- 1 file changed, 14 insertions(+), 29 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/ingest/IngestManager.java b/Core/src/org/sleuthkit/autopsy/ingest/IngestManager.java index 3576da6c71..ed3aa833ce 100644 --- a/Core/src/org/sleuthkit/autopsy/ingest/IngestManager.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/IngestManager.java @@ -770,45 +770,29 @@ public class IngestManager implements IngestProgressSnapshotProvider { /** * Updates the ingest progress snapshot when a new ingest module starts - * working on a data source level ingest task. + * working on an ingest task. * - * @param task The data source ingest task. + * @param task The ingest task. * @param currentModuleName The display name of the currently processing * module. */ - void setIngestTaskProgress(DataSourceIngestTask task, String currentModuleName) { - IngestThreadActivitySnapshot prevSnap = ingestThreadActivitySnapshots.get(task.getThreadId()); - IngestThreadActivitySnapshot newSnap = new IngestThreadActivitySnapshot(task.getThreadId(), task.getIngestJobPipeline().getId(), currentModuleName, task.getDataSource()); - ingestThreadActivitySnapshots.put(task.getThreadId(), newSnap); - - /* - * Update the total run time for the PREVIOUS ingest module in teh - * pipeline, which has now finished its processing for the task. - */ - incrementModuleRunTime(prevSnap.getActivity(), newSnap.getStartTime().getTime() - prevSnap.getStartTime().getTime()); - } - - /** - * Updates the ingest progress snapshot when a new ingest module starts - * working on a file ingest task. - * - * @param task The file ingest task. - * @param currentModuleName The display name of the currently processing - * module. - */ - void setIngestTaskProgress(FileIngestTask task, String currentModuleName) { + void setIngestTaskProgress(IngestTask task, String currentModuleName) { IngestThreadActivitySnapshot prevSnap = ingestThreadActivitySnapshots.get(task.getThreadId()); IngestThreadActivitySnapshot newSnap; - try { - newSnap = new IngestThreadActivitySnapshot(task.getThreadId(), task.getIngestJobPipeline().getId(), currentModuleName, task.getDataSource(), task.getFile()); - } catch (TskCoreException ex) { - logger.log(Level.SEVERE, "Error getting file from file ingest task", ex); + if (task instanceof FileIngestTask) { + try { + newSnap = new IngestThreadActivitySnapshot(task.getThreadId(), task.getIngestJobPipeline().getId(), currentModuleName, task.getDataSource(), ((FileIngestTask)task).getFile()); + } catch (TskCoreException ex) { + logger.log(Level.SEVERE, "Error getting file from file ingest task", ex); + newSnap = new IngestThreadActivitySnapshot(task.getThreadId(), task.getIngestJobPipeline().getId(), currentModuleName, task.getDataSource()); + } + } else { newSnap = new IngestThreadActivitySnapshot(task.getThreadId(), task.getIngestJobPipeline().getId(), currentModuleName, task.getDataSource()); } ingestThreadActivitySnapshots.put(task.getThreadId(), newSnap); /* - * Update the total run time for the PREVIOUS ingest module in teh + * Update the total run time for the PREVIOUS ingest module in the * pipeline, which has now finished its processing for the task. */ incrementModuleRunTime(prevSnap.getActivity(), newSnap.getStartTime().getTime() - prevSnap.getStartTime().getTime()); @@ -819,7 +803,8 @@ public class IngestManager implements IngestProgressSnapshotProvider { * * @param task The ingest task. */ - void setIngestTaskProgressCompleted(IngestTask task) { + void setIngestTaskProgressCompleted(IngestTask task + ) { IngestThreadActivitySnapshot prevSnap = ingestThreadActivitySnapshots.get(task.getThreadId()); IngestThreadActivitySnapshot newSnap = new IngestThreadActivitySnapshot(task.getThreadId()); ingestThreadActivitySnapshots.put(task.getThreadId(), newSnap); From c6580d4a122ca7c7550db39061f38c96c21558d9 Mon Sep 17 00:00:00 2001 From: Richard Cordovano Date: Mon, 22 Mar 2021 13:39:03 -0400 Subject: [PATCH 09/12] Revert "Ingest progress snapshot fix for file ingest modules" This reverts commit 39822f151d8e708ae6e810922795415d3601a9a7. --- .../autopsy/ingest/IngestManager.java | 43 +++++++++++++------ 1 file changed, 29 insertions(+), 14 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/ingest/IngestManager.java b/Core/src/org/sleuthkit/autopsy/ingest/IngestManager.java index ed3aa833ce..3576da6c71 100644 --- a/Core/src/org/sleuthkit/autopsy/ingest/IngestManager.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/IngestManager.java @@ -770,29 +770,45 @@ public class IngestManager implements IngestProgressSnapshotProvider { /** * Updates the ingest progress snapshot when a new ingest module starts - * working on an ingest task. + * working on a data source level ingest task. * - * @param task The ingest task. + * @param task The data source ingest task. * @param currentModuleName The display name of the currently processing * module. */ - void setIngestTaskProgress(IngestTask task, String currentModuleName) { + void setIngestTaskProgress(DataSourceIngestTask task, String currentModuleName) { + IngestThreadActivitySnapshot prevSnap = ingestThreadActivitySnapshots.get(task.getThreadId()); + IngestThreadActivitySnapshot newSnap = new IngestThreadActivitySnapshot(task.getThreadId(), task.getIngestJobPipeline().getId(), currentModuleName, task.getDataSource()); + ingestThreadActivitySnapshots.put(task.getThreadId(), newSnap); + + /* + * Update the total run time for the PREVIOUS ingest module in teh + * pipeline, which has now finished its processing for the task. + */ + incrementModuleRunTime(prevSnap.getActivity(), newSnap.getStartTime().getTime() - prevSnap.getStartTime().getTime()); + } + + /** + * Updates the ingest progress snapshot when a new ingest module starts + * working on a file ingest task. + * + * @param task The file ingest task. + * @param currentModuleName The display name of the currently processing + * module. + */ + void setIngestTaskProgress(FileIngestTask task, String currentModuleName) { IngestThreadActivitySnapshot prevSnap = ingestThreadActivitySnapshots.get(task.getThreadId()); IngestThreadActivitySnapshot newSnap; - if (task instanceof FileIngestTask) { - try { - newSnap = new IngestThreadActivitySnapshot(task.getThreadId(), task.getIngestJobPipeline().getId(), currentModuleName, task.getDataSource(), ((FileIngestTask)task).getFile()); - } catch (TskCoreException ex) { - logger.log(Level.SEVERE, "Error getting file from file ingest task", ex); - newSnap = new IngestThreadActivitySnapshot(task.getThreadId(), task.getIngestJobPipeline().getId(), currentModuleName, task.getDataSource()); - } - } else { + try { + newSnap = new IngestThreadActivitySnapshot(task.getThreadId(), task.getIngestJobPipeline().getId(), currentModuleName, task.getDataSource(), task.getFile()); + } catch (TskCoreException ex) { + logger.log(Level.SEVERE, "Error getting file from file ingest task", ex); newSnap = new IngestThreadActivitySnapshot(task.getThreadId(), task.getIngestJobPipeline().getId(), currentModuleName, task.getDataSource()); } ingestThreadActivitySnapshots.put(task.getThreadId(), newSnap); /* - * Update the total run time for the PREVIOUS ingest module in the + * Update the total run time for the PREVIOUS ingest module in teh * pipeline, which has now finished its processing for the task. */ incrementModuleRunTime(prevSnap.getActivity(), newSnap.getStartTime().getTime() - prevSnap.getStartTime().getTime()); @@ -803,8 +819,7 @@ public class IngestManager implements IngestProgressSnapshotProvider { * * @param task The ingest task. */ - void setIngestTaskProgressCompleted(IngestTask task - ) { + void setIngestTaskProgressCompleted(IngestTask task) { IngestThreadActivitySnapshot prevSnap = ingestThreadActivitySnapshots.get(task.getThreadId()); IngestThreadActivitySnapshot newSnap = new IngestThreadActivitySnapshot(task.getThreadId()); ingestThreadActivitySnapshots.put(task.getThreadId(), newSnap); From fc920120b2af055d401fa8359d314893a9ce465d Mon Sep 17 00:00:00 2001 From: Richard Cordovano Date: Mon, 22 Mar 2021 13:46:18 -0400 Subject: [PATCH 10/12] Ingest progress snapshot fix for file ingest modules --- Core/src/org/sleuthkit/autopsy/ingest/IngestManager.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/ingest/IngestManager.java b/Core/src/org/sleuthkit/autopsy/ingest/IngestManager.java index 3576da6c71..f73960aeca 100644 --- a/Core/src/org/sleuthkit/autopsy/ingest/IngestManager.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/IngestManager.java @@ -782,7 +782,7 @@ public class IngestManager implements IngestProgressSnapshotProvider { ingestThreadActivitySnapshots.put(task.getThreadId(), newSnap); /* - * Update the total run time for the PREVIOUS ingest module in teh + * Update the total run time for the PREVIOUS ingest module in the * pipeline, which has now finished its processing for the task. */ incrementModuleRunTime(prevSnap.getActivity(), newSnap.getStartTime().getTime() - prevSnap.getStartTime().getTime()); @@ -808,7 +808,7 @@ public class IngestManager implements IngestProgressSnapshotProvider { ingestThreadActivitySnapshots.put(task.getThreadId(), newSnap); /* - * Update the total run time for the PREVIOUS ingest module in teh + * Update the total run time for the PREVIOUS ingest module in the * pipeline, which has now finished its processing for the task. */ incrementModuleRunTime(prevSnap.getActivity(), newSnap.getStartTime().getTime() - prevSnap.getStartTime().getTime()); From 80bbc05b3c50bc983c1fb04eb9240e1ac86ebb81 Mon Sep 17 00:00:00 2001 From: Richard Cordovano Date: Mon, 22 Mar 2021 17:01:45 -0400 Subject: [PATCH 11/12] 7314 change name of 'Saving Files' pseudo-module --- .../org/sleuthkit/autopsy/ingest/Bundle.properties-MERGED | 1 + .../org/sleuthkit/autopsy/ingest/FileIngestPipeline.java | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Core/src/org/sleuthkit/autopsy/ingest/Bundle.properties-MERGED b/Core/src/org/sleuthkit/autopsy/ingest/Bundle.properties-MERGED index 157506a57f..65d3ba064d 100755 --- a/Core/src/org/sleuthkit/autopsy/ingest/Bundle.properties-MERGED +++ b/Core/src/org/sleuthkit/autopsy/ingest/Bundle.properties-MERGED @@ -1,4 +1,5 @@ CTL_RunIngestAction=Run Ingest +FileIngestPipeline_SaveResults_Activity=Saving Results IngestJobSettingsPanel.IngestModulesTableRenderer.info.message=A previous version of this ingest module has been run before on this data source. IngestJobSettingsPanel.IngestModulesTableRenderer.warning.message=This ingest module has been run before on this data source. IngestJobSettingsPanel.noPerRunSettings=The selected module has no per-run settings. diff --git a/Core/src/org/sleuthkit/autopsy/ingest/FileIngestPipeline.java b/Core/src/org/sleuthkit/autopsy/ingest/FileIngestPipeline.java index b7f2076c71..9878830697 100644 --- a/Core/src/org/sleuthkit/autopsy/ingest/FileIngestPipeline.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/FileIngestPipeline.java @@ -20,6 +20,7 @@ package org.sleuthkit.autopsy.ingest; import java.util.List; import java.util.Optional; +import org.openide.util.NbBundle; import org.sleuthkit.datamodel.AbstractFile; import org.sleuthkit.datamodel.TskCoreException; @@ -60,8 +61,11 @@ final class FileIngestPipeline extends IngestTaskPipeline { } @Override + @NbBundle.Messages({ + "FileIngestPipeline_SaveResults_Activity=Saving Results" + }) void completeTask(FileIngestTask task) throws IngestTaskPipelineException { - ingestManager.setIngestTaskProgress(task, "Saving Files"); //NON-NLS + ingestManager.setIngestTaskProgress(task, Bundle.FileIngestPipeline_SaveResults_Activity()); //NON-NLS AbstractFile file = null; try { file = task.getFile(); From 86f5387a8c50f6c14d68ac3d147dbd7009e80129 Mon Sep 17 00:00:00 2001 From: Richard Cordovano Date: Mon, 22 Mar 2021 17:03:03 -0400 Subject: [PATCH 12/12] 7314 change name of 'Saving Files' pseudo-module --- Core/src/org/sleuthkit/autopsy/ingest/FileIngestPipeline.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Core/src/org/sleuthkit/autopsy/ingest/FileIngestPipeline.java b/Core/src/org/sleuthkit/autopsy/ingest/FileIngestPipeline.java index 9878830697..4775d3ab1e 100644 --- a/Core/src/org/sleuthkit/autopsy/ingest/FileIngestPipeline.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/FileIngestPipeline.java @@ -65,7 +65,7 @@ final class FileIngestPipeline extends IngestTaskPipeline { "FileIngestPipeline_SaveResults_Activity=Saving Results" }) void completeTask(FileIngestTask task) throws IngestTaskPipelineException { - ingestManager.setIngestTaskProgress(task, Bundle.FileIngestPipeline_SaveResults_Activity()); //NON-NLS + ingestManager.setIngestTaskProgress(task, Bundle.FileIngestPipeline_SaveResults_Activity()); AbstractFile file = null; try { file = task.getFile();