From eefecc2c98b4b99372378252d84df49361b6283c Mon Sep 17 00:00:00 2001 From: millmanorama Date: Fri, 11 May 2018 13:01:13 +0200 Subject: [PATCH] change to Blackboard.postArtifact() --- Core/src/org/sleuthkit/autopsy/casemodule/Case.java | 2 +- .../sleuthkit/autopsy/casemodule/services/Blackboard.java | 4 ++-- .../eventlisteners/IngestEventsListener.java | 2 +- .../centralrepository/ingestmodule/IngestModule.java | 2 +- .../modules/embeddedfileextractor/SevenZipExtractor.java | 2 +- .../EncryptionDetectionDataSourceIngestModule.java | 2 +- .../EncryptionDetectionFileIngestModule.java | 2 +- .../autopsy/modules/exif/ExifParserFileIngestModule.java | 2 +- .../fileextmismatch/FileExtMismatchIngestModule.java | 2 +- .../autopsy/modules/filetypeid/FileTypeIdIngestModule.java | 2 +- .../autopsy/modules/hashdatabase/HashDbIngestModule.java | 2 +- .../org/sleuthkit/autopsy/modules/iOS/CallLogAnalyzer.java | 2 +- .../org/sleuthkit/autopsy/modules/iOS/ContactAnalyzer.java | 2 +- .../sleuthkit/autopsy/modules/iOS/TextMessageAnalyzer.java | 2 +- .../interestingitems/FilesIdentifierIngestModule.java | 2 +- .../sleuthkit/autopsy/modules/stix/StixArtifactData.java | 2 +- .../experimental/volatilityDSP/VolatilityProcessor.java | 2 +- .../sleuthkit/autopsy/keywordsearch/SolrSearchService.java | 7 ++++--- .../src/org/sleuthkit/autopsy/recentactivity/Extract.java | 2 +- .../thunderbirdparser/ThunderbirdMboxFileIngestModule.java | 4 ++-- 20 files changed, 25 insertions(+), 24 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/Case.java b/Core/src/org/sleuthkit/autopsy/casemodule/Case.java index 81f497214a..ccce6fdced 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/Case.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/Case.java @@ -2250,7 +2250,6 @@ public class Case { private void close(ProgressIndicator progressIndicator) { IngestManager.getInstance().cancelAllIngestJobs(IngestJob.CancellationReason.CASE_CLOSED); - caseDb.unregisterForEvents(tskEventForwarder); /* * Stop sending/receiving case events to and from other nodes if this is * a multi-user case. @@ -2287,6 +2286,7 @@ public class Case { */ if (null != caseDb) { progressIndicator.progress(Bundle.Case_progressMessage_closingCaseDatabase()); + caseDb.unregisterForEvents(tskEventForwarder); caseDb.close(); } diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/services/Blackboard.java b/Core/src/org/sleuthkit/autopsy/casemodule/services/Blackboard.java index 292383980b..665e105ce8 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/services/Blackboard.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/services/Blackboard.java @@ -47,7 +47,7 @@ public final class Blackboard implements Closeable { } /** - * Indexes the text associated with the an artifact. + * Indexes the text associated with an artifact. * * @param artifact The artifact to be indexed. * @@ -59,7 +59,7 @@ public final class Blackboard implements Closeable { } try { - delegate.publishArtifact(artifact); + delegate.postArtifact(artifact); } catch (org.sleuthkit.datamodel.Blackboard.BlackboardException ex) { throw new BlackboardException("Error indexing artifact", ex); } diff --git a/Core/src/org/sleuthkit/autopsy/centralrepository/eventlisteners/IngestEventsListener.java b/Core/src/org/sleuthkit/autopsy/centralrepository/eventlisteners/IngestEventsListener.java index 9dc784e0d0..1e98edb327 100644 --- a/Core/src/org/sleuthkit/autopsy/centralrepository/eventlisteners/IngestEventsListener.java +++ b/Core/src/org/sleuthkit/autopsy/centralrepository/eventlisteners/IngestEventsListener.java @@ -164,7 +164,7 @@ public class IngestEventsListener { try { // index the artifact for keyword search Blackboard blackboard = Case.getCurrentCaseThrows().getSleuthkitCase().getBlackboard(); - blackboard.publishArtifact(tifArtifact); + blackboard.postArtifact(tifArtifact); } catch (Blackboard.BlackboardException | NoCurrentCaseException ex) { LOGGER.log(Level.SEVERE, "Unable to index blackboard artifact " + tifArtifact.getArtifactID(), ex); //NON-NLS } diff --git a/Core/src/org/sleuthkit/autopsy/centralrepository/ingestmodule/IngestModule.java b/Core/src/org/sleuthkit/autopsy/centralrepository/ingestmodule/IngestModule.java index 76f51f3c55..d160d5cc1b 100644 --- a/Core/src/org/sleuthkit/autopsy/centralrepository/ingestmodule/IngestModule.java +++ b/Core/src/org/sleuthkit/autopsy/centralrepository/ingestmodule/IngestModule.java @@ -315,7 +315,7 @@ final class IngestModule implements FileIngestModule { try { // index the artifact for keyword search - blackboard.publishArtifact(tifArtifact); + blackboard.postArtifact(tifArtifact); } catch (Blackboard.BlackboardException ex) { logger.log(Level.SEVERE, "Unable to index blackboard artifact " + tifArtifact.getArtifactID(), ex); //NON-NLS } diff --git a/Core/src/org/sleuthkit/autopsy/modules/embeddedfileextractor/SevenZipExtractor.java b/Core/src/org/sleuthkit/autopsy/modules/embeddedfileextractor/SevenZipExtractor.java index 2171f98c54..288afbb1af 100644 --- a/Core/src/org/sleuthkit/autopsy/modules/embeddedfileextractor/SevenZipExtractor.java +++ b/Core/src/org/sleuthkit/autopsy/modules/embeddedfileextractor/SevenZipExtractor.java @@ -721,7 +721,7 @@ class SevenZipExtractor { try { // index the artifact for keyword search - blackboard.publishArtifact(artifact); + blackboard.postArtifact(artifact); } catch (Blackboard.BlackboardException ex) { logger.log(Level.SEVERE, "Unable to index blackboard artifact " + artifact.getArtifactID(), ex); //NON-NLS MessageNotifyUtil.Notify.error( diff --git a/Core/src/org/sleuthkit/autopsy/modules/encryptiondetection/EncryptionDetectionDataSourceIngestModule.java b/Core/src/org/sleuthkit/autopsy/modules/encryptiondetection/EncryptionDetectionDataSourceIngestModule.java index c659e3f051..416c6ac56d 100644 --- a/Core/src/org/sleuthkit/autopsy/modules/encryptiondetection/EncryptionDetectionDataSourceIngestModule.java +++ b/Core/src/org/sleuthkit/autopsy/modules/encryptiondetection/EncryptionDetectionDataSourceIngestModule.java @@ -120,7 +120,7 @@ final class EncryptionDetectionDataSourceIngestModule implements DataSourceInges /* * Index the artifact for keyword search. */ - blackboard.publishArtifact(artifact); + blackboard.postArtifact(artifact); } catch (Blackboard.BlackboardException ex) { logger.log(Level.SEVERE, "Unable to index blackboard artifact " + artifact.getArtifactID(), ex); //NON-NLS } diff --git a/Core/src/org/sleuthkit/autopsy/modules/encryptiondetection/EncryptionDetectionFileIngestModule.java b/Core/src/org/sleuthkit/autopsy/modules/encryptiondetection/EncryptionDetectionFileIngestModule.java index 0526be93b7..9ab46c589d 100644 --- a/Core/src/org/sleuthkit/autopsy/modules/encryptiondetection/EncryptionDetectionFileIngestModule.java +++ b/Core/src/org/sleuthkit/autopsy/modules/encryptiondetection/EncryptionDetectionFileIngestModule.java @@ -180,7 +180,7 @@ final class EncryptionDetectionFileIngestModule extends FileIngestModuleAdapter /* * Index the artifact for keyword search. */ - blackboard.publishArtifact(artifact); + blackboard.postArtifact(artifact); } catch (Blackboard.BlackboardException ex) { logger.log(Level.SEVERE, "Unable to index blackboard artifact " + artifact.getArtifactID(), ex); //NON-NLS } diff --git a/Core/src/org/sleuthkit/autopsy/modules/exif/ExifParserFileIngestModule.java b/Core/src/org/sleuthkit/autopsy/modules/exif/ExifParserFileIngestModule.java index 9578cbaa23..e9cc6d3a15 100644 --- a/Core/src/org/sleuthkit/autopsy/modules/exif/ExifParserFileIngestModule.java +++ b/Core/src/org/sleuthkit/autopsy/modules/exif/ExifParserFileIngestModule.java @@ -213,7 +213,7 @@ public final class ExifParserFileIngestModule implements FileIngestModule { try { // index the artifact for keyword search - blackboard.publishArtifact(bba); + blackboard.postArtifact(bba); } catch (Blackboard.BlackboardException ex) { logger.log(Level.SEVERE, "Unable to index blackboard artifact " + bba.getArtifactID(), ex); //NON-NLS MessageNotifyUtil.Notify.error( diff --git a/Core/src/org/sleuthkit/autopsy/modules/fileextmismatch/FileExtMismatchIngestModule.java b/Core/src/org/sleuthkit/autopsy/modules/fileextmismatch/FileExtMismatchIngestModule.java index f1eb697c2c..3300cbed93 100644 --- a/Core/src/org/sleuthkit/autopsy/modules/fileextmismatch/FileExtMismatchIngestModule.java +++ b/Core/src/org/sleuthkit/autopsy/modules/fileextmismatch/FileExtMismatchIngestModule.java @@ -146,7 +146,7 @@ public class FileExtMismatchIngestModule implements FileIngestModule { try { // index the artifact for keyword search - blackboard.publishArtifact(bart); + blackboard.postArtifact(bart); } catch (Blackboard.BlackboardException ex) { logger.log(Level.SEVERE, "Unable to index blackboard artifact " + bart.getArtifactID(), ex); //NON-NLS MessageNotifyUtil.Notify.error(FileExtMismatchDetectorModuleFactory.getModuleName(), Bundle.FileExtMismatchIngestModule_indexError_message()); diff --git a/Core/src/org/sleuthkit/autopsy/modules/filetypeid/FileTypeIdIngestModule.java b/Core/src/org/sleuthkit/autopsy/modules/filetypeid/FileTypeIdIngestModule.java index 88d2cad506..b0b673e8dd 100644 --- a/Core/src/org/sleuthkit/autopsy/modules/filetypeid/FileTypeIdIngestModule.java +++ b/Core/src/org/sleuthkit/autopsy/modules/filetypeid/FileTypeIdIngestModule.java @@ -157,7 +157,7 @@ public class FileTypeIdIngestModule implements FileIngestModule { attributes.add(ruleNameAttribute); artifact.addAttributes(attributes); try { - Case.getCurrentCaseThrows().getSleuthkitCase().getBlackboard().publishArtifact(artifact); + Case.getCurrentCaseThrows().getSleuthkitCase().getBlackboard().postArtifact(artifact); } catch (Blackboard.BlackboardException ex) { logger.log(Level.SEVERE, String.format("Unable to index TSK_INTERESTING_FILE_HIT blackboard artifact %d (file obj_id=%d)", artifact.getArtifactID(), file.getId()), ex); //NON-NLS } catch (NoCurrentCaseException ex) { diff --git a/Core/src/org/sleuthkit/autopsy/modules/hashdatabase/HashDbIngestModule.java b/Core/src/org/sleuthkit/autopsy/modules/hashdatabase/HashDbIngestModule.java index 36bd422b65..e5dc7d355d 100644 --- a/Core/src/org/sleuthkit/autopsy/modules/hashdatabase/HashDbIngestModule.java +++ b/Core/src/org/sleuthkit/autopsy/modules/hashdatabase/HashDbIngestModule.java @@ -313,7 +313,7 @@ public class HashDbIngestModule implements FileIngestModule { try { // index the artifact for keyword search - blackboard.publishArtifact(badFile); + blackboard.postArtifact(badFile); } catch (Blackboard.BlackboardException ex) { logger.log(Level.SEVERE, "Unable to index blackboard artifact " + badFile.getArtifactID(), ex); //NON-NLS MessageNotifyUtil.Notify.error( diff --git a/Core/src/org/sleuthkit/autopsy/modules/iOS/CallLogAnalyzer.java b/Core/src/org/sleuthkit/autopsy/modules/iOS/CallLogAnalyzer.java index e56255f898..eea0d54a6a 100644 --- a/Core/src/org/sleuthkit/autopsy/modules/iOS/CallLogAnalyzer.java +++ b/Core/src/org/sleuthkit/autopsy/modules/iOS/CallLogAnalyzer.java @@ -163,7 +163,7 @@ final class CallLogAnalyzer { bba.addAttributes(attributes); try { // index the artifact for keyword search - blackboard.publishArtifact(bba); + blackboard.postArtifact(bba); } catch (Blackboard.BlackboardException ex) { logger.log(Level.SEVERE, "Unable to index blackboard artifact " + bba.getArtifactID(), ex); //NON-NLS MessageNotifyUtil.Notify.error( diff --git a/Core/src/org/sleuthkit/autopsy/modules/iOS/ContactAnalyzer.java b/Core/src/org/sleuthkit/autopsy/modules/iOS/ContactAnalyzer.java index f9f3e2e484..2294351a1f 100644 --- a/Core/src/org/sleuthkit/autopsy/modules/iOS/ContactAnalyzer.java +++ b/Core/src/org/sleuthkit/autopsy/modules/iOS/ContactAnalyzer.java @@ -173,7 +173,7 @@ final class ContactAnalyzer { bba.addAttributes(attributes); try { // index the artifact for keyword search - blackboard.publishArtifact(bba); + blackboard.postArtifact(bba); } catch (Blackboard.BlackboardException ex) { logger.log(Level.SEVERE, "Unable to index blackboard artifact " + bba.getArtifactID(), ex); //NON-NLS MessageNotifyUtil.Notify.error( diff --git a/Core/src/org/sleuthkit/autopsy/modules/iOS/TextMessageAnalyzer.java b/Core/src/org/sleuthkit/autopsy/modules/iOS/TextMessageAnalyzer.java index da87b8882b..2efd3a7523 100644 --- a/Core/src/org/sleuthkit/autopsy/modules/iOS/TextMessageAnalyzer.java +++ b/Core/src/org/sleuthkit/autopsy/modules/iOS/TextMessageAnalyzer.java @@ -169,7 +169,7 @@ class TextMessageAnalyzer { bba.addAttributes(attributes); try { // index the artifact for keyword search - blackboard.publishArtifact(bba); + blackboard.postArtifact(bba); } catch (Blackboard.BlackboardException ex) { logger.log(Level.SEVERE, "Unable to index blackboard artifact " + bba.getArtifactID(), ex); //NON-NLS MessageNotifyUtil.Notify.error( diff --git a/Core/src/org/sleuthkit/autopsy/modules/interestingitems/FilesIdentifierIngestModule.java b/Core/src/org/sleuthkit/autopsy/modules/interestingitems/FilesIdentifierIngestModule.java index d3a936a83d..411d2fa6c9 100644 --- a/Core/src/org/sleuthkit/autopsy/modules/interestingitems/FilesIdentifierIngestModule.java +++ b/Core/src/org/sleuthkit/autopsy/modules/interestingitems/FilesIdentifierIngestModule.java @@ -145,7 +145,7 @@ final class FilesIdentifierIngestModule implements FileIngestModule { artifact.addAttributes(attributes); try { // index the artifact for keyword search - blackboard.publishArtifact(artifact); + blackboard.postArtifact(artifact); } catch (Blackboard.BlackboardException ex) { logger.log(Level.SEVERE, "Unable to index blackboard artifact " + artifact.getArtifactID(), ex); //NON-NLS MessageNotifyUtil.Notify.error(Bundle.FilesIdentifierIngestModule_indexError_message(), artifact.getDisplayName()); diff --git a/Core/src/org/sleuthkit/autopsy/modules/stix/StixArtifactData.java b/Core/src/org/sleuthkit/autopsy/modules/stix/StixArtifactData.java index 082f77d113..4b8a63ec9d 100644 --- a/Core/src/org/sleuthkit/autopsy/modules/stix/StixArtifactData.java +++ b/Core/src/org/sleuthkit/autopsy/modules/stix/StixArtifactData.java @@ -89,7 +89,7 @@ class StixArtifactData { bba.addAttributes(attributes); try { // index the artifact for keyword search - blackboard.publishArtifact(bba); + blackboard.postArtifact(bba); } catch (Blackboard.BlackboardException ex) { logger.log(Level.SEVERE, "Unable to index blackboard artifact " + bba.getArtifactID(), ex); //NON-NLS MessageNotifyUtil.Notify.error(Bundle.StixArtifactData_indexError_message(), bba.getDisplayName()); diff --git a/Experimental/src/org/sleuthkit/autopsy/experimental/volatilityDSP/VolatilityProcessor.java b/Experimental/src/org/sleuthkit/autopsy/experimental/volatilityDSP/VolatilityProcessor.java index ecec2c8359..34ffc2e9c2 100644 --- a/Experimental/src/org/sleuthkit/autopsy/experimental/volatilityDSP/VolatilityProcessor.java +++ b/Experimental/src/org/sleuthkit/autopsy/experimental/volatilityDSP/VolatilityProcessor.java @@ -380,7 +380,7 @@ class VolatilityProcessor { try { // index the artifact for keyword search - blackboard.publishArtifact(volArtifact); + blackboard.postArtifact(volArtifact); } catch (Blackboard.BlackboardException ex) { errorMsgs.add(Bundle.VolatilityProcessor_errorMessage_failedToIndexArtifact(pluginName)); /* diff --git a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/SolrSearchService.java b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/SolrSearchService.java index 9a642e0df1..2018e13234 100644 --- a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/SolrSearchService.java +++ b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/SolrSearchService.java @@ -50,6 +50,7 @@ import org.sleuthkit.autopsy.progress.ProgressIndicator; import org.sleuthkit.datamodel.Blackboard; import org.sleuthkit.datamodel.BlackboardArtifact; import org.sleuthkit.datamodel.Content; +import org.sleuthkit.datamodel.SleuthkitCase; import org.sleuthkit.datamodel.TskCoreException; /** @@ -78,8 +79,8 @@ public class SolrSearchService implements KeywordSearchService, AutopsyService { * 1) Indexing an artifact created during while either the file level ingest * module pipeline or the first stage data source level ingest module * pipeline of an ingest job is running. - * - * 2) Indexing a report. + * + * 2) Indexing a report. * * @param content The content to index. * @@ -433,7 +434,7 @@ public class SolrSearchService implements KeywordSearchService, AutopsyService { void handleNewArtifact(Blackboard.ArtifactPublishedEvent event) { BlackboardArtifact bba = event.getArtifact(); try { - indexArtifact(bba); + index(bba); } catch (TskCoreException ex) { //TODO: is this the right error handling? logger.log(Level.SEVERE, "Unable to index blackboard artifact " + bba.getArtifactID(), ex); //NON-NLS diff --git a/RecentActivity/src/org/sleuthkit/autopsy/recentactivity/Extract.java b/RecentActivity/src/org/sleuthkit/autopsy/recentactivity/Extract.java index 4108856c32..dd2883d683 100644 --- a/RecentActivity/src/org/sleuthkit/autopsy/recentactivity/Extract.java +++ b/RecentActivity/src/org/sleuthkit/autopsy/recentactivity/Extract.java @@ -127,7 +127,7 @@ abstract class Extract { try { Blackboard blackboard = Case.getCurrentCaseThrows().getSleuthkitCase().getBlackboard(); // index the artifact for keyword search - blackboard.publishArtifact(bbart); + blackboard.postArtifact(bbart); } catch (Blackboard.BlackboardException ex) { logger.log(Level.SEVERE, "Unable to index blackboard artifact " + bbart.getDisplayName(), ex); //NON-NLS MessageNotifyUtil.Notify.error(Bundle.Extract_indexError_message(), bbart.getDisplayName()); diff --git a/thunderbirdparser/src/org/sleuthkit/autopsy/thunderbirdparser/ThunderbirdMboxFileIngestModule.java b/thunderbirdparser/src/org/sleuthkit/autopsy/thunderbirdparser/ThunderbirdMboxFileIngestModule.java index c3a1fcde28..e9eb1631d3 100644 --- a/thunderbirdparser/src/org/sleuthkit/autopsy/thunderbirdparser/ThunderbirdMboxFileIngestModule.java +++ b/thunderbirdparser/src/org/sleuthkit/autopsy/thunderbirdparser/ThunderbirdMboxFileIngestModule.java @@ -193,7 +193,7 @@ public final class ThunderbirdMboxFileIngestModule implements FileIngestModule { try { // index the artifact for keyword search - blackboard.publishArtifact(artifact); + blackboard.postArtifact(artifact); } catch (Blackboard.BlackboardException ex) { MessageNotifyUtil.Notify.error(Bundle.ThunderbirdMboxFileIngestModule_processPst_indexError_message(), artifact.getDisplayName()); logger.log(Level.SEVERE, "Unable to index blackboard artifact " + artifact.getArtifactID(), ex); //NON-NLS @@ -524,7 +524,7 @@ public final class ThunderbirdMboxFileIngestModule implements FileIngestModule { try { // index the artifact for keyword search - blackboard.publishArtifact(bbart); + blackboard.postArtifact(bbart); } catch (Blackboard.BlackboardException ex) { logger.log(Level.SEVERE, "Unable to index blackboard artifact " + bbart.getArtifactID(), ex); //NON-NLS MessageNotifyUtil.Notify.error(Bundle.ThunderbirdMboxFileIngestModule_addArtifact_indexError_message(), bbart.getDisplayName());