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

Public Member Functions

 RdbmsCentralRepoFactory (CentralRepoPlatforms selectedPlatform, SqliteCentralRepoSettings repoSettings) throws CentralRepoException
 
 RdbmsCentralRepoFactory (CentralRepoPlatforms selectedPlatform, PostgresCentralRepoSettings repoSettings) throws CentralRepoException
 
boolean initializeDatabaseSchema ()
 
boolean insertDefaultDatabaseContent ()
 

Private Member Functions

Connection getEphemeralConnection ()
 

Static Private Member Functions

static String getCasesCaseUidIndexStatement ()
 
static String getCasesOrgIdIndexStatement ()
 
static String getCreateCasesTableStatement (CentralRepoPlatforms selectedPlatform)
 
static String getCreateCorrelationTypesTableStatement (CentralRepoPlatforms selectedPlatform)
 
static String getCreateDbInfoTableStatement (CentralRepoPlatforms selectedPlatform)
 
static String getCreateOrganizationsTableStatement (CentralRepoPlatforms selectedPlatform)
 
static String getCreateReferenceSetsTableStatement (CentralRepoPlatforms selectedPlatform)
 
static String getNumericPrimaryKeyClause (String pkName, CentralRepoPlatforms selectedPlatform)
 
static String getOnConflictDoNothingClause (CentralRepoPlatforms selectedPlatform)
 
static String getOnConflictIgnoreClause (CentralRepoPlatforms selectedPlatform)
 
static String getReferenceSetsOrgIdIndexTemplate ()
 
static String getReferenceTypesTableTemplate (CentralRepoPlatforms selectedPlatform)
 
static String getReferenceTypeValueIndexTemplate ()
 
static String getReferenceTypeValueKnownstatusIndexTemplate ()
 

Private Attributes

final PostgresCentralRepoSettings postgresCentralRepoSettings
 
final CentralRepoPlatforms selectedPlatform
 
final SqliteCentralRepoSettings sqliteCentralRepoSettings
 

Static Private Attributes

static final Logger LOGGER = Logger.getLogger(RdbmsCentralRepoFactory.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_OFF = "PRAGMA synchronous = OFF"
 

Detailed Description

Creates the CR schema and populates it with initial data.

Definition at line 38 of file RdbmsCentralRepoFactory.java.

Constructor & Destructor Documentation

org.sleuthkit.autopsy.centralrepository.datamodel.RdbmsCentralRepoFactory.RdbmsCentralRepoFactory ( CentralRepoPlatforms  selectedPlatform,
SqliteCentralRepoSettings  repoSettings 
) throws CentralRepoException
org.sleuthkit.autopsy.centralrepository.datamodel.RdbmsCentralRepoFactory.RdbmsCentralRepoFactory ( CentralRepoPlatforms  selectedPlatform,
PostgresCentralRepoSettings  repoSettings 
) throws CentralRepoException

Member Function Documentation

static String org.sleuthkit.autopsy.centralrepository.datamodel.RdbmsCentralRepoFactory.getCasesCaseUidIndexStatement ( )
staticprivate
static String org.sleuthkit.autopsy.centralrepository.datamodel.RdbmsCentralRepoFactory.getCasesOrgIdIndexStatement ( )
staticprivate
static String org.sleuthkit.autopsy.centralrepository.datamodel.RdbmsCentralRepoFactory.getCreateCasesTableStatement ( CentralRepoPlatforms  selectedPlatform)
staticprivate
static String org.sleuthkit.autopsy.centralrepository.datamodel.RdbmsCentralRepoFactory.getCreateCorrelationTypesTableStatement ( CentralRepoPlatforms  selectedPlatform)
staticprivate

Returns the SQL statement to create correlation_types table.

Parameters
selectedPlatformCR database platform.
Returns
SQL string to create correlation_types table.

Definition at line 354 of file RdbmsCentralRepoFactory.java.

References org.sleuthkit.autopsy.centralrepository.datamodel.RdbmsCentralRepoFactory.getNumericPrimaryKeyClause().

Referenced by org.sleuthkit.autopsy.centralrepository.datamodel.RdbmsCentralRepoFactory.initializeDatabaseSchema().

static String org.sleuthkit.autopsy.centralrepository.datamodel.RdbmsCentralRepoFactory.getCreateDbInfoTableStatement ( CentralRepoPlatforms  selectedPlatform)
staticprivate
static String org.sleuthkit.autopsy.centralrepository.datamodel.RdbmsCentralRepoFactory.getCreateOrganizationsTableStatement ( CentralRepoPlatforms  selectedPlatform)
staticprivate

Returns Create Table SQL for Organizations table.

Parameters
selectedPlatformCR database platform.
Returns
SQL string to create Organizations table.

Definition at line 235 of file RdbmsCentralRepoFactory.java.

References org.sleuthkit.autopsy.centralrepository.datamodel.RdbmsCentralRepoFactory.getNumericPrimaryKeyClause().

Referenced by org.sleuthkit.autopsy.centralrepository.datamodel.RdbmsCentralRepoFactory.initializeDatabaseSchema().

static String org.sleuthkit.autopsy.centralrepository.datamodel.RdbmsCentralRepoFactory.getCreateReferenceSetsTableStatement ( CentralRepoPlatforms  selectedPlatform)
staticprivate
Connection org.sleuthkit.autopsy.centralrepository.datamodel.RdbmsCentralRepoFactory.getEphemeralConnection ( )
private
static String org.sleuthkit.autopsy.centralrepository.datamodel.RdbmsCentralRepoFactory.getNumericPrimaryKeyClause ( String  pkName,
CentralRepoPlatforms  selectedPlatform 
)
staticprivate
static String org.sleuthkit.autopsy.centralrepository.datamodel.RdbmsCentralRepoFactory.getOnConflictDoNothingClause ( CentralRepoPlatforms  selectedPlatform)
staticprivate

Definition at line 578 of file RdbmsCentralRepoFactory.java.

static String org.sleuthkit.autopsy.centralrepository.datamodel.RdbmsCentralRepoFactory.getOnConflictIgnoreClause ( CentralRepoPlatforms  selectedPlatform)
staticprivate
static String org.sleuthkit.autopsy.centralrepository.datamodel.RdbmsCentralRepoFactory.getReferenceSetsOrgIdIndexTemplate ( )
staticprivate
static String org.sleuthkit.autopsy.centralrepository.datamodel.RdbmsCentralRepoFactory.getReferenceTypesTableTemplate ( CentralRepoPlatforms  selectedPlatform)
staticprivate

Returns the template string to create reference_TYPE tables.

Parameters
selectedPlatformCR database platform.
Returns
template string to create a reference_TYPE table.

Definition at line 317 of file RdbmsCentralRepoFactory.java.

References org.sleuthkit.autopsy.centralrepository.datamodel.RdbmsCentralRepoFactory.getNumericPrimaryKeyClause(), and org.sleuthkit.autopsy.centralrepository.datamodel.RdbmsCentralRepoFactory.getOnConflictIgnoreClause().

Referenced by org.sleuthkit.autopsy.centralrepository.datamodel.RdbmsCentralRepoFactory.initializeDatabaseSchema().

static String org.sleuthkit.autopsy.centralrepository.datamodel.RdbmsCentralRepoFactory.getReferenceTypeValueIndexTemplate ( )
staticprivate

Returns SQL string template to create a value index on ReferenceType table.

Definition at line 335 of file RdbmsCentralRepoFactory.java.

Referenced by org.sleuthkit.autopsy.centralrepository.datamodel.RdbmsCentralRepoFactory.initializeDatabaseSchema().

static String org.sleuthkit.autopsy.centralrepository.datamodel.RdbmsCentralRepoFactory.getReferenceTypeValueKnownstatusIndexTemplate ( )
staticprivate

Returns SQL string template to create a value/known_status index on ReferenceType table.

Definition at line 343 of file RdbmsCentralRepoFactory.java.

Referenced by org.sleuthkit.autopsy.centralrepository.datamodel.RdbmsCentralRepoFactory.initializeDatabaseSchema().

boolean org.sleuthkit.autopsy.centralrepository.datamodel.RdbmsCentralRepoFactory.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 83 of file RdbmsCentralRepoFactory.java.

References org.sleuthkit.autopsy.centralrepository.datamodel.CentralRepoDbUtil.correlationTypeToInstanceTableName(), org.sleuthkit.autopsy.centralrepository.datamodel.CentralRepoDbUtil.correlationTypeToReferenceTableName(), org.sleuthkit.autopsy.centralrepository.datamodel.CorrelationAttributeInstance.FILES_TYPE_ID, org.sleuthkit.autopsy.centralrepository.datamodel.RdbmsCentralRepoFactory.getCasesCaseUidIndexStatement(), org.sleuthkit.autopsy.centralrepository.datamodel.RdbmsCentralRepoFactory.getCasesOrgIdIndexStatement(), org.sleuthkit.autopsy.centralrepository.datamodel.RdbmsCentralRepoFactory.getCreateCasesTableStatement(), org.sleuthkit.autopsy.centralrepository.datamodel.RdbmsCentralRepoFactory.getCreateCorrelationTypesTableStatement(), org.sleuthkit.autopsy.centralrepository.datamodel.RdbmsCentralRepoFactory.getCreateDbInfoTableStatement(), org.sleuthkit.autopsy.centralrepository.datamodel.RdbmsCentralRepoFactory.getCreateOrganizationsTableStatement(), org.sleuthkit.autopsy.centralrepository.datamodel.RdbmsCentralRepoFactory.getCreateReferenceSetsTableStatement(), org.sleuthkit.autopsy.centralrepository.datamodel.CorrelationAttributeInstance.getDefaultCorrelationTypes(), org.sleuthkit.autopsy.centralrepository.datamodel.RdbmsCentralRepoFactory.getEphemeralConnection(), org.sleuthkit.autopsy.centralrepository.datamodel.RdbmsCentralRepoFactory.getReferenceSetsOrgIdIndexTemplate(), org.sleuthkit.autopsy.centralrepository.datamodel.RdbmsCentralRepoFactory.getReferenceTypesTableTemplate(), org.sleuthkit.autopsy.centralrepository.datamodel.RdbmsCentralRepoFactory.getReferenceTypeValueIndexTemplate(), org.sleuthkit.autopsy.centralrepository.datamodel.RdbmsCentralRepoFactory.getReferenceTypeValueKnownstatusIndexTemplate(), and org.sleuthkit.autopsy.centralrepository.datamodel.CentralRepoPlatforms.SQLITE.

Referenced by org.sleuthkit.autopsy.centralrepository.datamodel.CentralRepoDbManager.createDb().

boolean org.sleuthkit.autopsy.centralrepository.datamodel.RdbmsCentralRepoFactory.insertDefaultDatabaseContent ( )

Member Data Documentation

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

Definition at line 40 of file RdbmsCentralRepoFactory.java.

final PostgresCentralRepoSettings org.sleuthkit.autopsy.centralrepository.datamodel.RdbmsCentralRepoFactory.postgresCentralRepoSettings
private

Definition at line 45 of file RdbmsCentralRepoFactory.java.

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

Definition at line 52 of file RdbmsCentralRepoFactory.java.

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

Definition at line 54 of file RdbmsCentralRepoFactory.java.

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

Definition at line 50 of file RdbmsCentralRepoFactory.java.

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

Definition at line 53 of file RdbmsCentralRepoFactory.java.

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

Definition at line 51 of file RdbmsCentralRepoFactory.java.

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

Definition at line 49 of file RdbmsCentralRepoFactory.java.

final CentralRepoPlatforms org.sleuthkit.autopsy.centralrepository.datamodel.RdbmsCentralRepoFactory.selectedPlatform
private
final SqliteCentralRepoSettings org.sleuthkit.autopsy.centralrepository.datamodel.RdbmsCentralRepoFactory.sqliteCentralRepoSettings
private

Definition at line 44 of file RdbmsCentralRepoFactory.java.


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

Copyright © 2012-2021 Basis Technology. Generated on: Thu Jul 8 2021
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.