diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/EmailExtracted.java b/Core/src/org/sleuthkit/autopsy/datamodel/EmailExtracted.java index 45532a8ab7..7ef1b872db 100644 --- a/Core/src/org/sleuthkit/autopsy/datamodel/EmailExtracted.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/EmailExtracted.java @@ -226,7 +226,7 @@ public class EmailExtracted implements AutopsyVisitableItem { * for the event to have a null oldValue. */ ModuleDataEvent eventData = (ModuleDataEvent) evt.getOldValue(); - if (null != eventData && eventData.getArtifactType() == BlackboardArtifact.ARTIFACT_TYPE.TSK_EMAIL_MSG) { + if (null != eventData && eventData.getArtifactTypeId() == BlackboardArtifact.ARTIFACT_TYPE.TSK_EMAIL_MSG.getTypeID()) { emailResults.update(); } } catch (IllegalStateException notUsed) { diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/ExtractedContent.java b/Core/src/org/sleuthkit/autopsy/datamodel/ExtractedContent.java index 4dd61aa643..dc50e6a024 100644 --- a/Core/src/org/sleuthkit/autopsy/datamodel/ExtractedContent.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/ExtractedContent.java @@ -164,8 +164,16 @@ public class ExtractedContent implements AutopsyVisitableItem { * the event is a remote event. */ final ModuleDataEvent event = (ModuleDataEvent) evt.getOldValue(); - if (null != event && doNotShow.contains(event.getArtifactType()) == false) { - refresh(true); + if (null != event) { + boolean passed = true; + for(BlackboardArtifact.ARTIFACT_TYPE type: doNotShow) { + if(type.getTypeID() == event.getArtifactTypeId()) { + passed = false; + } + } + if(passed) { + refresh(true); + } } } catch (IllegalStateException notUsed) { /** @@ -416,7 +424,7 @@ public class ExtractedContent implements AutopsyVisitableItem { * for the event to have a null oldValue. */ final ModuleDataEvent event = (ModuleDataEvent) evt.getOldValue(); - if (null != event && event.getArtifactType() == type) { + if (null != event && event.getArtifactTypeId() == type.getTypeID()) { refresh(true); } } catch (IllegalStateException notUsed) { diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/HashsetHits.java b/Core/src/org/sleuthkit/autopsy/datamodel/HashsetHits.java index 3f1e3301a6..4d4da97efc 100644 --- a/Core/src/org/sleuthkit/autopsy/datamodel/HashsetHits.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/HashsetHits.java @@ -204,7 +204,7 @@ public class HashsetHits implements AutopsyVisitableItem { * oldValue if the event is a remote event. */ ModuleDataEvent eventData = (ModuleDataEvent) evt.getOldValue(); - if (null != eventData && eventData.getArtifactType() == ARTIFACT_TYPE.TSK_HASHSET_HIT) { + if (null != eventData && eventData.getArtifactTypeId() == ARTIFACT_TYPE.TSK_HASHSET_HIT.getTypeID()) { hashsetResults.update(); } } catch (IllegalStateException notUsed) { diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/InterestingHits.java b/Core/src/org/sleuthkit/autopsy/datamodel/InterestingHits.java index b71847bae0..3aaa09bf83 100644 --- a/Core/src/org/sleuthkit/autopsy/datamodel/InterestingHits.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/InterestingHits.java @@ -195,8 +195,8 @@ public class InterestingHits implements AutopsyVisitableItem { * for the event to have a null oldValue. */ ModuleDataEvent eventData = (ModuleDataEvent) evt.getOldValue(); - if (null != eventData && (eventData.getArtifactType() == BlackboardArtifact.ARTIFACT_TYPE.TSK_INTERESTING_ARTIFACT_HIT - || eventData.getArtifactType() == BlackboardArtifact.ARTIFACT_TYPE.TSK_INTERESTING_FILE_HIT)) { + if (null != eventData && (eventData.getArtifactTypeId() == BlackboardArtifact.ARTIFACT_TYPE.TSK_INTERESTING_ARTIFACT_HIT.getTypeID() + || eventData.getArtifactTypeId() == BlackboardArtifact.ARTIFACT_TYPE.TSK_INTERESTING_FILE_HIT.getTypeID())) { interestingResults.update(); } } catch (IllegalStateException notUsed) { diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/KeywordHits.java b/Core/src/org/sleuthkit/autopsy/datamodel/KeywordHits.java index 9bbe7b9c44..251b784ffb 100644 --- a/Core/src/org/sleuthkit/autopsy/datamodel/KeywordHits.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/KeywordHits.java @@ -268,7 +268,7 @@ public class KeywordHits implements AutopsyVisitableItem { * for the event to have a null oldValue. */ ModuleDataEvent eventData = (ModuleDataEvent) evt.getOldValue(); - if (null != eventData && eventData.getArtifactType() == BlackboardArtifact.ARTIFACT_TYPE.TSK_KEYWORD_HIT) { + if (null != eventData && eventData.getArtifactTypeId() == BlackboardArtifact.ARTIFACT_TYPE.TSK_KEYWORD_HIT.getTypeID()) { keywordResults.update(); } } catch (IllegalStateException notUsed) { diff --git a/Core/src/org/sleuthkit/autopsy/ingest/ModuleDataEvent.java b/Core/src/org/sleuthkit/autopsy/ingest/ModuleDataEvent.java index e2f2905290..8459376bd9 100644 --- a/Core/src/org/sleuthkit/autopsy/ingest/ModuleDataEvent.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/ModuleDataEvent.java @@ -50,27 +50,58 @@ public class ModuleDataEvent extends ChangeEvent { private String moduleName; private ARTIFACT_TYPE artifactType; - private Collection artifactIDs; + private int artifactTypeId; + private Collection artifacts; /** - * @param moduleName Module name + * @param moduleName Module name * @param artifactType Type of artifact that was posted to blackboard */ public ModuleDataEvent(String moduleName, ARTIFACT_TYPE artifactType) { super(artifactType); + this.artifactTypeId = artifactType.getTypeID(); this.moduleName = moduleName; this.artifactType = artifactType; } /** - * @param moduleName Module name - * @param artifactType Type of artifact that was posted to blackboard - * @param artifactIDs List of specific artifact ID values that were added - * to blackboard + * @param moduleName Module name + * @param artifactTypeId ID of the type of artifact posted to the blackboard */ - public ModuleDataEvent(String moduleName, ARTIFACT_TYPE artifactType, Collection artifactIDs) { + public ModuleDataEvent(String moduleName, int artifactTypeId) { + super(ARTIFACT_TYPE.fromID(artifactTypeId)); + this.artifactTypeId = artifactTypeId; + this.moduleName = moduleName; + } + + /** + * @param moduleName Module name + * @param artifactTypeId ID of the type of artifact posted to the blackboard + * @param artifacts List of specific artifact ID values that were added to + * blackboard + */ + public ModuleDataEvent(String moduleName, int artifactTypeId, Collection artifacts) { + this(moduleName, artifactTypeId); + this.artifacts = artifacts; + } + + /** + * @param moduleName Module name + * @param artifactType Type of artifact that was posted to blackboard + * @param artifacts List of specific artifact values that were added to + * blackboard + */ + public ModuleDataEvent(String moduleName, ARTIFACT_TYPE artifactType, Collection artifacts) { this(moduleName, artifactType); - this.artifactIDs = artifactIDs; + this.artifacts = artifacts; + } + + /** + * Gets the ID of the new artifacts associated with the event + * @return The artifact ID + */ + public int getArtifactTypeId() { + return this.artifactTypeId; } /** @@ -79,13 +110,13 @@ public class ModuleDataEvent extends ChangeEvent { * @return Collection of artifact ids or null if not provided */ public Collection getArtifacts() { - return artifactIDs; + return artifacts; } /** * get artifact type of the new artifacts associated with the event - * - * @return + * If it is a user defined artifact, it will return null + * @return the artifact type */ public ARTIFACT_TYPE getArtifactType() { return artifactType; diff --git a/Core/src/org/sleuthkit/autopsy/ingest/events/BlackboardPostEvent.java b/Core/src/org/sleuthkit/autopsy/ingest/events/BlackboardPostEvent.java index e8d2b7ad63..527eb61fb9 100644 --- a/Core/src/org/sleuthkit/autopsy/ingest/events/BlackboardPostEvent.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/events/BlackboardPostEvent.java @@ -61,7 +61,7 @@ public final class BlackboardPostEvent extends AutopsyEvent implements Serializa */ super( IngestManager.IngestModuleEvent.DATA_ADDED.toString(), - new SerializableEventData(eventData.getModuleName(), eventData.getArtifactType(), eventData.getArtifacts() != null + new SerializableEventData(eventData.getModuleName(), eventData.getArtifactTypeId(), eventData.getArtifacts() != null ? eventData.getArtifacts() .stream() .map(BlackboardArtifact::getArtifactID) @@ -96,7 +96,7 @@ public final class BlackboardPostEvent extends AutopsyEvent implements Serializa for (Long id : data.artifactIds) { artifacts.add(Case.getCurrentCase().getSleuthkitCase().getBlackboardArtifact(id)); } - eventData = new ModuleDataEvent(data.moduleName, data.artifactType, !artifacts.isEmpty() ? artifacts : null); + eventData = new ModuleDataEvent(data.moduleName, data.artifactTypeId, !artifacts.isEmpty() ? artifacts : null); return eventData; } catch (IllegalStateException | TskCoreException ex) { logger.log(Level.SEVERE, "Error doing lazy load for remote event", ex); @@ -112,12 +112,12 @@ public final class BlackboardPostEvent extends AutopsyEvent implements Serializa private static final long serialVersionUID = 1L; private final String moduleName; - private ARTIFACT_TYPE artifactType; + private int artifactTypeId; private Collection artifactIds; - private SerializableEventData(String moduleName, ARTIFACT_TYPE artifactType, Collection artifactIds) { + private SerializableEventData(String moduleName, int artifactTypeId, Collection artifactIds) { this.moduleName = moduleName; - this.artifactType = artifactType; + this.artifactTypeId = artifactTypeId; this.artifactIds = new ArrayList<>(artifactIds); }