Autopsy  4.10.0
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 
51  public AddDataSourceCallback(Case caseForJob, AutoIngestDataSource dataSourceInfo, UUID taskId, Object lock) {
52  this.caseForJob = caseForJob;
53  this.dataSourceInfo = dataSourceInfo;
54  this.taskId = taskId;
55  this.lock = lock;
56  }
57 
68  @Override
69  public void done(DataSourceProcessorCallback.DataSourceProcessorResult result, List<String> errorMessages, List<Content> dataSourceContent) {
70  if (!dataSourceContent.isEmpty()) {
71  caseForJob.notifyDataSourceAdded(dataSourceContent.get(0), taskId);
72  } else {
73  caseForJob.notifyFailedAddingDataSource(taskId);
74  }
75  dataSourceInfo.setDataSourceProcessorOutput(result, errorMessages, dataSourceContent);
76  dataSourceContent.addAll(dataSourceContent);
77  synchronized (lock) {
78  lock.notify();
79  }
80  }
81 
93  @Override
94  public void doneEDT(DataSourceProcessorCallback.DataSourceProcessorResult result, List<String> errorMessages, List<Content> dataSources) {
95  done(result, errorMessages, dataSources);
96  }
97 
98 }
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:1588
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:1573

Copyright © 2012-2018 Basis Technology. Generated on: Fri Mar 22 2019
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.