Autopsy  4.19.3
Graphical digital forensics platform for The Sleuth Kit and other tools.
TableReportSettings.java
Go to the documentation of this file.
1 /*
2  * Autopsy Forensic Browser
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.report.infrastructure;
20 
21 import java.io.Serializable;
22 import java.util.ArrayList;
23 import java.util.List;
24 import java.util.Map;
25 import org.sleuthkit.datamodel.BlackboardArtifact;
26 
32 final class TableReportSettings implements Serializable {
33 
37  enum TableReportOption {
38  ALL_RESULTS, //NON-NLS
39  ALL_TAGGED_RESULTS, //NON-NLS
40  SPECIFIC_TAGGED_RESULTS; //NON-NLS
41  }
42 
43  private static final long serialVersionUID = 1L;
44  private final List<BlackboardArtifact.Type> artifactTypes = new ArrayList<>();
45  private final List<String> tagNames = new ArrayList<>();
46  private final boolean useStoredTagsAndArtifactsLists;
47  private final TableReportOption reportOption;
48  private List<Long> selectedDataSources;
49 
63  TableReportSettings(Map<BlackboardArtifact.Type, Boolean> artifactTypeSelections, Map<String, Boolean> tagNameSelections, boolean useTagsAndArtifactsLists, TableReportOption reportOption) {
64  // Get the artifact types selected by the user
65  for (Map.Entry<BlackboardArtifact.Type, Boolean> entry : artifactTypeSelections.entrySet()) {
66  if (entry.getValue()) {
67  artifactTypes.add(entry.getKey());
68  }
69  }
70 
71  // Get the tag names selected by the user
72 
73  for (Map.Entry<String, Boolean> entry : tagNameSelections.entrySet()) {
74  if (entry.getValue() == true) {
75  tagNames.add(entry.getKey());
76  }
77  }
78 
79  this.reportOption = reportOption;
80  this.useStoredTagsAndArtifactsLists = useTagsAndArtifactsLists;
81  }
82 
83  List<BlackboardArtifact.Type> getArtifactSelections() {
84  return artifactTypes;
85  }
86 
87  List<String> getTagSelections() {
88  return tagNames;
89  }
90 
91  boolean useStoredTagsAndArtifactsLists() {
92  return useStoredTagsAndArtifactsLists;
93  }
94 
100  TableReportOption getSelectedReportOption() {
101  return reportOption;
102  }
103 
107  List<Long> getSelectedDataSources() {
108  return selectedDataSources;
109  }
110 
114  void setSelectedDataSources(List<Long> selectedDataSources) {
115  this.selectedDataSources = new ArrayList<>(selectedDataSources);
116  }
117 }

Copyright © 2012-2022 Basis Technology. Generated on: Tue Jun 27 2023
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.