19 package org.sleuthkit.autopsy.filequery;
21 import com.google.common.eventbus.EventBus;
22 import java.util.Collections;
23 import java.util.List;
31 final class DiscoveryEventUtils {
33 private final static EventBus discoveryEventBus =
new EventBus();
40 static EventBus getDiscoveryEventBus() {
41 return discoveryEventBus;
44 private DiscoveryEventUtils() {
50 static final class SearchStartedEvent {
52 private final FileType fileType;
59 SearchStartedEvent(FileType type) {
76 static final class SearchCompleteEvent {
78 private final Map<GroupKey, Integer> groupMap;
79 private final List<FileSearchFiltering.FileFilter> searchFilters;
80 private final FileSearch.AttributeType groupingAttribute;
81 private final FileGroup.GroupSortingAlgorithm groupSort;
82 private final FileSorter.SortingMethod fileSortMethod;
95 SearchCompleteEvent(Map<GroupKey, Integer> groupMap, List<FileSearchFiltering.FileFilter> searchfilters,
96 FileSearch.AttributeType groupingAttribute, FileGroup.GroupSortingAlgorithm groupSort,
97 FileSorter.SortingMethod fileSortMethod) {
98 this.groupMap = groupMap;
99 this.searchFilters = searchfilters;
100 this.groupingAttribute = groupingAttribute;
101 this.groupSort = groupSort;
102 this.fileSortMethod = fileSortMethod;
110 Map<GroupKey, Integer> getGroupMap() {
111 return Collections.unmodifiableMap(groupMap);
119 List<FileSearchFiltering.FileFilter> getFilters() {
120 return Collections.unmodifiableList(searchFilters);
128 FileSearch.AttributeType getGroupingAttr() {
129 return groupingAttribute;
137 FileGroup.GroupSortingAlgorithm getGroupSort() {
146 FileSorter.SortingMethod getFileSort() {
147 return fileSortMethod;
156 static final class PageRetrievedEvent {
158 private final List<ResultFile> results;
159 private final int page;
160 private final FileType resultType;
169 PageRetrievedEvent(FileType resultType,
int page, List<ResultFile> results) {
170 this.results = results;
172 this.resultType = resultType;
180 List<ResultFile> getSearchResults() {
181 return Collections.unmodifiableList(results);
189 int getPageNumber() {
206 static final class NoResultsEvent {
219 static final class SearchCancelledEvent {
224 SearchCancelledEvent() {
233 static final class GroupSelectedEvent {
235 private final FileType resultType;
236 private final GroupKey groupKey;
237 private final int groupSize;
238 private final List<FileSearchFiltering.FileFilter> searchfilters;
239 private final FileSearch.AttributeType groupingAttribute;
240 private final FileGroup.GroupSortingAlgorithm groupSort;
241 private final FileSorter.SortingMethod fileSortMethod;
257 GroupSelectedEvent(List<FileSearchFiltering.FileFilter> searchfilters,
258 FileSearch.AttributeType groupingAttribute, FileGroup.GroupSortingAlgorithm groupSort,
259 FileSorter.SortingMethod fileSortMethod, GroupKey groupKey,
int groupSize, FileType resultType) {
260 this.searchfilters = searchfilters;
261 this.groupingAttribute = groupingAttribute;
262 this.groupSort = groupSort;
263 this.fileSortMethod = fileSortMethod;
264 this.groupKey = groupKey;
265 this.groupSize = groupSize;
266 this.resultType = resultType;
274 FileType getResultType() {
285 GroupKey getGroupKey() {
303 FileGroup.GroupSortingAlgorithm getGroupSort() {
312 FileSorter.SortingMethod getFileSort() {
313 return fileSortMethod;
321 List<FileSearchFiltering.FileFilter> getFilters() {
322 return Collections.unmodifiableList(searchfilters);
330 FileSearch.AttributeType getGroupingAttr() {
331 return groupingAttribute;