diff --git a/Core/build.xml b/Core/build.xml
index c8a8aefadb..d111d640c9 100644
--- a/Core/build.xml
+++ b/Core/build.xml
@@ -54,6 +54,11 @@
+
+
+
+
+
diff --git a/Core/manifest.mf b/Core/manifest.mf
index 00681f3e7f..0f9b4579f6 100644
--- a/Core/manifest.mf
+++ b/Core/manifest.mf
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
OpenIDE-Module: org.sleuthkit.autopsy.core/10
OpenIDE-Module-Localizing-Bundle: org/sleuthkit/autopsy/core/Bundle.properties
OpenIDE-Module-Layer: org/sleuthkit/autopsy/core/layer.xml
-OpenIDE-Module-Implementation-Version: 31
+OpenIDE-Module-Implementation-Version: 32
OpenIDE-Module-Requires: org.openide.windows.WindowManager
AutoUpdate-Show-In-Client: true
AutoUpdate-Essential-Module: true
diff --git a/Core/nbproject/project.properties b/Core/nbproject/project.properties
index 0340d16d32..1ec55b9283 100644
--- a/Core/nbproject/project.properties
+++ b/Core/nbproject/project.properties
@@ -139,5 +139,5 @@ nbm.homepage=http://www.sleuthkit.org/
nbm.module.author=Brian Carrier
nbm.needs.restart=true
source.reference.curator-recipes-2.8.0.jar=release/modules/ext/curator-recipes-2.8.0-sources.jar
-spec.version.base=10.19
+spec.version.base=10.20
diff --git a/Core/src/org/sleuthkit/autopsy/actions/AddTagAction.java b/Core/src/org/sleuthkit/autopsy/actions/AddTagAction.java
index 53cf076c2e..9c059205f5 100644
--- a/Core/src/org/sleuthkit/autopsy/actions/AddTagAction.java
+++ b/Core/src/org/sleuthkit/autopsy/actions/AddTagAction.java
@@ -1,7 +1,7 @@
/*
* Autopsy Forensic Browser
*
- * Copyright 2011-2019 Basis Technology Corp.
+ * Copyright 2013-2020 Basis Technology Corp.
* Contact: carrier sleuthkit org
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -139,7 +139,7 @@ abstract class AddTagAction extends AbstractAction implements Presenter.Popup {
if (!tagNamesMap.isEmpty()) {
for (Map.Entry entry : tagNamesMap.entrySet()) {
TagName tagName = entry.getValue();
- TagSet tagSet = tagName.getTagSet();
+ TagSet tagSet = tagsManager.getTagSet(tagName);
// Show custom tags before predefined tags in the menu
if (tagSet != null) {
diff --git a/Core/src/org/sleuthkit/autopsy/actions/GetTagNameAndCommentDialog.java b/Core/src/org/sleuthkit/autopsy/actions/GetTagNameAndCommentDialog.java
index ba586c7b22..a0c3b1c5c0 100644
--- a/Core/src/org/sleuthkit/autopsy/actions/GetTagNameAndCommentDialog.java
+++ b/Core/src/org/sleuthkit/autopsy/actions/GetTagNameAndCommentDialog.java
@@ -1,7 +1,7 @@
/*
* Autopsy Forensic Browser
*
- * Copyright 2011-2018 Basis Technology Corp.
+ * Copyright 2013-2020 Basis Technology Corp.
* Contact: carrier sleuthkit org
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -23,7 +23,6 @@ import java.awt.Window;
import java.awt.event.ActionEvent;
import java.awt.event.KeyEvent;
import java.util.ArrayList;
-import java.util.HashMap;
import java.util.logging.Level;
import java.util.List;
import java.util.Map;
@@ -36,7 +35,6 @@ import javax.swing.JComponent;
import javax.swing.JDialog;
import javax.swing.JList;
import javax.swing.KeyStroke;
-import org.openide.util.Exceptions;
import org.openide.util.NbBundle;
import org.openide.windows.WindowManager;
import org.sleuthkit.autopsy.casemodule.Case;
@@ -150,7 +148,7 @@ public class GetTagNameAndCommentDialog extends JDialog {
}
);
- try {
+ try {
TagsManager tagsManager = Case.getCurrentCaseThrows().getServices().getTagsManager();
List standardTagNames = TagsManager.getStandardTagNames();
Map tagNamesMap = new TreeMap<>(tagsManager.getDisplayNamesToTagNamesMap());
@@ -161,7 +159,7 @@ public class GetTagNameAndCommentDialog extends JDialog {
tagNamesMap.entrySet().stream().map((entry) -> entry.getValue()).forEachOrdered((tagName) -> {
TagSet tagSet = null;
try {
- tagSet = tagName.getTagSet();
+ tagSet = tagsManager.getTagSet(tagName);
} catch (TskCoreException ex) {
Logger.getLogger(GetTagNameAndCommentDialog.class
.getName()).log(Level.SEVERE, "Failed to get tag set", ex); //NON-NLS
diff --git a/Core/src/org/sleuthkit/autopsy/actions/ReplaceTagAction.java b/Core/src/org/sleuthkit/autopsy/actions/ReplaceTagAction.java
index 91929db577..34ed836e3e 100644
--- a/Core/src/org/sleuthkit/autopsy/actions/ReplaceTagAction.java
+++ b/Core/src/org/sleuthkit/autopsy/actions/ReplaceTagAction.java
@@ -1,7 +1,7 @@
/*
* Autopsy Forensic Browser
*
- * Copyright 2018 Basis Technology Corp.
+ * Copyright 2018-2020 Basis Technology Corp.
* Contact: carrier sleuthkit org
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -131,7 +131,7 @@ abstract class ReplaceTagAction extends AbstractAction implements
if (!tagNamesMap.isEmpty()) {
for (Map.Entry entry : tagNamesMap.entrySet()) {
TagName tagName = entry.getValue();
- TagSet tagSet = tagName.getTagSet();
+ TagSet tagSet = tagsManager.getTagSet(tagName);
// Show custom tags before predefined tags in the menu
if (tagSet != null) {
diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/services/TagsManager.java b/Core/src/org/sleuthkit/autopsy/casemodule/services/TagsManager.java
index 746bac478c..1a9b2e792d 100755
--- a/Core/src/org/sleuthkit/autopsy/casemodule/services/TagsManager.java
+++ b/Core/src/org/sleuthkit/autopsy/casemodule/services/TagsManager.java
@@ -1,7 +1,7 @@
/*
* Autopsy Forensic Browser
*
- * Copyright 2011-2020 Basis Technology Corp.
+ * Copyright 2013-2020 Basis Technology Corp.
* Contact: carrier sleuthkit org
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -56,7 +56,7 @@ public class TagsManager implements Closeable {
private final SleuthkitCase caseDb;
private static String DEFAULT_TAG_SET_NAME = "Project VIC";
-
+
private static final Object lock = new Object();
static {
@@ -235,16 +235,16 @@ public class TagsManager implements Closeable {
public static String getNotableTagDisplayName() {
return TagNameDefinition.getNotableTagDisplayName();
}
-
+
/**
* Creates a new TagSetDefinition file.
- *
+ *
* @param tagSetDef The tag set definition.
- *
- * @throws IOException
+ *
+ * @throws IOException
*/
public static void addTagSetDefinition(TagSetDefinition tagSetDef) throws IOException {
- synchronized(lock) {
+ synchronized (lock) {
TagSetDefinition.writeTagSetDefinition(tagSetDef);
}
}
@@ -267,20 +267,20 @@ public class TagsManager implements Closeable {
caseDb.addOrUpdateTagName(def.getDisplayName(), def.getDescription(), def.getColor(), def.getKnownStatus());
}
//Assume new case and add tag sets
- for(TagSetDefinition setDef: TagSetDefinition.readTagSetDefinitions()) {
+ for (TagSetDefinition setDef : TagSetDefinition.readTagSetDefinitions()) {
List tagNameList = new ArrayList<>();
- for(TagNameDefinition tagNameDef: setDef.getTagNameDefinitions()) {
+ for (TagNameDefinition tagNameDef : setDef.getTagNameDefinitions()) {
tagNameList.add(caseDb.addOrUpdateTagName(tagNameDef.getDisplayName(), tagNameDef.getDescription(), tagNameDef.getColor(), tagNameDef.getKnownStatus()));
}
-
- if(!tagNameList.isEmpty()) {
+
+ if (!tagNameList.isEmpty()) {
taggingMgr.addTagSet(setDef.getName(), tagNameList);
}
}
}
} catch (TskCoreException ex) {
LOGGER.log(Level.SEVERE, "Error updating standard tag name and tag set definitions", ex);
- } catch(IOException ex) {
+ } catch (IOException ex) {
LOGGER.log(Level.SEVERE, "Error loading tag set JSON files", ex);
}
@@ -288,28 +288,41 @@ public class TagsManager implements Closeable {
tagName.saveToCase(caseDb);
}
}
-
+
/**
* Get a list of all tag sets currently in the case database.
- *
+ *
* @return A list, possibly empty, of TagSet objects.
- *
+ *
* @throws TskCoreException
*/
public List getAllTagSets() throws TskCoreException {
return caseDb.getTaggingManager().getTagSets();
}
-
+
+ /**
+ * Gets the tag set a tag name (tag definition) belongs to, if any.
+ *
+ * @param tagName The tag name.
+ *
+ * @return A TagSet object or null.
+ *
+ * @throws TskCoreException If there is an error querying the case database.
+ */
+ public TagSet getTagSet(TagName tagName) throws TskCoreException {
+ return caseDb.getTaggingManager().getTagSet(tagName);
+ }
+
/**
* Add a new TagSet to the case database. Tags will be ranked in the order
* which they are passed to this method.
- *
- * @param name Tag set name.
+ *
+ * @param name Tag set name.
* @param tagNameList List of TagName in rank order.
- *
+ *
* @return A new TagSet object.
- *
- * @throws TskCoreException
+ *
+ * @throws TskCoreException
*/
public TagSet addTagSet(String name, List tagNameList) throws TskCoreException {
return caseDb.getTaggingManager().addTagSet(name, tagNameList);
@@ -501,7 +514,7 @@ public class TagsManager implements Closeable {
* name to the case database.
*/
public TagName addTagName(String displayName, String description, TagName.HTML_COLOR color, TskData.FileKnown knownStatus) throws TagNameAlreadyExistsException, TskCoreException {
- synchronized(lock) {
+ synchronized (lock) {
try {
TagName tagName = caseDb.addOrUpdateTagName(displayName, description, color, knownStatus);
Set customTypes = TagNameDefinition.getTagNameDefinitions();
diff --git a/Core/src/org/sleuthkit/autopsy/centralrepository/Bundle.properties b/Core/src/org/sleuthkit/autopsy/centralrepository/Bundle.properties
index 1c7e6c2d7e..37d4c54c72 100644
--- a/Core/src/org/sleuthkit/autopsy/centralrepository/Bundle.properties
+++ b/Core/src/org/sleuthkit/autopsy/centralrepository/Bundle.properties
@@ -1,9 +1,9 @@
OpenIDE-Module-Name=Central Repository
OpenIDE-Module-Display-Category=Ingest Module
-OpenIDE-Module-Short-Description=Correlation Engine Ingest Module
+OpenIDE-Module-Short-Description=Central Repository Ingest Module
OpenIDE-Module-Long-Description=\
- Correlation Engine ingest module and central database. \n\n\
- The Correlation Engine ingest module stores attributes of artifacts matching selected correlation types into a central database.\n\
+ Central Repository ingest module and central database. \n\n\
+ The Central Repository ingest module stores attributes of artifacts matching selected correlation types into a central database.\n\
Stored attributes are used in future cases to correlate and analyzes files and artifacts during ingest.
CentralRepoCommentDialog.commentLabel.text=Comment:
CentralRepoCommentDialog.okButton.text=&OK
diff --git a/Core/src/org/sleuthkit/autopsy/centralrepository/Bundle.properties-MERGED b/Core/src/org/sleuthkit/autopsy/centralrepository/Bundle.properties-MERGED
index 007af703c5..b4f7f835ef 100755
--- a/Core/src/org/sleuthkit/autopsy/centralrepository/Bundle.properties-MERGED
+++ b/Core/src/org/sleuthkit/autopsy/centralrepository/Bundle.properties-MERGED
@@ -4,10 +4,10 @@ AddEditCentralRepoCommentAction.menuItemText.addEditCentralRepoCommentNoMD5=Add/
CentralRepoCommentDialog.title.addEditCentralRepoComment=Add/Edit Central Repository Comment
OpenIDE-Module-Name=Central Repository
OpenIDE-Module-Display-Category=Ingest Module
-OpenIDE-Module-Short-Description=Correlation Engine Ingest Module
+OpenIDE-Module-Short-Description=Central Repository Ingest Module
OpenIDE-Module-Long-Description=\
- Correlation Engine ingest module and central database. \n\n\
- The Correlation Engine ingest module stores attributes of artifacts matching selected correlation types into a central database.\n\
+ Central Repository ingest module and central database. \n\n\
+ The Central Repository ingest module stores attributes of artifacts matching selected correlation types into a central database.\n\
Stored attributes are used in future cases to correlate and analyzes files and artifacts during ingest.
CentralRepoCommentDialog.commentLabel.text=Comment:
CentralRepoCommentDialog.okButton.text=&OK
diff --git a/Core/src/org/sleuthkit/autopsy/centralrepository/datamodel/CorrelationDataSource.java b/Core/src/org/sleuthkit/autopsy/centralrepository/datamodel/CorrelationDataSource.java
index ac17a1e962..92c23d77c8 100644
--- a/Core/src/org/sleuthkit/autopsy/centralrepository/datamodel/CorrelationDataSource.java
+++ b/Core/src/org/sleuthkit/autopsy/centralrepository/datamodel/CorrelationDataSource.java
@@ -28,7 +28,7 @@ import org.sleuthkit.datamodel.TskDataException;
/**
*
- * Stores information about a Data Source in the correlation engine
+ * Stores information about a Data Source in the Central Repository
*
*/
public class CorrelationDataSource implements Serializable {
diff --git a/Core/src/org/sleuthkit/autopsy/centralrepository/datamodel/Persona.java b/Core/src/org/sleuthkit/autopsy/centralrepository/datamodel/Persona.java
index 502e4ddfbc..cc1b17ab80 100644
--- a/Core/src/org/sleuthkit/autopsy/centralrepository/datamodel/Persona.java
+++ b/Core/src/org/sleuthkit/autopsy/centralrepository/datamodel/Persona.java
@@ -234,7 +234,7 @@ public class Persona {
private static Persona createPersona(String name, String comment, PersonaStatus status) throws CentralRepoException {
// generate a UUID for the persona
String uuidStr = UUID.randomUUID().toString();
- CentralRepoExaminer examiner = CentralRepository.getInstance().getOrInsertExaminer(System.getProperty("user.name"));
+ CentralRepoExaminer examiner = getCRInstance().getOrInsertExaminer(System.getProperty("user.name"));
Instant instant = Instant.now();
Long timeStampMillis = instant.toEpochMilli();
@@ -248,22 +248,22 @@ public class Persona {
+ examiner.getId()
+ ")";
- CentralRepository.getInstance().executeInsertSQL(insertClause);
+ getCRInstance().executeInsertSQL(insertClause);
return getPersonaByUUID(uuidStr);
}
/**
* Sets the comment of this persona.
*
- * @param name The new comment.
+ * @param comment The new comment.
*
* @throws CentralRepoException If there is an error.
*/
public void setComment(String comment) throws CentralRepoException {
- String updateClause = "UPDATE personas SET comment = \"" + comment + "\" WHERE id = " + id;
+ String updateClause = "UPDATE personas SET comment = '" + comment + "' WHERE id = " + id;
CentralRepository cr = CentralRepository.getInstance();
if (cr != null) {
- cr.executeUpdateSQL(updateClause);
+ getCRInstance().executeUpdateSQL(updateClause);
}
}
@@ -275,7 +275,7 @@ public class Persona {
* @throws CentralRepoException If there is an error.
*/
public void setName(String name) throws CentralRepoException {
- String updateClause = "UPDATE personas SET name = \"" + name + "\" WHERE id = " + id;
+ String updateClause = "UPDATE personas SET name = '" + name + "' WHERE id = " + id;
CentralRepository cr = CentralRepository.getInstance();
if (cr != null) {
cr.executeUpdateSQL(updateClause);
@@ -313,7 +313,9 @@ public class Persona {
/**
* Modifies the confidence / justification of the given PersonaAccount
*
- * @param account account to modify
+ * @param account Account to modify.
+ * @param confidence Level of confidence.
+ * @param justification Justification.
*
* @throws CentralRepoException If there is an error in querying the
* Personas table.
@@ -329,7 +331,7 @@ public class Persona {
String deleteSQL = "UPDATE personas SET status_id = " + PersonaStatus.DELETED.status_id + " WHERE id = " + this.id;
CentralRepository cr = CentralRepository.getInstance();
if (cr != null) {
- cr.executeDeleteSQL(deleteSQL);
+ cr.executeUpdateSQL(deleteSQL);
}
}
@@ -395,7 +397,7 @@ public class Persona {
+ "WHERE p.uuid = '" + uuid + "'";
PersonaQueryCallback queryCallback = new PersonaQueryCallback();
- CentralRepository.getInstance().executeSelectSQL(queryClause, queryCallback);
+ getCRInstance().executeSelectSQL(queryClause, queryCallback);
Collection personas = queryCallback.getPersonas();
@@ -420,7 +422,7 @@ public class Persona {
" AND LOWER(p.name) LIKE " + "LOWER('%" + partialName + "%')" ;
PersonaQueryCallback queryCallback = new PersonaQueryCallback();
- CentralRepository.getInstance().executeSelectSQL(queryClause, queryCallback);
+ getCRInstance().executeSelectSQL(queryClause, queryCallback);
return queryCallback.getPersonas();
}
@@ -485,7 +487,9 @@ public class Persona {
/**
* Modifies the given alias.
*
- * @param alias alias to modify
+ * @param key Key for the alias to modify.
+ * @param confidence Level of confidence.
+ * @param justification Justification.
*
* @throws CentralRepoException If there is an error in querying the
* Personas table.
@@ -535,7 +539,9 @@ public class Persona {
/**
* Modifies the given metadata.
*
- * @param metadata metadata to modify
+ * @param key Key for the metadata to modify.
+ * @param confidence Level of confidence.
+ * @param justification Justification.
*
* @throws CentralRepoException If there is an error in querying the
* Personas table.
@@ -580,7 +586,7 @@ public class Persona {
while (resultSet.next()) {
// get Case for case_id
- CorrelationCase correlationCase = CentralRepository.getInstance().getCaseById(resultSet.getInt("case_id"));
+ CorrelationCase correlationCase = getCRInstance().getCaseById(resultSet.getInt("case_id"));
correlationCases.add(correlationCase);
}
}
@@ -605,14 +611,14 @@ public class Persona {
Collection accounts = PersonaAccount.getAccountsForPersona(this.getId());
for (CentralRepoAccount account : accounts) {
int corrTypeId = account.getAccountType().getCorrelationTypeId();
- CorrelationAttributeInstance.Type correlationType = CentralRepository.getInstance().getCorrelationTypeById(corrTypeId);
+ CorrelationAttributeInstance.Type correlationType = getCRInstance().getCorrelationTypeById(corrTypeId);
String tableName = CentralRepoDbUtil.correlationTypeToInstanceTableName(correlationType);
String querySql = "SELECT DISTINCT case_id FROM " + tableName
+ " WHERE account_id = " + account.getId();
CaseForAccountInstanceQueryCallback queryCallback = new CaseForAccountInstanceQueryCallback();
- CentralRepository.getInstance().executeSelectSQL(querySql, queryCallback);
+ getCRInstance().executeSelectSQL(querySql, queryCallback);
// Add any cases that aren't already on the list.
for (CorrelationCase corrCase : queryCallback.getCases()) {
@@ -639,8 +645,8 @@ public class Persona {
while (resultSet.next()) {
// get Case for case_id
- CorrelationCase correlationCase = CentralRepository.getInstance().getCaseById(resultSet.getInt("case_id"));
- CorrelationDataSource correlationDatasource = CentralRepository.getInstance().getDataSourceById(correlationCase, resultSet.getInt("data_source_id"));
+ CorrelationCase correlationCase = getCRInstance().getCaseById(resultSet.getInt("case_id"));
+ CorrelationDataSource correlationDatasource = getCRInstance().getDataSourceById(correlationCase, resultSet.getInt("data_source_id"));
// Add data source to list if not already on it.
if (!correlationDataSources.stream().anyMatch(p -> Objects.equals(p.getDataSourceObjectID(), correlationDatasource.getDataSourceObjectID()))) {
@@ -668,14 +674,14 @@ public class Persona {
Collection accounts = PersonaAccount.getAccountsForPersona(this.getId());
for (CentralRepoAccount account : accounts) {
int corrTypeId = account.getAccountType().getCorrelationTypeId();
- CorrelationAttributeInstance.Type correlationType = CentralRepository.getInstance().getCorrelationTypeById(corrTypeId);
+ CorrelationAttributeInstance.Type correlationType = getCRInstance().getCorrelationTypeById(corrTypeId);
String tableName = CentralRepoDbUtil.correlationTypeToInstanceTableName(correlationType);
String querySql = "SELECT case_id, data_source_id FROM " + tableName
+ " WHERE account_id = " + account.getId();
DatasourceForAccountInstanceQueryCallback queryCallback = new DatasourceForAccountInstanceQueryCallback();
- CentralRepository.getInstance().executeSelectSQL(querySql, queryCallback);
+ getCRInstance().executeSelectSQL(querySql, queryCallback);
// Add any data sources that aren't already on the list.
for (CorrelationDataSource correlationDatasource : queryCallback.getDataSources()) {
@@ -738,7 +744,7 @@ public class Persona {
private static String getPersonaFromInstanceTableQueryTemplate(CentralRepoAccount.CentralRepoAccountType crAccountType) throws CentralRepoException {
int corrTypeId = crAccountType.getCorrelationTypeId();
- CorrelationAttributeInstance.Type correlationType = CentralRepository.getInstance().getCorrelationTypeById(corrTypeId);
+ CorrelationAttributeInstance.Type correlationType = getCRInstance().getCorrelationTypeById(corrTypeId);
String instanceTableName = CentralRepoDbUtil.correlationTypeToInstanceTableName(correlationType);
return "SELECT " + instanceTableName + ".account_id, case_id, data_source_id, "
@@ -762,7 +768,7 @@ public class Persona {
public static Collection getPersonasForCase(CorrelationCase correlationCase) throws CentralRepoException {
Collection personaList = new ArrayList<>();
- Collection accountTypes = CentralRepository.getInstance().getAllAccountTypes();
+ Collection accountTypes = getCRInstance().getAllAccountTypes();
for (CentralRepoAccount.CentralRepoAccountType crAccountType : accountTypes) {
String querySql = getPersonaFromInstanceTableQueryTemplate(crAccountType)
@@ -770,7 +776,7 @@ public class Persona {
+ "AND personas.status_id != " + Persona.PersonaStatus.DELETED.getStatusId();
PersonaFromAccountInstanceQueryCallback queryCallback = new PersonaFromAccountInstanceQueryCallback();
- CentralRepository.getInstance().executeSelectSQL(querySql, queryCallback);
+ getCRInstance().executeSelectSQL(querySql, queryCallback);
// Add persona that aren't already on the list.
for (Persona persona : queryCallback.getPersonasList()) {
@@ -794,7 +800,7 @@ public class Persona {
public static Collection getPersonasForDataSource(CorrelationDataSource dataSource) throws CentralRepoException {
Collection personaList = new ArrayList<>();
- Collection accountTypes = CentralRepository.getInstance().getAllAccountTypes();
+ Collection accountTypes = getCRInstance().getAllAccountTypes();
for (CentralRepoAccount.CentralRepoAccountType crAccountType : accountTypes) {
String querySql = getPersonaFromInstanceTableQueryTemplate(crAccountType)
@@ -802,7 +808,7 @@ public class Persona {
+ "AND personas.status_id != " + Persona.PersonaStatus.DELETED.getStatusId();
PersonaFromAccountInstanceQueryCallback queryCallback = new PersonaFromAccountInstanceQueryCallback();
- CentralRepository.getInstance().executeSelectSQL(querySql, queryCallback);
+ getCRInstance().executeSelectSQL(querySql, queryCallback);
// Add persona that aren't already on the list.
for (Persona persona : queryCallback.getPersonasList()) {
@@ -814,4 +820,23 @@ public class Persona {
}
return personaList;
}
+
+
+ /**
+ * Wraps the call to CentralRepository.getInstance() throwing an
+ * exception if instance is null;
+ *
+ * @return Instance of CentralRepository
+ *
+ * @throws CentralRepoException
+ */
+ private static CentralRepository getCRInstance() throws CentralRepoException {
+ CentralRepository instance = CentralRepository.getInstance();
+
+ if(instance == null) {
+ throw new CentralRepoException("Failed to get instance of CentralRespository, CR was null");
+ }
+
+ return instance;
+ }
}
diff --git a/Core/src/org/sleuthkit/autopsy/centralrepository/datamodel/PersonaAccount.java b/Core/src/org/sleuthkit/autopsy/centralrepository/datamodel/PersonaAccount.java
index efd8b76152..3a921dd483 100644
--- a/Core/src/org/sleuthkit/autopsy/centralrepository/datamodel/PersonaAccount.java
+++ b/Core/src/org/sleuthkit/autopsy/centralrepository/datamodel/PersonaAccount.java
@@ -121,23 +121,18 @@ public class PersonaAccount {
/**
* Creates an account for the specified Persona.
*
- * @param persona Persona for which the account is being added.
- * @param account Account.
+ * @param persona Persona for which the account is being added.
+ * @param account Account.
* @param justification Reason for assigning the alias, may be null.
- * @param confidence Confidence level.
+ * @param confidence Confidence level.
*
* @return PersonaAccount
+ *
* @throws CentralRepoException If there is an error in creating the
- * account.
+ * account.
*/
static PersonaAccount addPersonaAccount(Persona persona, CentralRepoAccount account, String justification, Persona.Confidence confidence) throws CentralRepoException {
- CentralRepository cr = CentralRepository.getInstance();
-
- if(cr == null) {
- throw new CentralRepoException("Failed to add Persona, Central Repository is not enable");
- }
-
- CentralRepoExaminer currentExaminer = cr.getOrInsertExaminer(System.getProperty("user.name"));
+ CentralRepoExaminer currentExaminer = getCRInstance().getOrInsertExaminer(System.getProperty("user.name"));
Instant instant = Instant.now();
Long timeStampMillis = instant.toEpochMilli();
@@ -151,14 +146,14 @@ public class PersonaAccount {
+ currentExaminer.getId()
+ ")";
- CentralRepository.getInstance().executeInsertSQL(insertClause);
+ getCRInstance().executeInsertSQL(insertClause);
String queryClause = PERSONA_ACCOUNTS_QUERY_CLAUSE
+ "WHERE persona_id = " + persona.getId()
+ " AND account_type_id = " + account.getAccountType().getAccountTypeId()
- + " AND account_unique_identifier = \"" + account.getIdentifier() + "\"";
+ + " AND account_unique_identifier = '" + account.getIdentifier() + "'";
PersonaAccountsQueryCallback queryCallback = new PersonaAccountsQueryCallback();
- CentralRepository.getInstance().executeSelectSQL(queryClause, queryCallback);
+ getCRInstance().executeSelectSQL(queryClause, queryCallback);
Collection accounts = queryCallback.getPersonaAccountsList();
if (accounts.size() != 1) {
@@ -203,7 +198,7 @@ public class PersonaAccount {
);
// create account
- CentralRepoAccount.CentralRepoAccountType crAccountType = CentralRepository.getInstance().getAccountTypeByName(rs.getString("type_name"));
+ CentralRepoAccount.CentralRepoAccountType crAccountType = getCRInstance().getAccountTypeByName(rs.getString("type_name"));
CentralRepoAccount account = new CentralRepoAccount(
rs.getInt("account_id"),
crAccountType,
@@ -249,19 +244,13 @@ public class PersonaAccount {
* persona_account.
*/
static Collection getPersonaAccountsForPersona(long personaId) throws CentralRepoException {
- CentralRepository cr = CentralRepository.getInstance();
+ String queryClause = PERSONA_ACCOUNTS_QUERY_CLAUSE
+ + " WHERE persona_accounts.persona_id = " + personaId;
- if (cr != null) {
- String queryClause = PERSONA_ACCOUNTS_QUERY_CLAUSE
- + " WHERE persona_accounts.persona_id = " + personaId;
+ PersonaAccountsQueryCallback queryCallback = new PersonaAccountsQueryCallback();
+ getCRInstance().executeSelectSQL(queryClause, queryCallback);
- PersonaAccountsQueryCallback queryCallback = new PersonaAccountsQueryCallback();
- cr.executeSelectSQL(queryClause, queryCallback);
-
- return queryCallback.getPersonaAccountsList();
- }
-
- return new ArrayList<>();
+ return queryCallback.getPersonaAccountsList();
}
/**
@@ -279,16 +268,9 @@ public class PersonaAccount {
+ " WHERE persona_accounts.account_id = " + accountId
+ " AND personas.status_id != " + Persona.PersonaStatus.DELETED.getStatusId();
- CentralRepository cr = CentralRepository.getInstance();
-
- if (cr != null) {
- PersonaAccountsQueryCallback queryCallback = new PersonaAccountsQueryCallback();
- cr.executeSelectSQL(queryClause, queryCallback);
-
- return queryCallback.getPersonaAccountsList();
- }
-
- return new ArrayList<>();
+ PersonaAccountsQueryCallback queryCallback = new PersonaAccountsQueryCallback();
+ getCRInstance().executeSelectSQL(queryClause, queryCallback);
+ return queryCallback.getPersonaAccountsList();
}
/**
@@ -308,15 +290,10 @@ public class PersonaAccount {
+ " WHERE LOWER(accounts.account_unique_identifier) LIKE LOWER('%" + accountIdentifierSubstring + "%')"
+ " AND personas.status_id != " + Persona.PersonaStatus.DELETED.getStatusId();
- CentralRepository cr = CentralRepository.getInstance();
- if (cr != null) {
- PersonaAccountsQueryCallback queryCallback = new PersonaAccountsQueryCallback();
- cr.executeSelectSQL(queryClause, queryCallback);
+ PersonaAccountsQueryCallback queryCallback = new PersonaAccountsQueryCallback();
+ getCRInstance().executeSelectSQL(queryClause, queryCallback);
+ return queryCallback.getPersonaAccountsList();
- return queryCallback.getPersonaAccountsList();
- }
-
- return new ArrayList<>();
}
/**
@@ -335,14 +312,9 @@ public class PersonaAccount {
+ " AND type_name = '" + account.getAccountType().getTypeName() + "' "
+ " AND personas.status_id != " + Persona.PersonaStatus.DELETED.getStatusId();
- CentralRepository cr = CentralRepository.getInstance();
- if (cr != null) {
- PersonaAccountsQueryCallback queryCallback = new PersonaAccountsQueryCallback();
- cr.executeSelectSQL(queryClause, queryCallback);
- return queryCallback.getPersonaAccountsList();
- }
-
- return new ArrayList<>();
+ PersonaAccountsQueryCallback queryCallback = new PersonaAccountsQueryCallback();
+ getCRInstance().executeSelectSQL(queryClause, queryCallback);
+ return queryCallback.getPersonaAccountsList();
}
/**
@@ -351,36 +323,24 @@ public class PersonaAccount {
* @param id row id for the account to be removed
*
* @throws CentralRepoException If there is an error in removing the
- * account.
+ * account.
*/
static void removePersonaAccount(long id) throws CentralRepoException {
- CentralRepository cr = CentralRepository.getInstance();
-
- if(cr == null) {
- throw new CentralRepoException("Failed to remove persona account, Central Repo is not enabled");
- }
-
String deleteClause = " DELETE FROM persona_accounts WHERE id = " + id;
- cr.executeDeleteSQL(deleteClause);
+ getCRInstance().executeDeleteSQL(deleteClause);
}
-
+
/**
* Modifies the PersonaAccount row by the given id
*
* @param id row id for the account to be removed
*
* @throws CentralRepoException If there is an error in removing the
- * account.
+ * account.
*/
static void modifyPersonaAccount(long id, Persona.Confidence confidence, String justification) throws CentralRepoException {
- CentralRepository cr = CentralRepository.getInstance();
-
- if (cr == null) {
- throw new CentralRepoException("Failed to modify persona account, Central Repo is not enabled");
- }
-
- String updateClause = "UPDATE persona_accounts SET confidence_id = " + confidence.getLevelId() + ", justification = \"" + justification + "\" WHERE id = " + id;
- cr.executeUpdateSQL(updateClause);
+ String updateClause = "UPDATE persona_accounts SET confidence_id = " + confidence.getLevelId() + ", justification = '" + justification + "' WHERE id = " + id;
+ getCRInstance().executeUpdateSQL(updateClause);
}
/**
@@ -397,7 +357,7 @@ public class PersonaAccount {
while (rs.next()) {
// create account
- CentralRepoAccount.CentralRepoAccountType crAccountType = CentralRepository.getInstance().getAccountTypeByName(rs.getString("type_name"));
+ CentralRepoAccount.CentralRepoAccountType crAccountType = getCRInstance().getAccountTypeByName(rs.getString("type_name"));
CentralRepoAccount account = new CentralRepoAccount(
rs.getInt("account_id"),
crAccountType,
@@ -418,28 +378,41 @@ public class PersonaAccount {
* @param personaId Id of the persona to look for.
*
* @return Collection of all accounts associated with the given persona, may
- * be empty.
+ * be empty.
+ *
* @throws CentralRepoException If there is an error in getting the
- * accounts.
+ * accounts.
*/
static Collection getAccountsForPersona(long personaId) throws CentralRepoException {
- CentralRepository cr = CentralRepository.getInstance();
+ String queryClause = "SELECT account_id, "
+ + " accounts.account_type_id as account_type_id, accounts.account_unique_identifier as account_unique_identifier,"
+ + " account_types.type_name as type_name "
+ + " FROM persona_accounts "
+ + " JOIN accounts as accounts on persona_accounts.account_id = accounts.id "
+ + " JOIN account_types as account_types on accounts.account_type_id = account_types.id "
+ + " WHERE persona_accounts.persona_id = " + personaId;
- if (cr != null) {
- String queryClause = "SELECT account_id, "
- + " accounts.account_type_id as account_type_id, accounts.account_unique_identifier as account_unique_identifier,"
- + " account_types.type_name as type_name "
- + " FROM persona_accounts "
- + " JOIN accounts as accounts on persona_accounts.account_id = accounts.id "
- + " JOIN account_types as account_types on accounts.account_type_id = account_types.id "
- + " WHERE persona_accounts.persona_id = " + personaId;
+ AccountsForPersonaQueryCallback queryCallback = new AccountsForPersonaQueryCallback();
+ getCRInstance().executeSelectSQL(queryClause, queryCallback);
- AccountsForPersonaQueryCallback queryCallback = new AccountsForPersonaQueryCallback();
- cr.executeSelectSQL(queryClause, queryCallback);
+ return queryCallback.getAccountsList();
+ }
- return queryCallback.getAccountsList();
+ /**
+ * Wraps the call to CentralRepository.getInstance() throwing an exception
+ * if instance is null;
+ *
+ * @return Instance of CentralRepository
+ *
+ * @throws CentralRepoException
+ */
+ private static CentralRepository getCRInstance() throws CentralRepoException {
+ CentralRepository instance = CentralRepository.getInstance();
+
+ if (instance == null) {
+ throw new CentralRepoException("Failed to get instance of CentralRespository, CR was null");
}
- return new ArrayList<>();
+ return instance;
}
}
diff --git a/Core/src/org/sleuthkit/autopsy/centralrepository/datamodel/PersonaAlias.java b/Core/src/org/sleuthkit/autopsy/centralrepository/datamodel/PersonaAlias.java
index 421d8d0d9e..63fcb346b9 100644
--- a/Core/src/org/sleuthkit/autopsy/centralrepository/datamodel/PersonaAlias.java
+++ b/Core/src/org/sleuthkit/autopsy/centralrepository/datamodel/PersonaAlias.java
@@ -98,7 +98,7 @@ public class PersonaAlias {
*/
static PersonaAlias addPersonaAlias(Persona persona, String alias, String justification, Persona.Confidence confidence) throws CentralRepoException {
- CentralRepoExaminer examiner = CentralRepository.getInstance().getOrInsertExaminer(System.getProperty("user.name"));
+ CentralRepoExaminer examiner = getCRInstance().getOrInsertExaminer(System.getProperty("user.name"));
Instant instant = Instant.now();
Long timeStampMillis = instant.toEpochMilli();
@@ -113,16 +113,16 @@ public class PersonaAlias {
+ examiner.getId()
+ ")";
- CentralRepository.getInstance().executeInsertSQL(insertClause);
+ getCRInstance().executeInsertSQL(insertClause);
String queryClause = SELECT_QUERY_BASE
+ "WHERE pa.persona_id = " + persona.getId()
- + " AND pa.alias = \"" + alias + "\""
+ + " AND pa.alias = '" + alias + "'"
+ " AND pa.date_added = " + timeStampMillis
+ " AND pa.examiner_id = " + examiner.getId();
PersonaAliasesQueryCallback queryCallback = new PersonaAliasesQueryCallback();
- CentralRepository.getInstance().executeSelectSQL(queryClause, queryCallback);
+ getCRInstance().executeSelectSQL(queryClause, queryCallback);
Collection aliases = queryCallback.getAliases();
if (aliases.size() != 1) {
@@ -141,7 +141,7 @@ public class PersonaAlias {
*/
static void removePersonaAlias(PersonaAlias alias) throws CentralRepoException {
String deleteClause = " DELETE FROM persona_alias WHERE id = " + alias.getId();
- CentralRepository.getInstance().executeDeleteSQL(deleteClause);
+ getCRInstance().executeDeleteSQL(deleteClause);
}
/**
@@ -158,7 +158,7 @@ public class PersonaAlias {
throw new CentralRepoException("Failed to modify persona alias, Central Repo is not enabled");
}
- String updateClause = "UPDATE persona_alias SET confidence_id = " + confidence.getLevelId() + ", justification = \"" + justification + "\" WHERE id = " + alias.id;
+ String updateClause = "UPDATE persona_alias SET confidence_id = " + confidence.getLevelId() + ", justification = '" + justification + "' WHERE id = " + alias.id;
cr.executeUpdateSQL(updateClause);
}
@@ -208,9 +208,26 @@ public class PersonaAlias {
String queryClause = SELECT_QUERY_BASE + "WHERE pa.persona_id = " + personaId;
PersonaAliasesQueryCallback queryCallback = new PersonaAliasesQueryCallback();
- CentralRepository.getInstance().executeSelectSQL(queryClause, queryCallback);
+ getCRInstance().executeSelectSQL(queryClause, queryCallback);
return queryCallback.getAliases();
}
+ /**
+ * Wraps the call to CentralRepository.getInstance() throwing an
+ * exception if instance is null;
+ *
+ * @return Instance of CentralRepository
+ *
+ * @throws CentralRepoException
+ */
+ private static CentralRepository getCRInstance() throws CentralRepoException {
+ CentralRepository instance = CentralRepository.getInstance();
+
+ if(instance == null) {
+ throw new CentralRepoException("Failed to get instance of CentralRespository, CR was null");
+ }
+
+ return instance;
+ }
}
diff --git a/Core/src/org/sleuthkit/autopsy/centralrepository/datamodel/PersonaMetadata.java b/Core/src/org/sleuthkit/autopsy/centralrepository/datamodel/PersonaMetadata.java
index 667c332dbc..a3fc414730 100644
--- a/Core/src/org/sleuthkit/autopsy/centralrepository/datamodel/PersonaMetadata.java
+++ b/Core/src/org/sleuthkit/autopsy/centralrepository/datamodel/PersonaMetadata.java
@@ -107,7 +107,7 @@ public class PersonaMetadata {
*/
static PersonaMetadata addPersonaMetadata(long personaId, String name, String value, String justification, Persona.Confidence confidence) throws CentralRepoException {
- CentralRepoExaminer examiner = CentralRepository.getInstance().getOrInsertExaminer(System.getProperty("user.name"));
+ CentralRepoExaminer examiner = getCRInstance().getOrInsertExaminer(System.getProperty("user.name"));
Instant instant = Instant.now();
Long timeStampMillis = instant.toEpochMilli();
@@ -123,17 +123,17 @@ public class PersonaMetadata {
+ examiner.getId()
+ ")";
- CentralRepository.getInstance().executeInsertSQL(insertClause);
+ getCRInstance().executeInsertSQL(insertClause);
String queryClause = SELECT_QUERY_BASE
+ "WHERE pmd.persona_id = " + personaId
- + " AND pmd.name = \"" + name + "\""
- + " AND pmd.value = \"" + value + "\""
+ + " AND pmd.name = '" + name + "'"
+ + " AND pmd.value = '" + value + "'"
+ " AND pmd.date_added = " + timeStampMillis
+ " AND pmd.examiner_id = " + examiner.getId();
PersonaMetadataQueryCallback queryCallback = new PersonaMetadataQueryCallback();
- CentralRepository.getInstance().executeSelectSQL(queryClause, queryCallback);
+ getCRInstance().executeSelectSQL(queryClause, queryCallback);
Collection metadata = queryCallback.getMetadataList();
if (metadata.size() != 1) {
@@ -152,7 +152,7 @@ public class PersonaMetadata {
*/
static void removePersonaMetadata(PersonaMetadata metadata) throws CentralRepoException {
String deleteClause = " DELETE FROM persona_metadata WHERE id = " + metadata.getId();
- CentralRepository.getInstance().executeDeleteSQL(deleteClause);
+ getCRInstance().executeDeleteSQL(deleteClause);
}
/**
@@ -169,7 +169,7 @@ public class PersonaMetadata {
throw new CentralRepoException("Failed to modify persona metadata, Central Repo is not enabled");
}
- String updateClause = "UPDATE persona_metadata SET confidence_id = " + confidence.getLevelId() + ", justification = \"" + justification + "\" WHERE id = " + metadata.id;
+ String updateClause = "UPDATE persona_metadata SET confidence_id = " + confidence.getLevelId() + ", justification = '" + justification + "' WHERE id = " + metadata.id;
cr.executeUpdateSQL(updateClause);
}
@@ -219,10 +219,27 @@ public class PersonaMetadata {
String queryClause = SELECT_QUERY_BASE + "WHERE pmd.persona_id = " + personaId;
PersonaMetadataQueryCallback queryCallback = new PersonaMetadataQueryCallback();
- CentralRepository.getInstance().executeSelectSQL(queryClause, queryCallback);
+ getCRInstance().executeSelectSQL(queryClause, queryCallback);
return queryCallback.getMetadataList();
}
+ /**
+ * Wraps the call to CentralRepository.getInstance() throwing an
+ * exception if instance is null;
+ *
+ * @return Instance of CentralRepository
+ *
+ * @throws CentralRepoException
+ */
+ private static CentralRepository getCRInstance() throws CentralRepoException {
+ CentralRepository instance = CentralRepository.getInstance();
+
+ if(instance == null) {
+ throw new CentralRepoException("Failed to get instance of CentralRespository, CR was null");
+ }
+
+ return instance;
+ }
}
diff --git a/Core/src/org/sleuthkit/autopsy/centralrepository/datamodel/RdbmsCentralRepo.java b/Core/src/org/sleuthkit/autopsy/centralrepository/datamodel/RdbmsCentralRepo.java
index 165440af45..b550804421 100644
--- a/Core/src/org/sleuthkit/autopsy/centralrepository/datamodel/RdbmsCentralRepo.java
+++ b/Core/src/org/sleuthkit/autopsy/centralrepository/datamodel/RdbmsCentralRepo.java
@@ -1679,7 +1679,7 @@ abstract class RdbmsCentralRepo implements CentralRepository {
bulkArtifacts.get(tableName).clear();
}
- TimingMetric timingMetric = HealthMonitor.getTimingMetric("Correlation Engine: Bulk insert");
+ TimingMetric timingMetric = HealthMonitor.getTimingMetric("Central Repository: Bulk insert");
HealthMonitor.submitTimingMetric(timingMetric);
// Reset state
diff --git a/Core/src/org/sleuthkit/autopsy/centralrepository/eventlisteners/Bundle.properties-MERGED b/Core/src/org/sleuthkit/autopsy/centralrepository/eventlisteners/Bundle.properties-MERGED
index e3c99ded13..d4cca6c407 100755
--- a/Core/src/org/sleuthkit/autopsy/centralrepository/eventlisteners/Bundle.properties-MERGED
+++ b/Core/src/org/sleuthkit/autopsy/centralrepository/eventlisteners/Bundle.properties-MERGED
@@ -1,5 +1,5 @@
caseeventlistener.evidencetag=Evidence
-IngestEventsListener.ingestmodule.name=Correlation Engine
+IngestEventsListener.ingestmodule.name=Central Repository
IngestEventsListener.prevCaseComment.text=Previous Case:
# {0} - typeName
# {1} - count
diff --git a/Core/src/org/sleuthkit/autopsy/centralrepository/eventlisteners/IngestEventsListener.java b/Core/src/org/sleuthkit/autopsy/centralrepository/eventlisteners/IngestEventsListener.java
index d399fe4614..03fa640ca5 100644
--- a/Core/src/org/sleuthkit/autopsy/centralrepository/eventlisteners/IngestEventsListener.java
+++ b/Core/src/org/sleuthkit/autopsy/centralrepository/eventlisteners/IngestEventsListener.java
@@ -73,7 +73,7 @@ import org.sleuthkit.datamodel.CommunicationsUtils;
* Listen for ingest events and update entries in the Central Repository
* database accordingly
*/
-@NbBundle.Messages({"IngestEventsListener.ingestmodule.name=Correlation Engine"})
+@NbBundle.Messages({"IngestEventsListener.ingestmodule.name=Central Repository"})
public class IngestEventsListener {
private static final Logger LOGGER = Logger.getLogger(CorrelationAttributeInstance.class.getName());
@@ -116,24 +116,24 @@ public class IngestEventsListener {
/**
* Increase the number of IngestEventsListeners adding contents to the
- * Correlation Engine.
+ * Central Repository.
*/
public synchronized static void incrementCorrelationEngineModuleCount() {
- correlationModuleInstanceCount++; //Should be called once in the Correlation Engine module's startup method.
+ correlationModuleInstanceCount++; //Should be called once in the Central Repository module's startup method.
}
/**
* Decrease the number of IngestEventsListeners adding contents to the
- * Correlation Engine.
+ * Central Repository.
*/
public synchronized static void decrementCorrelationEngineModuleCount() {
if (getCeModuleInstanceCount() > 0) { //prevent it ingestJobCounter from going negative
- correlationModuleInstanceCount--; //Should be called once in the Correlation Engine module's shutdown method.
+ correlationModuleInstanceCount--; //Should be called once in the Central Repository module's shutdown method.
}
}
/**
- * Reset the counter which keeps track of if the Correlation Engine Module
+ * Reset the counter which keeps track of if the Central Repository Module
* is being run during injest to 0.
*/
synchronized static void resetCeModuleInstanceCount() {
@@ -141,10 +141,10 @@ public class IngestEventsListener {
}
/**
- * Whether or not the Correlation Engine Module is enabled for any of the
+ * Whether or not the Central Repository Module is enabled for any of the
* currently running ingest jobs.
*
- * @return boolean True for Correlation Engine enabled, False for disabled
+ * @return boolean True for Central Repository enabled, False for disabled
*/
public synchronized static int getCeModuleInstanceCount() {
return correlationModuleInstanceCount;
@@ -282,7 +282,7 @@ public class IngestEventsListener {
@Override
public void propertyChange(PropertyChangeEvent evt) {
- //if ingest is running we want there to check if there is a Correlation Engine module running
+ //if ingest is running we want there to check if there is a Central Repository module running
//sometimes artifacts are generated by DSPs or other sources while ingest is not running
//in these cases we still want to create correlation attributesForNewArtifact for those artifacts when appropriate
if (!IngestManager.getInstance().isIngestRunning() || getCeModuleInstanceCount() > 0) {
@@ -349,7 +349,7 @@ public class IngestEventsListener {
if (getCeModuleInstanceCount() == 0) {
recentlyAddedCeArtifacts.clear();
}
- //else another instance of the Correlation Engine Module is still being run.
+ //else another instance of the Central Repository Module is still being run.
/*
* Ensure the data source in the Central Repository has hash values
diff --git a/Core/src/org/sleuthkit/autopsy/centralrepository/ingestmodule/Bundle.properties-MERGED b/Core/src/org/sleuthkit/autopsy/centralrepository/ingestmodule/Bundle.properties-MERGED
index 96a73954fa..46a2f01a64 100755
--- a/Core/src/org/sleuthkit/autopsy/centralrepository/ingestmodule/Bundle.properties-MERGED
+++ b/Core/src/org/sleuthkit/autopsy/centralrepository/ingestmodule/Bundle.properties-MERGED
@@ -1,6 +1,6 @@
CentralRepoIngestModel_name_header=Name:
CentralRepoIngestModel_previous_case_header=
Previous Cases:
-CentralRepoIngestModule.errorMessage.isNotEnabled=Central repository settings are not initialized, cannot run Correlation Engine ingest module.
+CentralRepoIngestModule.errorMessage.isNotEnabled=Central repository settings are not initialized, cannot run Central Repository ingest module.
CentralRepoIngestModule.notfyBubble.title=Central Repository Not Initialized
CentralRepoIngestModule.prevCaseComment.text=Previous Case:
CentralRepoIngestModule.prevTaggedSet.text=Previously Tagged As Notable (Central Repository)
@@ -8,7 +8,7 @@ CentralRepoIngestModule_notable_message_header=A file in this data source
# {0} - Name of file that is Notable
CentralRepoIngestModule_postToBB_knownBadMsg=Notable: {0}
CentralRepoIngestModuleFactory.ingestmodule.desc=Saves properties to the central repository for later correlation
-CentralRepoIngestModuleFactory.ingestmodule.name=Correlation Engine
+CentralRepoIngestModuleFactory.ingestmodule.name=Central Repository
IngestSettingsPanel.ingestSettingsLabel.text=Ingest Settings
IngestSettingsPanel.flagTaggedNotableItemsCheckbox.text=Flag items previously tagged as notable
IngestSettingsPanel.flagPreviouslySeenDevicesCheckbox.text=Flag devices previously seen in other cases
diff --git a/Core/src/org/sleuthkit/autopsy/centralrepository/ingestmodule/CentralRepoIngestModule.java b/Core/src/org/sleuthkit/autopsy/centralrepository/ingestmodule/CentralRepoIngestModule.java
index 1f7472d330..a7c3bd41e0 100644
--- a/Core/src/org/sleuthkit/autopsy/centralrepository/ingestmodule/CentralRepoIngestModule.java
+++ b/Core/src/org/sleuthkit/autopsy/centralrepository/ingestmodule/CentralRepoIngestModule.java
@@ -85,7 +85,7 @@ final class CentralRepoIngestModule implements FileIngestModule {
private final boolean createCorrelationProperties;
/**
- * Instantiate the Correlation Engine ingest module.
+ * Instantiate the Central Repository ingest module.
*
* @param settings The ingest settings for the module instance.
*/
@@ -147,7 +147,7 @@ final class CentralRepoIngestModule implements FileIngestModule {
*/
if (abstractFile.getKnown() != TskData.FileKnown.KNOWN && flagTaggedNotableItems) {
try {
- TimingMetric timingMetric = HealthMonitor.getTimingMetric("Correlation Engine: Notable artifact query");
+ TimingMetric timingMetric = HealthMonitor.getTimingMetric("Central Repository: Notable artifact query");
List caseDisplayNamesList = dbManager.getListCasesHavingArtifactInstancesKnownBad(filesType, md5);
HealthMonitor.submitTimingMetric(timingMetric);
if (!caseDisplayNamesList.isEmpty()) {
@@ -220,7 +220,7 @@ final class CentralRepoIngestModule implements FileIngestModule {
// see ArtifactManagerTimeTester for details
@Messages({
"CentralRepoIngestModule.notfyBubble.title=Central Repository Not Initialized",
- "CentralRepoIngestModule.errorMessage.isNotEnabled=Central repository settings are not initialized, cannot run Correlation Engine ingest module."
+ "CentralRepoIngestModule.errorMessage.isNotEnabled=Central repository settings are not initialized, cannot run Central Repository ingest module."
})
@Override
public void startUp(IngestJobContext context) throws IngestModuleException {
@@ -235,7 +235,7 @@ final class CentralRepoIngestModule implements FileIngestModule {
* posited.
*
* Note: Flagging cannot be disabled if any other instances of the
- * Correlation Engine module are running. This restriction is to prevent
+ * Central Repository module are running. This restriction is to prevent
* missing results in the case where the first module is flagging
* notable items, and the proceeding module (with flagging disabled)
* causes the first to stop flagging.
@@ -276,7 +276,7 @@ final class CentralRepoIngestModule implements FileIngestModule {
// Don't allow sqlite central repo databases to be used for multi user cases
if ((autopsyCase.getCaseType() == Case.CaseType.MULTI_USER_CASE)
&& (CentralRepoDbManager.getSavedDbChoice().getDbPlatform() == CentralRepoPlatforms.SQLITE)) {
- logger.log(Level.SEVERE, "Cannot run correlation engine on a multi-user case with a SQLite central repository.");
+ logger.log(Level.SEVERE, "Cannot run Central Repository ingest module on a multi-user case with a SQLite central repository.");
throw new IngestModuleException("Cannot run on a multi-user case with a SQLite central repository."); // NON-NLS
}
jobId = context.getJobId();
diff --git a/Core/src/org/sleuthkit/autopsy/centralrepository/ingestmodule/CentralRepoIngestModuleFactory.java b/Core/src/org/sleuthkit/autopsy/centralrepository/ingestmodule/CentralRepoIngestModuleFactory.java
index 078c3a5ac9..1c34f1ffad 100644
--- a/Core/src/org/sleuthkit/autopsy/centralrepository/ingestmodule/CentralRepoIngestModuleFactory.java
+++ b/Core/src/org/sleuthkit/autopsy/centralrepository/ingestmodule/CentralRepoIngestModuleFactory.java
@@ -33,7 +33,7 @@ import org.sleuthkit.autopsy.ingest.NoIngestModuleIngestJobSettings;
* Factory for Central Repository ingest modules
*/
@ServiceProvider(service = org.sleuthkit.autopsy.ingest.IngestModuleFactory.class)
-@NbBundle.Messages({"CentralRepoIngestModuleFactory.ingestmodule.name=Correlation Engine",
+@NbBundle.Messages({"CentralRepoIngestModuleFactory.ingestmodule.name=Central Repository",
"CentralRepoIngestModuleFactory.ingestmodule.desc=Saves properties to the central repository for later correlation"})
public class CentralRepoIngestModuleFactory extends IngestModuleFactoryAdapter {
diff --git a/Core/src/org/sleuthkit/autopsy/centralrepository/ingestmodule/IngestSettings.java b/Core/src/org/sleuthkit/autopsy/centralrepository/ingestmodule/IngestSettings.java
index c48f2811a0..52d645bcac 100755
--- a/Core/src/org/sleuthkit/autopsy/centralrepository/ingestmodule/IngestSettings.java
+++ b/Core/src/org/sleuthkit/autopsy/centralrepository/ingestmodule/IngestSettings.java
@@ -21,7 +21,7 @@ package org.sleuthkit.autopsy.centralrepository.ingestmodule;
import org.sleuthkit.autopsy.ingest.IngestModuleIngestJobSettings;
/**
- * Ingest job settings for the Correlation Engine module.
+ * Ingest job settings for the Central Repository module.
*/
final class IngestSettings implements IngestModuleIngestJobSettings {
diff --git a/Core/src/org/sleuthkit/autopsy/centralrepository/ingestmodule/IngestSettingsPanel.java b/Core/src/org/sleuthkit/autopsy/centralrepository/ingestmodule/IngestSettingsPanel.java
index 29e2d91253..befe405281 100755
--- a/Core/src/org/sleuthkit/autopsy/centralrepository/ingestmodule/IngestSettingsPanel.java
+++ b/Core/src/org/sleuthkit/autopsy/centralrepository/ingestmodule/IngestSettingsPanel.java
@@ -22,7 +22,7 @@ import org.sleuthkit.autopsy.ingest.IngestModuleIngestJobSettings;
import org.sleuthkit.autopsy.ingest.IngestModuleIngestJobSettingsPanel;
/**
- * Ingest job settings panel for the Correlation Engine module.
+ * Ingest job settings panel for the Central Repository module.
*/
@SuppressWarnings("PMD.SingularField") // UI widgets cause lots of false positives
final class IngestSettingsPanel extends IngestModuleIngestJobSettingsPanel {
diff --git a/Core/src/org/sleuthkit/autopsy/centralrepository/persona/Bundle.properties b/Core/src/org/sleuthkit/autopsy/centralrepository/persona/Bundle.properties
index 3535f3cd52..26463c8818 100644
--- a/Core/src/org/sleuthkit/autopsy/centralrepository/persona/Bundle.properties
+++ b/Core/src/org/sleuthkit/autopsy/centralrepository/persona/Bundle.properties
@@ -1,15 +1,6 @@
-CTL_OpenPersonaManager=Persona Manager
-CTL_PersonaManagerTopComponentAction=Persona Manager
+CTL_OpenPersonas=Personas
+CTL_PersonasTopComponentAction=Personas
CTL_PersonaDetailsTopComponent=Persona Details
-PersonaManagerTopComponent.createBtn.text=New Persona
-PersonaManagerTopComponent.searchBtn.text=Search
-PersonaManagerTopComponent.resultsTable.columnModel.title1=Name
-PersonaManagerTopComponent.resultsTable.columnModel.title0=ID
-PersonaManagerTopComponent.resultsTable.toolTipText=
-PersonaManagerTopComponent.searchAccountRadio.text=Account
-PersonaManagerTopComponent.searchNameRadio.text=Name
-PersonaManagerTopComponent.searchField.text=
-PersonaManagerTopComponent.editBtn.text=Edit Persona
PersonaDetailsDialog.cancelBtn.text=Cancel
PersonaDetailsDialog.okBtn.text=OK
PersonaDetailsPanel.casesLbl.text=Cases found in:
@@ -27,7 +18,6 @@ PersonaDetailsPanel.nameLbl.text=Name:
AddAliasDialog.accountsLbl.text=Account:
AddAliasDialog.okBtn.text=OK
AddAliasDialog.cancelBtn.text=Cancel
-PersonaManagerTopComponent.deleteBtn.text=Delete Persona
PersonaDetailsPanel.casesLbl.text=Cases found in:
PersonaDetailsPanel.deleteAliasBtn.text=Delete
PersonaDetailsPanel.addAliasBtn.text=Add
@@ -73,3 +63,20 @@ PersonaMetadataDialog.cancelBtn.text=Cancel
PersonaDetailsPanel.editAccountBtn.text=Edit
PersonaDetailsPanel.editMetadataBtn.text=Edit
PersonaDetailsPanel.editAliasBtn.text=Edit
+PersonasTopComponent.searchAccountRadio.text=Account
+PersonasTopComponent.searchNameRadio.text=Name
+PersonasTopComponent.searchField.text=
+PersonasTopComponent.deleteBtn.text=Delete Persona
+PersonasTopComponent.editBtn.text=Edit Persona
+PersonasTopComponent.createBtn.text=New Persona
+PersonasTopComponent.createAccountBtn.text=Create Account
+PersonasTopComponent.searchBtn.text=Search
+PersonasTopComponent.resultsTable.columnModel.title1=Name
+PersonasTopComponent.resultsTable.columnModel.title0=ID
+PersonasTopComponent.resultsTable.toolTipText=
+CreatePersonaAccountDialog.cancelBtn.text=Cancel
+CreatePersonaAccountDialog.typeLbl.text=Type:
+CreatePersonaAccountDialog.identifierTextField.text=
+CreatePersonaAccountDialog.identiferLbl.text=Identifier:
+CreatePersonaAccountDialog.okBtn.text=OK
+PersonasTopComponent.introText.text=Personas represent an online identity. They span cases and are stored in the Central Repository based on accounts that were found in artifacts. You can create, edit, and delete personas here.
diff --git a/Core/src/org/sleuthkit/autopsy/centralrepository/persona/Bundle.properties-MERGED b/Core/src/org/sleuthkit/autopsy/centralrepository/persona/Bundle.properties-MERGED
index ed71818774..7ddd81ee59 100644
--- a/Core/src/org/sleuthkit/autopsy/centralrepository/persona/Bundle.properties-MERGED
+++ b/Core/src/org/sleuthkit/autopsy/centralrepository/persona/Bundle.properties-MERGED
@@ -3,10 +3,15 @@ AddMetadataDialog_dup_msg=A metadata entry with this name has already been added
AddMetadataDialog_dup_Title=Metadata add failure
AddMetadataDialog_empty_name_msg=A metadata entry cannot have an empty name or value.
AddMetadataDialog_empty_name_Title=Missing field(s)
-CTL_OpenPersonaManager=Persona Manager
-CTL_PersonaManagerTopComponentAction=Persona Manager
+CreatePersonaAccountDialog.title.text=Create Account
+CreatePersonaAccountDialog_error_msg=Failed to create account.
+CreatePersonaAccountDialog_error_title=Account failure
+CreatePersonaAccountDialog_success_msg=Account added.
+CreatePersonaAccountDialog_success_title=Account added
+CTL_OpenPersonas=Personas
+CTL_PersonasTopComponentAction=Personas
CTL_PersonaDetailsTopComponent=Persona Details
-OpenPersonasAction.displayName=Persona Manager
+OpenPersonasAction.displayName=Personas
PersonaAccountDialog.title.text=Add Account
PersonaAccountDialog_dup_msg=This account is already added to the persona.
PersonaAccountDialog_dup_Title=Account add failure
@@ -23,32 +28,11 @@ PersonaAliasDialog_dup_msg=This alias has already been added to this persona.
PersonaAliasDialog_dup_Title=Alias add failure
PersonaAliasDialog_empty_msg=An alias cannot be empty.
PersonaAliasDialog_empty_Title=Empty alias
+PersonaDetailsDialog.cancelBtn.text=Cancel
+PersonaDetailsDialog.okBtn.text=OK
PersonaDetailsDialogCreateTitle=Create Persona
PersonaDetailsDialogEditTitle=Edit Persona
PersonaDetailsDialogViewTitle=View Persona
-PersonaDetailsPanel_CentralRepoErr_msg=Failure to write to Central Repository.
-PersonaDetailsPanel_CentralRepoErr_Title=Central Repository failure
-PersonaDetailsPanel_empty_justification_msg=The justification field cannot be empty
-PersonaDetailsPanel_empty_justification_Title=Empty justification
-PersonaDetailsPanel_EmptyComment_msg=Persona comment cannot be empty.
-PersonaDetailsPanel_EmptyComment_Title=Empty persona comment
-PersonaDetailsPanel_EmptyName_msg=Persona name cannot be empty.
-PersonaDetailsPanel_EmptyName_Title=Empty persona name
-PersonaDetailsPanel_load_exception_msg=Failed to load persona.
-PersonaDetailsPanel_load_exception_Title=Initialization failure
-PersonaDetailsPanel_NotEnoughAccounts_msg=A persona needs at least one account.
-PersonaDetailsPanel_NotEnoughAccounts_Title=Missing account
-PersonaManagerTopComponent.createBtn.text=New Persona
-PersonaManagerTopComponent.searchBtn.text=Search
-PersonaManagerTopComponent.resultsTable.columnModel.title1=Name
-PersonaManagerTopComponent.resultsTable.columnModel.title0=ID
-PersonaManagerTopComponent.resultsTable.toolTipText=
-PersonaManagerTopComponent.searchAccountRadio.text=Account
-PersonaManagerTopComponent.searchNameRadio.text=Name
-PersonaManagerTopComponent.searchField.text=
-PersonaManagerTopComponent.editBtn.text=Edit Persona
-PersonaDetailsDialog.cancelBtn.text=Cancel
-PersonaDetailsDialog.okBtn.text=OK
PersonaDetailsPanel.casesLbl.text=Cases found in:
PersonaDetailsPanel.deleteAliasBtn.text=Delete
PersonaDetailsPanel.addAliasBtn.text=Add
@@ -64,7 +48,6 @@ PersonaDetailsPanel.nameLbl.text=Name:
AddAliasDialog.accountsLbl.text=Account:
AddAliasDialog.okBtn.text=OK
AddAliasDialog.cancelBtn.text=Cancel
-PersonaManagerTopComponent.deleteBtn.text=Delete Persona
PersonaDetailsPanel.casesLbl.text=Cases found in:
PersonaDetailsPanel.deleteAliasBtn.text=Delete
PersonaDetailsPanel.addAliasBtn.text=Add
@@ -98,6 +81,18 @@ PersonaAliasDialog.justificationLbl.text=Justification:
PersonaAliasDialog.aliasTextField.text=
PersonaAliasDialog.aliasLbl.text=Alias:
PersonaAliasDialog.okBtn.text_1=OK
+PersonaDetailsPanel_CentralRepoErr_msg=Failure to write to Central Repository.
+PersonaDetailsPanel_CentralRepoErr_Title=Central Repository failure
+PersonaDetailsPanel_empty_justification_msg=The justification field cannot be empty
+PersonaDetailsPanel_empty_justification_Title=Empty justification
+PersonaDetailsPanel_EmptyComment_msg=Persona comment cannot be empty.
+PersonaDetailsPanel_EmptyComment_Title=Empty persona comment
+PersonaDetailsPanel_EmptyName_msg=Persona name cannot be empty.
+PersonaDetailsPanel_EmptyName_Title=Empty persona name
+PersonaDetailsPanel_load_exception_msg=Failed to load persona.
+PersonaDetailsPanel_load_exception_Title=Initialization failure
+PersonaDetailsPanel_NotEnoughAccounts_msg=A persona needs at least one account.
+PersonaDetailsPanel_NotEnoughAccounts_Title=Missing account
PersonaMetadataDialog.confidenceLbl.text=Confidence:
PersonaMetadataDialog.justificationTextField.text=
PersonaMetadataDialog.justificationLbl.text=Justification:
@@ -110,10 +105,27 @@ PersonaMetadataDialog.cancelBtn.text=Cancel
PersonaDetailsPanel.editAccountBtn.text=Edit
PersonaDetailsPanel.editMetadataBtn.text=Edit
PersonaDetailsPanel.editAliasBtn.text=Edit
-PMTopComponent_delete_confirmation_msg=Are you sure you want to delete this persona?
-PMTopComponent_delete_confirmation_Title=Are you sure?
-PMTopComponent_delete_exception_msg=Failed to delete persona.
-PMTopComponent_delete_exception_Title=Delete failure
-PMTopComponent_Name=Persona Manager
-PMTopComponent_search_exception_msg=Failed to search personas.
-PMTopComponent_search_exception_Title=Search failure
+PersonasTopComponent.searchAccountRadio.text=Account
+PersonasTopComponent.searchNameRadio.text=Name
+PersonasTopComponent.searchField.text=
+PersonasTopComponent.deleteBtn.text=Delete Persona
+PersonasTopComponent.editBtn.text=Edit Persona
+PersonasTopComponent.createBtn.text=New Persona
+PersonasTopComponent.createAccountBtn.text=Create Account
+PersonasTopComponent.searchBtn.text=Search
+PersonasTopComponent.resultsTable.columnModel.title1=Name
+PersonasTopComponent.resultsTable.columnModel.title0=ID
+PersonasTopComponent.resultsTable.toolTipText=
+CreatePersonaAccountDialog.cancelBtn.text=Cancel
+CreatePersonaAccountDialog.typeLbl.text=Type:
+CreatePersonaAccountDialog.identifierTextField.text=
+CreatePersonaAccountDialog.identiferLbl.text=Identifier:
+CreatePersonaAccountDialog.okBtn.text=OK
+PersonasTopComponent.introText.text=Personas represent an online identity. They span cases and are stored in the Central Repository based on accounts that were found in artifacts. You can create, edit, and delete personas here.
+PersonasTopComponent_delete_confirmation_msg=Are you sure you want to delete this persona?
+PersonasTopComponent_delete_confirmation_Title=Are you sure?
+PersonasTopComponent_delete_exception_msg=Failed to delete persona.
+PersonasTopComponent_delete_exception_Title=Delete failure
+PersonasTopComponent_Name=Personas
+PersonasTopComponent_search_exception_msg=Failed to search personas.
+PersonasTopComponent_search_exception_Title=Search failure
diff --git a/Core/src/org/sleuthkit/autopsy/centralrepository/persona/Bundle_ja.properties b/Core/src/org/sleuthkit/autopsy/centralrepository/persona/Bundle_ja.properties
index f757a8f7ef..bfdd721a69 100644
--- a/Core/src/org/sleuthkit/autopsy/centralrepository/persona/Bundle_ja.properties
+++ b/Core/src/org/sleuthkit/autopsy/centralrepository/persona/Bundle_ja.properties
@@ -8,3 +8,5 @@ PersonaAliasDialog.cancelBtn.text_1=\u53d6\u308a\u6d88\u3057
PersonaAliasDialog.okBtn.text_1=OK
PersonaMetadataDialog.okBtn.text=OK
PersonaMetadataDialog.cancelBtn.text=\u53d6\u308a\u6d88\u3057
+CreatePersonaAccountDialog.okBtn.text=OK
+CreatePersonaAccountDialog.cancelBtn.text=\u53d6\u308a\u6d88\u3057
diff --git a/Core/src/org/sleuthkit/autopsy/centralrepository/persona/CreatePersonaAccountDialog.form b/Core/src/org/sleuthkit/autopsy/centralrepository/persona/CreatePersonaAccountDialog.form
new file mode 100644
index 0000000000..fd74cca117
--- /dev/null
+++ b/Core/src/org/sleuthkit/autopsy/centralrepository/persona/CreatePersonaAccountDialog.form
@@ -0,0 +1,168 @@
+
+
+
diff --git a/Core/src/org/sleuthkit/autopsy/centralrepository/persona/CreatePersonaAccountDialog.java b/Core/src/org/sleuthkit/autopsy/centralrepository/persona/CreatePersonaAccountDialog.java
new file mode 100644
index 0000000000..d4d23f7f0e
--- /dev/null
+++ b/Core/src/org/sleuthkit/autopsy/centralrepository/persona/CreatePersonaAccountDialog.java
@@ -0,0 +1,281 @@
+/*
+ * Central Repository
+ *
+ * Copyright 2020 Basis Technology Corp.
+ * Contact: carrier sleuthkit org
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.sleuthkit.autopsy.centralrepository.persona;
+
+import java.awt.Component;
+import java.io.Serializable;
+import java.util.Collection;
+import java.util.logging.Level;
+import javax.swing.JDialog;
+import javax.swing.JLabel;
+import javax.swing.JList;
+import javax.swing.JOptionPane;
+import javax.swing.ListCellRenderer;
+import javax.swing.SwingUtilities;
+import org.openide.util.NbBundle.Messages;
+import org.openide.windows.WindowManager;
+import org.sleuthkit.autopsy.centralrepository.datamodel.CentralRepoAccount;
+import org.sleuthkit.autopsy.centralrepository.datamodel.CentralRepoAccount.CentralRepoAccountType;
+import org.sleuthkit.autopsy.centralrepository.datamodel.CentralRepoException;
+import org.sleuthkit.autopsy.centralrepository.datamodel.CentralRepository;
+import org.sleuthkit.autopsy.coreutils.Logger;
+
+/**
+ * Configuration dialog for creating an account.
+ */
+@SuppressWarnings("PMD.SingularField") // UI widgets cause lots of false positives
+public class CreatePersonaAccountDialog extends JDialog {
+
+ private static final Logger logger = Logger.getLogger(CreatePersonaAccountDialog.class.getName());
+
+ private static final long serialVersionUID = 1L;
+
+ private final TypeChoiceRenderer TYPE_CHOICE_RENDERER = new TypeChoiceRenderer();
+
+ /**
+ * Creates new create account dialog.
+ */
+ @Messages({"CreatePersonaAccountDialog.title.text=Create Account",})
+ public CreatePersonaAccountDialog(PersonaDetailsPanel pdp) {
+ super(SwingUtilities.windowForComponent(pdp),
+ Bundle.PersonaAccountDialog_title_text(),
+ ModalityType.APPLICATION_MODAL);
+
+ initComponents();
+ typeComboBox.setRenderer(TYPE_CHOICE_RENDERER);
+ display();
+ }
+
+ /**
+ * This class handles displaying and rendering drop down menu for account
+ * choices.
+ */
+ private class TypeChoiceRenderer extends JLabel implements ListCellRenderer, Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public Component getListCellRendererComponent(
+ JList extends CentralRepoAccountType> list, CentralRepoAccountType value,
+ int index, boolean isSelected, boolean cellHasFocus) {
+ setText(value.getAcctType().getDisplayName());
+ return this;
+ }
+ }
+
+ private CentralRepoAccountType[] getAllAccountTypes() {
+ Collection allAccountTypes;
+ try {
+ allAccountTypes = CentralRepository.getInstance().getAllAccountTypes();
+ } catch (CentralRepoException e) {
+ logger.log(Level.SEVERE, "Failed to access central repository", e);
+ JOptionPane.showMessageDialog(this,
+ Bundle.PersonaAccountDialog_get_types_exception_Title(),
+ Bundle.PersonaAccountDialog_get_types_exception_msg(),
+ JOptionPane.ERROR_MESSAGE);
+ return new CentralRepoAccountType[0];
+ }
+ return allAccountTypes.toArray(new CentralRepoAccountType[0]);
+ }
+
+ /**
+ * This method is called from within the constructor to initialize the form.
+ * WARNING: Do NOT modify this code. The content of this method is always
+ * regenerated by the Form Editor.
+ */
+ @SuppressWarnings("unchecked")
+ // //GEN-BEGIN:initComponents
+ private void initComponents() {
+
+ settingsPanel = new javax.swing.JPanel();
+ identiferLbl = new javax.swing.JLabel();
+ identifierTextField = new javax.swing.JTextField();
+ typeLbl = new javax.swing.JLabel();
+ typeComboBox = new javax.swing.JComboBox<>();
+ cancelBtn = new javax.swing.JButton();
+ okBtn = new javax.swing.JButton();
+
+ setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
+ setResizable(false);
+
+ settingsPanel.setBorder(javax.swing.BorderFactory.createEtchedBorder());
+
+ org.openide.awt.Mnemonics.setLocalizedText(identiferLbl, org.openide.util.NbBundle.getMessage(CreatePersonaAccountDialog.class, "CreatePersonaAccountDialog.identiferLbl.text")); // NOI18N
+
+ identifierTextField.setText(org.openide.util.NbBundle.getMessage(CreatePersonaAccountDialog.class, "CreatePersonaAccountDialog.identifierTextField.text")); // NOI18N
+ identifierTextField.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ identifierTextFieldActionPerformed(evt);
+ }
+ });
+
+ org.openide.awt.Mnemonics.setLocalizedText(typeLbl, org.openide.util.NbBundle.getMessage(CreatePersonaAccountDialog.class, "CreatePersonaAccountDialog.typeLbl.text")); // NOI18N
+
+ typeComboBox.setModel(new javax.swing.DefaultComboBoxModel<>(getAllAccountTypes()));
+
+ javax.swing.GroupLayout settingsPanelLayout = new javax.swing.GroupLayout(settingsPanel);
+ settingsPanel.setLayout(settingsPanelLayout);
+ settingsPanelLayout.setHorizontalGroup(
+ settingsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(settingsPanelLayout.createSequentialGroup()
+ .addContainerGap()
+ .addGroup(settingsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(settingsPanelLayout.createSequentialGroup()
+ .addComponent(typeLbl)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(typeComboBox, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
+ .addGroup(settingsPanelLayout.createSequentialGroup()
+ .addComponent(identiferLbl)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(identifierTextField, javax.swing.GroupLayout.DEFAULT_SIZE, 281, Short.MAX_VALUE)))
+ .addContainerGap())
+ );
+ settingsPanelLayout.setVerticalGroup(
+ settingsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(settingsPanelLayout.createSequentialGroup()
+ .addContainerGap()
+ .addGroup(settingsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
+ .addComponent(identiferLbl)
+ .addComponent(identifierTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addGroup(settingsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
+ .addComponent(typeComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addComponent(typeLbl, javax.swing.GroupLayout.PREFERRED_SIZE, 9, javax.swing.GroupLayout.PREFERRED_SIZE))
+ .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
+ );
+
+ org.openide.awt.Mnemonics.setLocalizedText(cancelBtn, org.openide.util.NbBundle.getMessage(CreatePersonaAccountDialog.class, "CreatePersonaAccountDialog.cancelBtn.text")); // NOI18N
+ cancelBtn.setMaximumSize(new java.awt.Dimension(79, 23));
+ cancelBtn.setMinimumSize(new java.awt.Dimension(79, 23));
+ cancelBtn.setPreferredSize(new java.awt.Dimension(79, 23));
+ cancelBtn.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ cancelBtnActionPerformed(evt);
+ }
+ });
+
+ org.openide.awt.Mnemonics.setLocalizedText(okBtn, org.openide.util.NbBundle.getMessage(CreatePersonaAccountDialog.class, "CreatePersonaAccountDialog.okBtn.text")); // NOI18N
+ okBtn.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ okBtnActionPerformed(evt);
+ }
+ });
+
+ javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
+ getContentPane().setLayout(layout);
+ layout.setHorizontalGroup(
+ layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(layout.createSequentialGroup()
+ .addContainerGap(194, Short.MAX_VALUE)
+ .addComponent(okBtn)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(cancelBtn, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addContainerGap())
+ .addComponent(settingsPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+ );
+
+ layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {cancelBtn, okBtn});
+
+ layout.setVerticalGroup(
+ layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(layout.createSequentialGroup()
+ .addContainerGap()
+ .addComponent(settingsPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
+ .addComponent(okBtn)
+ .addComponent(cancelBtn, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
+ .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
+ );
+
+ pack();
+ }// //GEN-END:initComponents
+
+ private void display() {
+ this.setLocationRelativeTo(WindowManager.getDefault().getMainWindow());
+ setVisible(true);
+ }
+
+ @Messages({
+ "CreatePersonaAccountDialog_error_title=Account failure",
+ "CreatePersonaAccountDialog_error_msg=Failed to create account.",
+ })
+ private CentralRepoAccount createAccount(CentralRepoAccount.CentralRepoAccountType type, String identifier) {
+ CentralRepoAccount ret = null;
+ try {
+ CentralRepository cr = CentralRepository.getInstance();
+ if (cr != null) {
+ ret = cr.getOrCreateAccount(type, identifier);
+ }
+ } catch (CentralRepoException e) {
+ logger.log(Level.SEVERE, "Failed to create account", e);
+ JOptionPane.showMessageDialog(this,
+ Bundle.CreatePersonaAccountDialog_error_title(),
+ Bundle.CreatePersonaAccountDialog_error_msg(),
+ JOptionPane.ERROR_MESSAGE);
+ }
+ return ret;
+ }
+
+ @Messages({
+ "CreatePersonaAccountDialog_success_title=Account added",
+ "CreatePersonaAccountDialog_success_msg=Account added.",
+ })
+ private void okBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_okBtnActionPerformed
+ if (identifierTextField.getText().isEmpty()) {
+ JOptionPane.showMessageDialog(this,
+ Bundle.PersonaAccountDialog_identifier_empty_msg(),
+ Bundle.PersonaAccountDialog_identifier_empty_Title(),
+ JOptionPane.ERROR_MESSAGE);
+ return;
+ }
+
+ CentralRepoAccount.CentralRepoAccountType type =
+ (CentralRepoAccount.CentralRepoAccountType) typeComboBox.getSelectedItem();
+ String identifier = identifierTextField.getText();
+
+ if (createAccount(type, identifier) != null) {
+ // show account created message
+ JOptionPane.showMessageDialog(this,
+ Bundle.CreatePersonaAccountDialog_success_msg(),
+ Bundle.CreatePersonaAccountDialog_success_title(),
+ JOptionPane.INFORMATION_MESSAGE);
+
+ dispose();
+ }
+ }//GEN-LAST:event_okBtnActionPerformed
+
+ private void cancelBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cancelBtnActionPerformed
+ dispose();
+ }//GEN-LAST:event_cancelBtnActionPerformed
+
+ private void identifierTextFieldActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_identifierTextFieldActionPerformed
+ // TODO add your handling code here:
+ }//GEN-LAST:event_identifierTextFieldActionPerformed
+
+ // Variables declaration - do not modify//GEN-BEGIN:variables
+ private javax.swing.JButton cancelBtn;
+ private javax.swing.JLabel identiferLbl;
+ private javax.swing.JTextField identifierTextField;
+ private javax.swing.JButton okBtn;
+ private javax.swing.JPanel settingsPanel;
+ private javax.swing.JComboBox typeComboBox;
+ private javax.swing.JLabel typeLbl;
+ // End of variables declaration//GEN-END:variables
+}
diff --git a/Core/src/org/sleuthkit/autopsy/centralrepository/persona/OpenPersonaManagerAction.java b/Core/src/org/sleuthkit/autopsy/centralrepository/persona/OpenPersonasAction.java
similarity index 88%
rename from Core/src/org/sleuthkit/autopsy/centralrepository/persona/OpenPersonaManagerAction.java
rename to Core/src/org/sleuthkit/autopsy/centralrepository/persona/OpenPersonasAction.java
index 9d40eeb357..5407abc981 100644
--- a/Core/src/org/sleuthkit/autopsy/centralrepository/persona/OpenPersonaManagerAction.java
+++ b/Core/src/org/sleuthkit/autopsy/centralrepository/persona/OpenPersonasAction.java
@@ -35,18 +35,18 @@ import org.sleuthkit.autopsy.coreutils.ThreadConfined;
* An Action that opens the Persona Search window.
*/
-@ActionID(category = "Tools", id = "org.sleuthkit.autopsy.centralrepository.persona.OpenPersonaManagerAction")
-@ActionRegistration(displayName = "#CTL_OpenPersonaManager", lazy = false)
+@ActionID(category = "Tools", id = "org.sleuthkit.autopsy.centralrepository.persona.OpenPersonasAction")
+@ActionRegistration(displayName = "#CTL_OpenPersonas", lazy = false)
@ActionReferences(value = {
@ActionReference(path = "Menu/Tools", position = 105)
})
-public final class OpenPersonaManagerAction extends CallableSystemAction {
+public final class OpenPersonasAction extends CallableSystemAction {
private static final long serialVersionUID = 1L;
private final JMenuItem menuItem;
- public OpenPersonaManagerAction() {
+ public OpenPersonasAction() {
menuItem = super.getMenuPresenter();
this.setEnabled(CentralRepository.isEnabled());
}
@@ -54,7 +54,7 @@ public final class OpenPersonaManagerAction extends CallableSystemAction {
@Override
@ThreadConfined(type = ThreadConfined.ThreadType.AWT)
public void performAction() {
- final TopComponent topComponent = WindowManager.getDefault().findTopComponent("PersonaManagerTopComponent");
+ final TopComponent topComponent = WindowManager.getDefault().findTopComponent("PersonasTopComponent");
if (topComponent != null) {
if (topComponent.isOpened() == false) {
topComponent.open();
@@ -65,7 +65,7 @@ public final class OpenPersonaManagerAction extends CallableSystemAction {
}
@Override
- @NbBundle.Messages("OpenPersonasAction.displayName=Persona Manager")
+ @NbBundle.Messages("OpenPersonasAction.displayName=Personas")
public String getName() {
return Bundle.OpenPersonasAction_displayName();
}
diff --git a/Core/src/org/sleuthkit/autopsy/centralrepository/persona/PersonaManagerTopComponent.form b/Core/src/org/sleuthkit/autopsy/centralrepository/persona/PersonasTopComponent.form
similarity index 62%
rename from Core/src/org/sleuthkit/autopsy/centralrepository/persona/PersonaManagerTopComponent.form
rename to Core/src/org/sleuthkit/autopsy/centralrepository/persona/PersonasTopComponent.form
index 4c2a65a276..45edb3e159 100644
--- a/Core/src/org/sleuthkit/autopsy/centralrepository/persona/PersonaManagerTopComponent.form
+++ b/Core/src/org/sleuthkit/autopsy/centralrepository/persona/PersonasTopComponent.form
@@ -1,35 +1,12 @@
-
-