Autopsy  4.19.1
Graphical digital forensics platform for The Sleuth Kit and other tools.
CorrelationCase.java
Go to the documentation of this file.
1 /*
2  * Central Repository
3  *
4  * Copyright 2015-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.centralrepository.datamodel;
20 
21 import java.io.Serializable;
22 import java.text.DateFormat;
23 import java.text.SimpleDateFormat;
24 import java.util.Date;
25 import org.openide.util.NbBundle.Messages;
26 
32 public class CorrelationCase implements Serializable {
33 
34  private static long serialVersionUID = 1L;
35  private static final DateFormat DATE_FORMAT = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss (z)");
36 
37  private int databaseId;
38  private String caseUUID; // globally unique
40  private String displayName;
41  private String creationDate;
42  private String caseNumber;
43  private String examinerName;
44  private String examinerEmail;
45  private String examinerPhone;
46  private String notes;
47 
53  public CorrelationCase(String caseUUID, String displayName) {
54  this(-1, caseUUID, null, displayName, DATE_FORMAT.format(new Date()), null, null, null, null, null);
55  }
56 
57  CorrelationCase(int ID,
58  String caseUUID,
60  String displayName,
61  String creationDate,
62  String caseNumber,
63  String examinerName,
64  String examinerEmail,
65  String examinerPhone,
66  String notes) {
67  this.databaseId = ID;
68  this.caseUUID = caseUUID;
69  this.org = org;
70  this.displayName = displayName;
71  this.creationDate = creationDate;
72  this.caseNumber = caseNumber;
73  this.examinerName = examinerName;
74  this.examinerEmail = examinerEmail;
75  this.examinerPhone = examinerPhone;
76  this.notes = notes;
77  }
78 
79  @Override
80  public String toString() {
81  StringBuilder str = new StringBuilder();
82  str.append("(");
83  str.append("ID=").append(Integer.toString(getID()));
84  str.append(",UUID=").append(getCaseUUID());
85  str.append(",organization=").append(getOrg().toString());
86  str.append(",displayName=").append(getDisplayName());
87  str.append(",creationDate=").append(getCreationDate());
88  str.append(",caseNumber=").append(getCaseNumber());
89  str.append(",examinerName=").append(getExaminerName());
90  str.append(",examinerEmail=").append(getExaminerEmail());
91  str.append(",examinerPhone=").append(getExaminerPhone());
92  str.append(",notes=").append(getNotes());
93  str.append(")");
94  return str.toString();
95  }
96 
97  @Messages({"EamCase.title.caseUUID=Case UUID: "})
98  public String getTitleCaseUUID() {
99  return Bundle.EamCase_title_caseUUID();
100  }
101 
102  @Messages({"EamCase.title.creationDate=Creation Date: "})
103  public String getTitleCreationDate() {
104  return Bundle.EamCase_title_creationDate();
105  }
106 
107  @Messages({"EamCase.title.caseDisplayName=Case Name: "})
108  public String getTitleCaseDisplayName() {
109  return Bundle.EamCase_title_caseDisplayName();
110  }
111 
112  @Messages({"EamCase.title.caseNumber=Case Number: "})
113  public String getTitleCaseNumber() {
114  return Bundle.EamCase_title_caseNumber();
115  }
116 
117  @Messages({"EamCase.title.examinerName=Examiner Name: "})
118  public String getTitleExaminerName() {
119  return Bundle.EamCase_title_examinerName();
120  }
121 
122  @Messages({"EamCase.title.examinerEmail=Examiner Email: "})
123  public String getTitleExaminerEmail() {
124  return Bundle.EamCase_title_examinerEmail();
125  }
126 
127  @Messages({"EamCase.title.examinerPhone=Examiner Phone: "})
128  public String getTitleExaminerPhone() {
129  return Bundle.EamCase_title_examinerPhone();
130  }
131 
132  @Messages({"EamCase.title.org=Organization: "})
133  public String getTitleOrganization() {
134  return Bundle.EamCase_title_org();
135  }
136 
137  @Messages({"EamCase.title.notes=Notes: "})
138  public String getTitleNotes() {
139  return Bundle.EamCase_title_notes();
140  }
141 
143  StringBuilder content = new StringBuilder();
144  content.append(getTitleCaseUUID()).append(getCaseUUID()).append("\n");
145  content.append(getTitleCaseDisplayName()).append(getDisplayName()).append("\n");
146  content.append(getTitleCreationDate()).append(getCreationDate()).append("\n");
147  content.append(getTitleCaseNumber()).append(getCaseNumber()).append("\n");
148  content.append(getTitleExaminerName()).append(getExaminerName()).append("\n");
149  content.append(getTitleExaminerEmail()).append(getExaminerEmail()).append("\n");
150  content.append(getTitleExaminerPhone()).append(getExaminerPhone()).append("\n");
151  content.append(getTitleNotes()).append(getNotes()).append("\n");
152 
153  return content.toString();
154  }
155 
160  public int getID() {
161  // @@@ Should probably have some lazy logic here to lead the ID from the DB if it is -1
162  return databaseId;
163  }
164 
168  public String getCaseUUID() {
169  return caseUUID;
170  }
171 
176  return org;
177  }
178 
182  public void setOrg(CentralRepoOrganization org) {
183  this.org = org;
184  }
185 
189  public String getDisplayName() {
190  return displayName;
191  }
192 
196  public void setDisplayName(String displayName) {
197  this.displayName = displayName;
198  }
199 
203  public String getCreationDate() {
204  return creationDate;
205  }
206 
210  public void setCreationDate(String creationDate) {
211  this.creationDate = creationDate;
212  }
213 
217  public String getCaseNumber() {
218  return null == caseNumber ? "" : caseNumber;
219  }
220 
224  public void setCaseNumber(String caseNumber) {
225  this.caseNumber = caseNumber;
226  }
227 
231  public String getExaminerName() {
232  return null == examinerName ? "" : examinerName;
233  }
234 
238  public void setExaminerName(String examinerName) {
239  this.examinerName = examinerName;
240  }
241 
245  public String getExaminerEmail() {
246  return null == examinerEmail ? "" : examinerEmail;
247  }
248 
252  public void setExaminerEmail(String examinerEmail) {
253  this.examinerEmail = examinerEmail;
254  }
255 
259  public String getExaminerPhone() {
260  return null == examinerPhone ? "" : examinerPhone;
261  }
262 
266  public void setExaminerPhone(String examinerPhone) {
267  this.examinerPhone = examinerPhone;
268  }
269 
273  public String getNotes() {
274  return null == notes ? "" : notes;
275  }
276 
280  public void setNotes(String notes) {
281  this.notes = notes;
282  }
283 }

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