Merge pull request #2837 from narfindustries/eam

Eam - clean ups
This commit is contained in:
Richard Cordovano 2017-06-12 11:48:43 -04:00 committed by GitHub
commit edd70dc9d1
13 changed files with 30 additions and 33 deletions

View File

@ -89,9 +89,7 @@ public final class EamEditCaseInfoAction extends CallableSystemAction implements
public void performAction() { public void performAction() {
if (popUpWindow == null) { if (popUpWindow == null) {
String curCaseDisplayName = Case.getCurrentCase().getDisplayName(); String curCaseUUID = Case.getCurrentCase().getName();
// TODO: replace with caseUUID once it is implemented
String curCaseUUID = curCaseDisplayName;
// create the popUp window for it // create the popUp window for it
String title = Bundle.EnterpriseArtifactManagerCaseEditDetails_window_title(); String title = Bundle.EnterpriseArtifactManagerCaseEditDetails_window_title();

View File

@ -445,7 +445,7 @@ public class DataContentViewerOtherCases extends javax.swing.JPanel implements D
} }
/** /**
* Query the CDB for artifact instances from other cases correlated to the * Query the db for artifact instances from other cases correlated to the
* given enterprise artifact manager artifact. * given enterprise artifact manager artifact.
* *
* @param eamArtifact The artifact to correlate against * @param eamArtifact The artifact to correlate against

View File

@ -153,8 +153,9 @@ public class PostgresEamDb extends AbstractSqlEamDb {
createOrganizationsTable.append("poc_phone character varying(20) NOT NULL"); createOrganizationsTable.append("poc_phone character varying(20) NOT NULL");
createOrganizationsTable.append(")"); createOrganizationsTable.append(")");
// TODO: The organizations will only have a small number of rows, so // NOTE: The organizations will only have a small number of rows, so
// determine if an index is worthwhile. // an index is probably not worthwhile.
StringBuilder createCasesTable = new StringBuilder(); StringBuilder createCasesTable = new StringBuilder();
createCasesTable.append("CREATE TABLE IF NOT EXISTS cases ("); createCasesTable.append("CREATE TABLE IF NOT EXISTS cases (");
createCasesTable.append("id SERIAL PRIMARY KEY,"); createCasesTable.append("id SERIAL PRIMARY KEY,");
@ -170,7 +171,7 @@ public class PostgresEamDb extends AbstractSqlEamDb {
createCasesTable.append("foreign key (org_id) references organizations(id) on update set null on delete set null"); createCasesTable.append("foreign key (org_id) references organizations(id) on update set null on delete set null");
createCasesTable.append(")"); createCasesTable.append(")");
// TODO: when there are few cases in the cases table, these indices may not be worthwhile // NOTE: when there are few cases in the cases table, these indices may not be worthwhile
String casesIdx1 = "CREATE INDEX IF NOT EXISTS cases_org_id ON cases (org_id)"; String casesIdx1 = "CREATE INDEX IF NOT EXISTS cases_org_id ON cases (org_id)";
String casesIdx2 = "CREATE INDEX IF NOT EXISTS cases_case_uid ON cases (case_uid)"; String casesIdx2 = "CREATE INDEX IF NOT EXISTS cases_case_uid ON cases (case_uid)";
@ -251,8 +252,8 @@ public class PostgresEamDb extends AbstractSqlEamDb {
// NOTE: the db_info table currenly only has 1 row, so having an index // NOTE: the db_info table currenly only has 1 row, so having an index
// provides no benefit. // provides no benefit.
Connection conn = null;
Connection conn = null;
try { try {
conn = connectionPool.getConnection(); conn = connectionPool.getConnection();
Statement stmt = conn.createStatement(); Statement stmt = conn.createStatement();

View File

@ -131,11 +131,11 @@ public class SqliteEamDb extends AbstractSqlEamDb {
} }
/** /**
* Verify the CDB directory exists. If it doesn't, then create it. * Verify the EAM db directory exists. If it doesn't, then create it.
* *
* @throws EamDbException * @throws EamDbException
*/ */
private void verifyCDBDirectory() throws EamDbException { private void verifyDBDirectory() throws EamDbException {
File dbDir = new File(dbSettings.getDbDirectory()); File dbDir = new File(dbSettings.getDbDirectory());
if (!dbDir.exists()) { if (!dbDir.exists()) {
LOGGER.log(Level.INFO, "sqlite directory does not exist, creating it at {0}.", dbSettings.getDbDirectory()); // NON-NLS LOGGER.log(Level.INFO, "sqlite directory does not exist, creating it at {0}.", dbSettings.getDbDirectory()); // NON-NLS
@ -177,8 +177,9 @@ public class SqliteEamDb extends AbstractSqlEamDb {
createOrganizationsTable.append("poc_phone character varying(20) NOT NULL"); createOrganizationsTable.append("poc_phone character varying(20) NOT NULL");
createOrganizationsTable.append(")"); createOrganizationsTable.append(")");
// TODO: The organizations will only have a small number of rows, so // NOTE: The organizations will only have a small number of rows, so
// determine if an index is worthwhile. // an index is probably not worthwhile.
StringBuilder createCasesTable = new StringBuilder(); StringBuilder createCasesTable = new StringBuilder();
createCasesTable.append("CREATE TABLE IF NOT EXISTS cases ("); createCasesTable.append("CREATE TABLE IF NOT EXISTS cases (");
createCasesTable.append("id integer primary key autoincrement NOT NULL,"); createCasesTable.append("id integer primary key autoincrement NOT NULL,");
@ -195,7 +196,7 @@ public class SqliteEamDb extends AbstractSqlEamDb {
createCasesTable.append("CONSTRAINT case_uid_unique UNIQUE(case_uid)"); createCasesTable.append("CONSTRAINT case_uid_unique UNIQUE(case_uid)");
createCasesTable.append(")"); createCasesTable.append(")");
// TODO: when there are few cases in the cases table, these indices may not be worthwhile // NOTE: when there are few cases in the cases table, these indices may not be worthwhile
String casesIdx1 = "CREATE INDEX IF NOT EXISTS cases_org_id ON cases (org_id)"; String casesIdx1 = "CREATE INDEX IF NOT EXISTS cases_org_id ON cases (org_id)";
String casesIdx2 = "CREATE INDEX IF NOT EXISTS cases_case_uid ON cases (case_uid)"; String casesIdx2 = "CREATE INDEX IF NOT EXISTS cases_case_uid ON cases (case_uid)";
@ -276,6 +277,7 @@ public class SqliteEamDb extends AbstractSqlEamDb {
// NOTE: the db_info table currenly only has 1 row, so having an index // NOTE: the db_info table currenly only has 1 row, so having an index
// provides no benefit. // provides no benefit.
Connection conn = null; Connection conn = null;
try { try {
conn = connectionPool.getConnection(); conn = connectionPool.getConnection();
@ -339,7 +341,7 @@ public class SqliteEamDb extends AbstractSqlEamDb {
} }
if (connectionPool == null) { if (connectionPool == null) {
verifyCDBDirectory(); verifyDBDirectory();
setupConnectionPool(); setupConnectionPool();
confirmDatabaseSchema(); confirmDatabaseSchema();
} }

View File

@ -40,7 +40,7 @@ public final class SqliteEamDbSettings {
private final static Logger LOGGER = Logger.getLogger(SqliteEamDbSettings.class.getName()); private final static Logger LOGGER = Logger.getLogger(SqliteEamDbSettings.class.getName());
private final String DEFAULT_DBNAME = "enterpriseartifactmanagerdb.db"; // NON-NLS private final String DEFAULT_DBNAME = "enterpriseartifactmanagerdb.db"; // NON-NLS
private final String DEFAULT_DBDIRECTORY = System.getProperty("user.home") + File.separator + "Autopsy" + File.separator + "cdb"; // NON-NLS private final String DEFAULT_DBDIRECTORY = System.getProperty("user.home") + File.separator + "Autopsy" + File.separator + "eamdb"; // NON-NLS
private final int DEFAULT_BULK_THRESHHOLD = 1000; private final int DEFAULT_BULK_THRESHHOLD = 1000;
private final String DEFAULT_BAD_TAGS = "Evidence"; // NON-NLS private final String DEFAULT_BAD_TAGS = "Evidence"; // NON-NLS
private final String JDBC_DRIVER = "org.sqlite.JDBC"; // NON-NLS private final String JDBC_DRIVER = "org.sqlite.JDBC"; // NON-NLS

View File

@ -37,9 +37,6 @@ public class Installer extends ModuleInstall {
@Override @Override
public void restored() { public void restored() {
// TODO: Setup the default config settings here
// something like EnterpriseArtifactManagerSettings.setDefaults();
Case.addPropertyChangeListener(pcl); Case.addPropertyChangeListener(pcl);
ieListener.installListeners(); ieListener.installListeners();

View File

@ -95,7 +95,7 @@ class IngestModule implements FileIngestModule {
EamArtifact eamArtifact = new EamArtifact(filesType, md5); EamArtifact eamArtifact = new EamArtifact(filesType, md5);
// If unknown to both the hash module and as a globally known artifact in the CDB, correlate to other cases // If unknown to both the hash module and as a globally known artifact in the EAM DB, correlate to other cases
if (af.getKnown() == TskData.FileKnown.UNKNOWN) { if (af.getKnown() == TskData.FileKnown.UNKNOWN) {
// query db for artifact instances having this MD5 and knownStatus = "Bad". // query db for artifact instances having this MD5 and knownStatus = "Bad".
try { try {
@ -122,7 +122,6 @@ class IngestModule implements FileIngestModule {
} }
try { try {
// TODO: add the actual device once it is implemented in Autopsy.
EamArtifactInstance cefi = new EamArtifactInstance( EamArtifactInstance cefi = new EamArtifactInstance(
eamCase, eamCase,
eamDataSource, eamDataSource,
@ -194,7 +193,7 @@ class IngestModule implements FileIngestModule {
// and image exist in the DB before we associate artifacts with it. // and image exist in the DB before we associate artifacts with it.
if (refCounter.incrementAndGet(jobId) if (refCounter.incrementAndGet(jobId)
== 1) { == 1) {
// ensure we have this data source in the CDB // ensure we have this data source in the EAM DB
try { try {
if (null == dbManager.getDataSourceDetails(eamDataSource.getDeviceID())) { if (null == dbManager.getDataSourceDetails(eamDataSource.getDeviceID())) {
dbManager.newDataSource(eamDataSource); dbManager.newDataSource(eamDataSource);
@ -204,7 +203,7 @@ class IngestModule implements FileIngestModule {
throw new IngestModuleException("Error creating new data source in startUp.", ex); // NON-NLS throw new IngestModuleException("Error creating new data source in startUp.", ex); // NON-NLS
} }
// ensure we have this case defined in the CDB // ensure we have this case defined in the EAM DB
EamCase existingCase; EamCase existingCase;
Case curCase = Case.getCurrentCase(); Case curCase = Case.getCurrentCase();
EamCase curCeCase = new EamCase( EamCase curCeCase = new EamCase(

View File

@ -1,7 +1,7 @@
/* /*
* Autopsy Forensic Browser * Enterprise Artifact Manager
* *
* Copyright 2013-2016 Basis Technology Corp. * Copyright 2015-2017 Basis Technology Corp.
* Contact: carrier <at> sleuthkit <dot> org * Contact: carrier <at> sleuthkit <dot> org
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");

View File

@ -1,7 +1,7 @@
/* /*
* Autopsy Forensic Browser * Enterprise Artifact Manager
* *
* Copyright 2011 - 2013 Basis Technology Corp. * Copyright 2015-2017 Basis Technology Corp.
* Contact: carrier <at> sleuthkit <dot> org * Contact: carrier <at> sleuthkit <dot> org
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");

View File

@ -1,7 +1,7 @@
/* /*
* Autopsy Forensic Browser * Enterprise Artifact Manager
* *
* Copyright 2011 - 2013 Basis Technology Corp. * Copyright 2015-2017 Basis Technology Corp.
* Contact: carrier <at> sleuthkit <dot> org * Contact: carrier <at> sleuthkit <dot> org
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");

View File

@ -1,7 +1,7 @@
/* /*
* Autopsy Forensic Browser * Enterprise Artifact Manager
* *
* Copyright 2013-2014 Basis Technology Corp. * Copyright 2015-2017 Basis Technology Corp.
* Contact: carrier <at> sleuthkit <dot> org * Contact: carrier <at> sleuthkit <dot> org
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");

View File

@ -91,7 +91,7 @@ public class EamSqliteSettingsDialog extends javax.swing.JDialog {
bnTestDatabase.setEnabled(false); bnTestDatabase.setEnabled(false);
} }
@Messages({"EnterpriseArtifactManagerSQLiteSettingsDialog.fileNameExtFilter.text=CDB Database File"}) @Messages({"EnterpriseArtifactManagerSQLiteSettingsDialog.fileNameExtFilter.text=SQLite Database File"})
private void customizeFileChooser() { private void customizeFileChooser() {
fcDatabasePath.setDragEnabled(false); fcDatabasePath.setDragEnabled(false);
fcDatabasePath.setFileSelectionMode(JFileChooser.FILES_ONLY); fcDatabasePath.setFileSelectionMode(JFileChooser.FILES_ONLY);

View File

@ -1,7 +1,7 @@
/* /*
* Autopsy Forensic Browser * Enterprise Artifact Manager
* *
* Copyright 2011 - 2013 Basis Technology Corp. * Copyright 2015-2017 Basis Technology Corp.
* Contact: carrier <at> sleuthkit <dot> org * Contact: carrier <at> sleuthkit <dot> org
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");