Autopsy  4.19.1
Graphical digital forensics platform for The Sleuth Kit and other tools.
AddDataSourceCallback.java
Go to the documentation of this file.
1 /*
2  * Autopsy Forensic Browser
3  *
4  * Copyright 2011-2019 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.datasourceprocessors;
20 
21 import java.util.List;
22 import java.util.UUID;
23 import javax.annotation.concurrent.Immutable;
26 import org.sleuthkit.datamodel.Content;
27 
28 
34 @Immutable
36 
37  private final Case caseForJob;
39  private final UUID taskId;
40  private final Object lock;
41 
52  public AddDataSourceCallback(Case caseForJob, AutoIngestDataSource dataSourceInfo, UUID taskId, Object lock) {
53  this.caseForJob = caseForJob;
54  this.dataSourceInfo = dataSourceInfo;
55  this.taskId = taskId;
56  this.lock = lock;
57  }
58 
69  @Override
70  public void done(DataSourceProcessorCallback.DataSourceProcessorResult result, List<String> errorMessages, List<Content> dataSourceContent) {
71  if (!dataSourceContent.isEmpty()) {
72  caseForJob.notifyDataSourceAdded(dataSourceContent.get(0), taskId);
73  } else {
74  caseForJob.notifyFailedAddingDataSource(taskId);
75  }
76  dataSourceInfo.setDataSourceProcessorOutput(result, errorMessages, dataSourceContent);
77  dataSourceContent.addAll(dataSourceContent);
78  synchronized (lock) {
79  lock.notify();
80  }
81  }
82 
94  @Override
95  public void doneEDT(DataSourceProcessorCallback.DataSourceProcessorResult result, List<String> errorMessages, List<Content> dataSources) {
96  done(result, errorMessages, dataSources);
97  }
98 
99 }
AddDataSourceCallback(Case caseForJob, AutoIngestDataSource dataSourceInfo, UUID taskId, Object lock)
void done(DataSourceProcessorCallback.DataSourceProcessorResult result, List< String > errorMessages, List< Content > dataSourceContent)
void notifyDataSourceAdded(Content dataSource, UUID addingDataSourceEventId)
Definition: Case.java:1798
synchronized void setDataSourceProcessorOutput(DataSourceProcessorResult result, List< String > errorMessages, List< Content > content)
void doneEDT(DataSourceProcessorCallback.DataSourceProcessorResult result, List< String > errorMessages, List< Content > dataSources)
void notifyFailedAddingDataSource(UUID addingDataSourceEventId)
Definition: Case.java:1783

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