Autopsy  4.13.0
Graphical digital forensics platform for The Sleuth Kit and other tools.
DiscoveryEventUtils.java
Go to the documentation of this file.
1 /*
2  * Autopsy
3  *
4  * Copyright 2019 Basis Technology Corp.
5  * Contact: carrier <at> sleuthkit <dot> org
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  */
19 package org.sleuthkit.autopsy.filequery;
20 
21 import com.google.common.eventbus.EventBus;
22 import java.util.Collections;
23 import java.util.List;
24 import java.util.Map;
27 
31 final class DiscoveryEventUtils {
32 
33  private final static EventBus discoveryEventBus = new EventBus();
34 
40  static EventBus getDiscoveryEventBus() {
41  return discoveryEventBus;
42  }
43 
44  private DiscoveryEventUtils() {
45  }
46 
50  static final class SearchStartedEvent {
51 
52  private final FileType fileType;
53 
59  SearchStartedEvent(FileType type) {
60  this.fileType = type;
61  }
62 
68  FileType getType() {
69  return fileType;
70  }
71  }
72 
76  static final class SearchCompleteEvent {
77 
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;
83 
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;
103  }
104 
110  Map<GroupKey, Integer> getGroupMap() {
111  return Collections.unmodifiableMap(groupMap);
112  }
113 
119  List<FileSearchFiltering.FileFilter> getFilters() {
120  return Collections.unmodifiableList(searchFilters);
121  }
122 
128  FileSearch.AttributeType getGroupingAttr() {
129  return groupingAttribute;
130  }
131 
137  FileGroup.GroupSortingAlgorithm getGroupSort() {
138  return groupSort;
139  }
140 
146  FileSorter.SortingMethod getFileSort() {
147  return fileSortMethod;
148  }
149 
150  }
151 
156  static final class PageRetrievedEvent {
157 
158  private final List<ResultFile> results;
159  private final int page;
160  private final FileType resultType;
161 
169  PageRetrievedEvent(FileType resultType, int page, List<ResultFile> results) {
170  this.results = results;
171  this.page = page;
172  this.resultType = resultType;
173  }
174 
180  List<ResultFile> getSearchResults() {
181  return Collections.unmodifiableList(results);
182  }
183 
189  int getPageNumber() {
190  return page;
191  }
192 
198  FileType getType() {
199  return resultType;
200  }
201  }
202 
206  static final class NoResultsEvent {
207 
211  NoResultsEvent() {
212  //no arg constructor
213  }
214  }
215 
219  static final class SearchCancelledEvent {
220 
224  SearchCancelledEvent() {
225  //no arg constructor
226  }
227 
228  }
229 
233  static final class GroupSelectedEvent {
234 
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;
242 
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;
267  }
268 
274  FileType getResultType() {
275  return resultType;
276  }
277 
285  GroupKey getGroupKey() {
286  return groupKey;
287  }
288 
294  int getGroupSize() {
295  return groupSize;
296  }
297 
303  FileGroup.GroupSortingAlgorithm getGroupSort() {
304  return groupSort;
305  }
306 
312  FileSorter.SortingMethod getFileSort() {
313  return fileSortMethod;
314  }
315 
321  List<FileSearchFiltering.FileFilter> getFilters() {
322  return Collections.unmodifiableList(searchfilters);
323  }
324 
330  FileSearch.AttributeType getGroupingAttr() {
331  return groupingAttribute;
332  }
333 
334  }
335 }

Copyright © 2012-2019 Basis Technology. Generated on: Tue Jan 7 2020
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.