mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-17 18:17:43 +00:00
Merge pull request #1804 from BasisOlivers/custom_artifact_addition
Updated ModuleDataEvent
This commit is contained in:
commit
b6fb5d65e8
@ -226,7 +226,7 @@ public class EmailExtracted implements AutopsyVisitableItem {
|
|||||||
* for the event to have a null oldValue.
|
* for the event to have a null oldValue.
|
||||||
*/
|
*/
|
||||||
ModuleDataEvent eventData = (ModuleDataEvent) evt.getOldValue();
|
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();
|
emailResults.update();
|
||||||
}
|
}
|
||||||
} catch (IllegalStateException notUsed) {
|
} catch (IllegalStateException notUsed) {
|
||||||
|
@ -164,8 +164,16 @@ public class ExtractedContent implements AutopsyVisitableItem {
|
|||||||
* the event is a remote event.
|
* the event is a remote event.
|
||||||
*/
|
*/
|
||||||
final ModuleDataEvent event = (ModuleDataEvent) evt.getOldValue();
|
final ModuleDataEvent event = (ModuleDataEvent) evt.getOldValue();
|
||||||
if (null != event && doNotShow.contains(event.getArtifactType()) == false) {
|
if (null != event) {
|
||||||
refresh(true);
|
boolean passed = true;
|
||||||
|
for(BlackboardArtifact.ARTIFACT_TYPE type: doNotShow) {
|
||||||
|
if(type.getTypeID() == event.getArtifactTypeId()) {
|
||||||
|
passed = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(passed) {
|
||||||
|
refresh(true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} catch (IllegalStateException notUsed) {
|
} catch (IllegalStateException notUsed) {
|
||||||
/**
|
/**
|
||||||
@ -416,7 +424,7 @@ public class ExtractedContent implements AutopsyVisitableItem {
|
|||||||
* for the event to have a null oldValue.
|
* for the event to have a null oldValue.
|
||||||
*/
|
*/
|
||||||
final ModuleDataEvent event = (ModuleDataEvent) evt.getOldValue();
|
final ModuleDataEvent event = (ModuleDataEvent) evt.getOldValue();
|
||||||
if (null != event && event.getArtifactType() == type) {
|
if (null != event && event.getArtifactTypeId() == type.getTypeID()) {
|
||||||
refresh(true);
|
refresh(true);
|
||||||
}
|
}
|
||||||
} catch (IllegalStateException notUsed) {
|
} catch (IllegalStateException notUsed) {
|
||||||
|
@ -204,7 +204,7 @@ public class HashsetHits implements AutopsyVisitableItem {
|
|||||||
* oldValue if the event is a remote event.
|
* oldValue if the event is a remote event.
|
||||||
*/
|
*/
|
||||||
ModuleDataEvent eventData = (ModuleDataEvent) evt.getOldValue();
|
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();
|
hashsetResults.update();
|
||||||
}
|
}
|
||||||
} catch (IllegalStateException notUsed) {
|
} catch (IllegalStateException notUsed) {
|
||||||
|
@ -195,8 +195,8 @@ public class InterestingHits implements AutopsyVisitableItem {
|
|||||||
* for the event to have a null oldValue.
|
* for the event to have a null oldValue.
|
||||||
*/
|
*/
|
||||||
ModuleDataEvent eventData = (ModuleDataEvent) evt.getOldValue();
|
ModuleDataEvent eventData = (ModuleDataEvent) evt.getOldValue();
|
||||||
if (null != eventData && (eventData.getArtifactType() == BlackboardArtifact.ARTIFACT_TYPE.TSK_INTERESTING_ARTIFACT_HIT
|
if (null != eventData && (eventData.getArtifactTypeId() == BlackboardArtifact.ARTIFACT_TYPE.TSK_INTERESTING_ARTIFACT_HIT.getTypeID()
|
||||||
|| eventData.getArtifactType() == BlackboardArtifact.ARTIFACT_TYPE.TSK_INTERESTING_FILE_HIT)) {
|
|| eventData.getArtifactTypeId() == BlackboardArtifact.ARTIFACT_TYPE.TSK_INTERESTING_FILE_HIT.getTypeID())) {
|
||||||
interestingResults.update();
|
interestingResults.update();
|
||||||
}
|
}
|
||||||
} catch (IllegalStateException notUsed) {
|
} catch (IllegalStateException notUsed) {
|
||||||
|
@ -268,7 +268,7 @@ public class KeywordHits implements AutopsyVisitableItem {
|
|||||||
* for the event to have a null oldValue.
|
* for the event to have a null oldValue.
|
||||||
*/
|
*/
|
||||||
ModuleDataEvent eventData = (ModuleDataEvent) evt.getOldValue();
|
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();
|
keywordResults.update();
|
||||||
}
|
}
|
||||||
} catch (IllegalStateException notUsed) {
|
} catch (IllegalStateException notUsed) {
|
||||||
|
@ -50,27 +50,58 @@ public class ModuleDataEvent extends ChangeEvent {
|
|||||||
|
|
||||||
private String moduleName;
|
private String moduleName;
|
||||||
private ARTIFACT_TYPE artifactType;
|
private ARTIFACT_TYPE artifactType;
|
||||||
private Collection<BlackboardArtifact> artifactIDs;
|
private int artifactTypeId;
|
||||||
|
private Collection<BlackboardArtifact> artifacts;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param moduleName Module name
|
* @param moduleName Module name
|
||||||
* @param artifactType Type of artifact that was posted to blackboard
|
* @param artifactType Type of artifact that was posted to blackboard
|
||||||
*/
|
*/
|
||||||
public ModuleDataEvent(String moduleName, ARTIFACT_TYPE artifactType) {
|
public ModuleDataEvent(String moduleName, ARTIFACT_TYPE artifactType) {
|
||||||
super(artifactType);
|
super(artifactType);
|
||||||
|
this.artifactTypeId = artifactType.getTypeID();
|
||||||
this.moduleName = moduleName;
|
this.moduleName = moduleName;
|
||||||
this.artifactType = artifactType;
|
this.artifactType = artifactType;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param moduleName Module name
|
* @param moduleName Module name
|
||||||
* @param artifactType Type of artifact that was posted to blackboard
|
* @param artifactTypeId ID of the type of artifact posted to the blackboard
|
||||||
* @param artifactIDs List of specific artifact ID values that were added
|
|
||||||
* to blackboard
|
|
||||||
*/
|
*/
|
||||||
public ModuleDataEvent(String moduleName, ARTIFACT_TYPE artifactType, Collection<BlackboardArtifact> 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<BlackboardArtifact> 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<BlackboardArtifact> artifacts) {
|
||||||
this(moduleName, artifactType);
|
this(moduleName, artifactType);
|
||||||
this.artifactIDs = artifactIDs;
|
this.artifacts = artifacts;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the Artifact Type ID of this 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
|
* @return Collection of artifact ids or null if not provided
|
||||||
*/
|
*/
|
||||||
public Collection<BlackboardArtifact> getArtifacts() {
|
public Collection<BlackboardArtifact> getArtifacts() {
|
||||||
return artifactIDs;
|
return artifacts;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* get artifact type of the new artifacts associated with the event
|
* get artifact type of the new artifacts associated with the event
|
||||||
*
|
* If it is a user defined artifact, it will return null
|
||||||
* @return
|
* @return the artifact type
|
||||||
*/
|
*/
|
||||||
public ARTIFACT_TYPE getArtifactType() {
|
public ARTIFACT_TYPE getArtifactType() {
|
||||||
return artifactType;
|
return artifactType;
|
||||||
|
@ -61,7 +61,7 @@ public final class BlackboardPostEvent extends AutopsyEvent implements Serializa
|
|||||||
*/
|
*/
|
||||||
super(
|
super(
|
||||||
IngestManager.IngestModuleEvent.DATA_ADDED.toString(),
|
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()
|
? eventData.getArtifacts()
|
||||||
.stream()
|
.stream()
|
||||||
.map(BlackboardArtifact::getArtifactID)
|
.map(BlackboardArtifact::getArtifactID)
|
||||||
@ -96,7 +96,7 @@ public final class BlackboardPostEvent extends AutopsyEvent implements Serializa
|
|||||||
for (Long id : data.artifactIds) {
|
for (Long id : data.artifactIds) {
|
||||||
artifacts.add(Case.getCurrentCase().getSleuthkitCase().getBlackboardArtifact(id));
|
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;
|
return eventData;
|
||||||
} catch (IllegalStateException | TskCoreException ex) {
|
} catch (IllegalStateException | TskCoreException ex) {
|
||||||
logger.log(Level.SEVERE, "Error doing lazy load for remote event", 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 static final long serialVersionUID = 1L;
|
||||||
private final String moduleName;
|
private final String moduleName;
|
||||||
private ARTIFACT_TYPE artifactType;
|
private int artifactTypeId;
|
||||||
private Collection<Long> artifactIds;
|
private Collection<Long> artifactIds;
|
||||||
|
|
||||||
private SerializableEventData(String moduleName, ARTIFACT_TYPE artifactType, Collection<Long> artifactIds) {
|
private SerializableEventData(String moduleName, int artifactTypeId, Collection<Long> artifactIds) {
|
||||||
this.moduleName = moduleName;
|
this.moduleName = moduleName;
|
||||||
this.artifactType = artifactType;
|
this.artifactTypeId = artifactTypeId;
|
||||||
this.artifactIds = new ArrayList<>(artifactIds);
|
this.artifactIds = new ArrayList<>(artifactIds);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user