19 package org.sleuthkit.autopsy.discovery.search;
21 import java.awt.Image;
22 import java.util.ArrayList;
23 import java.util.HashMap;
24 import java.util.LinkedHashMap;
25 import java.util.List;
27 import org.apache.commons.lang3.StringUtils;
63 this.searchCache = cache;
90 List<AbstractFilter> filters,
96 final Map<GroupKey, List<Result>> searchResults = searchCache.get(
97 userName, filters, groupAttributeType, groupSortingType,
98 domainSortingMethod, caseDb, centralRepoDb, context);
101 final LinkedHashMap<GroupKey, Integer> groupSizes =
new LinkedHashMap<>();
102 for (
GroupKey groupKey : searchResults.keySet()) {
103 if (context.searchIsCancelled()) {
106 groupSizes.put(groupKey, searchResults.get(groupKey).size());
136 List<AbstractFilter> filters,
140 GroupKey groupKey,
int startingEntry,
int numberOfEntries,
143 final Map<GroupKey, List<Result>> searchResults = searchCache.get(
144 userName, filters, groupAttributeType, groupSortingType,
145 domainSortingMethod, caseDb, centralRepoDb, context);
146 final List<Result> domainsInGroup = searchResults.get(groupKey);
147 final List<Result> page =
new ArrayList<>();
148 for (
int i = startingEntry; (i < startingEntry + numberOfEntries)
149 && (i < domainsInGroup.size()); i++) {
150 page.add(domainsInGroup.get(i));
174 return thumbnailCache.
get(thumbnailRequest);
193 return artifactsCache.
get(artifactsRequest);
209 List<BlackboardArtifact> artifacts =
new ArrayList<>();
210 Map<String, List<BlackboardArtifact>> dateMap =
new HashMap<>();
211 if (!StringUtils.isBlank(domain)) {
217 for (BlackboardArtifact artifact : artifacts) {
221 }
catch (TskCoreException ex) {
222 throw new DiscoveryException(
"Unable to get date for artifact with ID: " + artifact.getArtifactID(), ex);
224 if (!StringUtils.isBlank(date)) {
225 List<BlackboardArtifact> artifactList = dateMap.get(date);
226 if (artifactList == null) {
227 artifactList =
new ArrayList<>();
229 artifactList.add(artifact);
230 dateMap.put(date, artifactList);
234 List<MiniTimelineResult> dateArtifactList =
new ArrayList<>();
236 for (String date : dateMap.keySet()) {
239 return dateArtifactList;
252 private String
getDate(BlackboardArtifact artifact)
throws TskCoreException {
253 for (BlackboardAttribute attribute : artifact.getAttributes()) {
254 if (attribute.getAttributeType().getTypeName().startsWith(
"TSK_DATETIME")) {
256 if (dateString.length() >= 10) {
257 return dateString.substring(0, 10);
List< BlackboardArtifact > get(DomainSearchArtifactsRequest request)
List< Result > getDomainsInGroup(String userName, List< AbstractFilter > filters, DiscoveryAttributes.AttributeType groupAttributeType, Group.GroupSortingAlgorithm groupSortingType, ResultsSorter.SortingMethod domainSortingMethod, GroupKey groupKey, int startingEntry, int numberOfEntries, SleuthkitCase caseDb, CentralRepository centralRepoDb, SearchContext context)
Map< GroupKey, Integer > getGroupSizes(String userName, List< AbstractFilter > filters, DiscoveryAttributes.AttributeType groupAttributeType, Group.GroupSortingAlgorithm groupSortingType, ResultsSorter.SortingMethod domainSortingMethod, SleuthkitCase caseDb, CentralRepository centralRepoDb, SearchContext context)
static String getFormattedTime(long epochTime)
List< BlackboardArtifact > getArtifacts(DomainSearchArtifactsRequest artifactsRequest)
final DomainSearchArtifactsCache artifactsCache
final DomainSearchThumbnailCache thumbnailCache
final DomainSearchCache searchCache
Image get(DomainSearchThumbnailRequest request)
List< MiniTimelineResult > getAllArtifactsForDomain(SleuthkitCase sleuthkitCase, String domain)
String getDate(BlackboardArtifact artifact)
Image getThumbnail(DomainSearchThumbnailRequest thumbnailRequest)