Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Sleuthkit
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
IRT
Sleuthkit
Commits
aa52d67b
Unverified
Commit
aa52d67b
authored
4 years ago
by
Richard Cordovano
Committed by
GitHub
4 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #2111 from raman-bt/3994-items-by-score
Review comments
parents
96856028
3fd70351
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bindings/java/src/org/sleuthkit/datamodel/ScoringManager.java
+13
-15
13 additions, 15 deletions
...ings/java/src/org/sleuthkit/datamodel/ScoringManager.java
with
13 additions
and
15 deletions
bindings/java/src/org/sleuthkit/datamodel/ScoringManager.java
+
13
−
15
View file @
aa52d67b
...
...
@@ -23,7 +23,6 @@
import
java.sql.Statement
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.logging.Level
;
import
java.util.logging.Logger
;
import
org.sleuthkit.datamodel.Score.Confidence
;
import
org.sleuthkit.datamodel.Score.Significance
;
...
...
@@ -161,7 +160,6 @@ private void setAggregateScore(long objId, long dataSourceObjectId, Score score,
/**
* /**
* Updates the score for the specified object, if the given analysis result
* score is higher than the score the object already has.
*
...
...
@@ -170,7 +168,7 @@ private void setAggregateScore(long objId, long dataSourceObjectId, Score score,
* @param resultScore Score for a newly added analysis result.
* @param transaction Transaction to use for the update.
*
* @return
Final
score for the object.
* @return
Aggregate
score for the object.
*
* @throws TskCoreException
*/
...
...
@@ -223,11 +221,11 @@ public long getContentCount(long dataSourceObjectId, Score aggregateScore) throw
*
* @throws TskCoreException if there is an error getting the count.
*/
private
long
getContentCount
(
long
dataSourceObjectId
,
Score
s
core
,
CaseDbConnection
connection
)
throws
TskCoreException
{
private
long
getContentCount
(
long
dataSourceObjectId
,
Score
aggregateS
core
,
CaseDbConnection
connection
)
throws
TskCoreException
{
String
queryString
=
"SELECT COUNT(obj_id) AS count FROM tsk_aggregate_score"
+
" WHERE data_source_obj_id = "
+
dataSourceObjectId
+
" AND significance = "
+
s
core
.
getSignificance
().
getId
()
+
" AND confidence = "
+
s
core
.
getConfidence
().
getId
();
+
" AND significance = "
+
aggregateS
core
.
getSignificance
().
getId
()
+
" AND confidence = "
+
aggregateS
core
.
getConfidence
().
getId
();
db
.
acquireSingleUserCaseReadLock
();
try
(
Statement
statement
=
connection
.
createStatement
();
...
...
@@ -239,7 +237,7 @@ private long getContentCount(long dataSourceObjectId, Score score, CaseDbConnect
}
return
count
;
}
catch
(
SQLException
ex
)
{
throw
new
TskCoreException
(
"Error getting count of items with score = "
+
s
core
.
toString
(),
ex
);
throw
new
TskCoreException
(
"Error getting count of items with score = "
+
aggregateS
core
.
toString
(),
ex
);
}
finally
{
db
.
releaseSingleUserCaseReadLock
();
}
...
...
@@ -249,13 +247,13 @@ private long getContentCount(long dataSourceObjectId, Score score, CaseDbConnect
* Get the contents with the specified score.
*
* @param dataSourceObjectId Data source object id.
* @param
s
core Score to look for.
* @param
aggregateS
core Score to look for.
*
* @return Collection of contents with given score.
*/
public
List
<
Content
>
getContent
(
long
dataSourceObjectId
,
Score
s
core
)
throws
TskCoreException
{
public
List
<
Content
>
getContent
(
long
dataSourceObjectId
,
Score
aggregateS
core
)
throws
TskCoreException
{
try
(
CaseDbConnection
connection
=
db
.
getConnection
())
{
return
getContent
(
dataSourceObjectId
,
s
core
,
connection
);
return
getContent
(
dataSourceObjectId
,
aggregateS
core
,
connection
);
}
}
...
...
@@ -264,18 +262,18 @@ public List<Content> getContent(long dataSourceObjectId, Score score) throws Tsk
* to obtain the database connection.
*
* @param dataSourceObjectId Data source object id.
* @param
s
core Score to look for.
* @param
aggregateS
core Score to look for.
* @param connection Connection to use for the query.
*
* @return List of contents with given score.
*
* @throws TskCoreException
*/
private
List
<
Content
>
getContent
(
long
dataSourceObjectId
,
Score
s
core
,
CaseDbConnection
connection
)
throws
TskCoreException
{
private
List
<
Content
>
getContent
(
long
dataSourceObjectId
,
Score
aggregateS
core
,
CaseDbConnection
connection
)
throws
TskCoreException
{
String
queryString
=
"SELECT obj_id FROM tsk_aggregate_score"
+
" WHERE data_source_obj_id = "
+
dataSourceObjectId
+
" AND significance = "
+
s
core
.
getSignificance
().
getId
()
+
" AND confidence = "
+
s
core
.
getConfidence
().
getId
();
+
" AND significance = "
+
aggregateS
core
.
getSignificance
().
getId
()
+
" AND confidence = "
+
aggregateS
core
.
getConfidence
().
getId
();
db
.
acquireSingleUserCaseReadLock
();
try
(
Statement
statement
=
connection
.
createStatement
();
...
...
@@ -288,7 +286,7 @@ private List<Content> getContent(long dataSourceObjectId, Score score, CaseDbCon
}
return
items
;
}
catch
(
SQLException
ex
)
{
throw
new
TskCoreException
(
"Error getting list of items with score = "
+
s
core
.
toString
(),
ex
);
throw
new
TskCoreException
(
"Error getting list of items with score = "
+
aggregateS
core
.
toString
(),
ex
);
}
finally
{
db
.
releaseSingleUserCaseReadLock
();
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment