19 package org.sleuthkit.autopsy.communications.relationships;
21 import java.util.List;
23 import java.util.logging.Level;
36 class AccountSummary {
38 private int attachmentCnt;
39 private int messagesCnt;
41 private int callLogCnt;
42 private int contactsCnt;
44 private int referenceCnt;
46 private final Account selectedAccount;
47 private final Set<BlackboardArtifact> artifacts;
49 private static final Logger logger = Logger.getLogger(AccountSummary.class.getName());
57 AccountSummary(Account selectedAccount, Set<BlackboardArtifact> artifacts) {
58 this.selectedAccount = selectedAccount;
59 this.artifacts = artifacts;
66 private void initCounts() {
67 for (BlackboardArtifact artifact : artifacts) {
68 BlackboardArtifact.ARTIFACT_TYPE fromID = BlackboardArtifact.ARTIFACT_TYPE.fromID(artifact.getArtifactTypeID());
81 if (selectedAccount.getAccountType() != Account.Type.DEVICE) {
82 String typeSpecificID = selectedAccount.getTypeSpecificID();
84 List<BlackboardAttribute> attributes = null;
87 attributes = artifact.getAttributes();
88 }
catch(TskCoreException ex) {
89 logger.log(Level.WARNING, String.format(
"Unable to getAttributes for artifact: %d", artifact.getArtifactID()), ex);
93 boolean isReference =
false;
95 for (BlackboardAttribute attribute: attributes) {
96 String attributeTypeName = attribute.getAttributeType().getTypeName();
97 String attributeValue = attribute.getValueString();
99 if (attributeTypeName.contains(
"PHONE")) {
100 attributeValue = RelationshipsNodeUtilities.normalizePhoneNum(attributeValue);
101 }
else if (attributeTypeName.contains(
"EMAIL")) {
102 attributeValue = RelationshipsNodeUtilities.normalizeEmailAddress(attributeValue);
105 if ( typeSpecificID.equals(attributeValue) ) {
124 attachmentCnt += artifact.getChildrenCount();
125 for (Content childContent : artifact.getChildren()) {
126 if (ImageUtils.thumbnailSupported(childContent)) {
130 }
catch (TskCoreException ex) {
131 logger.log(Level.WARNING, String.format(
"Exception thrown "
132 +
"from getChildrenCount artifactID: %d",
133 artifact.getArtifactID()), ex);
143 public int getAttachmentCnt() {
144 return attachmentCnt;
152 public int getMessagesCnt() {
161 public int getEmailCnt() {
170 public int getCallLogCnt() {
179 public int getContactsCnt() {
188 public int getThumbnailCnt() {
197 public int getReferenceCnt() {