Skip to content
Snippets Groups Projects
Commit 0c8b8a85 authored by Richard Cordovano's avatar Richard Cordovano
Browse files

Update CommunicationsManager use of deprecated SleuthkitCase methods

parent d6b0aa5f
No related branches found
No related tags found
No related merge requests found
......@@ -204,7 +204,7 @@ public Account.Type addAccountType(String accountTypeName, String displayName) t
}
CaseDbConnection connection = db.getConnection();
db.acquireExclusiveLock();
db.acquireSingleUserCaseWriteLock();
Statement s = null;
ResultSet rs = null;
try {
......@@ -244,7 +244,7 @@ public Account.Type addAccountType(String accountTypeName, String displayName) t
closeResultSet(rs);
closeStatement(s);
connection.close();
db.releaseExclusiveLock();
db.releaseSingleUserCaseWriteLock();
}
}
......@@ -290,7 +290,7 @@ public AccountFileInstance createAccountFileInstance(Account.Type accountType, S
public Account getAccount(Account.Type accountType, String accountUniqueID) throws TskCoreException {
Account account = null;
CaseDbConnection connection = db.getConnection();
db.acquireSharedLock();
db.acquireSingleUserCaseReadLock();
Statement s = null;
ResultSet rs = null;
try {
......@@ -308,7 +308,7 @@ public Account getAccount(Account.Type accountType, String accountUniqueID) thro
closeResultSet(rs);
closeStatement(s);
connection.close();
db.releaseSharedLock();
db.releaseSingleUserCaseReadLock();
}
return account;
......@@ -403,7 +403,7 @@ private Account getOrCreateAccount(Account.Type accountType, String accountUniqu
if (null == account) {
CaseDbConnection connection = db.getConnection();
db.acquireExclusiveLock();
db.acquireSingleUserCaseWriteLock();
Statement s = null;
ResultSet rs = null;
try {
......@@ -420,7 +420,7 @@ private Account getOrCreateAccount(Account.Type accountType, String accountUniqu
closeResultSet(rs);
closeStatement(s);
connection.close();
db.releaseExclusiveLock();
db.releaseSingleUserCaseWriteLock();
}
}
......@@ -473,7 +473,7 @@ BlackboardArtifact getOrCreateAccountFileInstanceArtifact(BlackboardArtifact.ART
private BlackboardArtifact getAccountFileInstanceArtifact(BlackboardArtifact.ARTIFACT_TYPE artifactType, Account.Type accountType, String accountUniqueID, Content sourceObj) throws TskCoreException {
BlackboardArtifact accountArtifact = null;
CaseDbConnection connection = db.getConnection();
db.acquireSharedLock();
db.acquireSingleUserCaseReadLock();
Statement s = null;
ResultSet rs = null;
......@@ -511,7 +511,7 @@ private BlackboardArtifact getAccountFileInstanceArtifact(BlackboardArtifact.ART
closeResultSet(rs);
closeStatement(s);
connection.close();
db.releaseSharedLock();
db.releaseSingleUserCaseReadLock();
}
return accountArtifact;
......@@ -519,7 +519,7 @@ private BlackboardArtifact getAccountFileInstanceArtifact(BlackboardArtifact.ART
private void addAccountFileInstanceMapping(long accountId, long accountInstanceId) throws TskCoreException {
CaseDbConnection connection = db.getConnection();
db.acquireExclusiveLock();
db.acquireSingleUserCaseWriteLock();
Statement s = null;
ResultSet rs = null;
......@@ -536,7 +536,7 @@ private void addAccountFileInstanceMapping(long accountId, long accountInstanceI
closeResultSet(rs);
closeStatement(s);
connection.close();
db.releaseExclusiveLock();
db.releaseSingleUserCaseWriteLock();
}
}
......@@ -555,7 +555,7 @@ public Account.Type getAccountType(String accountTypeName) throws TskCoreExcepti
return this.typeNameToAccountTypeMap.get(accountTypeName);
}
CaseDbConnection connection = db.getConnection();
db.acquireSharedLock();
db.acquireSingleUserCaseReadLock();
Statement s = null;
ResultSet rs = null;
......@@ -575,7 +575,7 @@ public Account.Type getAccountType(String accountTypeName) throws TskCoreExcepti
closeResultSet(rs);
closeStatement(s);
connection.close();
db.releaseSharedLock();
db.releaseSingleUserCaseReadLock();
}
}
......@@ -593,7 +593,7 @@ public Account.Type getAccountType(String accountTypeName) throws TskCoreExcepti
private Account getAccount(long account_id) throws TskCoreException {
Account account = null;
CaseDbConnection connection = db.getConnection();
db.acquireSharedLock();
db.acquireSingleUserCaseReadLock();
Statement s = null;
ResultSet rs = null;
......@@ -618,7 +618,7 @@ private Account getAccount(long account_id) throws TskCoreException {
closeResultSet(rs);
closeStatement(s);
connection.close();
db.releaseSharedLock();
db.releaseSingleUserCaseReadLock();
}
return account;
......@@ -641,7 +641,7 @@ private Account getAccount(long account_id) throws TskCoreException {
*/
private void addAccountsRelationship(long account1_id, long account2_id, long relationship_source_obj_id, long dateTime, int relationship_type, long data_source_obj_id) throws TskCoreException {
CaseDbConnection connection = db.getConnection();
db.acquireExclusiveLock();
db.acquireSingleUserCaseWriteLock();
Statement s = null;
ResultSet rs = null;
......@@ -658,7 +658,7 @@ private void addAccountsRelationship(long account1_id, long account2_id, long re
closeResultSet(rs);
closeStatement(s);
connection.close();
db.releaseExclusiveLock();
db.releaseSingleUserCaseWriteLock();
}
}
......@@ -676,7 +676,7 @@ private void addAccountsRelationship(long account1_id, long account2_id, long re
*/
public List<AccountDeviceInstance> getAccountDeviceInstancesWithCommunications(CommunicationsFilter filter) throws TskCoreException {
CaseDbConnection connection = db.getConnection();
db.acquireSharedLock();
db.acquireSingleUserCaseReadLock();
Statement s = null;
ResultSet rs = null;
......@@ -761,7 +761,7 @@ public List<AccountDeviceInstance> getAccountDeviceInstancesWithCommunications(C
closeResultSet(rs);
closeStatement(s);
connection.close();
db.releaseSharedLock();
db.releaseSingleUserCaseReadLock();
}
}
......@@ -788,7 +788,7 @@ public long getCommunicationsCount(AccountDeviceInstance accountDeviceInstance,
String datasource_obj_ids_list = StringUtils.buildCSVString(ds_ids);
CaseDbConnection connection = db.getConnection();
db.acquireSharedLock();
db.acquireSingleUserCaseReadLock();
Statement s = null;
ResultSet rs = null;
......@@ -836,7 +836,7 @@ public long getCommunicationsCount(AccountDeviceInstance accountDeviceInstance,
closeResultSet(rs);
closeStatement(s);
connection.close();
db.releaseSharedLock();
db.releaseSingleUserCaseReadLock();
}
}
......@@ -889,7 +889,7 @@ public Set<BlackboardArtifact> getCommunications(Set<AccountDeviceInstance> acco
}
CaseDbConnection connection = db.getConnection();
db.acquireSharedLock();
db.acquireSingleUserCaseReadLock();
Statement s = null;
ResultSet rs = null;
......@@ -948,7 +948,7 @@ public Set<BlackboardArtifact> getCommunications(Set<AccountDeviceInstance> acco
closeResultSet(rs);
closeStatement(s);
connection.close();
db.releaseSharedLock();
db.releaseSingleUserCaseReadLock();
}
}
......@@ -1133,7 +1133,7 @@ public long getSecond() {
// List<Long> getAccountInstanceIds(long account_id) throws TskCoreException {
// ArrayList<Long> accountInstanceIDs = new ArrayList<Long>();
// CaseDbConnection connection = db.getConnection();
// db.acquireSharedLock();
// db.acquireSingleUserCaseReadLock();
// Statement s = null;
// ResultSet rs = null;
//
......@@ -1150,7 +1150,7 @@ public long getSecond() {
// closeResultSet(rs);
// closeStatement(s);
// connection.close();
// db.releaseSharedLock();
// db.releaseSingleUserCaseReadLock();
// }
// }
// /**
......@@ -1165,7 +1165,7 @@ public long getSecond() {
// String query = "SELECT DISTINCT value_text FROM blackboard_attributes "
// + "WHERE attribute_type_id = " + BlackboardAttribute.ATTRIBUTE_TYPE.TSK_ACCOUNT_TYPE.getTypeID();
// CaseDbConnection connection = db.getConnection();
// db.acquireSharedLock();
// db.acquireSingleUserCaseReadLock();
// Statement s = null;
// ResultSet rs = null;
//
......@@ -1185,7 +1185,7 @@ public long getSecond() {
// closeResultSet(rs);
// closeStatement(s);
// connection.close();
// db.releaseSharedLock();
// db.releaseSingleUserCaseReadLock();
// }
// }
// /**
......@@ -1201,7 +1201,7 @@ public long getSecond() {
// public List<Account> getAccounts(Account.Type accountType) throws TskCoreException {
// ArrayList<Account> accounts = new ArrayList<Account>();
// CaseDbConnection connection = db.getConnection();
// db.acquireSharedLock();
// db.acquireSingleUserCaseReadLock();
// Statement s = null;
// ResultSet rs = null;
//
......@@ -1221,7 +1221,7 @@ public long getSecond() {
// closeResultSet(rs);
// closeStatement(s);
// connection.close();
// db.releaseSharedLock();
// db.releaseSingleUserCaseReadLock();
// }
// }
// /**
......@@ -1249,7 +1249,7 @@ public long getSecond() {
// */
// List<Account> getAccountsWithRelationship(long accountID) throws TskCoreException {
// CaseDbConnection connection = db.getConnection();
// db.acquireSharedLock();
// db.acquireSingleUserCaseReadLock();
// Statement s = null;
// ResultSet rs = null;
//
......@@ -1276,7 +1276,7 @@ public long getSecond() {
// closeResultSet(rs);
// closeStatement(s);
// connection.close();
// db.releaseSharedLock();
// db.releaseSingleUserCaseReadLock();
// }
// }
// /**
......@@ -1291,7 +1291,7 @@ public long getSecond() {
// */
// public List<MessageFolder> getMessageFolders(long srcObjID) throws TskCoreException {
// CaseDbConnection connection = db.getConnection();
// db.acquireSharedLock();
// db.acquireSingleUserCaseReadLock();
// Statement s = null;
// ResultSet rs = null;
//
......@@ -1321,7 +1321,7 @@ public long getSecond() {
// closeResultSet(rs);
// closeStatement(s);
// connection.close();
// db.releaseSharedLock();
// db.releaseSingleUserCaseReadLock();
// }
//
// }
......@@ -1340,7 +1340,7 @@ public long getSecond() {
// */
// public List<MessageFolder> getMessageFolders(long srcObjID, MessageFolder parentfolder) throws TskCoreException {
// CaseDbConnection connection = db.getConnection();
// db.acquireSharedLock();
// db.acquireSingleUserCaseReadLock();
// Statement s = null;
// ResultSet rs = null;
//
......@@ -1369,7 +1369,7 @@ public long getSecond() {
// closeResultSet(rs);
// closeStatement(s);
// connection.close();
// db.releaseSharedLock();
// db.releaseSingleUserCaseReadLock();
// }
//
// }
......@@ -1385,7 +1385,7 @@ public long getSecond() {
// */
// public List<BlackboardArtifact> getMessages(MessageFolder parentfolder) throws TskCoreException {
// CaseDbConnection connection = db.getConnection();
// db.acquireSharedLock();
// db.acquireSingleUserCaseReadLock();
// Statement s = null;
// ResultSet rs = null;
//
......@@ -1420,7 +1420,7 @@ public long getSecond() {
// closeResultSet(rs);
// closeStatement(s);
// connection.close();
// db.releaseSharedLock();
// db.releaseSingleUserCaseReadLock();
// }
//
// }
......@@ -1449,7 +1449,7 @@ public long getSecond() {
// */
// List<BlackboardArtifact.Type> getRelationshipTypes(long account1_id, long account2_id) throws TskCoreException {
// CaseDbConnection connection = db.getConnection();
// db.acquireSharedLock();
// db.acquireSingleUserCaseReadLock();
// Statement s = null;
// ResultSet rs = null;
//
......@@ -1480,7 +1480,7 @@ public long getSecond() {
// closeResultSet(rs);
// closeStatement(s);
// connection.close();
// db.releaseSharedLock();
// db.releaseSingleUserCaseReadLock();
// }
// }
// /**
......@@ -1494,7 +1494,7 @@ public long getSecond() {
// */
// public List<BlackboardArtifact> getRelationships(long account1_id, long account2_id) throws TskCoreException {
// CaseDbConnection connection = db.getConnection();
// db.acquireSharedLock();
// db.acquireSingleUserCaseReadLock();
// Statement s = null;
// ResultSet rs = null;
//
......@@ -1528,7 +1528,7 @@ public long getSecond() {
// closeResultSet(rs);
// closeStatement(s);
// connection.close();
// db.releaseSharedLock();
// db.releaseSingleUserCaseReadLock();
// }
// }
// /**
......@@ -1544,7 +1544,7 @@ public long getSecond() {
// */
// public List<BlackboardArtifact> getRelationshipsOfType(long account1_id, long account2_id, BlackboardArtifact.Type artifactType) throws TskCoreException {
// CaseDbConnection connection = db.getConnection();
// db.acquireSharedLock();
// db.acquireSingleUserCaseReadLock();
// Statement s = null;
// ResultSet rs = null;
//
......@@ -1577,7 +1577,7 @@ public long getSecond() {
// closeResultSet(rs);
// closeStatement(s);
// connection.close();
// db.releaseSharedLock();
// db.releaseSingleUserCaseReadLock();
// }
// }
// /**
......@@ -1595,7 +1595,7 @@ public long getSecond() {
// List<Long> ds_ids = db.getDataSourceObjIds(deviceId);
// String datasource_obj_ids_list = buildCSVString(ds_ids);
// CaseDbConnection connection = db.getConnection();
// db.acquireSharedLock();
// db.acquireSingleUserCaseReadLock();
// Statement s = null;
// ResultSet rs = null;
//
......@@ -1622,7 +1622,7 @@ public long getSecond() {
// closeResultSet(rs);
// closeStatement(s);
// connection.close();
// db.releaseSharedLock();
// db.releaseSingleUserCaseReadLock();
// }
// }
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment