19 package org.sleuthkit.autopsy.ingest;
21 import java.util.List;
22 import java.util.Optional;
29 final class DataArtifactIngestPipeline
extends IngestPipeline<DataArtifactIngestTask> {
41 DataArtifactIngestPipeline(IngestJobExecutor ingestJobExecutor, List<IngestModuleTemplate> moduleTemplates) {
42 super(ingestJobExecutor, moduleTemplates);
46 Optional<PipelineModule<DataArtifactIngestTask>> acceptModuleTemplate(IngestModuleTemplate
template) {
47 Optional<IngestPipeline.PipelineModule<DataArtifactIngestTask>> module = Optional.empty();
48 if (
template.isDataArtifactIngestModuleTemplate()) {
49 DataArtifactIngestModule ingestModule =
template.createDataArtifactIngestModule();
50 module = Optional.of(
new DataArtifactIngestPipelineModule(ingestModule,
template.getModuleName()));
56 void prepareForTask(DataArtifactIngestTask task)
throws IngestPipelineException {
60 void cleanUpAfterTask(DataArtifactIngestTask task)
throws IngestPipelineException {
61 IngestManager.getInstance().setIngestTaskProgressCompleted(task);
68 static final class DataArtifactIngestPipelineModule extends IngestPipeline.PipelineModule<DataArtifactIngestTask> {
70 private final DataArtifactIngestModule module;
79 DataArtifactIngestPipelineModule(DataArtifactIngestModule module, String displayName) {
80 super(module, displayName);
85 void process(IngestJobExecutor ingestJobExecutor, DataArtifactIngestTask task)
throws IngestModuleException {
86 DataArtifact artifact = task.getDataArtifact();
87 IngestManager.getInstance().setIngestTaskProgress(task, getDisplayName());
88 module.process(artifact);