19 package org.sleuthkit.autopsy.communications.relationships;
21 import java.util.Comparator;
22 import java.util.List;
24 import java.util.logging.Level;
25 import org.openide.nodes.ChildFactory;
26 import org.openide.nodes.Node;
70 protected boolean createKeys(List<BlackboardArtifact> list) {
72 if(selectionInfo == null) {
76 final Set<Content> relationshipSources;
78 relationshipSources = selectionInfo.getRelationshipSources();
80 logger.log(Level.SEVERE,
"Failed to load relationship sources.", ex);
85 for(
Content content: relationshipSources) {
90 BlackboardArtifact bba = (BlackboardArtifact) content;
91 BlackboardArtifact.ARTIFACT_TYPE fromID = BlackboardArtifact.ARTIFACT_TYPE.fromID(bba.
getArtifactTypeID());
93 if (fromID != BlackboardArtifact.ARTIFACT_TYPE.TSK_EMAIL_MSG
94 && fromID != BlackboardArtifact.ARTIFACT_TYPE.TSK_MESSAGE) {
102 String artifactThreadID = MessageNode.UNTHREADED_ID;
106 if(attribute != null) {
110 if(threadIDs == null || threadIDs.contains(artifactThreadID)) {
116 logger.log(Level.SEVERE,
"Failed to load artifacts for relationship sources.", ex);
119 list.sort(
new DateComparator());
126 return new MessageNode(key, null, null);
134 class DateComparator
implements Comparator<BlackboardArtifact> {
143 long dateTime1 = Long.MAX_VALUE;
144 long dateTime2 = Long.MAX_VALUE;
148 if (fromID != null) {
164 }
catch (TskCoreException ex) {
165 logger.log(Level.WARNING, String.format(
"Unable to compare attributes for artifact %d", bba1.
getArtifactID()), ex);
171 BlackboardArtifact.ARTIFACT_TYPE fromID = BlackboardArtifact.ARTIFACT_TYPE.fromID(bba2.
getArtifactTypeID());
172 if (fromID != null) {
176 attribute2 = bba2.
getAttribute(
new BlackboardAttribute.Type(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_DATETIME_SENT));
179 attribute2 = bba2.
getAttribute(
new BlackboardAttribute.Type(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_DATETIME));
182 attribute2 = bba2.
getAttribute(
new BlackboardAttribute.Type(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_DATETIME_START));
188 }
catch (TskCoreException ex) {
189 logger.log(Level.WARNING, String.format(
"Unable to compare attributes for artifact %d", bba2.
getArtifactID()), ex);
194 if (attribute1 != null) {
198 if (attribute2 != null) {
202 return Long.compare(dateTime1, dateTime2);
static ARTIFACT_TYPE fromID(int id)
boolean createKeys(List< BlackboardArtifact > list)
Node createNodeForKey(BlackboardArtifact key)
BlackboardAttribute getAttribute(BlackboardAttribute.Type attributeType)
SelectionInfo selectionInfo
static final Logger logger
void refresh(SelectionInfo selectionInfo, List< String > threadIDs)
synchronized static Logger getLogger(String name)