6 package org.sleuthkit.autopsy.ingest;
8 import java.util.ArrayList;
10 import java.util.Optional;
11 import java.util.concurrent.LinkedBlockingQueue;
12 import org.python.google.common.collect.ImmutableList;
18 class IngestModuleTier {
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;
31 void setDataSourceIngestPipeline(DataSourceIngestPipeline pipeline) {
32 dataSourceIngestPipeline = pipeline;
41 boolean hasDataSourceIngestModules() {
42 return (dataSourceIngestPipeline != null && dataSourceIngestPipeline.isEmpty() ==
false);
50 Optional<DataSourceIngestPipeline> getDataSourceIngestPipeline() {
51 return Optional.ofNullable(dataSourceIngestPipeline);
67 void setsFileIngestPipelines(List<FileIngestPipeline> pipelines)
throws InterruptedException {
68 fileIngestPipelines.addAll(pipelines);
69 for (FileIngestPipeline pipeline : pipelines) {
70 fileIngestPipelinesQueue.put(pipeline);
79 boolean hasFileIngestModules() {
80 return (!fileIngestPipelines.isEmpty() && !fileIngestPipelines.get(0).isEmpty());
88 List<FileIngestPipeline> getFileIngestPipelines() {
89 return ImmutableList.copyOf(fileIngestPipelines);
102 FileIngestPipeline takeFileIngestPipeline() throws InterruptedException {
103 return fileIngestPipelinesQueue.take();
116 void returnFileIngestPipeleine(FileIngestPipeline pipeline)
throws InterruptedException {
117 fileIngestPipelinesQueue.put(pipeline);
125 void setDataArtifactIngestPipeline(DataArtifactIngestPipeline pipeline) {
126 dataArtifactIngestPipeline = pipeline;
135 boolean hasDataArtifactIngestModules() {
136 return (dataArtifactIngestPipeline != null && dataArtifactIngestPipeline.isEmpty() ==
false);
144 Optional<DataArtifactIngestPipeline> getDataArtifactIngestPipeline() {
145 return Optional.ofNullable(dataArtifactIngestPipeline);
153 void setAnalysisResultIngestPipeline(AnalysisResultIngestPipeline pipeline) {
154 analysisResultIngestPipeline = pipeline;
163 boolean hasAnalysisResultIngestModules() {
164 return (analysisResultIngestPipeline != null && analysisResultIngestPipeline.isEmpty() ==
false);
172 Optional<AnalysisResultIngestPipeline> getAnalysisResultIngestPipeline() {
173 return Optional.ofNullable(analysisResultIngestPipeline);