Skip to content
Snippets Groups Projects
Commit 200eb9a6 authored by apriestman's avatar apriestman
Browse files

Move creation of OS account instances

parent 0326733e
No related branches found
No related tags found
No related merge requests found
...@@ -398,26 +398,12 @@ public AnalysisResultAdded newAnalysisResult(BlackboardArtifact.Type artifactTyp ...@@ -398,26 +398,12 @@ public AnalysisResultAdded newAnalysisResult(BlackboardArtifact.Type artifactTyp
@Override @Override
public DataArtifact newDataArtifact(BlackboardArtifact.Type artifactType, Collection<BlackboardAttribute> attributesList, Long osAccountId) throws TskCoreException { public DataArtifact newDataArtifact(BlackboardArtifact.Type artifactType, Collection<BlackboardAttribute> attributesList, Long osAccountId) throws TskCoreException {
DataArtifact artifact = db.getBlackboard().newDataArtifact(artifactType, objId, this.getDataSource().getId(), attributesList, osAccountId); return db.getBlackboard().newDataArtifact(artifactType, objId, this.getDataSource().getId(), attributesList, osAccountId);
if (osAccountId != null) {
try (CaseDbConnection connection = db.getConnection()) {
db.getOsAccountManager().newOsAccountInstance(osAccountId, getDataSource().getId(), OsAccountInstance.OsAccountInstanceType.ACCESSED, connection);
}
}
return artifact;
} }
@Override @Override
public DataArtifact newDataArtifact(BlackboardArtifact.Type artifactType, Collection<BlackboardAttribute> attributesList, Long osAccountId, long dataSourceId) throws TskCoreException { public DataArtifact newDataArtifact(BlackboardArtifact.Type artifactType, Collection<BlackboardAttribute> attributesList, Long osAccountId, long dataSourceId) throws TskCoreException {
DataArtifact artifact = db.getBlackboard().newDataArtifact(artifactType, objId, dataSourceId, attributesList, osAccountId); return db.getBlackboard().newDataArtifact(artifactType, objId, dataSourceId, attributesList, osAccountId);
if (osAccountId != null) {
try (CaseDbConnection connection = db.getConnection()) {
db.getOsAccountManager().newOsAccountInstance(osAccountId, dataSourceId, OsAccountInstance.OsAccountInstanceType.ACCESSED, connection);
}
}
return artifact;
} }
@Override @Override
......
...@@ -2236,6 +2236,9 @@ public DataArtifact newDataArtifact(BlackboardArtifact.Type artifactType, long s ...@@ -2236,6 +2236,9 @@ public DataArtifact newDataArtifact(BlackboardArtifact.Type artifactType, long s
statement.setLong(1, artifact_obj_id); statement.setLong(1, artifact_obj_id);
statement.setLong(2, osAccountObjId); statement.setLong(2, osAccountObjId);
connection.executeUpdate(statement); connection.executeUpdate(statement);
// Add an OS account instance
caseDb.getOsAccountManager().newOsAccountInstance(osAccountObjId, dataSourceObjId, OsAccountInstance.OsAccountInstanceType.ACCESSED, connection);
} }
// if attributes are provided, add them to the artifact. // if attributes are provided, add them to the artifact.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment