Updated to reflect use of BlackboardArtifact.Type (unfinished)

This commit is contained in:
Oliver Spohngellert
2016-01-08 16:50:39 -05:00
parent edd842500b
commit 2e32e5ad8b
7 changed files with 19 additions and 19 deletions
@@ -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.getArtifactTypeId() == BlackboardArtifact.ARTIFACT_TYPE.TSK_EMAIL_MSG.getTypeID()) {
if (null != eventData && eventData.getArtifactTypeId().getTypeID() == BlackboardArtifact.ARTIFACT_TYPE.TSK_EMAIL_MSG.getTypeID()) {
emailResults.update();
}
} catch (IllegalStateException notUsed) {
@@ -167,7 +167,7 @@ public class ExtractedContent implements AutopsyVisitableItem {
if (null != event) {
boolean passed = true;
for(BlackboardArtifact.ARTIFACT_TYPE type: doNotShow) {
if(type.getTypeID() == event.getArtifactTypeId()) {
if(type.getTypeID() == event.getArtifactTypeId().getTypeID()) {
passed = false;
}
}
@@ -225,9 +225,9 @@ public class ExtractedContent implements AutopsyVisitableItem {
if (skCase != null) {
try {
List<BlackboardArtifact.ARTIFACT_TYPE> inUse = new ArrayList<>();
List<Integer> types = skCase.getArtifactTypesInUse();
for (Integer i: types) {
inUse.add(BlackboardArtifact.ARTIFACT_TYPE.fromID(i));
List<BlackboardArtifact.Type> types = skCase.getArtifactTypesInUse();
for (BlackboardArtifact.Type type: types) {
inUse.add(BlackboardArtifact.ARTIFACT_TYPE.fromID(type.getTypeID()));
}
inUse.removeAll(doNotShow);
Collections.sort(inUse,
@@ -424,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.getArtifactTypeId() == type.getTypeID()) {
if (null != event && event.getArtifactTypeId().getTypeID() == type.getTypeID()) {
refresh(true);
}
} catch (IllegalStateException notUsed) {
@@ -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.getArtifactTypeId() == ARTIFACT_TYPE.TSK_HASHSET_HIT.getTypeID()) {
if (null != eventData && eventData.getArtifactTypeId().getTypeID() == ARTIFACT_TYPE.TSK_HASHSET_HIT.getTypeID()) {
hashsetResults.update();
}
} catch (IllegalStateException notUsed) {
@@ -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.getArtifactTypeId() == BlackboardArtifact.ARTIFACT_TYPE.TSK_INTERESTING_ARTIFACT_HIT.getTypeID()
|| eventData.getArtifactTypeId() == BlackboardArtifact.ARTIFACT_TYPE.TSK_INTERESTING_FILE_HIT.getTypeID())) {
if (null != eventData && (eventData.getArtifactTypeId().getTypeID() == BlackboardArtifact.ARTIFACT_TYPE.TSK_INTERESTING_ARTIFACT_HIT.getTypeID()
|| eventData.getArtifactTypeId().getTypeID() == BlackboardArtifact.ARTIFACT_TYPE.TSK_INTERESTING_FILE_HIT.getTypeID())) {
interestingResults.update();
}
} catch (IllegalStateException notUsed) {
@@ -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.getArtifactTypeId() == BlackboardArtifact.ARTIFACT_TYPE.TSK_KEYWORD_HIT.getTypeID()) {
if (null != eventData && eventData.getArtifactTypeId().getTypeID() == BlackboardArtifact.ARTIFACT_TYPE.TSK_KEYWORD_HIT.getTypeID()) {
keywordResults.update();
}
} catch (IllegalStateException notUsed) {
@@ -50,7 +50,7 @@ public class ModuleDataEvent extends ChangeEvent {
private String moduleName;
private ARTIFACT_TYPE artifactType;
private int artifactTypeId;
private BlackboardArtifact.Type artifactTypeId;
private Collection<BlackboardArtifact> artifacts;
/**
@@ -59,7 +59,7 @@ public class ModuleDataEvent extends ChangeEvent {
*/
public ModuleDataEvent(String moduleName, ARTIFACT_TYPE artifactType) {
super(artifactType);
this.artifactTypeId = artifactType.getTypeID();
this.artifactTypeId = BlackboardArtifact.typeFactory(artifactType);
this.moduleName = moduleName;
this.artifactType = artifactType;
}
@@ -68,8 +68,8 @@ public class ModuleDataEvent extends ChangeEvent {
* @param moduleName Module name
* @param artifactTypeId ID of the type of artifact posted to the blackboard
*/
public ModuleDataEvent(String moduleName, int artifactTypeId) {
super(ARTIFACT_TYPE.fromID(artifactTypeId));
public ModuleDataEvent(String moduleName, BlackboardArtifact.Type artifactTypeId) {
super(ARTIFACT_TYPE.fromID(artifactTypeId.getTypeID()));
this.artifactTypeId = artifactTypeId;
this.moduleName = moduleName;
}
@@ -80,7 +80,7 @@ public class ModuleDataEvent extends ChangeEvent {
* @param artifacts List of specific artifact ID values that were added to
* blackboard
*/
public ModuleDataEvent(String moduleName, int artifactTypeId, Collection<BlackboardArtifact> artifacts) {
public ModuleDataEvent(String moduleName, BlackboardArtifact.Type artifactTypeId, Collection<BlackboardArtifact> artifacts) {
this(moduleName, artifactTypeId);
this.artifacts = artifacts;
}
@@ -100,7 +100,7 @@ public class ModuleDataEvent extends ChangeEvent {
* Gets the ID of the new artifacts associated with the event
* @return The artifact ID
*/
public int getArtifactTypeId() {
public BlackboardArtifact.Type getArtifactTypeId() {
return this.artifactTypeId;
}
@@ -61,7 +61,7 @@ public final class BlackboardPostEvent extends AutopsyEvent implements Serializa
*/
super(
IngestManager.IngestModuleEvent.DATA_ADDED.toString(),
new SerializableEventData(eventData.getModuleName(), eventData.getArtifactTypeId(), eventData.getArtifacts() != null
new SerializableEventData(eventData.getModuleName(), eventData.getArtifactTypeId() , eventData.getArtifacts() != null
? eventData.getArtifacts()
.stream()
.map(BlackboardArtifact::getArtifactID)
@@ -112,10 +112,10 @@ public final class BlackboardPostEvent extends AutopsyEvent implements Serializa
private static final long serialVersionUID = 1L;
private final String moduleName;
private int artifactTypeId;
private BlackboardArtifact.Type artifactTypeId;
private Collection<Long> artifactIds;
private SerializableEventData(String moduleName, int artifactTypeId, Collection<Long> artifactIds) {
private SerializableEventData(String moduleName, BlackboardArtifact.Type artifactTypeId, Collection<Long> artifactIds) {
this.moduleName = moduleName;
this.artifactTypeId = artifactTypeId;
this.artifactIds = new ArrayList<>(artifactIds);