Autopsy  4.16.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-2020 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.discovery.search;
20 
21 import com.google.common.eventbus.EventBus;
22 import java.util.Collections;
23 import java.util.List;
24 import java.util.Map;
27 import org.sleuthkit.datamodel.AbstractFile;
28 
32 public final class DiscoveryEventUtils {
33 
34  private final static EventBus discoveryEventBus = new EventBus();
35 
41  public static EventBus getDiscoveryEventBus() {
42  return discoveryEventBus;
43  }
44 
48  private DiscoveryEventUtils() {
49  //Utility class private constructor intentionally left blank.
50  }
51 
55  public static final class SearchStartedEvent {
56 
57  private final Type type;
58 
64  public SearchStartedEvent(Type type) {
65  this.type = type;
66  }
67 
73  public Type getType() {
74  return type;
75  }
76 
77  }
78 
82  public static final class ClearInstanceSelectionEvent {
83 
88  //no arg constructor
89  }
90  }
91 
95  public static final class PopulateInstancesListEvent {
96 
97  private final List<AbstractFile> instances;
98 
102  public PopulateInstancesListEvent(List<AbstractFile> files) {
103  instances = files;
104  }
105 
111  public List<AbstractFile> getInstances() {
112  return Collections.unmodifiableList(instances);
113  }
114  }
115 
119  public static final class SearchCompleteEvent {
120 
121  private final Map<GroupKey, Integer> groupMap;
122  private final List<AbstractFilter> searchFilters;
126 
138  public SearchCompleteEvent(Map<GroupKey, Integer> groupMap, List<AbstractFilter> searchfilters,
141  this.groupMap = groupMap;
142  this.searchFilters = searchfilters;
144  this.groupSort = groupSort;
145  this.sortMethod = sortMethod;
146  }
147 
153  public Map<GroupKey, Integer> getGroupMap() {
154  return Collections.unmodifiableMap(groupMap);
155  }
156 
162  public List<AbstractFilter> getFilters() {
163  return Collections.unmodifiableList(searchFilters);
164  }
165 
172  return groupingAttribute;
173  }
174 
181  return groupSort;
182  }
183 
190  return sortMethod;
191  }
192 
193  }
194 
199  public static final class PageRetrievedEvent {
200 
201  private final List<Result> results;
202  private final int page;
203  private final Type resultType;
204 
212  public PageRetrievedEvent(Type resultType, int page, List<Result> results) {
213  this.results = results;
214  this.page = page;
215  this.resultType = resultType;
216  }
217 
223  public List<Result> getSearchResults() {
224  return Collections.unmodifiableList(results);
225  }
226 
232  public int getPageNumber() {
233  return page;
234  }
235 
241  public Type getType() {
242  return resultType;
243  }
244  }
245 
249  public static final class NoResultsEvent {
250 
254  public NoResultsEvent() {
255  //no arg constructor
256  }
257  }
258 
262  public static final class SearchCancelledEvent {
263 
268  //no arg constructor
269  }
270 
271  }
272 
276  public static final class GroupSelectedEvent {
277 
278  private final Type resultType;
279  private final GroupKey groupKey;
280  private final int groupSize;
281  private final List<AbstractFilter> searchfilters;
285 
301  public GroupSelectedEvent(List<AbstractFilter> searchfilters,
303  ResultsSorter.SortingMethod sortMethod, GroupKey groupKey, int groupSize, Type resultType) {
304  this.searchfilters = searchfilters;
306  this.groupSort = groupSort;
307  this.sortMethod = sortMethod;
308  this.groupKey = groupKey;
309  this.groupSize = groupSize;
310  this.resultType = resultType;
311  }
312 
318  public Type getResultType() {
319  return resultType;
320  }
321 
330  return groupKey;
331  }
332 
338  public int getGroupSize() {
339  return groupSize;
340  }
341 
348  return groupSort;
349  }
350 
357  return sortMethod;
358  }
359 
365  public List<AbstractFilter> getFilters() {
366  return Collections.unmodifiableList(searchfilters);
367  }
368 
375  return groupingAttribute;
376  }
377 
378  }
379 
383  public static class DetailsVisibleEvent {
384 
385  private final boolean showDetailsArea;
386 
393  public DetailsVisibleEvent(boolean isVisible) {
394  showDetailsArea = isVisible;
395  }
396 
402  public boolean isShowDetailsArea() {
403  return showDetailsArea;
404  }
405  }
406 
407 }
GroupSelectedEvent(List< AbstractFilter > searchfilters, DiscoveryAttributes.AttributeType groupingAttribute, Group.GroupSortingAlgorithm groupSort, ResultsSorter.SortingMethod sortMethod, GroupKey groupKey, int groupSize, Type resultType)
SearchCompleteEvent(Map< GroupKey, Integer > groupMap, List< AbstractFilter > searchfilters, DiscoveryAttributes.AttributeType groupingAttribute, Group.GroupSortingAlgorithm groupSort, ResultsSorter.SortingMethod sortMethod)

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