mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-13 08:26:15 +00:00
Merge pull request #4419 from wschaeferB/4556-IsCompatableCrCheck
4556 is compatable cr check
This commit is contained in:
commit
651fde6ac4
@ -25,7 +25,7 @@ import javax.swing.Action;
|
|||||||
import org.openide.util.Utilities;
|
import org.openide.util.Utilities;
|
||||||
import org.openide.util.lookup.ServiceProvider;
|
import org.openide.util.lookup.ServiceProvider;
|
||||||
import org.sleuthkit.autopsy.centralrepository.datamodel.EamArtifactUtil;
|
import org.sleuthkit.autopsy.centralrepository.datamodel.EamArtifactUtil;
|
||||||
import org.sleuthkit.autopsy.centralrepository.datamodel.EamDbUtil;
|
import org.sleuthkit.autopsy.centralrepository.datamodel.EamDb;
|
||||||
import org.sleuthkit.autopsy.corecomponentinterfaces.ContextMenuActionsProvider;
|
import org.sleuthkit.autopsy.corecomponentinterfaces.ContextMenuActionsProvider;
|
||||||
import org.sleuthkit.datamodel.AbstractFile;
|
import org.sleuthkit.datamodel.AbstractFile;
|
||||||
|
|
||||||
@ -46,7 +46,7 @@ public class CentralRepoContextMenuActionsProvider implements ContextMenuActions
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (AbstractFile file : selectedFiles) {
|
for (AbstractFile file : selectedFiles) {
|
||||||
if (EamDbUtil.useCentralRepo() && EamArtifactUtil.isSupportedAbstractFileType(file) && file.isFile()) {
|
if (EamDb.isEnabled() && EamArtifactUtil.isSupportedAbstractFileType(file) && file.isFile()) {
|
||||||
AddEditCentralRepoCommentAction action = new AddEditCentralRepoCommentAction(file);
|
AddEditCentralRepoCommentAction action = new AddEditCentralRepoCommentAction(file);
|
||||||
if (action.getCorrelationAttribute() == null) {
|
if (action.getCorrelationAttribute() == null) {
|
||||||
action.setEnabled(false);
|
action.setEnabled(false);
|
||||||
|
@ -71,7 +71,6 @@ import org.sleuthkit.datamodel.ContentTag;
|
|||||||
import org.sleuthkit.datamodel.TskCoreException;
|
import org.sleuthkit.datamodel.TskCoreException;
|
||||||
import org.sleuthkit.datamodel.TskException;
|
import org.sleuthkit.datamodel.TskException;
|
||||||
import org.sleuthkit.autopsy.centralrepository.datamodel.EamDb;
|
import org.sleuthkit.autopsy.centralrepository.datamodel.EamDb;
|
||||||
import org.sleuthkit.autopsy.centralrepository.datamodel.EamDbUtil;
|
|
||||||
import org.sleuthkit.datamodel.SleuthkitCase;
|
import org.sleuthkit.datamodel.SleuthkitCase;
|
||||||
import org.sleuthkit.datamodel.TskData;
|
import org.sleuthkit.datamodel.TskData;
|
||||||
|
|
||||||
@ -891,7 +890,7 @@ public class DataContentViewerOtherCases extends JPanel implements DataContentVi
|
|||||||
private void rightClickPopupMenuPopupMenuWillBecomeVisible(javax.swing.event.PopupMenuEvent evt) {//GEN-FIRST:event_rightClickPopupMenuPopupMenuWillBecomeVisible
|
private void rightClickPopupMenuPopupMenuWillBecomeVisible(javax.swing.event.PopupMenuEvent evt) {//GEN-FIRST:event_rightClickPopupMenuPopupMenuWillBecomeVisible
|
||||||
boolean enableCentralRepoActions = false;
|
boolean enableCentralRepoActions = false;
|
||||||
|
|
||||||
if (EamDbUtil.useCentralRepo() && otherCasesTable.getSelectedRowCount() == 1) {
|
if (EamDb.isEnabled() && otherCasesTable.getSelectedRowCount() == 1) {
|
||||||
int rowIndex = otherCasesTable.getSelectedRow();
|
int rowIndex = otherCasesTable.getSelectedRow();
|
||||||
OtherOccurrenceNodeData selectedNode = (OtherOccurrenceNodeData) tableModel.getRow(rowIndex);
|
OtherOccurrenceNodeData selectedNode = (OtherOccurrenceNodeData) tableModel.getRow(rowIndex);
|
||||||
if (selectedNode instanceof OtherOccurrenceNodeInstanceData) {
|
if (selectedNode instanceof OtherOccurrenceNodeInstanceData) {
|
||||||
|
@ -40,6 +40,7 @@ import java.util.Set;
|
|||||||
import java.util.concurrent.ExecutionException;
|
import java.util.concurrent.ExecutionException;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
|
import org.openide.util.NbBundle.Messages;
|
||||||
import org.sleuthkit.autopsy.casemodule.Case;
|
import org.sleuthkit.autopsy.casemodule.Case;
|
||||||
import static org.sleuthkit.autopsy.centralrepository.datamodel.EamDbUtil.updateSchemaVersion;
|
import static org.sleuthkit.autopsy.centralrepository.datamodel.EamDbUtil.updateSchemaVersion;
|
||||||
import org.sleuthkit.autopsy.coreutils.Logger;
|
import org.sleuthkit.autopsy.coreutils.Logger;
|
||||||
@ -60,7 +61,7 @@ abstract class AbstractSqlEamDb implements EamDb {
|
|||||||
static final String SCHEMA_MINOR_VERSION_KEY = "SCHEMA_MINOR_VERSION";
|
static final String SCHEMA_MINOR_VERSION_KEY = "SCHEMA_MINOR_VERSION";
|
||||||
static final String CREATION_SCHEMA_MAJOR_VERSION_KEY = "CREATION_SCHEMA_MAJOR_VERSION";
|
static final String CREATION_SCHEMA_MAJOR_VERSION_KEY = "CREATION_SCHEMA_MAJOR_VERSION";
|
||||||
static final String CREATION_SCHEMA_MINOR_VERSION_KEY = "CREATION_SCHEMA_MINOR_VERSION";
|
static final String CREATION_SCHEMA_MINOR_VERSION_KEY = "CREATION_SCHEMA_MINOR_VERSION";
|
||||||
static final CaseDbSchemaVersionNumber CURRENT_DB_SCHEMA_VERSION = new CaseDbSchemaVersionNumber(1, 2);
|
static final CaseDbSchemaVersionNumber SOFTWARE_CR_DB_SCHEMA_VERSION = new CaseDbSchemaVersionNumber(1, 2);
|
||||||
|
|
||||||
protected final List<CorrelationAttributeInstance.Type> defaultCorrelationTypes;
|
protected final List<CorrelationAttributeInstance.Type> defaultCorrelationTypes;
|
||||||
|
|
||||||
@ -3170,8 +3171,9 @@ abstract class AbstractSqlEamDb implements EamDb {
|
|||||||
*
|
*
|
||||||
* @throws EamDbException
|
* @throws EamDbException
|
||||||
*/
|
*/
|
||||||
|
@Messages({"AbstractSqlEamDb.upgradeSchema.incompatible=The selected Central Repository is not compatible with the current version of the application, please upgrade the application if you wish to use this Central Repository."})
|
||||||
@Override
|
@Override
|
||||||
public void upgradeSchema() throws EamDbException, SQLException {
|
public void upgradeSchema() throws EamDbException, SQLException, IncompatibleCentralRepoException {
|
||||||
|
|
||||||
ResultSet resultSet = null;
|
ResultSet resultSet = null;
|
||||||
Statement statement = null;
|
Statement statement = null;
|
||||||
@ -3220,11 +3222,18 @@ abstract class AbstractSqlEamDb implements EamDb {
|
|||||||
* schema updates that may already have been done once.
|
* schema updates that may already have been done once.
|
||||||
*/
|
*/
|
||||||
CaseDbSchemaVersionNumber dbSchemaVersion = new CaseDbSchemaVersionNumber(majorVersion, minorVersion);
|
CaseDbSchemaVersionNumber dbSchemaVersion = new CaseDbSchemaVersionNumber(majorVersion, minorVersion);
|
||||||
if (dbSchemaVersion.equals(CURRENT_DB_SCHEMA_VERSION)) {
|
|
||||||
|
//compare the major versions for compatability
|
||||||
|
//we can not use the CaseDbSchemaVersionNumber.isCompatible method
|
||||||
|
//because it is specific to case db schema versions only supporting major versions greater than 1
|
||||||
|
if (SOFTWARE_CR_DB_SCHEMA_VERSION.getMajor() < dbSchemaVersion.getMajor()) {
|
||||||
|
throw new IncompatibleCentralRepoException(Bundle.AbstractSqlEamDb_upgradeSchema_incompatible());
|
||||||
|
}
|
||||||
|
if (dbSchemaVersion.equals(SOFTWARE_CR_DB_SCHEMA_VERSION)) {
|
||||||
logger.log(Level.INFO, "Central Repository is up to date");
|
logger.log(Level.INFO, "Central Repository is up to date");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (dbSchemaVersion.compareTo(CURRENT_DB_SCHEMA_VERSION) > 0) {
|
if (dbSchemaVersion.compareTo(SOFTWARE_CR_DB_SCHEMA_VERSION) > 0) {
|
||||||
logger.log(Level.INFO, "Central Repository is of newer version than software creates");
|
logger.log(Level.INFO, "Central Repository is of newer version than software creates");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -3386,8 +3395,8 @@ abstract class AbstractSqlEamDb implements EamDb {
|
|||||||
* column having a UNIQUE constraint. The name column could now
|
* column having a UNIQUE constraint. The name column could now
|
||||||
* be used as the primary key, but the essentially useless id
|
* be used as the primary key, but the essentially useless id
|
||||||
* column is retained for the sake of backwards compatibility.
|
* column is retained for the sake of backwards compatibility.
|
||||||
* Note that the creation schema version number is set to 0.0
|
* Note that the creation schema version number is set to 0.0 to
|
||||||
* to indicate that it is unknown.
|
* indicate that it is unknown.
|
||||||
*/
|
*/
|
||||||
String creationMajorVer;
|
String creationMajorVer;
|
||||||
resultSet = statement.executeQuery("SELECT value FROM db_info WHERE name = '" + AbstractSqlEamDb.CREATION_SCHEMA_MAJOR_VERSION_KEY + "'");
|
resultSet = statement.executeQuery("SELECT value FROM db_info WHERE name = '" + AbstractSqlEamDb.CREATION_SCHEMA_MAJOR_VERSION_KEY + "'");
|
||||||
@ -3417,7 +3426,7 @@ abstract class AbstractSqlEamDb implements EamDb {
|
|||||||
|
|
||||||
updateSchemaVersion(conn);
|
updateSchemaVersion(conn);
|
||||||
conn.commit();
|
conn.commit();
|
||||||
logger.log(Level.INFO, String.format("Central Repository schema updated to version %s", CURRENT_DB_SCHEMA_VERSION));
|
logger.log(Level.INFO, String.format("Central Repository schema updated to version %s", SOFTWARE_CR_DB_SCHEMA_VERSION));
|
||||||
|
|
||||||
} catch (SQLException | EamDbException ex) {
|
} catch (SQLException | EamDbException ex) {
|
||||||
try {
|
try {
|
||||||
@ -3425,7 +3434,7 @@ abstract class AbstractSqlEamDb implements EamDb {
|
|||||||
conn.rollback();
|
conn.rollback();
|
||||||
}
|
}
|
||||||
} catch (SQLException ex2) {
|
} catch (SQLException ex2) {
|
||||||
logger.log(Level.SEVERE, String.format("Central Repository rollback of failed schema update to %s failed", CURRENT_DB_SCHEMA_VERSION), ex2);
|
logger.log(Level.SEVERE, String.format("Central Repository rollback of failed schema update to %s failed", SOFTWARE_CR_DB_SCHEMA_VERSION), ex2);
|
||||||
}
|
}
|
||||||
throw ex;
|
throw ex;
|
||||||
} finally {
|
} finally {
|
||||||
|
@ -98,7 +98,7 @@ public class CorrelationDataSource implements Serializable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
CorrelationDataSource correlationDataSource = null;
|
CorrelationDataSource correlationDataSource = null;
|
||||||
boolean useCR = EamDbUtil.useCentralRepo();
|
boolean useCR = EamDb.isEnabled();
|
||||||
if (useCR) {
|
if (useCR) {
|
||||||
correlationDataSource = EamDb.getInstance().getDataSource(correlationCase, dataSource.getId());
|
correlationDataSource = EamDb.getInstance().getDataSource(correlationCase, dataSource.getId());
|
||||||
}
|
}
|
||||||
|
@ -41,7 +41,7 @@ public interface EamDb {
|
|||||||
static EamDb getInstance() throws EamDbException {
|
static EamDb getInstance() throws EamDbException {
|
||||||
|
|
||||||
EamDbPlatformEnum selectedPlatform = EamDbPlatformEnum.DISABLED;
|
EamDbPlatformEnum selectedPlatform = EamDbPlatformEnum.DISABLED;
|
||||||
if (EamDbUtil.useCentralRepo()) {
|
if (EamDbUtil.allowUseOfCentralRepository()) {
|
||||||
selectedPlatform = EamDbPlatformEnum.getSelectedPlatform();
|
selectedPlatform = EamDbPlatformEnum.getSelectedPlatform();
|
||||||
}
|
}
|
||||||
switch (selectedPlatform) {
|
switch (selectedPlatform) {
|
||||||
@ -92,7 +92,7 @@ public interface EamDb {
|
|||||||
* @return Is the database enabled
|
* @return Is the database enabled
|
||||||
*/
|
*/
|
||||||
static boolean isEnabled() {
|
static boolean isEnabled() {
|
||||||
return EamDbUtil.useCentralRepo()
|
return EamDbUtil.allowUseOfCentralRepository()
|
||||||
&& EamDbPlatformEnum.getSelectedPlatform() != EamDbPlatformEnum.DISABLED;
|
&& EamDbPlatformEnum.getSelectedPlatform() != EamDbPlatformEnum.DISABLED;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -710,7 +710,7 @@ public interface EamDb {
|
|||||||
*
|
*
|
||||||
* @throws EamDbException
|
* @throws EamDbException
|
||||||
*/
|
*/
|
||||||
public void upgradeSchema() throws EamDbException, SQLException;
|
public void upgradeSchema() throws EamDbException, SQLException, IncompatibleCentralRepoException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets an exclusive lock (if applicable). Will return the lock if
|
* Gets an exclusive lock (if applicable). Will return the lock if
|
||||||
|
@ -25,11 +25,12 @@ import java.sql.SQLException;
|
|||||||
import java.sql.Statement;
|
import java.sql.Statement;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
import static org.sleuthkit.autopsy.centralrepository.datamodel.AbstractSqlEamDb.CURRENT_DB_SCHEMA_VERSION;
|
import org.openide.util.NbBundle.Messages;
|
||||||
import org.sleuthkit.autopsy.coordinationservice.CoordinationService;
|
import org.sleuthkit.autopsy.coordinationservice.CoordinationService;
|
||||||
import org.sleuthkit.autopsy.coordinationservice.CoordinationService.CoordinationServiceException;
|
import org.sleuthkit.autopsy.coordinationservice.CoordinationService.CoordinationServiceException;
|
||||||
import org.sleuthkit.autopsy.coreutils.Logger;
|
import org.sleuthkit.autopsy.coreutils.Logger;
|
||||||
import org.sleuthkit.autopsy.coreutils.ModuleSettings;
|
import org.sleuthkit.autopsy.coreutils.ModuleSettings;
|
||||||
|
import static org.sleuthkit.autopsy.centralrepository.datamodel.AbstractSqlEamDb.SOFTWARE_CR_DB_SCHEMA_VERSION;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@ -134,8 +135,8 @@ public class EamDbUtil {
|
|||||||
*/
|
*/
|
||||||
static void updateSchemaVersion(Connection conn) throws SQLException {
|
static void updateSchemaVersion(Connection conn) throws SQLException {
|
||||||
try (Statement statement = conn.createStatement()) {
|
try (Statement statement = conn.createStatement()) {
|
||||||
statement.execute("UPDATE db_info SET value = '" + CURRENT_DB_SCHEMA_VERSION.getMajor() + "' WHERE name = '" + AbstractSqlEamDb.SCHEMA_MAJOR_VERSION_KEY + "'");
|
statement.execute("UPDATE db_info SET value = '" + SOFTWARE_CR_DB_SCHEMA_VERSION.getMajor() + "' WHERE name = '" + AbstractSqlEamDb.SCHEMA_MAJOR_VERSION_KEY + "'");
|
||||||
statement.execute("UPDATE db_info SET value = '" + CURRENT_DB_SCHEMA_VERSION.getMinor() + "' WHERE name = '" + AbstractSqlEamDb.SCHEMA_MINOR_VERSION_KEY + "'");
|
statement.execute("UPDATE db_info SET value = '" + SOFTWARE_CR_DB_SCHEMA_VERSION.getMinor() + "' WHERE name = '" + AbstractSqlEamDb.SCHEMA_MINOR_VERSION_KEY + "'");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -172,9 +173,10 @@ public class EamDbUtil {
|
|||||||
*
|
*
|
||||||
* @return true if the upgrade succeeds, false otherwise.
|
* @return true if the upgrade succeeds, false otherwise.
|
||||||
*/
|
*/
|
||||||
public static boolean upgradeDatabase() {
|
@Messages({"EamDbUtil.centralRepoUpgradeFailed.message=Failed to upgrade central repository. It has been disabled."})
|
||||||
|
public static void upgradeDatabase() throws EamDbException {
|
||||||
if (!EamDb.isEnabled()) {
|
if (!EamDb.isEnabled()) {
|
||||||
return true;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
CoordinationService.Lock lock = null;
|
CoordinationService.Lock lock = null;
|
||||||
@ -188,7 +190,7 @@ public class EamDbUtil {
|
|||||||
|
|
||||||
db.upgradeSchema();
|
db.upgradeSchema();
|
||||||
|
|
||||||
} catch (EamDbException | SQLException ex) {
|
} catch (EamDbException | SQLException | IncompatibleCentralRepoException ex) {
|
||||||
LOGGER.log(Level.SEVERE, "Error updating central repository", ex);
|
LOGGER.log(Level.SEVERE, "Error updating central repository", ex);
|
||||||
|
|
||||||
// Disable the central repo and clear the current settings.
|
// Disable the central repo and clear the current settings.
|
||||||
@ -197,13 +199,17 @@ public class EamDbUtil {
|
|||||||
EamDb.getInstance().shutdownConnections();
|
EamDb.getInstance().shutdownConnections();
|
||||||
}
|
}
|
||||||
} catch (EamDbException ex2) {
|
} catch (EamDbException ex2) {
|
||||||
LOGGER.log(Level.SEVERE, "Error shutting down central repo connection pool", ex);
|
LOGGER.log(Level.SEVERE, "Error shutting down central repo connection pool", ex2);
|
||||||
}
|
}
|
||||||
setUseCentralRepo(false);
|
setUseCentralRepo(false);
|
||||||
|
|
||||||
EamDbPlatformEnum.setSelectedPlatform(EamDbPlatformEnum.DISABLED.name());
|
EamDbPlatformEnum.setSelectedPlatform(EamDbPlatformEnum.DISABLED.name());
|
||||||
EamDbPlatformEnum.saveSelectedPlatform();
|
EamDbPlatformEnum.saveSelectedPlatform();
|
||||||
|
String messageForDialog = Bundle.EamDbUtil_centralRepoUpgradeFailed_message();
|
||||||
return false;
|
if (ex instanceof IncompatibleCentralRepoException) {
|
||||||
|
messageForDialog = ex.getMessage() + "\n\n" + messageForDialog;
|
||||||
|
}
|
||||||
|
throw new EamDbException(messageForDialog);
|
||||||
} finally {
|
} finally {
|
||||||
if (lock != null) {
|
if (lock != null) {
|
||||||
try {
|
try {
|
||||||
@ -213,7 +219,6 @@ public class EamDbUtil {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -268,12 +273,16 @@ public class EamDbUtil {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* If the Central Repos use has been enabled.
|
* If the option to use a central repository has been selected, does not
|
||||||
|
* indicate the central repository is configured for use simply that the
|
||||||
|
* checkbox allowing configuration is checked on the options panel.
|
||||||
*
|
*
|
||||||
* @return true if the Central Repo may be configured, false if it should
|
* @return true if the Central Repo may be configured, false if it should
|
||||||
* not be able to be
|
* not be able to be
|
||||||
*/
|
*/
|
||||||
public static boolean useCentralRepo() {
|
public static boolean allowUseOfCentralRepository() {
|
||||||
|
//In almost all situations EamDb.isEnabled() should be used instead of this method
|
||||||
|
//as EamDb.isEnabled() will call this method as well as checking that the selected type of central repository is not DISABLED
|
||||||
return Boolean.parseBoolean(ModuleSettings.getConfigSetting(CENTRAL_REPO_NAME, CENTRAL_REPO_USE_KEY));
|
return Boolean.parseBoolean(ModuleSettings.getConfigSetting(CENTRAL_REPO_NAME, CENTRAL_REPO_USE_KEY));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -0,0 +1,53 @@
|
|||||||
|
/*
|
||||||
|
*
|
||||||
|
* Autopsy Forensic Browser
|
||||||
|
*
|
||||||
|
* Copyright 2018 Basis Technology Corp.
|
||||||
|
* Contact: carrier <at> sleuthkit <dot> org
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
package org.sleuthkit.autopsy.centralrepository.datamodel;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Exception to denote that the Central Repo is not compatable with the current version of the software.
|
||||||
|
*/
|
||||||
|
public class IncompatibleCentralRepoException extends Exception {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Construct an exception with the given message.
|
||||||
|
* @param message error message
|
||||||
|
*/
|
||||||
|
public IncompatibleCentralRepoException(String message){
|
||||||
|
super(message);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Construct an exception with the given message and inner exception.
|
||||||
|
* @param message error message
|
||||||
|
* @param cause inner exception
|
||||||
|
*/
|
||||||
|
public IncompatibleCentralRepoException(String message, Throwable cause){
|
||||||
|
super(message, cause);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Construct an exception with the given inner exception.
|
||||||
|
* @param cause inner exception
|
||||||
|
*/
|
||||||
|
public IncompatibleCentralRepoException(Throwable cause){
|
||||||
|
super(cause);
|
||||||
|
}
|
||||||
|
}
|
@ -28,11 +28,11 @@ import java.util.List;
|
|||||||
import java.util.Properties;
|
import java.util.Properties;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
import static org.sleuthkit.autopsy.centralrepository.datamodel.AbstractSqlEamDb.CURRENT_DB_SCHEMA_VERSION;
|
|
||||||
import org.sleuthkit.autopsy.coreutils.Logger;
|
import org.sleuthkit.autopsy.coreutils.Logger;
|
||||||
import org.sleuthkit.autopsy.coreutils.ModuleSettings;
|
import org.sleuthkit.autopsy.coreutils.ModuleSettings;
|
||||||
import org.sleuthkit.autopsy.coreutils.TextConverter;
|
import org.sleuthkit.autopsy.coreutils.TextConverter;
|
||||||
import org.sleuthkit.autopsy.coreutils.TextConverterException;
|
import org.sleuthkit.autopsy.coreutils.TextConverterException;
|
||||||
|
import static org.sleuthkit.autopsy.centralrepository.datamodel.AbstractSqlEamDb.SOFTWARE_CR_DB_SCHEMA_VERSION;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Settings for the Postgres implementation of the Central Repository database
|
* Settings for the Postgres implementation of the Central Repository database
|
||||||
@ -437,10 +437,10 @@ public final class PostgresEamDbSettings {
|
|||||||
* name column could be the primary key.
|
* name column could be the primary key.
|
||||||
*/
|
*/
|
||||||
stmt.execute("CREATE TABLE db_info (id SERIAL, name TEXT UNIQUE NOT NULL, value TEXT NOT NULL)");
|
stmt.execute("CREATE TABLE db_info (id SERIAL, name TEXT UNIQUE NOT NULL, value TEXT NOT NULL)");
|
||||||
stmt.execute("INSERT INTO db_info (name, value) VALUES ('" + AbstractSqlEamDb.SCHEMA_MAJOR_VERSION_KEY + "', '" + CURRENT_DB_SCHEMA_VERSION.getMajor() + "')");
|
stmt.execute("INSERT INTO db_info (name, value) VALUES ('" + AbstractSqlEamDb.SCHEMA_MAJOR_VERSION_KEY + "', '" + SOFTWARE_CR_DB_SCHEMA_VERSION.getMajor() + "')");
|
||||||
stmt.execute("INSERT INTO db_info (name, value) VALUES ('" + AbstractSqlEamDb.SCHEMA_MINOR_VERSION_KEY + "', '" + CURRENT_DB_SCHEMA_VERSION.getMinor() + "')");
|
stmt.execute("INSERT INTO db_info (name, value) VALUES ('" + AbstractSqlEamDb.SCHEMA_MINOR_VERSION_KEY + "', '" + SOFTWARE_CR_DB_SCHEMA_VERSION.getMinor() + "')");
|
||||||
stmt.execute("INSERT INTO db_info (name, value) VALUES ('" + AbstractSqlEamDb.CREATION_SCHEMA_MAJOR_VERSION_KEY + "', '" + CURRENT_DB_SCHEMA_VERSION.getMajor() + "')");
|
stmt.execute("INSERT INTO db_info (name, value) VALUES ('" + AbstractSqlEamDb.CREATION_SCHEMA_MAJOR_VERSION_KEY + "', '" + SOFTWARE_CR_DB_SCHEMA_VERSION.getMajor() + "')");
|
||||||
stmt.execute("INSERT INTO db_info (name, value) VALUES ('" + AbstractSqlEamDb.CREATION_SCHEMA_MINOR_VERSION_KEY + "', '" + CURRENT_DB_SCHEMA_VERSION.getMinor() + "')");
|
stmt.execute("INSERT INTO db_info (name, value) VALUES ('" + AbstractSqlEamDb.CREATION_SCHEMA_MINOR_VERSION_KEY + "', '" + SOFTWARE_CR_DB_SCHEMA_VERSION.getMinor() + "')");
|
||||||
|
|
||||||
// Create a separate instance and reference table for each correlation type
|
// Create a separate instance and reference table for each correlation type
|
||||||
List<CorrelationAttributeInstance.Type> DEFAULT_CORRELATION_TYPES = CorrelationAttributeInstance.getDefaultCorrelationTypes();
|
List<CorrelationAttributeInstance.Type> DEFAULT_CORRELATION_TYPES = CorrelationAttributeInstance.getDefaultCorrelationTypes();
|
||||||
|
@ -1118,7 +1118,7 @@ final class SqliteEamDb extends AbstractSqlEamDb {
|
|||||||
* @throws EamDbException
|
* @throws EamDbException
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void upgradeSchema() throws EamDbException, SQLException {
|
public void upgradeSchema() throws EamDbException, SQLException, IncompatibleCentralRepoException {
|
||||||
try {
|
try {
|
||||||
acquireExclusiveLock();
|
acquireExclusiveLock();
|
||||||
super.upgradeSchema();
|
super.upgradeSchema();
|
||||||
|
@ -29,10 +29,10 @@ import java.sql.Statement;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
import static org.sleuthkit.autopsy.centralrepository.datamodel.AbstractSqlEamDb.CURRENT_DB_SCHEMA_VERSION;
|
|
||||||
import org.sleuthkit.autopsy.coreutils.Logger;
|
import org.sleuthkit.autopsy.coreutils.Logger;
|
||||||
import org.sleuthkit.autopsy.coreutils.ModuleSettings;
|
import org.sleuthkit.autopsy.coreutils.ModuleSettings;
|
||||||
import org.sleuthkit.autopsy.coreutils.PlatformUtil;
|
import org.sleuthkit.autopsy.coreutils.PlatformUtil;
|
||||||
|
import static org.sleuthkit.autopsy.centralrepository.datamodel.AbstractSqlEamDb.SOFTWARE_CR_DB_SCHEMA_VERSION;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Settings for the sqlite implementation of the Central Repository database
|
* Settings for the sqlite implementation of the Central Repository database
|
||||||
@ -386,10 +386,10 @@ public final class SqliteEamDbSettings {
|
|||||||
* name column could be the primary key.
|
* name column could be the primary key.
|
||||||
*/
|
*/
|
||||||
stmt.execute("CREATE TABLE db_info (id INTEGER PRIMARY KEY, name TEXT UNIQUE NOT NULL, value TEXT NOT NULL)");
|
stmt.execute("CREATE TABLE db_info (id INTEGER PRIMARY KEY, name TEXT UNIQUE NOT NULL, value TEXT NOT NULL)");
|
||||||
stmt.execute("INSERT INTO db_info (name, value) VALUES ('" + AbstractSqlEamDb.SCHEMA_MAJOR_VERSION_KEY + "', '" + CURRENT_DB_SCHEMA_VERSION.getMajor() + "')");
|
stmt.execute("INSERT INTO db_info (name, value) VALUES ('" + AbstractSqlEamDb.SCHEMA_MAJOR_VERSION_KEY + "', '" + SOFTWARE_CR_DB_SCHEMA_VERSION.getMajor() + "')");
|
||||||
stmt.execute("INSERT INTO db_info (name, value) VALUES ('" + AbstractSqlEamDb.SCHEMA_MINOR_VERSION_KEY + "', '" + CURRENT_DB_SCHEMA_VERSION.getMinor() + "')");
|
stmt.execute("INSERT INTO db_info (name, value) VALUES ('" + AbstractSqlEamDb.SCHEMA_MINOR_VERSION_KEY + "', '" + SOFTWARE_CR_DB_SCHEMA_VERSION.getMinor() + "')");
|
||||||
stmt.execute("INSERT INTO db_info (name, value) VALUES ('" + AbstractSqlEamDb.CREATION_SCHEMA_MAJOR_VERSION_KEY + "', '" + CURRENT_DB_SCHEMA_VERSION.getMajor() + "')");
|
stmt.execute("INSERT INTO db_info (name, value) VALUES ('" + AbstractSqlEamDb.CREATION_SCHEMA_MAJOR_VERSION_KEY + "', '" + SOFTWARE_CR_DB_SCHEMA_VERSION.getMajor() + "')");
|
||||||
stmt.execute("INSERT INTO db_info (name, value) VALUES ('" + AbstractSqlEamDb.CREATION_SCHEMA_MINOR_VERSION_KEY + "', '" + CURRENT_DB_SCHEMA_VERSION.getMinor() + "')");
|
stmt.execute("INSERT INTO db_info (name, value) VALUES ('" + AbstractSqlEamDb.CREATION_SCHEMA_MINOR_VERSION_KEY + "', '" + SOFTWARE_CR_DB_SCHEMA_VERSION.getMinor() + "')");
|
||||||
|
|
||||||
// Create a separate instance and reference table for each artifact type
|
// Create a separate instance and reference table for each artifact type
|
||||||
List<CorrelationAttributeInstance.Type> DEFAULT_CORRELATION_TYPES = CorrelationAttributeInstance.getDefaultCorrelationTypes();
|
List<CorrelationAttributeInstance.Type> DEFAULT_CORRELATION_TYPES = CorrelationAttributeInstance.getDefaultCorrelationTypes();
|
||||||
|
@ -23,6 +23,7 @@ import org.openide.modules.ModuleInstall;
|
|||||||
import org.openide.util.NbBundle;
|
import org.openide.util.NbBundle;
|
||||||
import org.openide.windows.WindowManager;
|
import org.openide.windows.WindowManager;
|
||||||
import org.sleuthkit.autopsy.casemodule.Case;
|
import org.sleuthkit.autopsy.casemodule.Case;
|
||||||
|
import org.sleuthkit.autopsy.centralrepository.datamodel.EamDbException;
|
||||||
import org.sleuthkit.autopsy.centralrepository.datamodel.EamDbUtil;
|
import org.sleuthkit.autopsy.centralrepository.datamodel.EamDbUtil;
|
||||||
import org.sleuthkit.autopsy.core.RuntimeProperties;
|
import org.sleuthkit.autopsy.core.RuntimeProperties;
|
||||||
import org.sleuthkit.autopsy.coreutils.Logger;
|
import org.sleuthkit.autopsy.coreutils.Logger;
|
||||||
@ -50,21 +51,20 @@ public class Installer extends ModuleInstall {
|
|||||||
super();
|
super();
|
||||||
}
|
}
|
||||||
|
|
||||||
@NbBundle.Messages({"Installer.centralRepoUpgradeFailed.title=Central repository upgrade failed",
|
@NbBundle.Messages({"Installer.centralRepoUpgradeFailed.title=Central repository upgrade failed"})
|
||||||
"Installer.centralRepoUpgradeFailed.message=Failed to upgrade central repository. It has been disabled."
|
|
||||||
})
|
|
||||||
@Override
|
@Override
|
||||||
public void restored() {
|
public void restored() {
|
||||||
Case.addPropertyChangeListener(pcl);
|
Case.addPropertyChangeListener(pcl);
|
||||||
ieListener.installListeners();
|
ieListener.installListeners();
|
||||||
|
|
||||||
// Perform the database upgrade and inform the user if it fails
|
// Perform the database upgrade and inform the user if it fails
|
||||||
if (!EamDbUtil.upgradeDatabase()) {
|
try {
|
||||||
|
EamDbUtil.upgradeDatabase();
|
||||||
|
} catch (EamDbException ex) {
|
||||||
if (RuntimeProperties.runningWithGUI()) {
|
if (RuntimeProperties.runningWithGUI()) {
|
||||||
WindowManager.getDefault().invokeWhenUIReady(() -> {
|
WindowManager.getDefault().invokeWhenUIReady(() -> {
|
||||||
JOptionPane.showMessageDialog(null,
|
JOptionPane.showMessageDialog(null,
|
||||||
NbBundle.getMessage(this.getClass(),
|
ex.getMessage(),
|
||||||
"Installer.centralRepoUpgradeFailed.message"),
|
|
||||||
NbBundle.getMessage(this.getClass(),
|
NbBundle.getMessage(this.getClass(),
|
||||||
"Installer.centralRepoUpgradeFailed.title"),
|
"Installer.centralRepoUpgradeFailed.title"),
|
||||||
JOptionPane.ERROR_MESSAGE);
|
JOptionPane.ERROR_MESSAGE);
|
||||||
|
@ -369,7 +369,7 @@ public class EamDbSettingsDialog extends JDialog {
|
|||||||
case POSTGRESQL:
|
case POSTGRESQL:
|
||||||
if (dbSettingsPostgres.verifyConnection()) {
|
if (dbSettingsPostgres.verifyConnection()) {
|
||||||
if (dbSettingsPostgres.verifyDatabaseExists()) {
|
if (dbSettingsPostgres.verifyDatabaseExists()) {
|
||||||
if( dbSettingsPostgres.verifyDatabaseSchema()) {
|
if (dbSettingsPostgres.verifyDatabaseSchema()) {
|
||||||
testingStatus = DatabaseTestResult.TESTEDOK;
|
testingStatus = DatabaseTestResult.TESTEDOK;
|
||||||
} else {
|
} else {
|
||||||
testingStatus = DatabaseTestResult.SCHEMA_INVALID;
|
testingStatus = DatabaseTestResult.SCHEMA_INVALID;
|
||||||
@ -382,8 +382,8 @@ public class EamDbSettingsDialog extends JDialog {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case SQLITE:
|
case SQLITE:
|
||||||
if (dbSettingsSqlite.dbFileExists()){
|
if (dbSettingsSqlite.dbFileExists()) {
|
||||||
if(dbSettingsSqlite.verifyConnection()) {
|
if (dbSettingsSqlite.verifyConnection()) {
|
||||||
if (dbSettingsSqlite.verifyDatabaseSchema()) {
|
if (dbSettingsSqlite.verifyDatabaseSchema()) {
|
||||||
testingStatus = DatabaseTestResult.TESTEDOK;
|
testingStatus = DatabaseTestResult.TESTEDOK;
|
||||||
} else {
|
} else {
|
||||||
@ -418,7 +418,7 @@ public class EamDbSettingsDialog extends JDialog {
|
|||||||
}
|
}
|
||||||
if (!result) {
|
if (!result) {
|
||||||
// Remove the incomplete database
|
// Remove the incomplete database
|
||||||
if(dbCreated){
|
if (dbCreated) {
|
||||||
dbSettingsPostgres.deleteDatabase();
|
dbSettingsPostgres.deleteDatabase();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -439,7 +439,7 @@ public class EamDbSettingsDialog extends JDialog {
|
|||||||
&& dbSettingsSqlite.insertDefaultDatabaseContent();
|
&& dbSettingsSqlite.insertDefaultDatabaseContent();
|
||||||
}
|
}
|
||||||
if (!result) {
|
if (!result) {
|
||||||
if(dbCreated){
|
if (dbCreated) {
|
||||||
dbSettingsSqlite.deleteDatabase();
|
dbSettingsSqlite.deleteDatabase();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -455,10 +455,13 @@ public class EamDbSettingsDialog extends JDialog {
|
|||||||
testingStatus = DatabaseTestResult.TESTEDOK;
|
testingStatus = DatabaseTestResult.TESTEDOK;
|
||||||
valid();
|
valid();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns if changes to the central repository configuration were successfully applied
|
* Returns if changes to the central repository configuration were
|
||||||
|
* successfully applied
|
||||||
*
|
*
|
||||||
* @return true if the database configuration was successfully changed false if it was not
|
* @return true if the database configuration was successfully changed false
|
||||||
|
* if it was not
|
||||||
*/
|
*/
|
||||||
boolean wasConfigurationChanged() {
|
boolean wasConfigurationChanged() {
|
||||||
return configurationChanged;
|
return configurationChanged;
|
||||||
@ -481,7 +484,7 @@ public class EamDbSettingsDialog extends JDialog {
|
|||||||
Bundle.EamDbSettingsDialog_okButton_databaseConnectionFailed_message(),
|
Bundle.EamDbSettingsDialog_okButton_databaseConnectionFailed_message(),
|
||||||
Bundle.EamDbSettingsDialog_okButton_databaseConnectionFailed_title(),
|
Bundle.EamDbSettingsDialog_okButton_databaseConnectionFailed_title(),
|
||||||
JOptionPane.WARNING_MESSAGE);
|
JOptionPane.WARNING_MESSAGE);
|
||||||
} else if (testingStatus == DatabaseTestResult.SCHEMA_INVALID){
|
} else if (testingStatus == DatabaseTestResult.SCHEMA_INVALID) {
|
||||||
// There's an existing database or file, but it's not in our format.
|
// There's an existing database or file, but it's not in our format.
|
||||||
JOptionPane.showMessageDialog(WindowManager.getDefault().getMainWindow(),
|
JOptionPane.showMessageDialog(WindowManager.getDefault().getMainWindow(),
|
||||||
Bundle.EamDbSettingsDialog_okButton_corruptDatabaseExists_message(),
|
Bundle.EamDbSettingsDialog_okButton_corruptDatabaseExists_message(),
|
||||||
@ -580,7 +583,7 @@ public class EamDbSettingsDialog extends JDialog {
|
|||||||
customizeComponents();
|
customizeComponents();
|
||||||
}//GEN-LAST:event_cbDatabaseTypeActionPerformed
|
}//GEN-LAST:event_cbDatabaseTypeActionPerformed
|
||||||
|
|
||||||
private void updateFullDbPath(){
|
private void updateFullDbPath() {
|
||||||
lbFullDbPath.setText(tfDatabasePath.getText() + File.separator + CENTRAL_REPO_DB_NAME + CENTRAL_REPO_SQLITE_EXT);
|
lbFullDbPath.setText(tfDatabasePath.getText() + File.separator + CENTRAL_REPO_DB_NAME + CENTRAL_REPO_SQLITE_EXT);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -117,7 +117,7 @@
|
|||||||
</Property>
|
</Property>
|
||||||
</Properties>
|
</Properties>
|
||||||
<Events>
|
<Events>
|
||||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="cbUseCentralRepoActionPerformed"/>
|
<EventHandler event="stateChanged" listener="javax.swing.event.ChangeListener" parameters="javax.swing.event.ChangeEvent" handler="useCentralRepoStateChanged"/>
|
||||||
</Events>
|
</Events>
|
||||||
</Component>
|
</Component>
|
||||||
<Container class="javax.swing.JPanel" name="pnDatabaseConfiguration">
|
<Container class="javax.swing.JPanel" name="pnDatabaseConfiguration">
|
||||||
|
@ -30,6 +30,7 @@ import org.netbeans.spi.options.OptionsPanelController;
|
|||||||
import org.openide.util.NbBundle;
|
import org.openide.util.NbBundle;
|
||||||
import org.openide.util.NbBundle.Messages;
|
import org.openide.util.NbBundle.Messages;
|
||||||
import org.sleuthkit.autopsy.casemodule.Case;
|
import org.sleuthkit.autopsy.casemodule.Case;
|
||||||
|
import org.sleuthkit.autopsy.centralrepository.datamodel.EamDbException;
|
||||||
import org.sleuthkit.autopsy.corecomponents.OptionsPanel;
|
import org.sleuthkit.autopsy.corecomponents.OptionsPanel;
|
||||||
import org.sleuthkit.autopsy.events.AutopsyEvent;
|
import org.sleuthkit.autopsy.events.AutopsyEvent;
|
||||||
import org.sleuthkit.autopsy.ingest.IngestManager;
|
import org.sleuthkit.autopsy.ingest.IngestManager;
|
||||||
@ -75,9 +76,7 @@ public final class GlobalSettingsPanel extends IngestModuleGlobalSettingsPanel i
|
|||||||
ingestStateUpdated(Case.isCaseOpen());
|
ingestStateUpdated(Case.isCaseOpen());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Messages({"GlobalSettingsPanel.updateFailed.title=Update failed",
|
@Messages({"GlobalSettingsPanel.updateFailed.title=Central repository upgrade failed"})
|
||||||
"GlobalSettingsPanel.updateFailed.message=Failed to update database. Central repository has been disabled."
|
|
||||||
})
|
|
||||||
private void updateDatabase() {
|
private void updateDatabase() {
|
||||||
|
|
||||||
if (EamDbPlatformEnum.getSelectedPlatform().equals(DISABLED)) {
|
if (EamDbPlatformEnum.getSelectedPlatform().equals(DISABLED)) {
|
||||||
@ -86,16 +85,15 @@ public final class GlobalSettingsPanel extends IngestModuleGlobalSettingsPanel i
|
|||||||
setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
|
setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
|
||||||
|
|
||||||
try {
|
try {
|
||||||
boolean result = EamDbUtil.upgradeDatabase();
|
EamDbUtil.upgradeDatabase();
|
||||||
|
setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
|
||||||
|
} catch (EamDbException ex) {
|
||||||
setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
|
setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
|
||||||
if (!result) {
|
|
||||||
JOptionPane.showMessageDialog(this,
|
JOptionPane.showMessageDialog(this,
|
||||||
NbBundle.getMessage(this.getClass(),
|
ex.getMessage(),
|
||||||
"GlobalSettingsPanel.updateFailed.message"),
|
|
||||||
NbBundle.getMessage(this.getClass(),
|
NbBundle.getMessage(this.getClass(),
|
||||||
"GlobalSettingsPanel.updateFailed.title"),
|
"GlobalSettingsPanel.updateFailed.title"),
|
||||||
JOptionPane.WARNING_MESSAGE);
|
JOptionPane.WARNING_MESSAGE);
|
||||||
}
|
|
||||||
} finally {
|
} finally {
|
||||||
setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
|
setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
|
||||||
}
|
}
|
||||||
@ -149,9 +147,9 @@ public final class GlobalSettingsPanel extends IngestModuleGlobalSettingsPanel i
|
|||||||
org.openide.awt.Mnemonics.setLocalizedText(lbCentralRepository, org.openide.util.NbBundle.getMessage(GlobalSettingsPanel.class, "GlobalSettingsPanel.lbCentralRepository.text")); // NOI18N
|
org.openide.awt.Mnemonics.setLocalizedText(lbCentralRepository, org.openide.util.NbBundle.getMessage(GlobalSettingsPanel.class, "GlobalSettingsPanel.lbCentralRepository.text")); // NOI18N
|
||||||
|
|
||||||
org.openide.awt.Mnemonics.setLocalizedText(cbUseCentralRepo, org.openide.util.NbBundle.getMessage(GlobalSettingsPanel.class, "GlobalSettingsPanel.cbUseCentralRepo.text")); // NOI18N
|
org.openide.awt.Mnemonics.setLocalizedText(cbUseCentralRepo, org.openide.util.NbBundle.getMessage(GlobalSettingsPanel.class, "GlobalSettingsPanel.cbUseCentralRepo.text")); // NOI18N
|
||||||
cbUseCentralRepo.addActionListener(new java.awt.event.ActionListener() {
|
cbUseCentralRepo.addChangeListener(new javax.swing.event.ChangeListener() {
|
||||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
public void stateChanged(javax.swing.event.ChangeEvent evt) {
|
||||||
cbUseCentralRepoActionPerformed(evt);
|
useCentralRepoStateChanged(evt);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -433,15 +431,6 @@ public final class GlobalSettingsPanel extends IngestModuleGlobalSettingsPanel i
|
|||||||
}
|
}
|
||||||
}//GEN-LAST:event_bnDbConfigureActionPerformed
|
}//GEN-LAST:event_bnDbConfigureActionPerformed
|
||||||
|
|
||||||
private void cbUseCentralRepoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cbUseCentralRepoActionPerformed
|
|
||||||
//if saved setting is disabled checkbox should be disabled already
|
|
||||||
store();
|
|
||||||
updateDatabase();
|
|
||||||
load();
|
|
||||||
this.ingestStateUpdated(Case.isCaseOpen());
|
|
||||||
firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
|
|
||||||
}//GEN-LAST:event_cbUseCentralRepoActionPerformed
|
|
||||||
|
|
||||||
private void manageOrganizationButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_manageOrganizationButtonActionPerformed
|
private void manageOrganizationButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_manageOrganizationButtonActionPerformed
|
||||||
store();
|
store();
|
||||||
ManageOrganizationsDialog manageOrganizationsDialog = new ManageOrganizationsDialog();
|
ManageOrganizationsDialog manageOrganizationsDialog = new ManageOrganizationsDialog();
|
||||||
@ -452,13 +441,22 @@ public final class GlobalSettingsPanel extends IngestModuleGlobalSettingsPanel i
|
|||||||
ManageCasesDialog.displayManageCasesDialog();
|
ManageCasesDialog.displayManageCasesDialog();
|
||||||
}//GEN-LAST:event_showCasesButtonActionPerformed
|
}//GEN-LAST:event_showCasesButtonActionPerformed
|
||||||
|
|
||||||
|
private void useCentralRepoStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_useCentralRepoStateChanged
|
||||||
|
//if saved setting is disabled checkbox should be disabled already
|
||||||
|
store();
|
||||||
|
updateDatabase();
|
||||||
|
load();
|
||||||
|
this.ingestStateUpdated(Case.isCaseOpen());
|
||||||
|
firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
|
||||||
|
}//GEN-LAST:event_useCentralRepoStateChanged
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Messages({"GlobalSettingsPanel.validationerrMsg.mustConfigure=Configure the database to enable this module."})
|
@Messages({"GlobalSettingsPanel.validationerrMsg.mustConfigure=Configure the database to enable this module."})
|
||||||
public void load() {
|
public void load() {
|
||||||
tbOops.setText("");
|
tbOops.setText("");
|
||||||
enableButtonSubComponents(false);
|
enableButtonSubComponents(false);
|
||||||
EamDbPlatformEnum selectedPlatform = EamDbPlatformEnum.getSelectedPlatform();
|
EamDbPlatformEnum selectedPlatform = EamDbPlatformEnum.getSelectedPlatform();
|
||||||
cbUseCentralRepo.setSelected(EamDbUtil.useCentralRepo()); // NON-NLS
|
cbUseCentralRepo.setSelected(EamDbUtil.allowUseOfCentralRepository()); // NON-NLS
|
||||||
switch (selectedPlatform) {
|
switch (selectedPlatform) {
|
||||||
case POSTGRESQL:
|
case POSTGRESQL:
|
||||||
PostgresEamDbSettings dbSettingsPg = new PostgresEamDbSettings();
|
PostgresEamDbSettings dbSettingsPg = new PostgresEamDbSettings();
|
||||||
|
@ -24,7 +24,6 @@ import java.util.logging.Level;
|
|||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.openide.nodes.Sheet;
|
import org.openide.nodes.Sheet;
|
||||||
import org.sleuthkit.autopsy.centralrepository.datamodel.CorrelationAttributeInstance;
|
import org.sleuthkit.autopsy.centralrepository.datamodel.CorrelationAttributeInstance;
|
||||||
import org.sleuthkit.autopsy.centralrepository.datamodel.EamDbUtil;
|
|
||||||
import org.sleuthkit.autopsy.core.UserPreferences;
|
import org.sleuthkit.autopsy.core.UserPreferences;
|
||||||
import org.sleuthkit.autopsy.coreutils.Logger;
|
import org.sleuthkit.autopsy.coreutils.Logger;
|
||||||
import org.sleuthkit.autopsy.datamodel.BlackboardArtifactNode;
|
import org.sleuthkit.autopsy.datamodel.BlackboardArtifactNode;
|
||||||
@ -74,12 +73,12 @@ final class RelationshipNode extends BlackboardArtifactNode {
|
|||||||
addScoreProperty(sheetSet, tags);
|
addScoreProperty(sheetSet, tags);
|
||||||
|
|
||||||
CorrelationAttributeInstance correlationAttribute = null;
|
CorrelationAttributeInstance correlationAttribute = null;
|
||||||
if (EamDbUtil.useCentralRepo() && UserPreferences.hideCentralRepoCommentsAndOccurrences()== false) {
|
if (UserPreferences.hideCentralRepoCommentsAndOccurrences()== false) {
|
||||||
correlationAttribute = getCorrelationAttributeInstance();
|
correlationAttribute = getCorrelationAttributeInstance();
|
||||||
}
|
}
|
||||||
addCommentProperty(sheetSet, tags, correlationAttribute);
|
addCommentProperty(sheetSet, tags, correlationAttribute);
|
||||||
|
|
||||||
if (EamDbUtil.useCentralRepo() && UserPreferences.hideCentralRepoCommentsAndOccurrences()== false) {
|
if (UserPreferences.hideCentralRepoCommentsAndOccurrences()== false) {
|
||||||
addCountProperty(sheetSet, correlationAttribute);
|
addCountProperty(sheetSet, correlationAttribute);
|
||||||
}
|
}
|
||||||
final BlackboardArtifact artifact = getArtifact();
|
final BlackboardArtifact artifact = getArtifact();
|
||||||
|
@ -38,16 +38,12 @@ import org.openide.nodes.Node;
|
|||||||
import org.openide.nodes.Sheet;
|
import org.openide.nodes.Sheet;
|
||||||
import org.openide.util.NbBundle;
|
import org.openide.util.NbBundle;
|
||||||
import org.openide.util.lookup.ServiceProvider;
|
import org.openide.util.lookup.ServiceProvider;
|
||||||
import org.sleuthkit.autopsy.centralrepository.datamodel.CorrelationAttributeInstance;
|
|
||||||
import org.sleuthkit.autopsy.centralrepository.datamodel.EamDbUtil;
|
|
||||||
import org.sleuthkit.autopsy.core.UserPreferences;
|
|
||||||
import org.sleuthkit.autopsy.corecomponentinterfaces.DataContentViewer;
|
import org.sleuthkit.autopsy.corecomponentinterfaces.DataContentViewer;
|
||||||
import org.sleuthkit.autopsy.corecomponents.DataResultPanel;
|
import org.sleuthkit.autopsy.corecomponents.DataResultPanel;
|
||||||
import org.sleuthkit.autopsy.corecomponents.TableFilterNode;
|
import org.sleuthkit.autopsy.corecomponents.TableFilterNode;
|
||||||
import org.sleuthkit.autopsy.coreutils.Logger;
|
import org.sleuthkit.autopsy.coreutils.Logger;
|
||||||
import org.sleuthkit.autopsy.datamodel.AbstractAbstractFileNode;
|
import org.sleuthkit.autopsy.datamodel.AbstractAbstractFileNode;
|
||||||
import org.sleuthkit.autopsy.datamodel.FileNode;
|
import org.sleuthkit.autopsy.datamodel.FileNode;
|
||||||
import org.sleuthkit.autopsy.datamodel.NodeProperty;
|
|
||||||
import org.sleuthkit.autopsy.directorytree.DataResultFilterNode;
|
import org.sleuthkit.autopsy.directorytree.DataResultFilterNode;
|
||||||
import org.sleuthkit.autopsy.directorytree.NewWindowViewAction;
|
import org.sleuthkit.autopsy.directorytree.NewWindowViewAction;
|
||||||
import org.sleuthkit.datamodel.AbstractFile;
|
import org.sleuthkit.datamodel.AbstractFile;
|
||||||
@ -71,7 +67,6 @@ import static org.sleuthkit.datamodel.BlackboardAttribute.ATTRIBUTE_TYPE.TSK_PHO
|
|||||||
import static org.sleuthkit.datamodel.BlackboardAttribute.ATTRIBUTE_TYPE.TSK_PHONE_NUMBER_TO;
|
import static org.sleuthkit.datamodel.BlackboardAttribute.ATTRIBUTE_TYPE.TSK_PHONE_NUMBER_TO;
|
||||||
import static org.sleuthkit.datamodel.BlackboardAttribute.ATTRIBUTE_TYPE.TSK_SUBJECT;
|
import static org.sleuthkit.datamodel.BlackboardAttribute.ATTRIBUTE_TYPE.TSK_SUBJECT;
|
||||||
import static org.sleuthkit.datamodel.BlackboardAttribute.ATTRIBUTE_TYPE.TSK_TEXT;
|
import static org.sleuthkit.datamodel.BlackboardAttribute.ATTRIBUTE_TYPE.TSK_TEXT;
|
||||||
import org.sleuthkit.datamodel.ContentTag;
|
|
||||||
import org.sleuthkit.datamodel.TskCoreException;
|
import org.sleuthkit.datamodel.TskCoreException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -26,7 +26,7 @@ import javax.swing.JPanel;
|
|||||||
import org.netbeans.spi.options.OptionsPanelController;
|
import org.netbeans.spi.options.OptionsPanelController;
|
||||||
import org.sleuthkit.autopsy.casemodule.Case;
|
import org.sleuthkit.autopsy.casemodule.Case;
|
||||||
import org.sleuthkit.autopsy.casemodule.CasePreferences;
|
import org.sleuthkit.autopsy.casemodule.CasePreferences;
|
||||||
import org.sleuthkit.autopsy.centralrepository.datamodel.EamDbUtil;
|
import org.sleuthkit.autopsy.centralrepository.datamodel.EamDb;
|
||||||
import org.sleuthkit.autopsy.core.UserPreferences;
|
import org.sleuthkit.autopsy.core.UserPreferences;
|
||||||
import org.sleuthkit.autopsy.coreutils.TimeZoneUtils;
|
import org.sleuthkit.autopsy.coreutils.TimeZoneUtils;
|
||||||
import org.sleuthkit.autopsy.directorytree.DirectoryTreeTopComponent;
|
import org.sleuthkit.autopsy.directorytree.DirectoryTreeTopComponent;
|
||||||
@ -75,8 +75,8 @@ public class ViewPreferencesPanel extends JPanel implements OptionsPanel {
|
|||||||
dataSourcesHideSlackCheckbox.setSelected(UserPreferences.hideSlackFilesInDataSourcesTree());
|
dataSourcesHideSlackCheckbox.setSelected(UserPreferences.hideSlackFilesInDataSourcesTree());
|
||||||
viewsHideSlackCheckbox.setSelected(UserPreferences.hideSlackFilesInViewsTree());
|
viewsHideSlackCheckbox.setSelected(UserPreferences.hideSlackFilesInViewsTree());
|
||||||
|
|
||||||
commentsOccurencesColumnsCheckbox.setEnabled(EamDbUtil.useCentralRepo());
|
commentsOccurencesColumnsCheckbox.setEnabled(EamDb.isEnabled());
|
||||||
commentsOccurencesColumnWrapAroundText.setEnabled(EamDbUtil.useCentralRepo());
|
commentsOccurencesColumnWrapAroundText.setEnabled(EamDb.isEnabled());
|
||||||
commentsOccurencesColumnsCheckbox.setSelected(UserPreferences.hideCentralRepoCommentsAndOccurrences());
|
commentsOccurencesColumnsCheckbox.setSelected(UserPreferences.hideCentralRepoCommentsAndOccurrences());
|
||||||
|
|
||||||
hideOtherUsersTagsCheckbox.setSelected(UserPreferences.showOnlyCurrentUserTags());
|
hideOtherUsersTagsCheckbox.setSelected(UserPreferences.showOnlyCurrentUserTags());
|
||||||
|
@ -48,7 +48,6 @@ import org.sleuthkit.autopsy.centralrepository.datamodel.CorrelationAttributeNor
|
|||||||
import org.sleuthkit.autopsy.centralrepository.datamodel.EamArtifactUtil;
|
import org.sleuthkit.autopsy.centralrepository.datamodel.EamArtifactUtil;
|
||||||
import org.sleuthkit.autopsy.centralrepository.datamodel.EamDb;
|
import org.sleuthkit.autopsy.centralrepository.datamodel.EamDb;
|
||||||
import org.sleuthkit.autopsy.centralrepository.datamodel.EamDbException;
|
import org.sleuthkit.autopsy.centralrepository.datamodel.EamDbException;
|
||||||
import org.sleuthkit.autopsy.centralrepository.datamodel.EamDbUtil;
|
|
||||||
import org.sleuthkit.autopsy.core.UserPreferences;
|
import org.sleuthkit.autopsy.core.UserPreferences;
|
||||||
import org.sleuthkit.autopsy.corecomponents.DataResultViewerTable;
|
import org.sleuthkit.autopsy.corecomponents.DataResultViewerTable;
|
||||||
import org.sleuthkit.autopsy.corecomponents.DataResultViewerTable.HasCommentStatus;
|
import org.sleuthkit.autopsy.corecomponents.DataResultViewerTable.HasCommentStatus;
|
||||||
@ -572,7 +571,7 @@ public abstract class AbstractAbstractFileNode<T extends AbstractFile> extends A
|
|||||||
|
|
||||||
CorrelationAttributeInstance getCorrelationAttributeInstance() {
|
CorrelationAttributeInstance getCorrelationAttributeInstance() {
|
||||||
CorrelationAttributeInstance attribute = null;
|
CorrelationAttributeInstance attribute = null;
|
||||||
if (EamDbUtil.useCentralRepo() && !UserPreferences.hideCentralRepoCommentsAndOccurrences()) {
|
if (EamDb.isEnabled() && !UserPreferences.hideCentralRepoCommentsAndOccurrences()) {
|
||||||
attribute = EamArtifactUtil.getInstanceFromContent(content);
|
attribute = EamArtifactUtil.getInstanceFromContent(content);
|
||||||
}
|
}
|
||||||
return attribute;
|
return attribute;
|
||||||
|
@ -54,7 +54,6 @@ import org.sleuthkit.autopsy.centralrepository.datamodel.CorrelationAttributeNor
|
|||||||
import org.sleuthkit.autopsy.centralrepository.datamodel.EamArtifactUtil;
|
import org.sleuthkit.autopsy.centralrepository.datamodel.EamArtifactUtil;
|
||||||
import org.sleuthkit.autopsy.centralrepository.datamodel.EamDb;
|
import org.sleuthkit.autopsy.centralrepository.datamodel.EamDb;
|
||||||
import org.sleuthkit.autopsy.centralrepository.datamodel.EamDbException;
|
import org.sleuthkit.autopsy.centralrepository.datamodel.EamDbException;
|
||||||
import org.sleuthkit.autopsy.centralrepository.datamodel.EamDbUtil;
|
|
||||||
import org.sleuthkit.autopsy.core.UserPreferences;
|
import org.sleuthkit.autopsy.core.UserPreferences;
|
||||||
import org.sleuthkit.autopsy.corecomponents.DataResultViewerTable.Score;
|
import org.sleuthkit.autopsy.corecomponents.DataResultViewerTable.Score;
|
||||||
import org.sleuthkit.autopsy.coreutils.Logger;
|
import org.sleuthkit.autopsy.coreutils.Logger;
|
||||||
@ -572,7 +571,7 @@ public class BlackboardArtifactNode extends AbstractContentNode<BlackboardArtifa
|
|||||||
|
|
||||||
protected final CorrelationAttributeInstance getCorrelationAttributeInstance() {
|
protected final CorrelationAttributeInstance getCorrelationAttributeInstance() {
|
||||||
CorrelationAttributeInstance correlationAttribute = null;
|
CorrelationAttributeInstance correlationAttribute = null;
|
||||||
if (EamDbUtil.useCentralRepo()) {
|
if (EamDb.isEnabled()) {
|
||||||
correlationAttribute = EamArtifactUtil.getInstanceFromContent(associated);
|
correlationAttribute = EamArtifactUtil.getInstanceFromContent(associated);
|
||||||
}
|
}
|
||||||
return correlationAttribute;
|
return correlationAttribute;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user