Finishing touches on Blackboard implementation

This commit is contained in:
Eugene Livis 2015-11-06 14:37:00 -05:00
parent 7ee82794ad
commit 2db0f57f2d
3 changed files with 7 additions and 3 deletions

View File

@ -21,6 +21,7 @@ package org.sleuthkit.autopsy.casemodule.services;
import java.io.Closeable;
import java.io.IOException;
import org.openide.util.Lookup;
import org.openide.util.NbBundle;
import org.sleuthkit.autopsy.keywordsearchservice.KeywordSearchService;
import org.sleuthkit.datamodel.BlackboardArtifact;
import org.sleuthkit.datamodel.TskCoreException;
@ -41,16 +42,16 @@ public final class Blackboard implements Closeable {
* @throws
* org.sleuthkit.autopsy.casemodule.services.Blackboard.BlackboardException
*/
public static void indexArtifact(BlackboardArtifact artifact) throws BlackboardException {
public void indexArtifact(BlackboardArtifact artifact) throws BlackboardException {
KeywordSearchService searchService = Lookup.getDefault().lookup(KeywordSearchService.class);
if (null == searchService) {
throw new BlackboardException("Keyword search service not found");
throw new BlackboardException(NbBundle.getMessage(this.getClass(), "Blackboard.keywordSearchNotFound.exception.msg"));
}
try {
searchService.indexArtifact(artifact);
} catch (TskCoreException ex) {
throw new BlackboardException("Unable to index blackboard artifact", ex);
throw new BlackboardException(NbBundle.getMessage(this.getClass(), "Blackboard.unableToIndexArtifact.exception.msg"), ex);
}
}

View File

@ -19,3 +19,5 @@ TagsManager.addContentTag.noCaseWarning=Failed to publish new content tag event.
TagsManager.deleteContentTag.noCaseWarning=Failed to publish content tag deleted event. There is no case open.
TagsManager.addBlackboardArtifactTag.noCaseWarning=Failed to publish new blackboard artifact tag event. There is no case open.
TagsManager.deleteBlackboardArtifactTag.noCaseWarning=Failed to publish blackboard artifact tag deleted event. There is no case open.
Blackboard.keywordSearchNotFound.exception.msg=Keyword search service not found.
Blackboard.unableToIndexArtifact.exception.msg=Unable to index blackboard artifact.

View File

@ -146,6 +146,7 @@ public class SolrSearchService implements KeywordSearchService {
try {
Ingester.getDefault().ingest(new StringStream(""), solrFields, 0);
} catch (Ingester.IngesterException ex) {
throw new TskCoreException(ex.getCause().getMessage(), ex);
}
// Next create the index entry for the document content.