Go to the documentation of this file.
19package org.sleuthkit.autopsy.discovery.search;
21import com.google.common.cache.CacheLoader;
22import java.util.ArrayList;
23import java.util.HashMap;
26import org.sleuthkit.datamodel.TskCoreException;
27import org.sleuthkit.datamodel.SleuthkitCase;
28import org.sleuthkit.datamodel.BlackboardArtifact;
29import org.sleuthkit.datamodel.BlackboardArtifact.ARTIFACT_TYPE;
30import org.sleuthkit.datamodel.BlackboardAttribute;
36public class DomainSearchArtifactsLoader extends CacheLoader<DomainSearchArtifactsCache.ArtifactCacheKey, Map<String, List<BlackboardArtifact>>> {
38 private static final BlackboardAttribute.Type
TSK_DOMAIN =
new BlackboardAttribute.Type(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_DOMAIN);
42 final SleuthkitCase caseDb = artifactKey.getSleuthkitCase();
43 final ARTIFACT_TYPE type = artifactKey.getType();
44 List<BlackboardArtifact> artifacts = caseDb.getBlackboardArtifacts(type);
46 Map<String, List<BlackboardArtifact>> artifactsByDomain =
new HashMap<>();
49 for (BlackboardArtifact artifact : artifacts) {
50 if(Thread.currentThread().isInterrupted()) {
51 throw new InterruptedException();
53 final BlackboardAttribute tskDomain = artifact.getAttribute(
TSK_DOMAIN);
54 if (tskDomain !=
null) {
55 final String normalizedDomain = tskDomain.getValueString().trim().toLowerCase();
56 List<BlackboardArtifact> artifactsWithDomain = artifactsByDomain.getOrDefault(normalizedDomain,
new ArrayList<>());
57 artifactsWithDomain.add(artifact);
58 artifactsByDomain.put(normalizedDomain, artifactsWithDomain);
62 return artifactsByDomain;
Map< String, List< BlackboardArtifact > > load(DomainSearchArtifactsCache.ArtifactCacheKey artifactKey)
static final BlackboardAttribute.Type TSK_DOMAIN
Copyright © 2012-2024 Sleuth Kit Labs. Generated on:
This work is licensed under a
Creative Commons Attribution-Share Alike 3.0 United States License.