19 package org.sleuthkit.autopsy.communications.relationships;
21 import java.util.List;
23 import java.util.logging.Level;
24 import org.openide.nodes.ChildFactory;
25 import org.openide.nodes.Node;
30 import static org.
sleuthkit.datamodel.BlackboardArtifact.ARTIFACT_TYPE.TSK_CONTACT;
38 final class ContactsChildNodeFactory
extends ChildFactory<BlackboardArtifact>{
39 private static final Logger logger = Logger.getLogger(ContactsChildNodeFactory.class.getName());
41 private SelectionInfo selectionInfo;
49 ContactsChildNodeFactory(SelectionInfo selectionInfo) {
50 this.selectionInfo = selectionInfo;
58 public void refresh(SelectionInfo selectionInfo) {
59 this.selectionInfo = selectionInfo;
70 protected boolean createKeys(List<BlackboardArtifact> list) {
71 CommunicationsManager communicationManager;
73 communicationManager = Case.getCurrentCaseThrows().getSleuthkitCase().getCommunicationsManager();
74 }
catch (NoCurrentCaseException | TskCoreException ex) {
75 logger.log(Level.SEVERE,
"Failed to get communications manager from case.", ex);
79 if(selectionInfo == null) {
83 final Set<Content> relationshipSources;
86 relationshipSources = communicationManager.getRelationshipSources(selectionInfo.getAccountDevicesInstances(), selectionInfo.getCommunicationsFilter());
88 relationshipSources.stream().filter((content) -> (content instanceof BlackboardArtifact)).forEachOrdered((content) -> {
90 BlackboardArtifact bba = (BlackboardArtifact) content;
91 BlackboardArtifact.ARTIFACT_TYPE fromID = BlackboardArtifact.ARTIFACT_TYPE.fromID(bba.getArtifactTypeID());
93 if (fromID == TSK_CONTACT) {
98 }
catch (TskCoreException ex) {
99 logger.log(Level.SEVERE,
"Failed to get relationship sources.", ex);
106 protected Node createNodeForKey(BlackboardArtifact key) {
107 return new ContactNode(key);