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;
87 List<AbstractFilter> filters,
93 final Map<GroupKey, List<Result>> searchResults = searchCache.get(
94 userName, filters, groupAttributeType, groupSortingType,
95 domainSortingMethod, caseDb, centralRepoDb);
97 final LinkedHashMap<GroupKey, Integer> groupSizes =
new LinkedHashMap<>();
98 for (
GroupKey groupKey : searchResults.keySet()) {
99 groupSizes.put(groupKey, searchResults.get(groupKey).size());
128 List<AbstractFilter> filters,
132 GroupKey groupKey,
int startingEntry,
int numberOfEntries,
135 final Map<GroupKey, List<Result>> searchResults = searchCache.get(
136 userName, filters, groupAttributeType, groupSortingType,
137 domainSortingMethod, caseDb, centralRepoDb);
138 final List<Result> domainsInGroup = searchResults.get(groupKey);
139 final List<Result> page =
new ArrayList<>();
140 for (
int i = startingEntry; (i < startingEntry + numberOfEntries)
141 && (i < domainsInGroup.size()); i++) {
142 page.add(domainsInGroup.get(i));
166 return thumbnailCache.
get(thumbnailRequest);
185 return artifactsCache.
get(artifactsRequest);
201 List<BlackboardArtifact> artifacts =
new ArrayList<>();
202 Map<String, List<BlackboardArtifact>> dateMap =
new HashMap<>();
203 if (!StringUtils.isBlank(domain)) {
209 for (BlackboardArtifact artifact : artifacts) {
213 }
catch (TskCoreException ex) {
214 throw new DiscoveryException(
"Unable to get date for artifact with ID: " + artifact.getArtifactID(), ex);
216 if (!StringUtils.isBlank(date)) {
217 List<BlackboardArtifact> artifactList = dateMap.get(date);
218 if (artifactList == null) {
219 artifactList =
new ArrayList<>();
221 artifactList.add(artifact);
222 dateMap.put(date, artifactList);
226 List<MiniTimelineResult> dateArtifactList =
new ArrayList<>();
228 for (String date : dateMap.keySet()) {
231 return dateArtifactList;
244 private String
getDate(BlackboardArtifact artifact)
throws TskCoreException {
245 for (BlackboardAttribute attribute : artifact.getAttributes()) {
246 if (attribute.getAttributeType().getTypeName().startsWith(
"TSK_DATETIME")) {
248 if (dateString.length() >= 10) {
249 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)
static String getFormattedTime(long epochTime)
List< BlackboardArtifact > getArtifacts(DomainSearchArtifactsRequest artifactsRequest)
final DomainSearchArtifactsCache artifactsCache
final DomainSearchThumbnailCache thumbnailCache
final DomainSearchCache searchCache
Map< GroupKey, Integer > getGroupSizes(String userName, List< AbstractFilter > filters, DiscoveryAttributes.AttributeType groupAttributeType, Group.GroupSortingAlgorithm groupSortingType, ResultsSorter.SortingMethod domainSortingMethod, SleuthkitCase caseDb, CentralRepository centralRepoDb)
Image get(DomainSearchThumbnailRequest request)
List< MiniTimelineResult > getAllArtifactsForDomain(SleuthkitCase sleuthkitCase, String domain)
String getDate(BlackboardArtifact artifact)
Image getThumbnail(DomainSearchThumbnailRequest thumbnailRequest)