Merge branch 'release-4.5.0' of https://github.com/sleuthkit/autopsy into 3087-CrSchemaChanges

This commit is contained in:
William Schaefer 2017-09-26 15:01:28 -04:00
commit 1630562ffb
13 changed files with 167 additions and 207 deletions

View File

@ -36,7 +36,7 @@ import javax.swing.event.DocumentListener;
import org.openide.util.NbBundle.Messages;
import org.openide.windows.WindowManager;
import org.sleuthkit.autopsy.casemodule.Case;
import org.sleuthkit.autopsy.centralrepository.datamodel.EamCase;
import org.sleuthkit.autopsy.centralrepository.datamodel.CorrelationCase;
import org.sleuthkit.autopsy.centralrepository.datamodel.EamDb;
import org.sleuthkit.autopsy.centralrepository.datamodel.EamDbException;
import org.sleuthkit.autopsy.centralrepository.datamodel.EamOrganization;
@ -48,7 +48,7 @@ import org.sleuthkit.autopsy.centralrepository.optionspanel.AddNewOrganizationDi
public class EamCaseEditDetailsDialog extends JDialog {
private final static Logger LOGGER = Logger.getLogger(EamCaseEditDetailsDialog.class.getName());
private EamCase eamCase;
private CorrelationCase eamCase;
private EamDb dbManager;
private Boolean contentChanged = false;
private final Collection<JTextField> textBoxes = new ArrayList<>();
@ -69,7 +69,7 @@ public class EamCaseEditDetailsDialog extends JDialog {
try {
this.dbManager = EamDb.getInstance();
this.eamCase = this.dbManager.getCaseDetails(Case.getCurrentCase().getName());
this.eamCase = this.dbManager.getCaseByUUID(Case.getCurrentCase().getName());
if(this.eamCase == null){
this.eamCase = dbManager.newCase(Case.getCurrentCase());
}

View File

@ -50,7 +50,7 @@ import org.sleuthkit.autopsy.corecomponentinterfaces.DataContentViewer;
import org.sleuthkit.autopsy.centralrepository.datamodel.CorrelationAttribute;
import org.sleuthkit.autopsy.centralrepository.datamodel.CorrelationAttributeInstance;
import org.sleuthkit.autopsy.centralrepository.datamodel.EamArtifactUtil;
import org.sleuthkit.autopsy.centralrepository.datamodel.EamCase;
import org.sleuthkit.autopsy.centralrepository.datamodel.CorrelationCase;
import org.sleuthkit.autopsy.centralrepository.datamodel.EamDbException;
import org.sleuthkit.autopsy.centralrepository.datamodel.EamGlobalFileInstance;
import org.sleuthkit.datamodel.AbstractFile;
@ -167,7 +167,7 @@ public class DataContentViewerOtherCases extends javax.swing.JPanel implements D
EamDb dbManager = EamDb.getInstance();
int selectedRowModelIdx = otherCasesTable.convertRowIndexToModel(selectedRowViewIdx);
CorrelationAttribute eamArtifact = (CorrelationAttribute) tableModel.getRow(selectedRowModelIdx);
EamCase eamCasePartial = eamArtifact.getInstances().get(0).getEamCase();
CorrelationCase eamCasePartial = eamArtifact.getInstances().get(0).getCorrelationCase();
if (eamCasePartial == null) {
JOptionPane.showConfirmDialog(showCaseDetailsMenuItem,
Bundle.DataContentViewerOtherCases_caseDetailsDialog_noDetailsReference(),
@ -177,7 +177,7 @@ public class DataContentViewerOtherCases extends javax.swing.JPanel implements D
}
caseDisplayName = eamCasePartial.getDisplayName();
// query case details
EamCase eamCase = dbManager.getCaseDetails(eamCasePartial.getCaseUUID());
CorrelationCase eamCase = dbManager.getCaseByUUID(eamCasePartial.getCaseUUID());
if (eamCase == null) {
JOptionPane.showConfirmDialog(showCaseDetailsMenuItem,
Bundle.DataContentViewerOtherCases_caseDetailsDialog_noDetails(),
@ -421,9 +421,9 @@ public class DataContentViewerOtherCases extends javax.swing.JPanel implements D
try {
EamDb dbManager = EamDb.getInstance();
Collection<CorrelationAttributeInstance> artifactInstances = dbManager.getArtifactInstancesByTypeValue(corAttr.getCorrelationType(), corAttr.getCorrelationValue()).stream()
.filter(artifactInstance -> !artifactInstance.getEamCase().getCaseUUID().equals(caseUUID)
|| !artifactInstance.getEamDataSource().getName().equals(dataSourceName)
|| !artifactInstance.getEamDataSource().getDeviceID().equals(deviceId))
.filter(artifactInstance -> !artifactInstance.getCorrelationCase().getCaseUUID().equals(caseUUID)
|| !artifactInstance.getCorrelationDataSource().getName().equals(dataSourceName)
|| !artifactInstance.getCorrelationDataSource().getDeviceID().equals(deviceId))
.collect(Collectors.toList());
return artifactInstances;
} catch (EamDbException ex) {

View File

@ -133,18 +133,18 @@ public class DataContentViewerOtherCasesTableModel extends AbstractTableModel {
switch (colId) {
case CASE_NAME:
if (null != eamArtifactInstance.getEamCase()) {
value = eamArtifactInstance.getEamCase().getDisplayName();
if (null != eamArtifactInstance.getCorrelationCase()) {
value = eamArtifactInstance.getCorrelationCase().getDisplayName();
}
break;
case DEVICE:
if (null != eamArtifactInstance.getEamDataSource()) {
value = eamArtifactInstance.getEamDataSource().getDeviceID();
if (null != eamArtifactInstance.getCorrelationDataSource()) {
value = eamArtifactInstance.getCorrelationDataSource().getDeviceID();
}
break;
case DATA_SOURCE:
if (null != eamArtifactInstance.getEamDataSource()) {
value = eamArtifactInstance.getEamDataSource().getName();
if (null != eamArtifactInstance.getCorrelationDataSource()) {
value = eamArtifactInstance.getCorrelationDataSource().getName();
}
break;
case FILE_PATH:

View File

@ -198,7 +198,7 @@ public abstract class AbstractSqlEamDb implements EamDb {
* @param eamCase The case to add
*/
@Override
public void newCase(EamCase eamCase) throws EamDbException {
public void newCase(CorrelationCase eamCase) throws EamDbException {
Connection conn = connect();
PreparedStatement preparedStatement = null;
@ -259,12 +259,12 @@ public abstract class AbstractSqlEamDb implements EamDb {
* @param case The case to add
*/
@Override
public EamCase newCase(Case autopsyCase) throws EamDbException{
public CorrelationCase newCase(Case autopsyCase) throws EamDbException{
if(autopsyCase == null){
throw new EamDbException("Case is null");
}
EamCase curCeCase = new EamCase(
CorrelationCase curCeCase = new CorrelationCase(
-1,
autopsyCase.getName(), // unique case ID
EamOrganization.getDefault(),
@ -285,7 +285,7 @@ public abstract class AbstractSqlEamDb implements EamDb {
* @param eamCase The case to update
*/
@Override
public void updateCase(EamCase eamCase) throws EamDbException {
public void updateCase(CorrelationCase eamCase) throws EamDbException {
Connection conn = connect();
PreparedStatement preparedStatement = null;
@ -349,10 +349,12 @@ public abstract class AbstractSqlEamDb implements EamDb {
* @return The retrieved case
*/
@Override
public EamCase getCaseDetails(String caseUUID) throws EamDbException {
public CorrelationCase getCaseByUUID(String caseUUID) throws EamDbException {
// @@@ We should have a cache here...
Connection conn = connect();
EamCase eamCaseResult = null;
CorrelationCase eamCaseResult = null;
PreparedStatement preparedStatement = null;
ResultSet resultSet = null;
@ -386,11 +388,11 @@ public abstract class AbstractSqlEamDb implements EamDb {
* @return List of cases
*/
@Override
public List<EamCase> getCases() throws EamDbException {
public List<CorrelationCase> getCases() throws EamDbException {
Connection conn = connect();
List<EamCase> cases = new ArrayList<>();
EamCase eamCaseResult;
List<CorrelationCase> cases = new ArrayList<>();
CorrelationCase eamCaseResult;
PreparedStatement preparedStatement = null;
ResultSet resultSet = null;
@ -450,27 +452,27 @@ public abstract class AbstractSqlEamDb implements EamDb {
*
* @param eamDataSource the data source to update
*/
@Override
public void updateDataSource(CorrelationDataSource eamDataSource) throws EamDbException {
Connection conn = connect();
PreparedStatement preparedStatement = null;
String sql = "UPDATE data_sources SET name=? WHERE device_id=?";
try {
preparedStatement = conn.prepareStatement(sql);
preparedStatement.setString(1, eamDataSource.getName());
preparedStatement.setString(2, eamDataSource.getDeviceID());
preparedStatement.executeUpdate();
} catch (SQLException ex) {
throw new EamDbException("Error updating case.", ex); // NON-NLS
} finally {
EamDbUtil.closePreparedStatement(preparedStatement);
EamDbUtil.closeConnection(conn);
}
}
// @Override
// public void updateDataSource(CorrelationDataSource eamDataSource) throws EamDbException {
// Connection conn = connect();
// BC: This needs to be updated because device_id is not unique. Query needs to also use case_id
// PreparedStatement preparedStatement = null;
// String sql = "UPDATE data_sources SET name=? WHERE device_id=?";
//
// try {
// preparedStatement = conn.prepareStatement(sql);
//
// preparedStatement.setString(1, eamDataSource.getName());
// preparedStatement.setString(2, eamDataSource.getDeviceID());
//
// preparedStatement.executeUpdate();
// } catch (SQLException ex) {
// throw new EamDbException("Error updating case.", ex); // NON-NLS
// } finally {
// EamDbUtil.closePreparedStatement(preparedStatement);
// EamDbUtil.closeConnection(conn);
// }
// }
/**
* Retrieves Data Source details based on data source device ID
@ -568,8 +570,8 @@ public abstract class AbstractSqlEamDb implements EamDb {
preparedStatement = conn.prepareStatement(sql.toString());
for (CorrelationAttributeInstance eamInstance : eamInstances) {
if(! eamArtifact.getCorrelationValue().isEmpty()){
preparedStatement.setString(1, eamInstance.getEamCase().getCaseUUID());
preparedStatement.setString(2, eamInstance.getEamDataSource().getDeviceID());
preparedStatement.setString(1, eamInstance.getCorrelationCase().getCaseUUID());
preparedStatement.setString(2, eamInstance.getCorrelationDataSource().getDeviceID());
preparedStatement.setString(3, eamArtifact.getCorrelationValue());
preparedStatement.setString(4, eamInstance.getFilePath());
preparedStatement.setByte(5, eamInstance.getKnownStatus().getFileKnownValue());
@ -928,8 +930,8 @@ public abstract class AbstractSqlEamDb implements EamDb {
for (CorrelationAttributeInstance eamInstance : eamInstances) {
if(! eamArtifact.getCorrelationValue().isEmpty()){
bulkPs.setString(1, eamInstance.getEamCase().getCaseUUID());
bulkPs.setString(2, eamInstance.getEamDataSource().getDeviceID());
bulkPs.setString(1, eamInstance.getCorrelationCase().getCaseUUID());
bulkPs.setString(2, eamInstance.getCorrelationDataSource().getDeviceID());
bulkPs.setString(3, eamArtifact.getCorrelationValue());
bulkPs.setString(4, eamInstance.getFilePath());
bulkPs.setByte(5, eamInstance.getKnownStatus().getFileKnownValue());
@ -962,7 +964,7 @@ public abstract class AbstractSqlEamDb implements EamDb {
* Executes a bulk insert of the cases
*/
@Override
public void bulkInsertCases(List<EamCase> cases) throws EamDbException {
public void bulkInsertCases(List<CorrelationCase> cases) throws EamDbException {
Connection conn = connect();
if (cases.isEmpty()) {
@ -978,7 +980,7 @@ public abstract class AbstractSqlEamDb implements EamDb {
+ getConflictClause();
bulkPs = conn.prepareStatement(sql);
for (EamCase eamCase : cases) {
for (CorrelationCase eamCase : cases) {
bulkPs.setString(1, eamCase.getCaseUUID());
if (null == eamCase.getOrg()) {
bulkPs.setNull(2, Types.INTEGER);
@ -1075,8 +1077,8 @@ public abstract class AbstractSqlEamDb implements EamDb {
try {
preparedQuery = conn.prepareStatement(sqlQuery.toString());
preparedQuery.setString(1, eamInstance.getEamCase().getCaseUUID());
preparedQuery.setString(2, eamInstance.getEamDataSource().getDeviceID());
preparedQuery.setString(1, eamInstance.getCorrelationCase().getCaseUUID());
preparedQuery.setString(2, eamInstance.getCorrelationDataSource().getDeviceID());
preparedQuery.setString(3, eamArtifact.getCorrelationValue());
preparedQuery.setString(4, eamInstance.getFilePath());
resultSet = preparedQuery.executeQuery();
@ -1103,12 +1105,12 @@ public abstract class AbstractSqlEamDb implements EamDb {
// in the database, but we don't expect the user to be tagging large numbers
// of items (that didn't have the CE ingest module run on them) at once.
if(null == getCaseDetails(eamInstance.getEamCase().getCaseUUID())){
newCase(eamInstance.getEamCase());
if(null == getCaseByUUID(eamInstance.getCorrelationCase().getCaseUUID())){
newCase(eamInstance.getCorrelationCase());
}
if (null == getDataSourceDetails(eamInstance.getEamDataSource().getDeviceID())) {
newDataSource(eamInstance.getEamDataSource());
if (null == getDataSourceDetails(eamInstance.getCorrelationDataSource().getDeviceID())) {
newDataSource(eamInstance.getCorrelationDataSource());
}
eamArtifact.getInstances().get(0).setKnownStatus(knownStatus);
@ -1836,7 +1838,7 @@ public abstract class AbstractSqlEamDb implements EamDb {
*
* @throws SQLException when an expected column name is not in the resultSet
*/
private EamCase getEamCaseFromResultSet(ResultSet resultSet) throws SQLException {
private CorrelationCase getEamCaseFromResultSet(ResultSet resultSet) throws SQLException {
if (null == resultSet) {
return null;
}
@ -1853,8 +1855,7 @@ public abstract class AbstractSqlEamDb implements EamDb {
resultSet.getString("poc_phone"));
}
EamCase eamCase = new EamCase(resultSet.getString("case_uid"), resultSet.getString("case_name"));
eamCase.setID(resultSet.getInt("case_id"));
CorrelationCase eamCase = new CorrelationCase(resultSet.getInt("case_id"), resultSet.getString("case_uid"), resultSet.getString("case_name"));
eamCase.setOrg(eamOrg);
eamCase.setCreationDate(resultSet.getString("creation_date"));
eamCase.setCaseNumber(resultSet.getString("case_number"));
@ -1911,7 +1912,7 @@ public abstract class AbstractSqlEamDb implements EamDb {
return null;
}
CorrelationAttributeInstance eamArtifactInstance = new CorrelationAttributeInstance(
new EamCase(resultSet.getString("case_uid"), resultSet.getString("case_name")),
new CorrelationCase(resultSet.getString("case_uid"), resultSet.getString("case_name")),
new CorrelationDataSource(-1, resultSet.getString("device_id"), resultSet.getString("name")),
resultSet.getString("file_path"),
resultSet.getString("comment"),

View File

@ -53,52 +53,52 @@ public class CorrelationAttributeInstance implements Serializable {
private static final long serialVersionUID = 1L;
private String ID;
private EamCase eamCase;
private CorrelationDataSource eamDataSource;
private int ID;
private CorrelationCase correlationCase;
private CorrelationDataSource correlationDataSource;
private String filePath;
private String comment;
private TskData.FileKnown knownStatus;
private GlobalStatus globalStatus;
public CorrelationAttributeInstance(
EamCase eamCase,
CorrelationCase eamCase,
CorrelationDataSource eamDataSource
) {
this("", eamCase, eamDataSource, "", null, TskData.FileKnown.UNKNOWN, GlobalStatus.LOCAL);
this(-1, eamCase, eamDataSource, "", null, TskData.FileKnown.UNKNOWN, GlobalStatus.LOCAL);
}
public CorrelationAttributeInstance(
EamCase eamCase,
CorrelationCase eamCase,
CorrelationDataSource eamDataSource,
String filePath
) {
this("", eamCase, eamDataSource, filePath, null, TskData.FileKnown.UNKNOWN, GlobalStatus.LOCAL);
this(-1, eamCase, eamDataSource, filePath, null, TskData.FileKnown.UNKNOWN, GlobalStatus.LOCAL);
}
public CorrelationAttributeInstance(
EamCase eamCase,
CorrelationCase eamCase,
CorrelationDataSource eamDataSource,
String filePath,
String comment
) {
this("", eamCase, eamDataSource, filePath, comment, TskData.FileKnown.UNKNOWN, GlobalStatus.LOCAL);
this(-1, eamCase, eamDataSource, filePath, comment, TskData.FileKnown.UNKNOWN, GlobalStatus.LOCAL);
}
public CorrelationAttributeInstance(
EamCase eamCase,
CorrelationCase eamCase,
CorrelationDataSource eamDataSource,
String filePath,
String comment,
TskData.FileKnown knownStatus,
GlobalStatus globalStatus
) {
this("", eamCase, eamDataSource, filePath, comment, knownStatus, globalStatus);
this(-1, eamCase, eamDataSource, filePath, comment, knownStatus, globalStatus);
}
public CorrelationAttributeInstance(
String ID,
EamCase eamCase,
int ID,
CorrelationCase eamCase,
CorrelationDataSource eamDataSource,
String filePath,
String comment,
@ -106,8 +106,8 @@ public class CorrelationAttributeInstance implements Serializable {
GlobalStatus globalStatus
) {
this.ID = ID;
this.eamCase = eamCase;
this.eamDataSource = eamDataSource;
this.correlationCase = eamCase;
this.correlationDataSource = eamDataSource;
// Lower case paths to normalize paths and improve correlation results, if this causes significant issues on case-sensitive file systems, remove
this.filePath = filePath.toLowerCase();
this.comment = comment;
@ -116,9 +116,9 @@ public class CorrelationAttributeInstance implements Serializable {
}
public Boolean equals(CorrelationAttributeInstance otherInstance) {
return ((this.getID().equals(otherInstance.getID()))
&& (this.getEamCase().equals(otherInstance.getEamCase()))
&& (this.getEamDataSource().equals(otherInstance.getEamDataSource()))
return ((this.getID() == otherInstance.getID())
&& (this.getCorrelationCase().equals(otherInstance.getCorrelationCase()))
&& (this.getCorrelationDataSource().equals(otherInstance.getCorrelationDataSource()))
&& (this.getFilePath().equals(otherInstance.getFilePath()))
&& (this.getGlobalStatus().equals(otherInstance.getGlobalStatus()))
&& (this.getKnownStatus().equals(otherInstance.getKnownStatus()))
@ -128,8 +128,8 @@ public class CorrelationAttributeInstance implements Serializable {
@Override
public String toString() {
return this.getID()
+ this.getEamCase().getCaseUUID()
+ this.getEamDataSource().getName()
+ this.getCorrelationCase().getCaseUUID()
+ this.getCorrelationDataSource().getName()
+ this.getFilePath()
+ this.getGlobalStatus()
+ this.getKnownStatus()
@ -137,45 +137,24 @@ public class CorrelationAttributeInstance implements Serializable {
}
/**
* @return the ID
* @return the database ID
*/
public String getID() {
int getID() {
return ID;
}
/**
* @param ID the ID to set
*/
public void setID(String ID) {
this.ID = ID;
}
/**
* @return the eamCase
*/
public EamCase getEamCase() {
return eamCase;
}
/**
* @param eamCase the eamCase to set
*/
public void setEamCase(EamCase eamCase) {
this.eamCase = eamCase;
public CorrelationCase getCorrelationCase() {
return correlationCase;
}
/**
* @return the eamDataSource
*/
public CorrelationDataSource getEamDataSource() {
return eamDataSource;
}
/**
* @param eamDataSource the eamDataSource to set
*/
public void setEamDataSource(CorrelationDataSource eamDataSource) {
this.eamDataSource = eamDataSource;
public CorrelationDataSource getCorrelationDataSource() {
return correlationDataSource;
}
/**
@ -185,14 +164,6 @@ public class CorrelationAttributeInstance implements Serializable {
return filePath;
}
/**
* @param filePath the filePath to set
*/
public void setFilePath(String filePath) {
// Lower case paths to normalize paths and improve correlation results, if this causes significant issues on case-sensitive file systems, remove
this.filePath = filePath.toLowerCase();
}
/**
* @return the comment
*/

View File

@ -29,13 +29,13 @@ import org.openide.util.NbBundle.Messages;
* Used to store info about a case.
*
*/
public class EamCase implements Serializable {
public class CorrelationCase implements Serializable {
private static long serialVersionUID = 1L;
private static final DateFormat DATE_FORMAT = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss (z)");
private int ID;
private String caseUUID;
private int databaseId;
private String caseUUID; // globally unique
private EamOrganization org;
private String displayName;
private String creationDate;
@ -45,11 +45,20 @@ public class EamCase implements Serializable {
private String examinerPhone;
private String notes;
public EamCase(String caseUUID, String displayName) {
/**
*
* @param caseUUID Globally unique identifier
* @param displayName
*/
public CorrelationCase(String caseUUID, String displayName) {
this(-1, caseUUID, null, displayName, DATE_FORMAT.format(new Date()), null, null, null, null, null);
}
CorrelationCase(int ID, String caseUUID, String displayName) {
this(ID, caseUUID, null, displayName, DATE_FORMAT.format(new Date()), null, null, null, null, null);
}
public EamCase(int ID,
public CorrelationCase(int ID,
String caseUUID,
EamOrganization org,
String displayName,
@ -59,7 +68,7 @@ public class EamCase implements Serializable {
String examinerEmail,
String examinerPhone,
String notes) {
this.ID = ID;
this.databaseId = ID;
this.caseUUID = caseUUID;
this.org = org;
this.displayName = displayName;
@ -149,18 +158,13 @@ public class EamCase implements Serializable {
}
/**
* @return the ID
* @return the database ID for the case or -1 if it is unknown (or not in the DB)
*/
public int getID() {
return ID;
int getID() {
// @@@ Should probably have some lazy logic here to lead the ID from the DB if it is -1
return databaseId;
}
/**
* @param ID the ID to set
*/
public void setID(int ID) {
this.ID = ID;
}
/**
* @return the caseUUID
@ -169,12 +173,6 @@ public class EamCase implements Serializable {
return caseUUID;
}
/**
* @param caseUUID the caseUUID to set
*/
public void setCaseUUID(String caseUUID) {
this.caseUUID = caseUUID;
}
/**
* @return the org
@ -287,5 +285,4 @@ public class EamCase implements Serializable {
public void setNotes(String notes) {
this.notes = notes;
}
}

View File

@ -34,7 +34,7 @@ public class CorrelationDataSource implements Serializable {
private static final long serialVersionUID = 1L;
private final int dataSourceId; //< Id in the central repo
private final String deviceID;
private final String deviceID; //< Unique to its associated case (not necessarily globally unique)
private final String name;
@ -73,7 +73,7 @@ public class CorrelationDataSource implements Serializable {
public String toString() {
StringBuilder str = new StringBuilder();
str.append("(");
str.append("ID=").append(Integer.toString(getDataSourceID()));
str.append("ID=").append(Integer.toString(getID()));
str.append(",deviceID=").append(getDeviceID());
str.append(",name=").append(getName());
str.append(")");
@ -81,13 +81,16 @@ public class CorrelationDataSource implements Serializable {
}
/**
* Get the database row ID
*
* @return the ID
*/
public int getDataSourceID() {
int getID() {
return dataSourceId;
}
/**
* Get the device ID that is unique to the case
* @return the deviceID
*/
public String getDeviceID() {

View File

@ -97,7 +97,7 @@ public class EamArtifactUtil {
// make an instance for the BB source file
CorrelationAttributeInstance eamInstance = new CorrelationAttributeInstance(
new EamCase(currentCase.getName(), currentCase.getDisplayName()),
new CorrelationCase(currentCase.getName(), currentCase.getDisplayName()),
CorrelationDataSource.fromTSKDataSource(bbSourceFile.getDataSource()),
bbSourceFile.getParentPath() + bbSourceFile.getName(),
"",
@ -249,7 +249,7 @@ public class EamArtifactUtil {
CorrelationAttribute.Type filesType = EamDb.getInstance().getCorrelationTypeById(CorrelationAttribute.FILES_TYPE_ID);
eamArtifact = new CorrelationAttribute(filesType, af.getMd5Hash());
CorrelationAttributeInstance cei = new CorrelationAttributeInstance(
new EamCase(Case.getCurrentCase().getName(), Case.getCurrentCase().getDisplayName()),
new CorrelationCase(Case.getCurrentCase().getName(), Case.getCurrentCase().getDisplayName()),
CorrelationDataSource.fromTSKDataSource(af.getDataSource()),
af.getParentPath() + af.getName(),
comment,

View File

@ -147,21 +147,21 @@ public interface EamDb {
*
* @param eamCase The case to add
*/
void newCase(EamCase eamCase) throws EamDbException;
void newCase(CorrelationCase eamCase) throws EamDbException;
/**
* Creates new Case in the database from the given case
*
* @param case The case to add
*/
EamCase newCase(Case autopsyCase) throws EamDbException;
CorrelationCase newCase(Case autopsyCase) throws EamDbException;
/**
* Updates an existing Case in the database
*
* @param eamCase The case to update
*/
void updateCase(EamCase eamCase) throws EamDbException;
void updateCase(CorrelationCase eamCase) throws EamDbException;
/**
* Retrieves Case details based on Case UUID
@ -170,14 +170,14 @@ public interface EamDb {
*
* @return The retrieved case
*/
EamCase getCaseDetails(String caseUUID) throws EamDbException;
CorrelationCase getCaseByUUID(String caseUUID) throws EamDbException;
/**
* Retrieves cases that are in DB.
*
* @return List of cases
*/
List<EamCase> getCases() throws EamDbException;
List<CorrelationCase> getCases() throws EamDbException;
/**
* Creates new Data Source in the database
@ -191,7 +191,7 @@ public interface EamDb {
*
* @param eamDataSource the data source to update
*/
void updateDataSource(CorrelationDataSource eamDataSource) throws EamDbException;
//void updateDataSource(CorrelationDataSource eamDataSource) throws EamDbException;
/**
* Retrieves Data Source details based on data source device ID
@ -312,7 +312,7 @@ public interface EamDb {
/**
* Executes a bulk insert of the cases
*/
void bulkInsertCases(List<EamCase> cases) throws EamDbException;
void bulkInsertCases(List<CorrelationCase> cases) throws EamDbException;
/**
* Sets an eamArtifact instance to the given known status. If eamArtifact

View File

@ -271,7 +271,7 @@ public class SqliteEamDb extends AbstractSqlEamDb {
* @param case The case to add
*/
@Override
public EamCase newCase(Case autopsyCase) throws EamDbException {
public CorrelationCase newCase(Case autopsyCase) throws EamDbException {
try{
acquireExclusiveLock();
return super.newCase(autopsyCase);
@ -288,7 +288,7 @@ public class SqliteEamDb extends AbstractSqlEamDb {
* @param eamCase The case to add
*/
@Override
public void newCase(EamCase eamCase) throws EamDbException {
public void newCase(CorrelationCase eamCase) throws EamDbException {
try{
acquireExclusiveLock();
super.newCase(eamCase);
@ -303,7 +303,7 @@ public class SqliteEamDb extends AbstractSqlEamDb {
* @param eamCase The case to update
*/
@Override
public void updateCase(EamCase eamCase) throws EamDbException {
public void updateCase(CorrelationCase eamCase) throws EamDbException {
try{
acquireExclusiveLock();
super.updateCase(eamCase);
@ -320,10 +320,10 @@ public class SqliteEamDb extends AbstractSqlEamDb {
* @return The retrieved case
*/
@Override
public EamCase getCaseDetails(String caseUUID) throws EamDbException {
public CorrelationCase getCaseByUUID(String caseUUID) throws EamDbException {
try{
acquireSharedLock();
return super.getCaseDetails(caseUUID);
return super.getCaseByUUID(caseUUID);
} finally {
releaseSharedLock();
}
@ -335,7 +335,7 @@ public class SqliteEamDb extends AbstractSqlEamDb {
* @return List of cases
*/
@Override
public List<EamCase> getCases() throws EamDbException {
public List<CorrelationCase> getCases() throws EamDbException {
try{
acquireSharedLock();
return super.getCases();
@ -364,15 +364,15 @@ public class SqliteEamDb extends AbstractSqlEamDb {
*
* @param eamDataSource the data source to update
*/
@Override
public void updateDataSource(CorrelationDataSource eamDataSource) throws EamDbException {
try{
acquireExclusiveLock();
super.updateDataSource(eamDataSource);
} finally {
releaseExclusiveLock();
}
}
// @Override
// public void updateDataSource(CorrelationDataSource eamDataSource) throws EamDbException {
// try{
// acquireExclusiveLock();
// super.updateDataSource(eamDataSource);
// } finally {
// releaseExclusiveLock();
// }
// }
/**
* Retrieves Data Source details based on data source device ID
@ -561,7 +561,7 @@ public class SqliteEamDb extends AbstractSqlEamDb {
* Executes a bulk insert of the cases
*/
@Override
public void bulkInsertCases(List<EamCase> cases) throws EamDbException {
public void bulkInsertCases(List<CorrelationCase> cases) throws EamDbException {
try{
acquireExclusiveLock();
super.bulkInsertCases(cases);

View File

@ -34,7 +34,7 @@ import org.sleuthkit.autopsy.casemodule.services.TagsManager;
import org.sleuthkit.autopsy.coreutils.Logger;
import org.sleuthkit.autopsy.centralrepository.datamodel.CorrelationAttribute;
import org.sleuthkit.autopsy.centralrepository.datamodel.EamArtifactUtil;
import org.sleuthkit.autopsy.centralrepository.datamodel.EamCase;
import org.sleuthkit.autopsy.centralrepository.datamodel.CorrelationCase;
import org.sleuthkit.autopsy.centralrepository.datamodel.CorrelationDataSource;
import org.sleuthkit.autopsy.centralrepository.datamodel.EamDb;
import org.sleuthkit.autopsy.centralrepository.datamodel.EamDbException;
@ -279,7 +279,7 @@ public class CaseEventListener implements PropertyChangeListener {
LOGGER.log(Level.SEVERE, "Error adding tag.", ex); // NON-NLS
}
EamCase curCeCase = new EamCase(
CorrelationCase curCeCase = new CorrelationCase(
-1,
curCase.getName(), // unique case ID
EamOrganization.getDefault(),
@ -298,7 +298,7 @@ public class CaseEventListener implements PropertyChangeListener {
try {
// NOTE: Cannot determine if the opened case is a new case or a reopened case,
// so check for existing name in DB and insert if missing.
EamCase existingCase = dbManager.getCaseDetails(curCeCase.getCaseUUID());
CorrelationCase existingCase = dbManager.getCaseByUUID(curCeCase.getCaseUUID());
if (null == existingCase) {
dbManager.newCase(curCeCase);
@ -321,7 +321,7 @@ public class CaseEventListener implements PropertyChangeListener {
String newName = (String)evt.getNewValue();
try {
// See if the case is in the database. If it is, update the display name.
EamCase existingCase = dbManager.getCaseDetails(Case.getCurrentCase().getName());
CorrelationCase existingCase = dbManager.getCaseByUUID(Case.getCurrentCase().getName());
if (null != existingCase) {
existingCase.setDisplayName(newName);

View File

@ -18,7 +18,7 @@
*/
package org.sleuthkit.autopsy.centralrepository.ingestmodule;
import org.sleuthkit.autopsy.centralrepository.datamodel.EamCase;
import org.sleuthkit.autopsy.centralrepository.datamodel.CorrelationCase;
import org.sleuthkit.autopsy.centralrepository.datamodel.EamDbException;
import java.util.List;
import java.util.logging.Level;
@ -64,7 +64,7 @@ class IngestModule implements FileIngestModule {
private static final IngestModuleReferenceCounter refCounter = new IngestModuleReferenceCounter();
private static final IngestModuleReferenceCounter warningMsgRefCounter = new IngestModuleReferenceCounter();
private long jobId;
private EamCase eamCase;
private CorrelationCase eamCase;
private CorrelationDataSource eamDataSource;
private Blackboard blackboard;
private CorrelationAttribute.Type filesType;
@ -216,7 +216,7 @@ class IngestModule implements FileIngestModule {
throw new IngestModuleException("Cannot run on a multi-user case with a SQLite central repository."); // NON-NLS
}
jobId = context.getJobId();
eamCase = new EamCase(Case.getCurrentCase().getName(), Case.getCurrentCase().getDisplayName());
eamCase = new CorrelationCase(Case.getCurrentCase().getName(), Case.getCurrentCase().getDisplayName());
try {
eamDataSource = CorrelationDataSource.fromTSKDataSource(context.getDataSource());
@ -256,9 +256,9 @@ class IngestModule implements FileIngestModule {
}
// ensure we have this case defined in the EAM DB
EamCase existingCase;
CorrelationCase existingCase;
Case curCase = Case.getCurrentCase();
EamCase curCeCase = new EamCase(
CorrelationCase curCeCase = new CorrelationCase(
-1,
curCase.getName(), // unique case ID
EamOrganization.getDefault(),
@ -270,7 +270,7 @@ class IngestModule implements FileIngestModule {
null,
null);
try {
existingCase = dbManager.getCaseDetails(curCeCase.getCaseUUID());
existingCase = dbManager.getCaseByUUID(curCeCase.getCaseUUID());
if (existingCase == null) {
dbManager.newCase(curCeCase);
}

View File

@ -23,13 +23,12 @@ import java.awt.event.ActionEvent;
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.List;
import javax.swing.AbstractAction;
import javax.swing.Action;
import javax.swing.JOptionPane;
import org.openide.DialogDisplayer;
import org.openide.WizardDescriptor;
import org.openide.util.HelpCtx;
import org.openide.util.NbBundle.Messages;
import org.openide.util.actions.CallableSystemAction;
import org.openide.windows.WindowManager;
import org.sleuthkit.autopsy.ingest.IngestJobSettings;
import org.sleuthkit.autopsy.ingest.IngestManager;
@ -41,7 +40,7 @@ import org.sleuthkit.datamodel.Directory;
* When the data source is pressed, it should open the wizard for ingest
* modules.
*/
public final class RunIngestModulesAction extends CallableSystemAction {
public final class RunIngestModulesAction extends AbstractAction {
@Messages("RunIngestModulesAction.name=Run Ingest Modules")
private static final long serialVersionUID = 1L;
@ -51,6 +50,21 @@ public final class RunIngestModulesAction extends CallableSystemAction {
* used instead of this wizard and is retained for backwards compatibility.
*/
private static final String EXECUTION_CONTEXT = "org.sleuthkit.autopsy.ingest.RunIngestModulesDialog";
/**
* Display any warnings that the ingestJobSettings have.
*
* @param ingestJobSettings
*/
private static void showWarnings(IngestJobSettings ingestJobSettings) {
List<String> warnings = ingestJobSettings.getWarnings();
if (warnings.isEmpty() == false) {
StringBuilder warningMessage = new StringBuilder(1024);
for (String warning : warnings) {
warningMessage.append(warning).append("\n");
}
JOptionPane.showMessageDialog(null, warningMessage.toString());
}
}
private final List<Content> dataSources = new ArrayList<>();
private final IngestJobSettings.IngestType ingestType;
@ -103,35 +117,9 @@ public final class RunIngestModulesAction extends CallableSystemAction {
}
}
/**
* Display any warnings that the ingestJobSettings have.
*
* @param ingestJobSettings
*/
private static void showWarnings(IngestJobSettings ingestJobSettings) {
List<String> warnings = ingestJobSettings.getWarnings();
if (warnings.isEmpty() == false) {
StringBuilder warningMessage = new StringBuilder(1024);
for (String warning : warnings) {
warningMessage.append(warning).append("\n");
}
JOptionPane.showMessageDialog(null, warningMessage.toString());
}
}
@Override
public void performAction() {
actionPerformed(null);
public Object clone() throws CloneNotSupportedException {
throw new CloneNotSupportedException("Clone is not supported for the RunIngestModulesAction");
}
@Override
public String getName() {
return Bundle.RunIngestModulesAction_name();
}
@Override
public HelpCtx getHelpCtx() {
return HelpCtx.DEFAULT_HELP;
}
}