19 package org.sleuthkit.autopsy.discovery.ui;
22 import java.util.ArrayList;
23 import java.util.List;
24 import java.util.concurrent.CancellationException;
25 import java.util.concurrent.ExecutionException;
26 import java.util.logging.Level;
27 import javax.swing.SwingWorker;
28 import org.apache.commons.lang3.StringUtils;
39 class MiniTimelineWorker
extends SwingWorker<Void, Void> {
41 private final static Logger logger = Logger.getLogger(MiniTimelineWorker.class.getName());
42 private final String domain;
43 private final boolean grabFocus;
53 MiniTimelineWorker(String domain,
boolean shouldGrabFocus) {
55 this.grabFocus = shouldGrabFocus;
59 protected Void doInBackground() throws Exception {
60 List<MiniTimelineResult> results =
new ArrayList<>();
61 if (!StringUtils.isBlank(domain)) {
62 DomainSearch domainSearch =
new DomainSearch();
64 results.addAll(domainSearch.getAllArtifactsForDomain(Case.getCurrentCase().getSleuthkitCase(), domain));
65 DiscoveryEventUtils.getDiscoveryEventBus().post(
new DiscoveryEventUtils.MiniTimelineResultEvent(results, domain, grabFocus));
66 }
catch (DiscoveryException ex) {
67 if (ex.getCause() instanceof InterruptedException) {
79 protected void done() {
83 }
catch (InterruptedException | ExecutionException ex) {
84 logger.log(Level.SEVERE,
"Exception while trying to get list of artifacts for Domain details for mini timeline view for domain: " + domain, ex);
85 }
catch (CancellationException ignored) {