Autopsy 4.22.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 */
19package org.sleuthkit.autopsy.datasourceprocessors;
20
21import java.util.List;
22import java.util.UUID;
23import javax.annotation.concurrent.Immutable;
24import org.sleuthkit.autopsy.casemodule.Case;
25import org.sleuthkit.autopsy.corecomponentinterfaces.DataSourceProcessorCallback;
26import 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
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}
void doneEDT(DataSourceProcessorCallback.DataSourceProcessorResult result, List< String > errorMessages, List< Content > dataSources)
AddDataSourceCallback(Case caseForJob, AutoIngestDataSource dataSourceInfo, UUID taskId, Object lock)
void done(DataSourceProcessorCallback.DataSourceProcessorResult result, List< String > errorMessages, List< Content > dataSourceContent)

Copyright © 2012-2024 Sleuth Kit Labs. Generated on:
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.