Autopsy  4.4.1
Graphical digital forensics platform for The Sleuth Kit and other tools.
CorrelationAttributeInstance.java
Go to the documentation of this file.
1 /*
2  * Central Repository
3  *
4  * Copyright 2015-2017 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.centralrepository.datamodel;
20 
21 import java.io.Serializable;
22 import org.openide.util.NbBundle.Messages;
23 import org.sleuthkit.datamodel.TskData;
24 
31 @Messages({"EamArtifactInstances.globalStatus.local=Local",
32  "EamArtifactInstances.globalStatus.global=Global",
33  "EamArtifactInstances.knownStatus.bad=Bad",
34  "EamArtifactInstances.knownStatus.known=Known",
35  "EamArtifactInstances.knownStatus.unknown=Unknown"})
36 public class CorrelationAttributeInstance implements Serializable {
37 
38  public enum GlobalStatus {
39  LOCAL(Bundle.EamArtifactInstances_globalStatus_local()),
40  GLOBAL(Bundle.EamArtifactInstances_globalStatus_global());
41 
42  private final String globalStatus;
43 
44  private GlobalStatus(String globalStatus) {
45  this.globalStatus = globalStatus;
46  }
47 
48  @Override
49  public String toString() {
50  return globalStatus;
51  }
52  }
53 
54  private static final long serialVersionUID = 1L;
55 
56  private int ID;
59  private String filePath;
60  private String comment;
61  private TskData.FileKnown knownStatus;
63 
65  CorrelationCase eamCase,
66  CorrelationDataSource eamDataSource
67  ) {
68  this(-1, eamCase, eamDataSource, "", null, TskData.FileKnown.UNKNOWN, GlobalStatus.LOCAL);
69  }
70 
72  CorrelationCase eamCase,
73  CorrelationDataSource eamDataSource,
74  String filePath
75  ) {
76  this(-1, eamCase, eamDataSource, filePath, null, TskData.FileKnown.UNKNOWN, GlobalStatus.LOCAL);
77  }
78 
80  CorrelationCase eamCase,
81  CorrelationDataSource eamDataSource,
82  String filePath,
83  String comment
84  ) {
85  this(-1, eamCase, eamDataSource, filePath, comment, TskData.FileKnown.UNKNOWN, GlobalStatus.LOCAL);
86  }
87 
89  CorrelationCase eamCase,
90  CorrelationDataSource eamDataSource,
91  String filePath,
92  String comment,
93  TskData.FileKnown knownStatus,
94  GlobalStatus globalStatus
95  ) {
96  this(-1, eamCase, eamDataSource, filePath, comment, knownStatus, globalStatus);
97  }
98 
100  int ID,
101  CorrelationCase eamCase,
102  CorrelationDataSource eamDataSource,
103  String filePath,
104  String comment,
105  TskData.FileKnown knownStatus,
106  GlobalStatus globalStatus
107  ) {
108  this.ID = ID;
109  this.correlationCase = eamCase;
110  this.correlationDataSource = eamDataSource;
111  // Lower case paths to normalize paths and improve correlation results, if this causes significant issues on case-sensitive file systems, remove
112  this.filePath = filePath.toLowerCase();
113  this.comment = comment;
114  this.knownStatus = knownStatus;
115  this.globalStatus = globalStatus;
116  }
117 
118  public Boolean equals(CorrelationAttributeInstance otherInstance) {
119  return ((this.getID() == otherInstance.getID())
120  && (this.getCorrelationCase().equals(otherInstance.getCorrelationCase()))
121  && (this.getCorrelationDataSource().equals(otherInstance.getCorrelationDataSource()))
122  && (this.getFilePath().equals(otherInstance.getFilePath()))
123  && (this.getGlobalStatus().equals(otherInstance.getGlobalStatus()))
124  && (this.getKnownStatus().equals(otherInstance.getKnownStatus()))
125  && (this.getComment().equals(otherInstance.getComment())));
126  }
127 
128  @Override
129  public String toString() {
130  return this.getID()
131  + this.getCorrelationCase().getCaseUUID()
132  + this.getCorrelationDataSource().getName()
133  + this.getFilePath()
134  + this.getGlobalStatus()
135  + this.getKnownStatus()
136  + this.getComment();
137  }
138 
142  int getID() {
143  return ID;
144  }
145 
150  return correlationCase;
151  }
152 
157  return correlationDataSource;
158  }
159 
163  public String getFilePath() {
164  return filePath;
165  }
166 
170  public String getComment() {
171  return null == comment ? "" : comment;
172  }
173 
177  public void setComment(String comment) {
178  this.comment = comment;
179  }
180 
184  public TskData.FileKnown getKnownStatus() {
185  return knownStatus;
186  }
187 
191  public void setKnownStatus(TskData.FileKnown knownStatus) {
192  this.knownStatus = knownStatus;
193  }
194 
199  return globalStatus;
200  }
201 
205  public void setGlobalStatus(GlobalStatus globalStatus) {
206  this.globalStatus = globalStatus;
207  }
208 
209 }
CorrelationAttributeInstance(CorrelationCase eamCase, CorrelationDataSource eamDataSource, String filePath)
CorrelationAttributeInstance(CorrelationCase eamCase, CorrelationDataSource eamDataSource, String filePath, String comment)
CorrelationAttributeInstance(CorrelationCase eamCase, CorrelationDataSource eamDataSource)
CorrelationAttributeInstance(int ID, CorrelationCase eamCase, CorrelationDataSource eamDataSource, String filePath, String comment, TskData.FileKnown knownStatus, GlobalStatus globalStatus)
CorrelationAttributeInstance(CorrelationCase eamCase, CorrelationDataSource eamDataSource, String filePath, String comment, TskData.FileKnown knownStatus, GlobalStatus globalStatus)

Copyright © 2012-2016 Basis Technology. Generated on: Fri Sep 29 2017
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.