Autopsy  4.7.0
Graphical digital forensics platform for The Sleuth Kit and other tools.
Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
org.sleuthkit.autopsy.centralrepository.datamodel.SqliteEamDbSettings Class Reference

Public Member Functions

 SqliteEamDbSettings ()
 
boolean createDbDirectory ()
 
boolean dbDirectoryExists ()
 
boolean dbFileExists ()
 
boolean deleteDatabase ()
 
String getDbDirectory ()
 
String getDbName ()
 
String getFileNameWithPath ()
 
boolean initializeDatabaseSchema ()
 
boolean insertDefaultDatabaseContent ()
 
void loadSettings ()
 
void saveSettings ()
 
void setDbDirectory (String dbDirectory) throws EamDbException
 
void setDbName (String dbName) throws EamDbException
 
boolean verifyConnection ()
 
boolean verifyDatabaseSchema ()
 

Private Member Functions

Connection getEphemeralConnection ()
 

Private Attributes

int bulkThreshold
 
final String DB_NAMES_REGEX = "[a-z][a-z0-9_]*(\\.db)?"
 
String dbDirectory
 
String dbName
 
final String DEFAULT_DBDIRECTORY = PlatformUtil.getUserDirectory() + File.separator + "central_repository"
 
final String DEFAULT_DBNAME = "central_repository.db"
 
final String JDBC_BASE_URI = "jdbc:sqlite:"
 
final String JDBC_DRIVER = "org.sqlite.JDBC"
 
final String VALIDATION_QUERY = "SELECT count(*) from sqlite_master"
 

Static Private Attributes

static final Logger LOGGER = Logger.getLogger(SqliteEamDbSettings.class.getName())
 
static final String PRAGMA_ENCODING_UTF8 = "PRAGMA encoding = 'UTF-8'"
 
static final String PRAGMA_FOREIGN_KEYS_ON = "PRAGMA foreign_keys = ON"
 
static final String PRAGMA_JOURNAL_WAL = "PRAGMA journal_mode = WAL"
 
static final String PRAGMA_PAGE_SIZE_4096 = "PRAGMA page_size = 4096"
 
static final String PRAGMA_READ_UNCOMMITTED_TRUE = "PRAGMA read_uncommitted = True"
 
static final String PRAGMA_SYNC_NORMAL = "PRAGMA synchronous = NORMAL"
 
static final String PRAGMA_SYNC_OFF = "PRAGMA synchronous = OFF"
 

Detailed Description

Settings for the sqlite implementation of the Central Repository database

NOTE: This is public scope because the options panel calls it directly to set/get

Definition at line 41 of file SqliteEamDbSettings.java.

Constructor & Destructor Documentation

org.sleuthkit.autopsy.centralrepository.datamodel.SqliteEamDbSettings.SqliteEamDbSettings ( )

Member Function Documentation

boolean org.sleuthkit.autopsy.centralrepository.datamodel.SqliteEamDbSettings.createDbDirectory ( )
boolean org.sleuthkit.autopsy.centralrepository.datamodel.SqliteEamDbSettings.dbDirectoryExists ( )
boolean org.sleuthkit.autopsy.centralrepository.datamodel.SqliteEamDbSettings.dbFileExists ( )
boolean org.sleuthkit.autopsy.centralrepository.datamodel.SqliteEamDbSettings.deleteDatabase ( )
String org.sleuthkit.autopsy.centralrepository.datamodel.SqliteEamDbSettings.getDbDirectory ( )
String org.sleuthkit.autopsy.centralrepository.datamodel.SqliteEamDbSettings.getDbName ( )
Connection org.sleuthkit.autopsy.centralrepository.datamodel.SqliteEamDbSettings.getEphemeralConnection ( )
private
String org.sleuthkit.autopsy.centralrepository.datamodel.SqliteEamDbSettings.getFileNameWithPath ( )
boolean org.sleuthkit.autopsy.centralrepository.datamodel.SqliteEamDbSettings.initializeDatabaseSchema ( )

Initialize the database schema.

Requires valid connectionPool.

This method is called from within connect(), so we cannot call connect() to get a connection. This method is called after setupConnectionPool(), so it is safe to assume that a valid connectionPool exists. The implementation of connect() is synchronized, so we can safely use the connectionPool object directly.

Definition at line 244 of file SqliteEamDbSettings.java.

References org.sleuthkit.autopsy.centralrepository.datamodel.EamDbUtil.closeConnection(), org.sleuthkit.autopsy.centralrepository.datamodel.EamDbUtil.correlationTypeToInstanceTableName(), org.sleuthkit.autopsy.centralrepository.datamodel.EamDbUtil.correlationTypeToReferenceTableName(), org.sleuthkit.autopsy.centralrepository.datamodel.CorrelationAttribute.FILES_TYPE_ID, org.sleuthkit.autopsy.centralrepository.datamodel.CorrelationAttribute.getDefaultCorrelationTypes(), and org.sleuthkit.autopsy.centralrepository.datamodel.SqliteEamDbSettings.getEphemeralConnection().

Referenced by org.sleuthkit.autopsy.centralrepository.optionspanel.EamDbSettingsDialog.createDb().

boolean org.sleuthkit.autopsy.centralrepository.datamodel.SqliteEamDbSettings.insertDefaultDatabaseContent ( )
void org.sleuthkit.autopsy.centralrepository.datamodel.SqliteEamDbSettings.loadSettings ( )
void org.sleuthkit.autopsy.centralrepository.datamodel.SqliteEamDbSettings.saveSettings ( )
void org.sleuthkit.autopsy.centralrepository.datamodel.SqliteEamDbSettings.setDbDirectory ( String  dbDirectory) throws EamDbException

Path for directory to hold the sqlite database.

User must have WRITE permission to this directory.

Parameters
dbDirectorythe dbDirectory to set

Definition at line 509 of file SqliteEamDbSettings.java.

References org.sleuthkit.autopsy.centralrepository.datamodel.SqliteEamDbSettings.dbDirectory.

Referenced by org.sleuthkit.autopsy.centralrepository.optionspanel.EamDbSettingsDialog.databaseSettingsAreValid().

void org.sleuthkit.autopsy.centralrepository.datamodel.SqliteEamDbSettings.setDbName ( String  dbName) throws EamDbException
boolean org.sleuthkit.autopsy.centralrepository.datamodel.SqliteEamDbSettings.verifyConnection ( )
boolean org.sleuthkit.autopsy.centralrepository.datamodel.SqliteEamDbSettings.verifyDatabaseSchema ( )

Member Data Documentation

int org.sleuthkit.autopsy.centralrepository.datamodel.SqliteEamDbSettings.bulkThreshold
private

Definition at line 59 of file SqliteEamDbSettings.java.

final String org.sleuthkit.autopsy.centralrepository.datamodel.SqliteEamDbSettings.DB_NAMES_REGEX = "[a-z][a-z0-9_]*(\\.db)?"
private

Definition at line 56 of file SqliteEamDbSettings.java.

String org.sleuthkit.autopsy.centralrepository.datamodel.SqliteEamDbSettings.dbDirectory
private
String org.sleuthkit.autopsy.centralrepository.datamodel.SqliteEamDbSettings.dbName
private
final String org.sleuthkit.autopsy.centralrepository.datamodel.SqliteEamDbSettings.DEFAULT_DBDIRECTORY = PlatformUtil.getUserDirectory() + File.separator + "central_repository"
private
final String org.sleuthkit.autopsy.centralrepository.datamodel.SqliteEamDbSettings.DEFAULT_DBNAME = "central_repository.db"
private
final String org.sleuthkit.autopsy.centralrepository.datamodel.SqliteEamDbSettings.JDBC_BASE_URI = "jdbc:sqlite:"
private

Definition at line 47 of file SqliteEamDbSettings.java.

final String org.sleuthkit.autopsy.centralrepository.datamodel.SqliteEamDbSettings.JDBC_DRIVER = "org.sqlite.JDBC"
private

Definition at line 46 of file SqliteEamDbSettings.java.

final Logger org.sleuthkit.autopsy.centralrepository.datamodel.SqliteEamDbSettings.LOGGER = Logger.getLogger(SqliteEamDbSettings.class.getName())
staticprivate

Definition at line 43 of file SqliteEamDbSettings.java.

final String org.sleuthkit.autopsy.centralrepository.datamodel.SqliteEamDbSettings.PRAGMA_ENCODING_UTF8 = "PRAGMA encoding = 'UTF-8'"
staticprivate

Definition at line 53 of file SqliteEamDbSettings.java.

final String org.sleuthkit.autopsy.centralrepository.datamodel.SqliteEamDbSettings.PRAGMA_FOREIGN_KEYS_ON = "PRAGMA foreign_keys = ON"
staticprivate

Definition at line 55 of file SqliteEamDbSettings.java.

final String org.sleuthkit.autopsy.centralrepository.datamodel.SqliteEamDbSettings.PRAGMA_JOURNAL_WAL = "PRAGMA journal_mode = WAL"
staticprivate

Definition at line 51 of file SqliteEamDbSettings.java.

final String org.sleuthkit.autopsy.centralrepository.datamodel.SqliteEamDbSettings.PRAGMA_PAGE_SIZE_4096 = "PRAGMA page_size = 4096"
staticprivate

Definition at line 54 of file SqliteEamDbSettings.java.

final String org.sleuthkit.autopsy.centralrepository.datamodel.SqliteEamDbSettings.PRAGMA_READ_UNCOMMITTED_TRUE = "PRAGMA read_uncommitted = True"
staticprivate

Definition at line 52 of file SqliteEamDbSettings.java.

final String org.sleuthkit.autopsy.centralrepository.datamodel.SqliteEamDbSettings.PRAGMA_SYNC_NORMAL = "PRAGMA synchronous = NORMAL"
staticprivate

Definition at line 50 of file SqliteEamDbSettings.java.

final String org.sleuthkit.autopsy.centralrepository.datamodel.SqliteEamDbSettings.PRAGMA_SYNC_OFF = "PRAGMA synchronous = OFF"
staticprivate

Definition at line 49 of file SqliteEamDbSettings.java.

final String org.sleuthkit.autopsy.centralrepository.datamodel.SqliteEamDbSettings.VALIDATION_QUERY = "SELECT count(*) from sqlite_master"
private

Definition at line 48 of file SqliteEamDbSettings.java.


The documentation for this class was generated from the following file:

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