Autopsy  4.5.0
Graphical digital forensics platform for The Sleuth Kit and other tools.
AccountDetailsNode.java
Go to the documentation of this file.
1 /*
2  * Autopsy Forensic Browser
3  *
4  * Copyright 2017 Basis Technology Corp.
5  * Contact: carrier <at> sleuthkit <dot> org
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  */
19 package org.sleuthkit.autopsy.communications;
20 
21 import java.util.List;
22 import java.util.Set;
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;
29 import org.sleuthkit.datamodel.AccountDeviceInstance;
30 import org.sleuthkit.datamodel.BlackboardArtifact;
31 import org.sleuthkit.datamodel.CommunicationsFilter;
32 import org.sleuthkit.datamodel.CommunicationsManager;
33 import org.sleuthkit.datamodel.Content;
34 import org.sleuthkit.datamodel.TskCoreException;
35 
41 class AccountDetailsNode extends AbstractNode {
42 
43  private final static Logger logger = Logger.getLogger(AccountDetailsNode.class.getName());
44 
45  AccountDetailsNode(Set<AccountDeviceInstance> accountDeviceInstances, CommunicationsFilter filter, CommunicationsManager commsManager) {
46  super(Children.create(new AccountRelationshipChildren(accountDeviceInstances, commsManager, filter), true));
47  }
48 
52  private static class AccountRelationshipChildren extends ChildFactory<Content> {
53 
54  private final Set<AccountDeviceInstance> accountDeviceInstances;
55  private final CommunicationsManager commsManager;
56  private final CommunicationsFilter filter;
57 
58  private AccountRelationshipChildren(Set<AccountDeviceInstance> accountDeviceInstances, CommunicationsManager commsManager, CommunicationsFilter filter) {
59  this.accountDeviceInstances = accountDeviceInstances;
60  this.commsManager = commsManager;
61  this.filter = filter;
62  }
63 
64  @Override
65  protected boolean createKeys(List<Content> list) {
66  try {
67  list.addAll(commsManager.getRelationshipSources(accountDeviceInstances, filter));
68  } catch (TskCoreException ex) {
69  logger.log(Level.SEVERE, "Error getting communications", ex);
70  }
71  return true;
72  }
73 
74  @Override
75  protected Node createNodeForKey(Content t) {
76  if (t instanceof BlackboardArtifact) {
77  return new RelationshipNode((BlackboardArtifact) t);
78  } else {
79  throw new UnsupportedOperationException("Cannot create a RelationshipNode for non BlackboardArtifact content.");
80  }
81  }
82  }
83 }
synchronized static Logger getLogger(String name)
Definition: Logger.java:124
AccountRelationshipChildren(Set< AccountDeviceInstance > accountDeviceInstances, CommunicationsManager commsManager, CommunicationsFilter filter)

Copyright © 2012-2016 Basis Technology. Generated on: Tue Feb 20 2018
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.