Autopsy  4.19.0
Graphical digital forensics platform for The Sleuth Kit and other tools.
DataArtifactIngestPipeline.java
Go to the documentation of this file.
1 /*
2  * Autopsy Forensic Browser
3  *
4  * Copyright 2021 Basis Technology Corp.
5  * Contact: carrier <at> sleuthkit <dot> org
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  */
19 package org.sleuthkit.autopsy.ingest;
20 
21 import java.util.List;
22 import java.util.Optional;
23 import org.sleuthkit.datamodel.DataArtifact;
24 
29 final class DataArtifactIngestPipeline extends IngestTaskPipeline<DataArtifactIngestTask> {
30 
40  DataArtifactIngestPipeline(IngestJobPipeline ingestJobPipeline, List<IngestModuleTemplate> moduleTemplates) {
41  super(ingestJobPipeline, moduleTemplates);
42  }
43 
44  @Override
45  Optional<PipelineModule<DataArtifactIngestTask>> acceptModuleTemplate(IngestModuleTemplate template) {
46  Optional<IngestTaskPipeline.PipelineModule<DataArtifactIngestTask>> module = Optional.empty();
47  if (template.isDataArtifactIngestModuleTemplate()) {
48  DataArtifactIngestModule ingestModule = template.createDataArtifactIngestModule();
49  module = Optional.of(new DataArtifactIngestPipelineModule(ingestModule, template.getModuleName()));
50  }
51  return module;
52  }
53 
54  @Override
55  void prepareForTask(DataArtifactIngestTask task) throws IngestTaskPipelineException {
56  }
57 
58  @Override
59  void cleanUpAfterTask(DataArtifactIngestTask task) throws IngestTaskPipelineException {
60  }
61 
66  static final class DataArtifactIngestPipelineModule extends IngestTaskPipeline.PipelineModule<DataArtifactIngestTask> {
67 
68  private final DataArtifactIngestModule module;
69 
77  DataArtifactIngestPipelineModule(DataArtifactIngestModule module, String displayName) {
78  super(module, displayName);
79  this.module = module;
80  }
81 
82  @Override
83  void executeTask(IngestJobPipeline ingestJobPipeline, DataArtifactIngestTask task) throws IngestModuleException {
84  DataArtifact artifact = task.getDataArtifact();
85  module.process(artifact);
86  }
87 
88  }
89 
90 }

Copyright © 2012-2021 Basis Technology. Generated on: Fri Aug 6 2021
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.