20 package org.sleuthkit.autopsy.communications.relationships;
 
   22 import java.util.List;
 
   23 import java.util.TimeZone;
 
   24 import java.util.concurrent.ExecutionException;
 
   25 import java.util.logging.Level;
 
   26 import org.openide.nodes.Node;
 
   27 import org.openide.util.NbBundle;
 
   36 import static org.
sleuthkit.datamodel.BlackboardAttribute.ATTRIBUTE_TYPE.TSK_NAME;
 
   37 import static org.
sleuthkit.datamodel.BlackboardAttribute.TSK_BLACKBOARD_ATTRIBUTE_VALUE_TYPE.DATETIME;
 
   48     private static final BlackboardAttribute.Type 
NAME_ATTRIBUTE = 
new BlackboardAttribute.Type(BlackboardAttribute.ATTRIBUTE_TYPE.fromID(TSK_NAME.getTypeID()));
 
   66     static String getAttributeDisplayString(
final BlackboardArtifact artifact, 
final BlackboardAttribute.ATTRIBUTE_TYPE attributeType) {
 
   68             BlackboardAttribute attribute = artifact.getAttribute(
new BlackboardAttribute.Type(BlackboardAttribute.ATTRIBUTE_TYPE.fromID(attributeType.getTypeID())));
 
   69             if (attribute == null) {
 
   71             } 
else if (attributeType.getValueType() == DATETIME) {
 
   72                 return TimeUtilities.epochToTime(attribute.getValueLong(),
 
   75                 return attribute.getDisplayString();
 
   77         } 
catch (TskCoreException tskCoreException) {
 
   78             logger.log(Level.WARNING, 
"Error getting attribute value.", tskCoreException); 
 
   84         "# {0} - Contact Name",
 
   85         "# {1} - Persona Name",
 
   86         "RelationshipsNodeUtilities_Tooltip_Template=Contact: {0} - Persona: {1}",
 
   87         "# {0} - PersonaAccount count",
 
   88         "RelationshipsNodeUtilities_Tooltip_suffix=(1 of {0})" 
   95         List<PersonaAccount> personaList;
 
   96         List<BlackboardArtifact> contactArtifactList;
 
  100         } 
catch (ExecutionException ex) {
 
  101             logger.log(Level.WARNING, 
"Failed to retrieve Persona details for node.", ex);
 
  106         if (personaList != null && !personaList.isEmpty()) {
 
  107             personaName = personaList.get(0).getPersona().getName();
 
  108             if (personaList.size() > 1) {
 
  109                 personaName += Bundle.RelationshipsNodeUtilities_Tooltip_suffix(Integer.toString(personaList.size()));
 
  112             personaName = 
"None";
 
  115         String contactName = displayName;
 
  116         if (contactArtifactList != null && !contactArtifactList.isEmpty()) {
 
  118                 BlackboardArtifact contactArtifact = contactArtifactList.get(0);
 
  119                 BlackboardAttribute attribute = contactArtifact.getAttribute(
NAME_ATTRIBUTE);
 
  120                 if (attribute != null) {
 
  121                     contactName = attribute.getValueString();
 
  123             } 
catch (TskCoreException ex) {
 
  124                 logger.log(Level.WARNING, 
"Failed to retrive name attribute from contact artifact.", ex);
 
  128         return Bundle.RelationshipsNodeUtilities_Tooltip_Template(contactName, personaName);
 
static synchronized List< PersonaAccount > getPersonaAccounts(Account account)
 
RelationshipsNodeUtilities()
 
static final Logger logger
 
static ZoneId getUserPreferredZoneId()
 
static String getAccoutToolTipText(String displayName, Account account)
 
synchronized static Logger getLogger(String name)
 
static final BlackboardAttribute.Type NAME_ATTRIBUTE