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() {
if (popUpWindow == null) {
String curCaseDisplayName = Case.getCurrentCase().getDisplayName();
// TODO: replace with caseUUID once it is implemented
String curCaseUUID = curCaseDisplayName;
String curCaseUUID = Case.getCurrentCase().getName();
// create the popUp window for it
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.
*
* @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(")");
// TODO: The organizations will only have a small number of rows, so
// determine if an index is worthwhile.
// NOTE: The organizations will only have a small number of rows, so
// an index is probably not worthwhile.
StringBuilder createCasesTable = new StringBuilder();
createCasesTable.append("CREATE TABLE IF NOT EXISTS cases (");
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(")");
// 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 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
// provides no benefit.
Connection conn = null;
Connection conn = null;
try {
conn = connectionPool.getConnection();
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
*/
private void verifyCDBDirectory() throws EamDbException {
private void verifyDBDirectory() throws EamDbException {
File dbDir = new File(dbSettings.getDbDirectory());
if (!dbDir.exists()) {
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(")");
// TODO: The organizations will only have a small number of rows, so
// determine if an index is worthwhile.
// NOTE: The organizations will only have a small number of rows, so
// an index is probably not worthwhile.
StringBuilder createCasesTable = new StringBuilder();
createCasesTable.append("CREATE TABLE IF NOT EXISTS cases (");
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(")");
// 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 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
// provides no benefit.
Connection conn = null;
try {
conn = connectionPool.getConnection();
@ -339,7 +341,7 @@ public class SqliteEamDb extends AbstractSqlEamDb {
}
if (connectionPool == null) {
verifyCDBDirectory();
verifyDBDirectory();
setupConnectionPool();
confirmDatabaseSchema();
}

View File

@ -40,7 +40,7 @@ public final class SqliteEamDbSettings {
private final static Logger LOGGER = Logger.getLogger(SqliteEamDbSettings.class.getName());
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 String DEFAULT_BAD_TAGS = "Evidence"; // NON-NLS
private final String JDBC_DRIVER = "org.sqlite.JDBC"; // NON-NLS

View File

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

View File

@ -95,7 +95,7 @@ class IngestModule implements FileIngestModule {
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) {
// query db for artifact instances having this MD5 and knownStatus = "Bad".
try {
@ -122,7 +122,6 @@ class IngestModule implements FileIngestModule {
}
try {
// TODO: add the actual device once it is implemented in Autopsy.
EamArtifactInstance cefi = new EamArtifactInstance(
eamCase,
eamDataSource,
@ -194,7 +193,7 @@ class IngestModule implements FileIngestModule {
// and image exist in the DB before we associate artifacts with it.
if (refCounter.incrementAndGet(jobId)
== 1) {
// ensure we have this data source in the CDB
// ensure we have this data source in the EAM DB
try {
if (null == dbManager.getDataSourceDetails(eamDataSource.getDeviceID())) {
dbManager.newDataSource(eamDataSource);
@ -204,7 +203,7 @@ class IngestModule implements FileIngestModule {
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;
Case curCase = Case.getCurrentCase();
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
*
* 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
*
* 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
*
* 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
*
* 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);
}
@Messages({"EnterpriseArtifactManagerSQLiteSettingsDialog.fileNameExtFilter.text=CDB Database File"})
@Messages({"EnterpriseArtifactManagerSQLiteSettingsDialog.fileNameExtFilter.text=SQLite Database File"})
private void customizeFileChooser() {
fcDatabasePath.setDragEnabled(false);
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
*
* Licensed under the Apache License, Version 2.0 (the "License");