Sleuth Kit Java Bindings (JNI)
4.12.1
Java bindings for using The Sleuth Kit
|
Classes | |
interface | CaseDbAccessQueryCallback |
class | CaseDbPreparedStatement |
Public Member Functions | |
void | alterTable (final String tableName, final String alterSQL) throws TskCoreException |
void | alterTable (final String tableName, final String alterSQL, final CaseDbTransaction transaction) throws TskCoreException |
boolean | columnExists (String tableName, String columnName) throws TskCoreException |
boolean | columnExists (String tableName, String columnName, CaseDbTransaction transaction) throws TskCoreException |
void | createIndex (final String indexName, final String tableName, final String colsSQL) throws TskCoreException |
void | createTable (final String tableName, final String tableSchema) throws TskCoreException |
void | delete (final String tableName, final String sql) throws TskCoreException |
long | insert (final String tableName, final String sql) throws TskCoreException |
long | insert (final String tableName, final String sql, final CaseDbTransaction transaction) throws TskCoreException |
void | insert (CaseDbPreparedStatement preparedStatement) throws TskCoreException |
long | insertOrUpdate (final String tableName, final String sql) throws TskCoreException |
long | insertOrUpdate (final String tableName, final String sql, final CaseDbTransaction transaction) throws TskCoreException |
CaseDbPreparedStatement | prepareInsert (String tableName, String sql, CaseDbTransaction trans) throws TskCoreException |
CaseDbPreparedStatement | prepareSelect (String sql) throws TskCoreException |
CaseDbPreparedStatement | prepareSelect (String sql, CaseDbTransaction trans) throws TskCoreException |
CaseDbPreparedStatement | prepareUpdate (String tableName, String sql, CaseDbTransaction trans) throws TskCoreException |
void | select (final String sql, final CaseDbAccessQueryCallback queryCallback) throws TskCoreException |
void | select (CaseDbPreparedStatement preparedStatement, CaseDbAccessQueryCallback queryCallback) throws TskCoreException |
boolean | tableExists (String tableName) throws TskCoreException |
boolean | tableExists (String tableName, CaseDbTransaction transaction) throws TskCoreException |
void | update (CaseDbPreparedStatement preparedStatement) throws TskCoreException |
void | update (final String tableName, final String sql) throws TskCoreException |
void | update (final String tableName, final String sql, CaseDbTransaction transaction) throws TskCoreException |
This class provides modules with access to the case database to create custom tables/indexes and to query them.
Definition at line 42 of file CaseDbAccessManager.java.
void org.sleuthkit.datamodel.CaseDbAccessManager.alterTable | ( | final String | tableName, |
final String | alterSQL | ||
) | throws TskCoreException |
Alters a table with the specified name.
tableName | name of the table to alter |
alterSQL | SQL to alter the table |
TskCoreException |
Definition at line 276 of file CaseDbAccessManager.java.
References org.sleuthkit.datamodel.SleuthkitCase.beginTransaction(), org.sleuthkit.datamodel.SleuthkitCase.CaseDbTransaction.commit(), and org.sleuthkit.datamodel.SleuthkitCase.CaseDbTransaction.rollback().
void org.sleuthkit.datamodel.CaseDbAccessManager.alterTable | ( | final String | tableName, |
final String | alterSQL, | ||
final CaseDbTransaction | transaction | ||
) | throws TskCoreException |
Alters a table with the specified name.
tableName | name of the table to alter |
alterSQL | SQL to alter the table |
transaction | transaction |
TskCoreException |
Definition at line 303 of file CaseDbAccessManager.java.
References org.sleuthkit.datamodel.SleuthkitCase.getDatabaseType(), and org.sleuthkit.datamodel.TskData.DbType.SQLITE.
boolean org.sleuthkit.datamodel.CaseDbAccessManager.columnExists | ( | String | tableName, |
String | columnName | ||
) | throws TskCoreException |
Checks if a column exists in a table.
tableName | name of the table |
columnName | column name to check |
TskCoreException |
Definition at line 85 of file CaseDbAccessManager.java.
References org.sleuthkit.datamodel.SleuthkitCase.beginTransaction(), org.sleuthkit.datamodel.SleuthkitCase.CaseDbTransaction.commit(), and org.sleuthkit.datamodel.SleuthkitCase.CaseDbTransaction.rollback().
Referenced by org.sleuthkit.datamodel.CaseDbAccessManager.columnExists().
boolean org.sleuthkit.datamodel.CaseDbAccessManager.columnExists | ( | String | tableName, |
String | columnName, | ||
CaseDbTransaction | transaction | ||
) | throws TskCoreException |
Checks if a column exists in a table.
tableName | name of the table |
columnName | column name to check |
transaction | transaction |
TskCoreException |
Definition at line 117 of file CaseDbAccessManager.java.
References org.sleuthkit.datamodel.CaseDbAccessManager.columnExists(), org.sleuthkit.datamodel.SleuthkitCase.getDatabaseType(), and org.sleuthkit.datamodel.TskData.DbType.SQLITE.
void org.sleuthkit.datamodel.CaseDbAccessManager.createIndex | ( | final String | indexName, |
final String | tableName, | ||
final String | colsSQL | ||
) | throws TskCoreException |
Creates an index on the specified table, on specified column(s).
If the index already exists, it does nothing, and no error is generated.
It is recommended that clients of the API use module specific prefixes to prevent name collisions.
indexName | name of index to create |
tableName | name of table to create the index on |
colsSQL | - columns on which to index |
TskCoreException |
Definition at line 346 of file CaseDbAccessManager.java.
References org.sleuthkit.datamodel.SleuthkitCase.acquireSingleUserCaseWriteLock(), and org.sleuthkit.datamodel.SleuthkitCase.releaseSingleUserCaseWriteLock().
void org.sleuthkit.datamodel.CaseDbAccessManager.createTable | ( | final String | tableName, |
final String | tableSchema | ||
) | throws TskCoreException |
Creates a table with the specified name and schema.
If the table already exists, it does nothing, and no error is generated
It is recommended that clients of the API use module specific prefixes to prevent name collisions.
tableName | name of the table to create |
tableSchema | table schema |
TskCoreException |
Definition at line 251 of file CaseDbAccessManager.java.
References org.sleuthkit.datamodel.SleuthkitCase.acquireSingleUserCaseWriteLock(), and org.sleuthkit.datamodel.SleuthkitCase.releaseSingleUserCaseWriteLock().
void org.sleuthkit.datamodel.CaseDbAccessManager.delete | ( | final String | tableName, |
final String | sql | ||
) | throws TskCoreException |
Deletes a row in the specified table.
tableName | table from which to delete the row |
sql | - SQL string specifying the condition to identify the row to delete |
TskCoreException |
Definition at line 794 of file CaseDbAccessManager.java.
References org.sleuthkit.datamodel.SleuthkitCase.acquireSingleUserCaseWriteLock(), and org.sleuthkit.datamodel.SleuthkitCase.releaseSingleUserCaseWriteLock().
long org.sleuthkit.datamodel.CaseDbAccessManager.insert | ( | final String | tableName, |
final String | sql | ||
) | throws TskCoreException |
Inserts a row in the specified table.
tableName | - table to insert into. |
sql | - SQL string specifying column values. |
TskCoreException |
Definition at line 374 of file CaseDbAccessManager.java.
References org.sleuthkit.datamodel.SleuthkitCase.beginTransaction(), org.sleuthkit.datamodel.SleuthkitCase.CaseDbTransaction.commit(), and org.sleuthkit.datamodel.SleuthkitCase.CaseDbTransaction.rollback().
long org.sleuthkit.datamodel.CaseDbAccessManager.insert | ( | final String | tableName, |
final String | sql, | ||
final CaseDbTransaction | transaction | ||
) | throws TskCoreException |
Inserts a row in the specified table, as part of the specified transaction. If the primary key is duplicate, it does nothing.
Note: For PostGreSQL, the caller must include the ON CONFLICT DO NOTHING clause
Caller is responsible for committing the transaction.
tableName | - table to insert into. |
sql | - SQL string specifying column values. |
transaction | transaction in which the insert/update is done |
TskCoreException |
Definition at line 410 of file CaseDbAccessManager.java.
References org.sleuthkit.datamodel.SleuthkitCase.getDatabaseType(), and org.sleuthkit.datamodel.TskData.DbType.SQLITE.
void org.sleuthkit.datamodel.CaseDbAccessManager.insert | ( | CaseDbPreparedStatement | preparedStatement | ) | throws TskCoreException |
Performs a insert statement query with the given case prepared statement.
preparedStatement | The case prepared statement. |
TskCoreException |
Definition at line 773 of file CaseDbAccessManager.java.
long org.sleuthkit.datamodel.CaseDbAccessManager.insertOrUpdate | ( | final String | tableName, |
final String | sql | ||
) | throws TskCoreException |
Inserts a row in the specified table. If the primary key is duplicate, the existing row is updated.
Note: For PostGreSQL, the caller must include the ON CONFLICT UPDATE clause to handle duplicates
tableName | - table to insert into. |
sql | - SQL string specifying column values. |
TskCoreException |
Definition at line 457 of file CaseDbAccessManager.java.
References org.sleuthkit.datamodel.SleuthkitCase.beginTransaction(), org.sleuthkit.datamodel.SleuthkitCase.CaseDbTransaction.commit(), and org.sleuthkit.datamodel.SleuthkitCase.CaseDbTransaction.rollback().
long org.sleuthkit.datamodel.CaseDbAccessManager.insertOrUpdate | ( | final String | tableName, |
final String | sql, | ||
final CaseDbTransaction | transaction | ||
) | throws TskCoreException |
Inserts a row in the specified table, as part of the specified transaction. If the primary key is duplicate, the existing row is updated. Caller is responsible for committing the transaction.
Note: For PostGreSQL, the caller must include the ON CONFLICT UPDATE clause to handle duplicates
tableName | - table to insert into. |
sql | - SQL string specifying column values. |
transaction | transaction in which the insert/update is done |
TskCoreException |
Definition at line 493 of file CaseDbAccessManager.java.
References org.sleuthkit.datamodel.SleuthkitCase.getDatabaseType(), and org.sleuthkit.datamodel.TskData.DbType.SQLITE.
CaseDbPreparedStatement org.sleuthkit.datamodel.CaseDbAccessManager.prepareInsert | ( | String | tableName, |
String | sql, | ||
CaseDbTransaction | trans | ||
) | throws TskCoreException |
Creates a prepared statement object for the purposes of running an insert statement. The given SQL should not include the starting "INSERT INTO" or the name of the table.
For PostGreSQL, the caller must include the ON CONFLICT DO NOTHING clause
tableName | The name of the table being updated. |
sql | The insert statement without the starting "INSERT INTO (table name)" part. |
trans | The open transaction. |
TskCoreException |
Definition at line 748 of file CaseDbAccessManager.java.
References org.sleuthkit.datamodel.SleuthkitCase.getDatabaseType(), and org.sleuthkit.datamodel.TskData.DbType.SQLITE.
CaseDbPreparedStatement org.sleuthkit.datamodel.CaseDbAccessManager.prepareSelect | ( | String | sql | ) | throws TskCoreException |
Creates a prepared statement object for the purposes of running a select statement.
NOTE: Creating the CaseDbPreparedStatement opens a connection and acquires a read lock on the case database. For this reason, it is recommended to close the prepared statement as soon as it is no longer needed, through either a try-with-resources block or calling close(). Additionally, calling other methods that access or update the database should be avoided while the prepared statement is open to prevent possible deadlocks.
sql | The select statement without the starting select keyword. |
TskCoreException |
Definition at line 677 of file CaseDbAccessManager.java.
CaseDbPreparedStatement org.sleuthkit.datamodel.CaseDbAccessManager.prepareSelect | ( | String | sql, |
CaseDbTransaction | trans | ||
) | throws TskCoreException |
Creates a prepared statement object for the purposes of running a select statement. The given SQL should not include the starting "SELECT" keyword.
sql | The select statement without the starting select keyword. |
trans | The open transaction. |
TskCoreException |
Definition at line 698 of file CaseDbAccessManager.java.
CaseDbPreparedStatement org.sleuthkit.datamodel.CaseDbAccessManager.prepareUpdate | ( | String | tableName, |
String | sql, | ||
CaseDbTransaction | trans | ||
) | throws TskCoreException |
Creates a prepared statement object for the purposes of running an update statement. The given SQL should not include the starting "UPDATE" or the name of the table.
tableName | The name of the table being updated. |
sql | The insert statement without the starting "UPDATE (table name)" part. |
trans | The open transaction. |
TskCoreException |
Definition at line 539 of file CaseDbAccessManager.java.
void org.sleuthkit.datamodel.CaseDbAccessManager.select | ( | final String | sql, |
final CaseDbAccessQueryCallback | queryCallback | ||
) | throws TskCoreException |
Runs the specified SELECT query and then calls the specified callback with the result.
sql | SQL string specifying the columns to select, tables to select from and the WHERE clause. |
queryCallback | Callback object to process the result. |
TskCoreException |
Definition at line 637 of file CaseDbAccessManager.java.
References org.sleuthkit.datamodel.SleuthkitCase.acquireSingleUserCaseReadLock(), and org.sleuthkit.datamodel.SleuthkitCase.releaseSingleUserCaseReadLock().
void org.sleuthkit.datamodel.CaseDbAccessManager.select | ( | CaseDbPreparedStatement | preparedStatement, |
CaseDbAccessQueryCallback | queryCallback | ||
) | throws TskCoreException |
Performs a select statement query with the given case prepared statement.
preparedStatement | The case prepared statement. |
queryCallback | The callback to handle the result set. |
TskCoreException |
Definition at line 720 of file CaseDbAccessManager.java.
boolean org.sleuthkit.datamodel.CaseDbAccessManager.tableExists | ( | String | tableName | ) | throws TskCoreException |
Checks if a table exists in the case database.
tableName | name of the table to check |
TskCoreException |
Definition at line 167 of file CaseDbAccessManager.java.
References org.sleuthkit.datamodel.SleuthkitCase.beginTransaction(), org.sleuthkit.datamodel.SleuthkitCase.CaseDbTransaction.commit(), and org.sleuthkit.datamodel.SleuthkitCase.CaseDbTransaction.rollback().
Referenced by org.sleuthkit.datamodel.CaseDbAccessManager.tableExists().
boolean org.sleuthkit.datamodel.CaseDbAccessManager.tableExists | ( | String | tableName, |
CaseDbTransaction | transaction | ||
) | throws TskCoreException |
Checks if a table exists in the case database.
tableName | name of the table to check |
transaction | transaction |
TskCoreException |
Definition at line 198 of file CaseDbAccessManager.java.
References org.sleuthkit.datamodel.SleuthkitCase.getDatabaseType(), org.sleuthkit.datamodel.TskData.DbType.SQLITE, and org.sleuthkit.datamodel.CaseDbAccessManager.tableExists().
void org.sleuthkit.datamodel.CaseDbAccessManager.update | ( | CaseDbPreparedStatement | preparedStatement | ) | throws TskCoreException |
Performs an update statement query with the given case prepared statement.
preparedStatement | The case prepared statement. |
TskCoreException |
Definition at line 560 of file CaseDbAccessManager.java.
Referenced by org.sleuthkit.datamodel.CaseDbAccessManager.update().
void org.sleuthkit.datamodel.CaseDbAccessManager.update | ( | final String | tableName, |
final String | sql | ||
) | throws TskCoreException |
Updates row(s) in the specified table.
tableName | - table to insert into. |
sql | - SQL string specifying column values and conditions. |
TskCoreException |
Definition at line 581 of file CaseDbAccessManager.java.
References org.sleuthkit.datamodel.SleuthkitCase.beginTransaction(), org.sleuthkit.datamodel.SleuthkitCase.CaseDbTransaction.commit(), org.sleuthkit.datamodel.SleuthkitCase.CaseDbTransaction.rollback(), and org.sleuthkit.datamodel.CaseDbAccessManager.update().
void org.sleuthkit.datamodel.CaseDbAccessManager.update | ( | final String | tableName, |
final String | sql, | ||
CaseDbTransaction | transaction | ||
) | throws TskCoreException |
Updates row(s) in the specified table, as part of the specified transaction. Caller is responsible for committing the transaction.
tableName | - table to insert into. |
sql | - SQL string specifying column values and conditions. |
transaction | - transaction under which the update is performed. |
TskCoreException |
Definition at line 609 of file CaseDbAccessManager.java.
Copyright © 2011-2021 Brian Carrier. (carrier -at- sleuthkit -dot- org)
This work is licensed under a
Creative Commons Attribution-Share Alike 3.0 United States License.