19 package org.sleuthkit.autopsy.communications;
21 import java.util.List;
23 import java.util.logging.Level;
24 import org.openide.nodes.AbstractNode;
25 import org.openide.nodes.ChildFactory;
26 import org.openide.nodes.Children;
27 import org.openide.nodes.Node;
28 import org.python.google.common.collect.Iterables;
42 final class AccountDetailsNode
extends AbstractNode {
44 private final static Logger logger = Logger.getLogger(AccountDetailsNode.class.getName());
46 AccountDetailsNode(Set<AccountDeviceInstance> accountDeviceInstances, CommunicationsFilter filter, CommunicationsManager commsManager) {
47 super(Children.create(
new AccountRelationshipChildren(accountDeviceInstances, commsManager, filter),
true));
48 String displayName = (accountDeviceInstances.size() == 1)
49 ? Iterables.getOnlyElement(accountDeviceInstances).getAccount().getTypeSpecificID()
50 : accountDeviceInstances.size() +
" accounts";
51 setDisplayName(displayName);
61 private final CommunicationsFilter
filter;
63 private AccountRelationshipChildren(Set<AccountDeviceInstance> accountDeviceInstances, CommunicationsManager commsManager, CommunicationsFilter filter) {
72 list.addAll(commsManager.getRelationshipSources(accountDeviceInstances, filter));
73 }
catch (TskCoreException ex) {
74 logger.log(Level.SEVERE,
"Error getting communications", ex);
81 if (t instanceof BlackboardArtifact) {
82 return new RelationshipNode((BlackboardArtifact) t);
84 throw new UnsupportedOperationException(
"Cannot create a RelationshipNode for non BlackboardArtifact content.");
boolean createKeys(List< Content > list)
final CommunicationsManager commsManager
Node createNodeForKey(Content t)
final Set< AccountDeviceInstance > accountDeviceInstances
final CommunicationsFilter filter
AccountRelationshipChildren(Set< AccountDeviceInstance > accountDeviceInstances, CommunicationsManager commsManager, CommunicationsFilter filter)