19 package org.sleuthkit.autopsy.discovery;
21 import com.google.common.eventbus.EventBus;
22 import java.util.Collections;
23 import java.util.List;
32 final class DiscoveryEventUtils {
34 private final static EventBus discoveryEventBus =
new EventBus();
41 static EventBus getDiscoveryEventBus() {
42 return discoveryEventBus;
48 private DiscoveryEventUtils() {
55 static final class SearchStartedEvent {
57 private final FileType fileType;
64 SearchStartedEvent(FileType type) {
81 static final class ClearInstanceSelectionEvent {
86 ClearInstanceSelectionEvent() {
94 static final class PopulateInstancesListEvent {
96 private final List<AbstractFile> instances;
101 PopulateInstancesListEvent(List<AbstractFile> files) {
108 List<AbstractFile> getInstances() {
109 return Collections.unmodifiableList(instances);
116 static final class SearchCompleteEvent {
118 private final Map<GroupKey, Integer> groupMap;
119 private final List<FileSearchFiltering.FileFilter> searchFilters;
120 private final FileSearch.AttributeType groupingAttribute;
121 private final FileGroup.GroupSortingAlgorithm groupSort;
122 private final FileSorter.SortingMethod fileSortMethod;
135 SearchCompleteEvent(Map<GroupKey, Integer> groupMap, List<FileSearchFiltering.FileFilter> searchfilters,
136 FileSearch.AttributeType groupingAttribute, FileGroup.GroupSortingAlgorithm groupSort,
137 FileSorter.SortingMethod fileSortMethod) {
138 this.groupMap = groupMap;
139 this.searchFilters = searchfilters;
140 this.groupingAttribute = groupingAttribute;
141 this.groupSort = groupSort;
142 this.fileSortMethod = fileSortMethod;
150 Map<GroupKey, Integer> getGroupMap() {
151 return Collections.unmodifiableMap(groupMap);
159 List<FileSearchFiltering.FileFilter> getFilters() {
160 return Collections.unmodifiableList(searchFilters);
168 FileSearch.AttributeType getGroupingAttr() {
169 return groupingAttribute;
177 FileGroup.GroupSortingAlgorithm getGroupSort() {
186 FileSorter.SortingMethod getFileSort() {
187 return fileSortMethod;
196 static final class PageRetrievedEvent {
198 private final List<ResultFile> results;
199 private final int page;
200 private final FileType resultType;
209 PageRetrievedEvent(FileType resultType,
int page, List<ResultFile> results) {
210 this.results = results;
212 this.resultType = resultType;
220 List<ResultFile> getSearchResults() {
221 return Collections.unmodifiableList(results);
229 int getPageNumber() {
246 static final class NoResultsEvent {
259 static final class SearchCancelledEvent {
264 SearchCancelledEvent() {
273 static final class GroupSelectedEvent {
275 private final FileType resultType;
276 private final GroupKey groupKey;
277 private final int groupSize;
278 private final List<FileSearchFiltering.FileFilter> searchfilters;
279 private final FileSearch.AttributeType groupingAttribute;
280 private final FileGroup.GroupSortingAlgorithm groupSort;
281 private final FileSorter.SortingMethod fileSortMethod;
297 GroupSelectedEvent(List<FileSearchFiltering.FileFilter> searchfilters,
298 FileSearch.AttributeType groupingAttribute, FileGroup.GroupSortingAlgorithm groupSort,
299 FileSorter.SortingMethod fileSortMethod, GroupKey groupKey,
int groupSize, FileType resultType) {
300 this.searchfilters = searchfilters;
301 this.groupingAttribute = groupingAttribute;
302 this.groupSort = groupSort;
303 this.fileSortMethod = fileSortMethod;
304 this.groupKey = groupKey;
305 this.groupSize = groupSize;
306 this.resultType = resultType;
314 FileType getResultType() {
325 GroupKey getGroupKey() {
343 FileGroup.GroupSortingAlgorithm getGroupSort() {
352 FileSorter.SortingMethod getFileSort() {
353 return fileSortMethod;
361 List<FileSearchFiltering.FileFilter> getFilters() {
362 return Collections.unmodifiableList(searchfilters);
370 FileSearch.AttributeType getGroupingAttr() {
371 return groupingAttribute;
379 static class DetailsVisibleEvent {
381 private final boolean showDetailsArea;
389 DetailsVisibleEvent(
boolean isVisible) {
390 showDetailsArea = isVisible;
398 boolean isShowDetailsArea() {
399 return showDetailsArea;