19 package org.sleuthkit.autopsy.datamodel.accounts;
21 import com.google.common.collect.Range;
22 import com.google.common.collect.RangeMap;
23 import com.google.common.collect.TreeRangeMap;
24 import com.google.common.eventbus.EventBus;
25 import com.google.common.eventbus.Subscribe;
26 import java.awt.event.ActionEvent;
27 import java.beans.PropertyChangeEvent;
28 import java.beans.PropertyChangeListener;
29 import java.sql.ResultSet;
30 import java.sql.SQLException;
31 import java.util.ArrayList;
32 import java.util.Arrays;
33 import java.util.Collection;
34 import java.util.Collections;
35 import java.util.EnumSet;
36 import java.util.HashSet;
37 import java.util.List;
38 import java.util.Objects;
39 import java.util.Optional;
41 import java.util.function.Function;
42 import java.util.logging.Level;
43 import java.util.stream.Collectors;
44 import java.util.stream.Stream;
45 import javax.annotation.Nonnull;
46 import javax.annotation.concurrent.Immutable;
47 import javax.swing.AbstractAction;
48 import javax.swing.Action;
49 import org.apache.commons.lang3.StringUtils;
50 import org.openide.nodes.ChildFactory;
51 import org.openide.nodes.Children;
52 import org.openide.nodes.Node;
53 import org.openide.nodes.NodeNotFoundException;
54 import org.openide.nodes.NodeOp;
55 import org.openide.nodes.Sheet;
56 import org.openide.util.NbBundle;
57 import org.openide.util.Utilities;
58 import org.openide.util.lookup.Lookups;
77 import org.
sleuthkit.datamodel.BlackboardArtifact.ARTIFACT_TYPE;
91 private static final String
ICON_BASE_PATH =
"/org/sleuthkit/autopsy/images/";
93 @NbBundle.Messages(
"AccountsRootNode.name=Accounts")
94 final public static String
NAME = Bundle.AccountsRootNode_name();
122 public Accounts(SleuthkitCase skCase,
long objId) {
124 this.filteringDSObjId = objId;
133 return visitor.
visit(
this);
144 return showRejected ?
" " :
" AND blackboard_artifacts.review_status_id != " + BlackboardArtifact.ReviewStatus.REJECTED.getID() +
" ";
154 if (filteringDSObjId > 0) {
155 return " AND blackboard_artifacts.data_source_obj_id = " + filteringDSObjId +
" ";
193 abstract protected boolean createKeys(List<X> list);
208 super.removeNotify();
223 @NbBundle.Messages({
"Accounts.RootNode.displayName=Accounts"})
229 setDisplayName(Bundle.Accounts_RootNode_displayName());
230 this.setIconBaseWithExtension(
"org/sleuthkit/autopsy/images/accounts.png");
240 return visitor.
visit(
this);
245 return getClass().getName();
258 private final PropertyChangeListener
pcl =
new PropertyChangeListener() {
260 public void propertyChange(PropertyChangeEvent evt) {
261 String eventType = evt.getPropertyName();
278 if (null != eventData
280 reviewStatusBus.post(eventData);
301 if (evt.getNewValue() == null) {
323 String accountTypesInUseQuery =
324 "SELECT DISTINCT blackboard_attributes.value_text as account_type "
325 +
" FROM blackboard_artifacts "
326 +
" JOIN blackboard_attributes ON blackboard_artifacts.artifact_id = blackboard_attributes.artifact_id "
327 +
" WHERE blackboard_attributes.attribute_type_id = " + BlackboardAttribute.ATTRIBUTE_TYPE.TSK_ACCOUNT_TYPE.getTypeID()
330 try (SleuthkitCase.CaseDbQuery executeQuery = skCase.executeQuery(accountTypesInUseQuery );
331 ResultSet resultSet = executeQuery.getResultSet()) {
332 while (resultSet.next()) {
333 String accountType = resultSet.getString(
"account_type");
334 list.add(accountType);
336 }
catch (TskCoreException | SQLException ex) {
337 LOGGER.log(Level.SEVERE,
"Error querying for account_types", ex);
346 if (Account.Type.CREDIT_CARD.getTypeName().equals(acountTypeName)) {
351 Account.Type accountType = skCase.getCommunicationsManager().getAccountType(acountTypeName);
353 }
catch (TskCoreException ex) {
354 LOGGER.log(Level.SEVERE,
"Error getting display name for account type. ", ex);
366 super.removeNotify();
388 private final PropertyChangeListener
pcl =
new PropertyChangeListener() {
390 public void propertyChange(PropertyChangeEvent evt) {
391 String eventType = evt.getPropertyName();
408 if (null != eventData
410 reviewStatusBus.post(eventData);
432 if (evt.getNewValue() == null) {
453 super.removeNotify();
459 "SELECT blackboard_artifacts.artifact_id "
460 +
" FROM blackboard_artifacts "
461 +
" JOIN blackboard_attributes ON blackboard_artifacts.artifact_id = blackboard_attributes.artifact_id "
462 +
" WHERE blackboard_artifacts.artifact_type_id = " + BlackboardArtifact.ARTIFACT_TYPE.TSK_ACCOUNT.getTypeID()
463 +
" AND blackboard_attributes.attribute_type_id = " + BlackboardAttribute.ATTRIBUTE_TYPE.TSK_ACCOUNT_TYPE.getTypeID()
464 +
" AND blackboard_attributes.value_text = '" +
accountType.getTypeName() +
"'"
467 try (SleuthkitCase.CaseDbQuery results = skCase.executeQuery(query);
468 ResultSet rs = results.getResultSet();) {
470 list.add(rs.getLong(
"artifact_id"));
472 }
catch (TskCoreException | SQLException ex) {
473 LOGGER.log(Level.SEVERE,
"Error querying for account artifacts.", ex);
483 }
catch (TskCoreException ex) {
484 LOGGER.log(Level.SEVERE,
"Error get black board artifact with id " + t, ex);
521 return visitor.
visit(
this);
526 return getClass().getName();
540 private final PropertyChangeListener pcl =
new PropertyChangeListener() {
542 public void propertyChange(PropertyChangeEvent evt) {
543 String eventType = evt.getPropertyName();
560 if (null != eventData
562 reviewStatusBus.post(eventData);
584 if (evt.getNewValue() == null) {
617 super.removeNotify();
624 protected boolean createKeys(List<CreditCardViewMode> list) {
653 super(Children.create(
new ViewModeFactory(),
true), Lookups.singleton(Account.Type.CREDIT_CARD.getDisplayName()));
654 setName(Account.Type.CREDIT_CARD.getDisplayName());
655 this.setIconBaseWithExtension(
"org/sleuthkit/autopsy/images/credit-cards.png");
665 return visitor.
visit(
this);
670 return getClass().getName();
676 private final PropertyChangeListener pcl =
new PropertyChangeListener() {
678 public void propertyChange(PropertyChangeEvent evt) {
679 String eventType = evt.getPropertyName();
696 if (null != eventData
698 reviewStatusBus.post(eventData);
720 if (evt.getNewValue() == null) {
741 super.removeNotify();
759 "SELECT blackboard_artifacts.obj_id,"
760 +
" solr_attribute.value_text AS solr_document_id, ";
761 if (skCase.getDatabaseType().equals(DbType.POSTGRESQL)) {
762 query +=
" string_agg(blackboard_artifacts.artifact_id::character varying, ',') AS artifact_IDs, "
763 +
" string_agg(blackboard_artifacts.review_status_id::character varying, ',') AS review_status_ids, ";
765 query +=
" GROUP_CONCAT(blackboard_artifacts.artifact_id) AS artifact_IDs, "
766 +
" GROUP_CONCAT(blackboard_artifacts.review_status_id) AS review_status_ids, ";
768 query +=
" COUNT( blackboard_artifacts.artifact_id) AS hits "
769 +
" FROM blackboard_artifacts "
770 +
" LEFT JOIN blackboard_attributes as solr_attribute ON blackboard_artifacts.artifact_id = solr_attribute.artifact_id "
771 +
" AND solr_attribute.attribute_type_id = " + BlackboardAttribute.ATTRIBUTE_TYPE.TSK_KEYWORD_SEARCH_DOCUMENT_ID.getTypeID()
772 +
" LEFT JOIN blackboard_attributes as account_type ON blackboard_artifacts.artifact_id = account_type.artifact_id "
773 +
" AND account_type.attribute_type_id = " + BlackboardAttribute.ATTRIBUTE_TYPE.TSK_ACCOUNT_TYPE.getTypeID()
774 +
" AND account_type.value_text = '" + Account.Type.CREDIT_CARD.getTypeName() +
"'"
775 +
" WHERE blackboard_artifacts.artifact_type_id = " + BlackboardArtifact.ARTIFACT_TYPE.TSK_ACCOUNT.getTypeID()
778 +
" GROUP BY blackboard_artifacts.obj_id, solr_document_id "
779 +
" ORDER BY hits DESC ";
780 try (SleuthkitCase.CaseDbQuery results = skCase.executeQuery(query);
781 ResultSet resultSet = results.getResultSet();) {
782 while (resultSet.next()) {
784 resultSet.getLong(
"obj_id"),
785 resultSet.getString(
"solr_document_id"),
786 unGroupConcat(resultSet.getString(
"artifact_IDs"), Long::valueOf),
787 resultSet.getLong(
"hits"),
788 new HashSet<>(unGroupConcat(resultSet.getString(
"review_status_ids"), reviewStatusID -> BlackboardArtifact.ReviewStatus.withID(Integer.valueOf(reviewStatusID))))));
790 }
catch (TskCoreException | SQLException ex) {
791 LOGGER.log(Level.SEVERE,
"Error querying for files with ccn hits.", ex);
801 List<Object> lookupContents =
new ArrayList<>();
803 lookupContents.add(skCase.getBlackboardArtifact(artId));
805 AbstractFile abstractFileById = skCase.getAbstractFileById(key.
getObjID());
806 lookupContents.add(abstractFileById);
807 return new Node[]{
new FileWithCCNNode(key, abstractFileById, lookupContents.toArray())};
808 }
catch (TskCoreException ex) {
809 LOGGER.log(Level.SEVERE,
"Error getting content for file with ccn hits.", ex);
828 this.setIconBaseWithExtension(
"org/sleuthkit/autopsy/images/file-icon.png");
829 reviewStatusBus.register(
this);
833 "# {0} - number of children",
834 "Accounts.ByFileNode.displayName=By File ({0})"})
837 "SELECT count(*) FROM ( SELECT count(*) AS documents "
838 +
" FROM blackboard_artifacts "
839 +
" LEFT JOIN blackboard_attributes as solr_attribute ON blackboard_artifacts.artifact_id = solr_attribute.artifact_id "
840 +
" AND solr_attribute.attribute_type_id = " + BlackboardAttribute.ATTRIBUTE_TYPE.TSK_KEYWORD_SEARCH_DOCUMENT_ID.getTypeID()
841 +
" LEFT JOIN blackboard_attributes as account_type ON blackboard_artifacts.artifact_id = account_type.artifact_id "
842 +
" AND account_type.attribute_type_id = " + BlackboardAttribute.ATTRIBUTE_TYPE.TSK_ACCOUNT_TYPE.getTypeID()
843 +
" AND account_type.value_text = '" + Account.Type.CREDIT_CARD.getTypeName() +
"'"
844 +
" WHERE blackboard_artifacts.artifact_type_id = " + BlackboardArtifact.ARTIFACT_TYPE.TSK_ACCOUNT.getTypeID()
847 +
" GROUP BY blackboard_artifacts.obj_id, solr_attribute.value_text ) AS foo";
848 try (SleuthkitCase.CaseDbQuery results = skCase.executeQuery(query);
849 ResultSet resultSet = results.getResultSet();) {
850 while (resultSet.next()) {
851 if (skCase.getDatabaseType().equals(DbType.POSTGRESQL)) {
852 setDisplayName(Bundle.Accounts_ByFileNode_displayName(resultSet.getLong(
"count")));
854 setDisplayName(Bundle.Accounts_ByFileNode_displayName(resultSet.getLong(
"count(*)")));
857 }
catch (TskCoreException | SQLException ex) {
858 LOGGER.log(Level.SEVERE,
"Error querying for files with ccn hits.", ex);
870 return visitor.
visit(
this);
875 return getClass().getName();
891 private final PropertyChangeListener pcl =
new PropertyChangeListener() {
893 public void propertyChange(PropertyChangeEvent evt) {
894 String eventType = evt.getPropertyName();
911 if (null != eventData
913 reviewStatusBus.post(eventData);
934 && (evt.getNewValue() == null)) {
955 super.removeNotify();
973 RangeMap<Integer, BinResult> binRanges = TreeRangeMap.create();
976 "SELECT SUBSTR(blackboard_attributes.value_text,1,8) AS BIN, "
977 +
" COUNT(blackboard_artifacts.artifact_id) AS count "
978 +
" FROM blackboard_artifacts "
979 +
" JOIN blackboard_attributes ON blackboard_artifacts.artifact_id = blackboard_attributes.artifact_id"
980 +
" WHERE blackboard_artifacts.artifact_type_id = " + BlackboardArtifact.ARTIFACT_TYPE.TSK_ACCOUNT.getTypeID()
981 +
" AND blackboard_attributes.attribute_type_id = " + BlackboardAttribute.ATTRIBUTE_TYPE.TSK_CARD_NUMBER.getTypeID()
986 try (SleuthkitCase.CaseDbQuery results = skCase.executeQuery(query);
987 ResultSet resultSet = results.getResultSet();) {
989 while (resultSet.next()) {
990 final Integer bin = Integer.valueOf(resultSet.getString(
"BIN"));
991 long count = resultSet.getLong(
"count");
994 BinResult previousResult = binRanges.get(bin);
996 if (previousResult != null) {
997 binRanges.remove(Range.closed(previousResult.getBINStart(), previousResult.getBINEnd()));
998 count += previousResult.getCount();
1001 if (binRange == null) {
1002 binRanges.put(Range.closed(bin, bin),
new BinResult(count, bin, bin));
1007 binRanges.asMapOfRanges().values().forEach(list::add);
1008 }
catch (TskCoreException | SQLException ex) {
1009 LOGGER.log(Level.SEVERE,
"Error querying for BINs.", ex);
1017 return new Node[]{
new BINNode(key)};
1030 @NbBundle.Messages(
"Accounts.ByBINNode.name=By BIN")
1032 super(Children.create(
new BINFactory(),
true), Lookups.singleton(Bundle.Accounts_ByBINNode_name()));
1033 setName(Bundle.Accounts_ByBINNode_name());
1034 updateDisplayName();
1035 this.setIconBaseWithExtension(
"org/sleuthkit/autopsy/images/bank.png");
1036 reviewStatusBus.register(
this);
1039 @NbBundle.Messages({
1040 "# {0} - number of children",
1041 "Accounts.ByBINNode.displayName=By BIN ({0})"})
1044 "SELECT count(distinct SUBSTR(blackboard_attributes.value_text,1,8)) AS BINs "
1045 +
" FROM blackboard_artifacts "
1046 +
" JOIN blackboard_attributes ON blackboard_artifacts.artifact_id = blackboard_attributes.artifact_id"
1047 +
" WHERE blackboard_artifacts.artifact_type_id = " + BlackboardArtifact.ARTIFACT_TYPE.TSK_ACCOUNT.getTypeID()
1048 +
" AND blackboard_attributes.attribute_type_id = " + BlackboardAttribute.ATTRIBUTE_TYPE.TSK_CARD_NUMBER.getTypeID()
1051 try (SleuthkitCase.CaseDbQuery results = skCase.executeQuery(query);
1052 ResultSet resultSet = results.getResultSet();) {
1053 while (resultSet.next()) {
1054 setDisplayName(Bundle.Accounts_ByBINNode_displayName(resultSet.getLong(
"BINs")));
1056 }
catch (TskCoreException | SQLException ex) {
1057 LOGGER.log(Level.SEVERE,
"Error querying for BINs.", ex);
1068 return visitor.
visit(
this);
1073 return getClass().getName();
1078 updateDisplayName();
1083 updateDisplayName();
1097 hash = 79 * hash + (int) (this.objID ^ (this.objID >>> 32));
1098 hash = 79 * hash + Objects.hashCode(this.keywordSearchDocID);
1099 hash = 79 * hash + Objects.hashCode(this.artifactIDs);
1100 hash = 79 * hash + (int) (this.hits ^ (this.hits >>> 32));
1101 hash = 79 * hash + Objects.hashCode(this.statuses);
1113 if (getClass() != obj.getClass()) {
1117 if (this.objID != other.
objID) {
1120 if (this.hits != other.
hits) {
1126 if (!Objects.equals(
this.artifactIDs, other.
artifactIDs)) {
1129 if (!Objects.equals(
this.statuses, other.
statuses)) {
1139 private final Set<BlackboardArtifact.ReviewStatus>
statuses;
1141 private FileWithCCN(
long objID, String solrDocID, List<Long> artifactIDs,
long hits, Set<BlackboardArtifact.ReviewStatus> statuses) {
1143 this.keywordSearchDocID = solrDocID;
1144 this.artifactIDs = artifactIDs;
1146 this.statuses = statuses;
1165 return keywordSearchDocID;
1212 static <X> List<X> unGroupConcat(String groupConcat, Function<String, X> mapper) {
1213 return StringUtils.isBlank(groupConcat) ? Collections.emptyList()
1214 : Stream.of(groupConcat.split(
","))
1216 .collect(Collectors.toList());
1236 @NbBundle.Messages({
1237 "# {0} - raw file name",
1238 "# {1} - solr chunk id",
1239 "Accounts.FileWithCCNNode.unallocatedSpaceFile.displayName={0}_chunk_{1}"})
1241 super(Children.LEAF, Lookups.fixed(lookupContents));
1245 : Bundle.Accounts_FileWithCCNNode_unallocatedSpaceFile_displayName(content.getName(), StringUtils.substringAfter(key.
getkeywordSearchDocID(),
"_"));
1246 setName(fileName + key.
getObjID());
1247 setDisplayName(fileName);
1257 return visitor.
visit(
this);
1262 return getClass().getName();
1266 @NbBundle.Messages({
1267 "Accounts.FileWithCCNNode.nameProperty.displayName=File",
1268 "Accounts.FileWithCCNNode.accountsProperty.displayName=Accounts",
1269 "Accounts.FileWithCCNNode.statusProperty.displayName=Status",
1270 "Accounts.FileWithCCNNode.noDescription=no description"})
1272 Sheet sheet = super.createSheet();
1273 Sheet.Set propSet = sheet.get(Sheet.PROPERTIES);
1274 if (propSet == null) {
1275 propSet = Sheet.createPropertiesSet();
1279 propSet.put(
new NodeProperty<>(Bundle.Accounts_FileWithCCNNode_nameProperty_displayName(),
1280 Bundle.Accounts_FileWithCCNNode_nameProperty_displayName(),
1281 Bundle.Accounts_FileWithCCNNode_noDescription(),
1283 propSet.put(
new NodeProperty<>(Bundle.Accounts_FileWithCCNNode_accountsProperty_displayName(),
1284 Bundle.Accounts_FileWithCCNNode_accountsProperty_displayName(),
1285 Bundle.Accounts_FileWithCCNNode_noDescription(),
1287 propSet.put(
new NodeProperty<>(Bundle.Accounts_FileWithCCNNode_statusProperty_displayName(),
1288 Bundle.Accounts_FileWithCCNNode_statusProperty_displayName(),
1289 Bundle.Accounts_FileWithCCNNode_noDescription(),
1291 .map(BlackboardArtifact.ReviewStatus::getDisplayName)
1292 .collect(Collectors.joining(
", "))));
1299 Action[] actions = super.getActions(context);
1300 ArrayList<Action> arrayList =
new ArrayList<>();
1301 arrayList.addAll(Arrays.asList(actions));
1304 }
catch (TskCoreException ex) {
1305 LOGGER.log(Level.SEVERE,
"Error gettung content by id", ex);
1308 arrayList.add(approveActionInstance);
1309 arrayList.add(rejectActionInstance);
1311 return arrayList.toArray(
new Action[arrayList.size()]);
1339 "SELECT blackboard_artifacts.artifact_id "
1340 +
" FROM blackboard_artifacts "
1341 +
" JOIN blackboard_attributes ON blackboard_artifacts.artifact_id = blackboard_attributes.artifact_id "
1342 +
" WHERE blackboard_artifacts.artifact_type_id = " + BlackboardArtifact.ARTIFACT_TYPE.TSK_ACCOUNT.getTypeID()
1343 +
" AND blackboard_attributes.attribute_type_id = " + BlackboardAttribute.ATTRIBUTE_TYPE.TSK_CARD_NUMBER.getTypeID()
1344 +
" AND blackboard_attributes.value_text >= '" + bin.getBINStart() +
"' AND blackboard_attributes.value_text < '" + (bin.getBINEnd() + 1) +
"'"
1347 +
" ORDER BY blackboard_attributes.value_text";
1348 try (SleuthkitCase.CaseDbQuery results = skCase.executeQuery(query);
1349 ResultSet rs = results.getResultSet();) {
1351 list.add(rs.getLong(
"artifact_id"));
1353 }
catch (TskCoreException | SQLException ex) {
1354 LOGGER.log(Level.SEVERE,
"Error querying for account artifacts.", ex);
1362 if (skCase == null) {
1367 BlackboardArtifact art = skCase.getBlackboardArtifact(artifactID);
1369 }
catch (TskCoreException ex) {
1370 LOGGER.log(Level.SEVERE,
"Error creating BlackboardArtifactNode for artifact with ID " + artifactID, ex);
1377 if (bin.getBINStart() == bin.getBINEnd()) {
1378 return Integer.toString(bin.getBINStart());
1380 return bin.getBINStart() +
"-" + StringUtils.difference(bin.getBINStart() +
"", bin.getBINEnd() +
"");
1393 updateDisplayName();
1394 this.setIconBaseWithExtension(
"org/sleuthkit/autopsy/images/bank.png");
1395 reviewStatusBus.register(
this);
1400 updateDisplayName();
1406 updateDisplayName();
1411 "SELECT count(blackboard_artifacts.artifact_id ) AS count"
1412 +
" FROM blackboard_artifacts "
1413 +
" JOIN blackboard_attributes ON blackboard_artifacts.artifact_id = blackboard_attributes.artifact_id "
1414 +
" WHERE blackboard_artifacts.artifact_type_id = " + BlackboardArtifact.ARTIFACT_TYPE.TSK_ACCOUNT.getTypeID()
1415 +
" AND blackboard_attributes.attribute_type_id = " + BlackboardAttribute.ATTRIBUTE_TYPE.TSK_CARD_NUMBER.getTypeID()
1416 +
" AND blackboard_attributes.value_text >= '" + bin.getBINStart() +
"' AND blackboard_attributes.value_text < '" + (bin.getBINEnd() + 1) +
"'"
1419 try (SleuthkitCase.CaseDbQuery results = skCase.executeQuery(query);
1420 ResultSet resultSet = results.getResultSet();) {
1421 while (resultSet.next()) {
1422 setDisplayName(
getBinRangeString(bin) +
" (" + resultSet.getLong(
"count") +
")");
1424 }
catch (TskCoreException | SQLException ex) {
1425 LOGGER.log(Level.SEVERE,
"Error querying for account artifacts.", ex);
1438 return visitor.
visit(
this);
1443 return getClass().getName();
1447 Sheet.Set sheetSet = sheet.get(Sheet.PROPERTIES);
1448 if (sheetSet == null) {
1449 sheetSet = Sheet.createPropertiesSet();
1450 sheet.put(sheetSet);
1456 @NbBundle.Messages({
1457 "Accounts.BINNode.binProperty.displayName=Bank Identifier Number",
1458 "Accounts.BINNode.accountsProperty.displayName=Accounts",
1459 "Accounts.BINNode.cardTypeProperty.displayName=Payment Card Type",
1460 "Accounts.BINNode.schemeProperty.displayName=Credit Card Scheme",
1461 "Accounts.BINNode.brandProperty.displayName=Brand",
1462 "Accounts.BINNode.bankProperty.displayName=Bank",
1463 "Accounts.BINNode.bankCityProperty.displayName=Bank City",
1464 "Accounts.BINNode.bankCountryProperty.displayName=Bank Country",
1465 "Accounts.BINNode.bankPhoneProperty.displayName=Bank Phone #",
1466 "Accounts.BINNode.bankURLProperty.displayName=Bank URL",
1467 "Accounts.BINNode.noDescription=no description"})
1469 Sheet sheet = super.createSheet();
1470 Sheet.Set properties = getPropertySet(sheet);
1472 properties.put(
new NodeProperty<>(Bundle.Accounts_BINNode_binProperty_displayName(),
1473 Bundle.Accounts_BINNode_binProperty_displayName(),
1474 Bundle.Accounts_BINNode_noDescription(),
1476 properties.put(
new NodeProperty<>(Bundle.Accounts_BINNode_accountsProperty_displayName(),
1477 Bundle.Accounts_BINNode_accountsProperty_displayName(), Bundle.Accounts_BINNode_noDescription(),
1481 if (bin.hasDetails()) {
1482 bin.
getCardType().ifPresent(cardType -> properties.put(
new NodeProperty<>(Bundle.Accounts_BINNode_cardTypeProperty_displayName(),
1483 Bundle.Accounts_BINNode_cardTypeProperty_displayName(), Bundle.Accounts_BINNode_noDescription(),
1485 bin.
getScheme().ifPresent(scheme -> properties.put(
new NodeProperty<>(Bundle.Accounts_BINNode_schemeProperty_displayName(),
1486 Bundle.Accounts_BINNode_schemeProperty_displayName(), Bundle.Accounts_BINNode_noDescription(),
1488 bin.
getBrand().ifPresent(brand -> properties.put(
new NodeProperty<>(Bundle.Accounts_BINNode_brandProperty_displayName(),
1489 Bundle.Accounts_BINNode_brandProperty_displayName(), Bundle.Accounts_BINNode_noDescription(),
1491 bin.
getBankName().ifPresent(bankName -> properties.put(
new NodeProperty<>(Bundle.Accounts_BINNode_bankProperty_displayName(),
1492 Bundle.Accounts_BINNode_bankProperty_displayName(), Bundle.Accounts_BINNode_noDescription(),
1494 bin.
getBankCity().ifPresent(bankCity -> properties.put(
new NodeProperty<>(Bundle.Accounts_BINNode_bankCityProperty_displayName(),
1495 Bundle.Accounts_BINNode_bankCityProperty_displayName(), Bundle.Accounts_BINNode_noDescription(),
1497 bin.
getCountry().ifPresent(country -> properties.put(
new NodeProperty<>(Bundle.Accounts_BINNode_bankCountryProperty_displayName(),
1498 Bundle.Accounts_BINNode_bankCountryProperty_displayName(), Bundle.Accounts_BINNode_noDescription(),
1501 Bundle.Accounts_BINNode_bankPhoneProperty_displayName(), Bundle.Accounts_BINNode_noDescription(),
1503 bin.
getBankURL().ifPresent(url -> properties.put(
new NodeProperty<>(Bundle.Accounts_BINNode_bankURLProperty_displayName(),
1504 Bundle.Accounts_BINNode_bankURLProperty_displayName(), Bundle.Accounts_BINNode_noDescription(),
1511 this.setSheet(createSheet());
1526 hash = 97 * hash + this.binEnd;
1527 hash = 97 * hash + this.binStart;
1539 if (getClass() != obj.getClass()) {
1543 if (this.binEnd != other.
binEnd) {
1546 if (this.binStart != other.
binStart) {
1561 this.binRange = binRange;
1562 binStart = binRange.getBINstart();
1563 binEnd = binRange.getBINend();
1568 this.binRange = null;
1585 boolean hasDetails() {
1586 return binRange != null;
1640 super(artifact,
"org/sleuthkit/autopsy/images/credit-card.png");
1641 this.artifact = artifact;
1642 setName(Long.toString(
this.artifact.getArtifactID()));
1644 reviewStatusBus.register(
this);
1649 List<Action> actionsList =
new ArrayList<>();
1650 actionsList.addAll(Arrays.asList(super.getActions(context)));
1652 actionsList.add(approveActionInstance);
1653 actionsList.add(rejectActionInstance);
1655 return actionsList.toArray(
new Action[actionsList.size()]);
1660 Sheet sheet = super.createSheet();
1661 Sheet.Set properties = sheet.get(Sheet.PROPERTIES);
1662 if (properties == null) {
1663 properties = Sheet.createPropertiesSet();
1664 sheet.put(properties);
1666 properties.put(
new NodeProperty<>(Bundle.Accounts_FileWithCCNNode_statusProperty_displayName(),
1667 Bundle.Accounts_FileWithCCNNode_statusProperty_displayName(),
1668 Bundle.Accounts_FileWithCCNNode_noDescription(),
1669 artifact.getReviewStatus().getDisplayName()));
1678 event.artifacts.stream().filter((art) -> (art.getArtifactID() == this.artifact.getArtifactID())).map((_item) -> {
1680 }).forEachOrdered((_item) -> {
1686 this.setSheet(createSheet());
1694 @NbBundle.Messages(
"ToggleShowRejected.name=Show Rejected Results")
1696 super(Bundle.ToggleShowRejected_name());
1722 this.newStatus = newStatus;
1731 List<String[]> selectedPaths = Utilities.actionsGlobalContext().lookupAll(Node.class).stream()
1733 String[] createPath;
1739 if (newStatus == BlackboardArtifact.ReviewStatus.REJECTED && showRejected ==
false) {
1740 List<Node> siblings = Arrays.asList(node.getParentNode().getChildren().getNodes());
1741 if (siblings.size() > 1) {
1742 int indexOf = siblings.indexOf(node);
1744 Node sibling = indexOf > 0
1745 ? siblings.get(indexOf - 1)
1746 : siblings.get(Integer.max(indexOf + 1, siblings.size() - 1));
1747 createPath = NodeOp.createPath(sibling, null);
1755 createPath = NodeOp.createPath(node, null);
1758 return Arrays.copyOfRange(createPath, 1, createPath.length);
1760 .filter(Objects::nonNull)
1761 .collect(Collectors.toList());
1764 final Collection<? extends BlackboardArtifact> artifacts = Utilities.actionsGlobalContext().lookupAll(BlackboardArtifact.class);
1765 artifacts.forEach(artifact -> {
1767 artifact.setReviewStatus(newStatus);
1768 }
catch (TskCoreException ex) {
1769 LOGGER.log(Level.SEVERE,
"Error changing artifact review status.", ex);
1773 reviewStatusBus.post(
new ReviewStatusChangeEvent(artifacts, newStatus));
1775 final DataResultTopComponent directoryListing = DirectoryTreeTopComponent.findInstance().getDirectoryListing();
1776 final Node rootNode = directoryListing.getRootNode();
1779 List<Node> toArray =
new ArrayList<>();
1780 selectedPaths.forEach(path -> {
1782 toArray.add(NodeOp.findPath(rootNode, path));
1783 }
catch (NodeNotFoundException ex) {
1788 directoryListing.setSelectedNodes(toArray.toArray(
new Node[toArray.size()]));
1794 @NbBundle.Messages({
"ApproveAccountsAction.name=Approve Accounts"})
1796 super(Bundle.ApproveAccountsAction_name(), BlackboardArtifact.ReviewStatus.APPROVED);
1802 @NbBundle.Messages({
"RejectAccountsAction.name=Reject Accounts"})
1804 super(Bundle.RejectAccountsAction_name(), BlackboardArtifact.ReviewStatus.REJECTED);
1810 Collection<? extends BlackboardArtifact> artifacts;
1811 BlackboardArtifact.ReviewStatus newReviewStatus;
1813 ReviewStatusChangeEvent(Collection<? extends BlackboardArtifact> artifacts, BlackboardArtifact.ReviewStatus newReviewStatus) {
1814 this.artifacts = artifacts;
1815 this.newReviewStatus = newReviewStatus;
1826 if (type.equals(Account.Type.CREDIT_CARD)) {
1827 return ICON_BASE_PATH +
"credit-card.png";
1828 }
else if (type.equals(Account.Type.DEVICE)) {
1829 return ICON_BASE_PATH +
"image.png";
1830 }
else if (type.equals(Account.Type.EMAIL)) {
1831 return ICON_BASE_PATH +
"email.png";
1832 }
else if (type.equals(Account.Type.FACEBOOK)) {
1833 return ICON_BASE_PATH +
"facebook.png";
1834 }
else if (type.equals(Account.Type.INSTAGRAM)) {
1835 return ICON_BASE_PATH +
"instagram.png";
1836 }
else if (type.equals(Account.Type.MESSAGING_APP)) {
1837 return ICON_BASE_PATH +
"messaging.png";
1838 }
else if (type.equals(Account.Type.PHONE)) {
1839 return ICON_BASE_PATH +
"phone.png";
1840 }
else if (type.equals(Account.Type.TWITTER)) {
1841 return ICON_BASE_PATH +
"twitter.png";
1842 }
else if (type.equals(Account.Type.WEBSITE)) {
1843 return ICON_BASE_PATH +
"web-file.png";
1844 }
else if (type.equals(Account.Type.WHATSAPP)) {
1845 return ICON_BASE_PATH +
"WhatsApp.png";
1848 return ICON_BASE_PATH +
"face.png";
CreditCardNumberFactory(BinResult bin)
final BlackboardArtifact.ReviewStatus newStatus
boolean createKeys(List< CreditCardViewMode > list)
DefaultAccountFactory(Account.Type accountType)
BlackboardArtifact.Type getBlackboardArtifactType()
void removeIngestModuleEventListener(final PropertyChangeListener listener)
Optional< Integer > getNumberLength()
Node[] createNodesForKey(Long t)
Optional< String > getCountry()
final BlackboardArtifact artifact
static synchronized IngestManager getInstance()
String getBinRangeString(BinResult bin)
static final Logger LOGGER
Node[] createNodesForKey(BinResult key)
Optional< String > getBankPhoneNumber()
Set< BlackboardArtifact.ReviewStatus > getStatuses()
void setShowRejected(boolean showRejected)
Optional< String > getCountry()
Sheet.Set getPropertySet(Sheet sheet)
Optional< String > getBankCity()
final String keywordSearchDocID
static List< Action > getActions(File file, boolean isArtifactSource)
Optional< String > getBankName()
final EventBus reviewStatusBus
String getRejectedArtifactFilterClause()
final RejectAccounts rejectActionInstance
List< Long > getArtifactIDs()
boolean createKeys(List< String > list)
abstract boolean createKeys(List< X > list)
AccountArtifactNode(BlackboardArtifact artifact)
static synchronized BankIdentificationNumber getBINInfo(int bin)
Node[] createNodesForKey(Long artifactID)
Action[] getActions(boolean context)
Node[] createNodesForKey(FileWithCCN key)
static String getIconFilePath(Account.Type type)
boolean createKeys(List< FileWithCCN > list)
final Account.Type accountType
Optional< String > getBankURL()
boolean createKeys(List< Long > list)
final ApproveAccounts approveActionInstance
final long filteringDSObjId
T visit(DataSourcesNode in)
Node[] createNodesForKey(CreditCardViewMode key)
void removeIngestJobEventListener(final PropertyChangeListener listener)
Optional< String > getScheme()
final Set< BlackboardArtifact.ReviewStatus > statuses
Optional< String > getBrand()
boolean equals(Object obj)
CreditCardNumberAccountTypeNode()
void addIngestJobEventListener(final PropertyChangeListener listener)
DefaultAccountTypeNode(Account.Type accountType)
Optional< String > getBankURL()
String getkeywordSearchDocID()
Optional< Integer > getNumberLength()
BinResult(long count,@Nonnull BINRange binRange)
Action newToggleShowRejectedAction()
Optional< String > getBrand()
Node[] createNodesForKey(String acountTypeName)
boolean createKeys(List< Long > list)
FileWithCCNNode(FileWithCCN key, Content content, Object[] lookupContents)
Action[] getActions(boolean context)
final List< Long > artifactIDs
FileWithCCN(long objID, String solrDocID, List< Long > artifactIDs, long hits, Set< BlackboardArtifact.ReviewStatus > statuses)
void actionPerformed(ActionEvent e)
boolean createKeys(List< BinResult > list)
Optional< String > getBankCity()
Optional< String > getCardType()
final FileWithCCN fileKey
BinResult(long count, int start, int end)
void addIngestModuleEventListener(final PropertyChangeListener listener)
synchronized static Logger getLogger(String name)
Accounts(SleuthkitCase skCase, long objId)
static Case getCurrentCaseThrows()
final PropertyChangeListener pcl
static void addEventTypeSubscriber(Set< Events > eventTypes, PropertyChangeListener subscriber)
final PropertyChangeListener pcl
boolean equals(Object obj)
ReviewStatusAction(String displayName, BlackboardArtifact.ReviewStatus newStatus)
static final String ICON_BASE_PATH
static void removeEventTypeSubscriber(Set< Events > eventTypes, PropertyChangeListener subscriber)
void actionPerformed(ActionEvent e)
String getFilterByDataSourceClause()
Optional< String > getScheme()
Optional< String > getBankName()
Optional< String > getBankPhoneNumber()
Optional< String > getCardType()
Accounts(SleuthkitCase skCase)