Autopsy  4.9.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-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 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, displayName);
55  }
56 
57  CorrelationCase(int ID, String caseUUID, String displayName) {
58  this(ID, caseUUID, null, displayName, DATE_FORMAT.format(new Date()), null, null, null, null, null);
59  }
60 
61  CorrelationCase(int ID,
62  String caseUUID,
63  EamOrganization org,
64  String displayName,
65  String creationDate,
66  String caseNumber,
67  String examinerName,
68  String examinerEmail,
69  String examinerPhone,
70  String notes) {
71  this.databaseId = ID;
72  this.caseUUID = caseUUID;
73  this.org = org;
74  this.displayName = displayName;
75  this.creationDate = creationDate;
76  this.caseNumber = caseNumber;
77  this.examinerName = examinerName;
78  this.examinerEmail = examinerEmail;
79  this.examinerPhone = examinerPhone;
80  this.notes = notes;
81  }
82 
83  @Override
84  public String toString() {
85  StringBuilder str = new StringBuilder();
86  str.append("(");
87  str.append("ID=").append(Integer.toString(getID()));
88  str.append(",UUID=").append(getCaseUUID());
89  str.append(",organization=").append(getOrg().toString());
90  str.append(",displayName=").append(getDisplayName());
91  str.append(",creationDate=").append(getCreationDate());
92  str.append(",caseNumber=").append(getCaseNumber());
93  str.append(",examinerName=").append(getExaminerName());
94  str.append(",examinerEmail=").append(getExaminerEmail());
95  str.append(",examinerPhone=").append(getExaminerPhone());
96  str.append(",notes=").append(getNotes());
97  str.append(")");
98  return str.toString();
99  }
100 
101  @Messages({"EamCase.title.caseUUID=Case UUID: "})
102  public String getTitleCaseUUID() {
103  return Bundle.EamCase_title_caseUUID();
104  }
105 
106  @Messages({"EamCase.title.creationDate=Creation Date: "})
107  public String getTitleCreationDate() {
108  return Bundle.EamCase_title_creationDate();
109  }
110 
111  @Messages({"EamCase.title.caseDisplayName=Case Name: "})
112  public String getTitleCaseDisplayName() {
113  return Bundle.EamCase_title_caseDisplayName();
114  }
115 
116  @Messages({"EamCase.title.caseNumber=Case Number: "})
117  public String getTitleCaseNumber() {
118  return Bundle.EamCase_title_caseNumber();
119  }
120 
121  @Messages({"EamCase.title.examinerName=Examiner Name: "})
122  public String getTitleExaminerName() {
123  return Bundle.EamCase_title_examinerName();
124  }
125 
126  @Messages({"EamCase.title.examinerEmail=Examiner Email: "})
127  public String getTitleExaminerEmail() {
128  return Bundle.EamCase_title_examinerEmail();
129  }
130 
131  @Messages({"EamCase.title.examinerPhone=Examiner Phone: "})
132  public String getTitleExaminerPhone() {
133  return Bundle.EamCase_title_examinerPhone();
134  }
135 
136  @Messages({"EamCase.title.org=Organization: "})
137  public String getTitleOrganization() {
138  return Bundle.EamCase_title_org();
139  }
140 
141  @Messages({"EamCase.title.notes=Notes: "})
142  public String getTitleNotes() {
143  return Bundle.EamCase_title_notes();
144  }
145 
147  StringBuilder content = new StringBuilder();
148  content.append(getTitleCaseUUID()).append(getCaseUUID()).append("\n");
149  content.append(getTitleCaseDisplayName()).append(getDisplayName()).append("\n");
150  content.append(getTitleCreationDate()).append(getCreationDate()).append("\n");
151  content.append(getTitleCaseNumber()).append(getCaseNumber()).append("\n");
152  content.append(getTitleExaminerName()).append(getExaminerName()).append("\n");
153  content.append(getTitleExaminerEmail()).append(getExaminerEmail()).append("\n");
154  content.append(getTitleExaminerPhone()).append(getExaminerPhone()).append("\n");
155  content.append(getTitleNotes()).append(getNotes()).append("\n");
156 
157  return content.toString();
158  }
159 
163  public int getID() {
164  // @@@ Should probably have some lazy logic here to lead the ID from the DB if it is -1
165  return databaseId;
166  }
167 
168 
172  public String getCaseUUID() {
173  return caseUUID;
174  }
175 
176 
181  return org;
182  }
183 
187  public void setOrg(EamOrganization org) {
188  this.org = org;
189  }
190 
194  public String getDisplayName() {
195  return displayName;
196  }
197 
201  public void setDisplayName(String displayName) {
202  this.displayName = displayName;
203  }
204 
208  public String getCreationDate() {
209  return creationDate;
210  }
211 
215  public void setCreationDate(String creationDate) {
216  this.creationDate = creationDate;
217  }
218 
222  public String getCaseNumber() {
223  return null == caseNumber ? "" : caseNumber;
224  }
225 
229  public void setCaseNumber(String caseNumber) {
230  this.caseNumber = caseNumber;
231  }
232 
236  public String getExaminerName() {
237  return null == examinerName ? "" : examinerName;
238  }
239 
243  public void setExaminerName(String examinerName) {
244  this.examinerName = examinerName;
245  }
246 
250  public String getExaminerEmail() {
251  return null == examinerEmail ? "" : examinerEmail;
252  }
253 
257  public void setExaminerEmail(String examinerEmail) {
258  this.examinerEmail = examinerEmail;
259  }
260 
264  public String getExaminerPhone() {
265  return null == examinerPhone ? "" : examinerPhone;
266  }
267 
271  public void setExaminerPhone(String examinerPhone) {
272  this.examinerPhone = examinerPhone;
273  }
274 
278  public String getNotes() {
279  return null == notes ? "" : notes;
280  }
281 
285  public void setNotes(String notes) {
286  this.notes = notes;
287  }
288 }

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