Autopsy  4.20.0
Graphical digital forensics platform for The Sleuth Kit and other tools.
IngestModuleTier.java
Go to the documentation of this file.
1 /*
2  * To change this license header, choose License Headers in Project Properties.
3  * To change this template file, choose Tools | Templates
4  * and open the template in the editor.
5  */
6 package org.sleuthkit.autopsy.ingest;
7 
8 import java.util.ArrayList;
9 import java.util.List;
10 import java.util.Optional;
11 import java.util.concurrent.LinkedBlockingQueue;
12 import org.python.google.common.collect.ImmutableList;
13 
18 class IngestModuleTier {
19 
20  private DataSourceIngestPipeline dataSourceIngestPipeline;
21  private final LinkedBlockingQueue<FileIngestPipeline> fileIngestPipelinesQueue = new LinkedBlockingQueue<>();
22  private final List<FileIngestPipeline> fileIngestPipelines = new ArrayList<>();
23  private DataArtifactIngestPipeline dataArtifactIngestPipeline;
24  private AnalysisResultIngestPipeline analysisResultIngestPipeline;
25 
31  void setDataSourceIngestPipeline(DataSourceIngestPipeline pipeline) {
32  dataSourceIngestPipeline = pipeline;
33  }
34 
41  boolean hasDataSourceIngestModules() {
42  return (dataSourceIngestPipeline != null && dataSourceIngestPipeline.isEmpty() == false);
43  }
44 
50  Optional<DataSourceIngestPipeline> getDataSourceIngestPipeline() {
51  return Optional.ofNullable(dataSourceIngestPipeline);
52  }
53 
67  void setsFileIngestPipelines(List<FileIngestPipeline> pipelines) throws InterruptedException {
68  fileIngestPipelines.addAll(pipelines);
69  for (FileIngestPipeline pipeline : pipelines) {
70  fileIngestPipelinesQueue.put(pipeline);
71  }
72  }
73 
79  boolean hasFileIngestModules() {
80  return (!fileIngestPipelines.isEmpty() && !fileIngestPipelines.get(0).isEmpty());
81  }
82 
88  List<FileIngestPipeline> getFileIngestPipelines() {
89  return ImmutableList.copyOf(fileIngestPipelines);
90  }
91 
102  FileIngestPipeline takeFileIngestPipeline() throws InterruptedException {
103  return fileIngestPipelinesQueue.take();
104  }
105 
116  void returnFileIngestPipeleine(FileIngestPipeline pipeline) throws InterruptedException {
117  fileIngestPipelinesQueue.put(pipeline);
118  }
119 
125  void setDataArtifactIngestPipeline(DataArtifactIngestPipeline pipeline) {
126  dataArtifactIngestPipeline = pipeline;
127  }
128 
135  boolean hasDataArtifactIngestModules() {
136  return (dataArtifactIngestPipeline != null && dataArtifactIngestPipeline.isEmpty() == false);
137  }
138 
144  Optional<DataArtifactIngestPipeline> getDataArtifactIngestPipeline() {
145  return Optional.ofNullable(dataArtifactIngestPipeline);
146  }
147 
153  void setAnalysisResultIngestPipeline(AnalysisResultIngestPipeline pipeline) {
154  analysisResultIngestPipeline = pipeline;
155  }
156 
163  boolean hasAnalysisResultIngestModules() {
164  return (analysisResultIngestPipeline != null && analysisResultIngestPipeline.isEmpty() == false);
165  }
166 
172  Optional<AnalysisResultIngestPipeline> getAnalysisResultIngestPipeline() {
173  return Optional.ofNullable(analysisResultIngestPipeline);
174  }
175 
176 }

Copyright © 2012-2022 Basis Technology. Generated on: Tue Aug 1 2023
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.