Merge pull request #3269 from APriestman/3244_referenceSetType

Add correlation type field to reference sets
This commit is contained in:
Richard Cordovano 2017-12-08 17:57:22 -05:00 committed by GitHub
commit fe0114afa6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 113 additions and 70 deletions

View File

@ -1610,7 +1610,7 @@ public abstract class AbstractSqlEamDb implements EamDb {
PreparedStatement preparedStatement1 = null; PreparedStatement preparedStatement1 = null;
PreparedStatement preparedStatement2 = null; PreparedStatement preparedStatement2 = null;
ResultSet resultSet = null; ResultSet resultSet = null;
String sql1 = "INSERT INTO reference_sets(org_id, set_name, version, known_status, read_only, import_date) VALUES (?, ?, ?, ?, ?, ?)"; String sql1 = "INSERT INTO reference_sets(org_id, set_name, version, known_status, read_only, type, import_date) VALUES (?, ?, ?, ?, ?, ?, ?)";
String sql2 = "SELECT id FROM reference_sets WHERE org_id=? AND set_name=? AND version=? AND import_date=? LIMIT 1"; String sql2 = "SELECT id FROM reference_sets WHERE org_id=? AND set_name=? AND version=? AND import_date=? LIMIT 1";
try { try {
@ -1620,7 +1620,8 @@ public abstract class AbstractSqlEamDb implements EamDb {
preparedStatement1.setString(3, eamGlobalSet.getVersion()); preparedStatement1.setString(3, eamGlobalSet.getVersion());
preparedStatement1.setInt(4, eamGlobalSet.getFileKnownStatus().getFileKnownValue()); preparedStatement1.setInt(4, eamGlobalSet.getFileKnownStatus().getFileKnownValue());
preparedStatement1.setBoolean(5, eamGlobalSet.isReadOnly()); preparedStatement1.setBoolean(5, eamGlobalSet.isReadOnly());
preparedStatement1.setString(6, eamGlobalSet.getImportDate().toString()); preparedStatement1.setInt(6, eamGlobalSet.getType().getId());
preparedStatement1.setString(7, eamGlobalSet.getImportDate().toString());
preparedStatement1.executeUpdate(); preparedStatement1.executeUpdate();
@ -1680,18 +1681,20 @@ public abstract class AbstractSqlEamDb implements EamDb {
/** /**
* Get all reference sets * Get all reference sets
* *
* @param correlationType Type of sets to return
*
* @return List of all reference sets in the central repository * @return List of all reference sets in the central repository
* *
* @throws EamDbException * @throws EamDbException
*/ */
@Override @Override
public List<EamGlobalSet> getAllReferenceSets() throws EamDbException { public List<EamGlobalSet> getAllReferenceSets(CorrelationAttribute.Type correlationType) throws EamDbException {
List<EamGlobalSet> results = new ArrayList<>(); List<EamGlobalSet> results = new ArrayList<>();
Connection conn = connect(); Connection conn = connect();
PreparedStatement preparedStatement1 = null; PreparedStatement preparedStatement1 = null;
ResultSet resultSet = null; ResultSet resultSet = null;
String sql1 = "SELECT * FROM reference_sets"; String sql1 = "SELECT * FROM reference_sets WHERE type=" + correlationType.getId();
try { try {
preparedStatement1 = conn.prepareStatement(sql1); preparedStatement1 = conn.prepareStatement(sql1);
@ -2194,7 +2197,7 @@ public abstract class AbstractSqlEamDb implements EamDb {
return eamOrganization; return eamOrganization;
} }
private EamGlobalSet getEamGlobalSetFromResultSet(ResultSet resultSet) throws SQLException { private EamGlobalSet getEamGlobalSetFromResultSet(ResultSet resultSet) throws SQLException, EamDbException {
if (null == resultSet) { if (null == resultSet) {
return null; return null;
} }
@ -2206,6 +2209,7 @@ public abstract class AbstractSqlEamDb implements EamDb {
resultSet.getString("version"), resultSet.getString("version"),
TskData.FileKnown.valueOf(resultSet.getByte("known_status")), TskData.FileKnown.valueOf(resultSet.getByte("known_status")),
resultSet.getBoolean("read_only"), resultSet.getBoolean("read_only"),
EamDb.getInstance().getCorrelationTypeById(resultSet.getInt("type")),
LocalDate.parse(resultSet.getString("import_date")) LocalDate.parse(resultSet.getString("import_date"))
); );

View File

@ -33,7 +33,7 @@ public interface EamDb {
public static final int SCHEMA_VERSION = 1; public static final int SCHEMA_VERSION = 1;
public static final CaseDbSchemaVersionNumber CURRENT_DB_SCHEMA_VERSION public static final CaseDbSchemaVersionNumber CURRENT_DB_SCHEMA_VERSION
= new CaseDbSchemaVersionNumber(1, 1); = new CaseDbSchemaVersionNumber(1, 1);
/** /**
* Get the instance * Get the instance
@ -103,7 +103,7 @@ public interface EamDb {
/** /**
* Add a new name/value pair in the db_info table. * Add a new name/value pair in the db_info table.
* *
* @param name Key to set * @param name Key to set
* @param value Value to set * @param value Value to set
* *
* @throws EamDbException * @throws EamDbException
@ -124,7 +124,7 @@ public interface EamDb {
/** /**
* Update the value for a name in the name/value db_info table. * Update the value for a name in the name/value db_info table.
* *
* @param name Name to find * @param name Name to find
* @param value Value to assign to name. * @param value Value to assign to name.
* *
* @throws EamDbException * @throws EamDbException
@ -146,8 +146,6 @@ public interface EamDb {
* @param autopsyCase The case to add * @param autopsyCase The case to add
*/ */
CorrelationCase newCase(Case autopsyCase) throws EamDbException; CorrelationCase newCase(Case autopsyCase) throws EamDbException;
/** /**
* Updates an existing Case in the database * Updates an existing Case in the database
@ -158,13 +156,13 @@ public interface EamDb {
/** /**
* Retrieves Central Repo case based on an Autopsy Case * Retrieves Central Repo case based on an Autopsy Case
* *
* @param autopsyCase Autopsy case to find corresponding CR case for * @param autopsyCase Autopsy case to find corresponding CR case for
* @return CR Case * @return CR Case
* @throws EamDbException * @throws EamDbException
*/ */
CorrelationCase getCase(Case autopsyCase) throws EamDbException; CorrelationCase getCase(Case autopsyCase) throws EamDbException;
/** /**
* Retrieves Case details based on Case UUID * Retrieves Case details based on Case UUID
* *
@ -191,8 +189,8 @@ public interface EamDb {
/** /**
* Retrieves Data Source details based on data source device ID * Retrieves Data Source details based on data source device ID
* *
* @param correlationCase the current CorrelationCase used for ensuring * @param correlationCase the current CorrelationCase used for ensuring
* uniqueness of DataSource * uniqueness of DataSource
* @param dataSourceDeviceId the data source device ID number * @param dataSourceDeviceId the data source device ID number
* *
* @return The data source * @return The data source
@ -229,7 +227,7 @@ public interface EamDb {
* Retrieves eamArtifact instances from the database that are associated * Retrieves eamArtifact instances from the database that are associated
* with the aType and filePath * with the aType and filePath
* *
* @param aType EamArtifact.Type to search for * @param aType EamArtifact.Type to search for
* @param filePath File path to search for * @param filePath File path to search for
* *
* @return List of 0 or more EamArtifactInstances * @return List of 0 or more EamArtifactInstances
@ -246,7 +244,7 @@ public interface EamDb {
* @param value Value to search for * @param value Value to search for
* *
* @return Number of artifact instances having ArtifactType and * @return Number of artifact instances having ArtifactType and
* ArtifactValue. * ArtifactValue.
*/ */
Long getCountArtifactInstancesByTypeValue(CorrelationAttribute.Type aType, String value) throws EamDbException; Long getCountArtifactInstancesByTypeValue(CorrelationAttribute.Type aType, String value) throws EamDbException;
@ -283,11 +281,11 @@ public interface EamDb {
* associated with the caseDisplayName and dataSource of the given * associated with the caseDisplayName and dataSource of the given
* eamArtifact instance. * eamArtifact instance.
* *
* @param caseUUID Case ID to search for * @param caseUUID Case ID to search for
* @param dataSourceID Data source ID to search for * @param dataSourceID Data source ID to search for
* *
* @return Number of artifact instances having caseDisplayName and * @return Number of artifact instances having caseDisplayName and
* dataSource * dataSource
*/ */
Long getCountArtifactInstancesByCaseDataSource(String caseUUID, String dataSourceID) throws EamDbException; Long getCountArtifactInstancesByCaseDataSource(String caseUUID, String dataSourceID) throws EamDbException;
@ -349,7 +347,7 @@ public interface EamDb {
* @param value Value to search for * @param value Value to search for
* *
* @return List of cases containing this artifact with instances marked as * @return List of cases containing this artifact with instances marked as
* bad * bad
* *
* @throws EamDbException * @throws EamDbException
*/ */
@ -357,14 +355,17 @@ public interface EamDb {
/** /**
* Remove a reference set and all values contained in it. * Remove a reference set and all values contained in it.
*
* @param referenceSetID * @param referenceSetID
* @throws EamDbException * @throws EamDbException
*/ */
public void deleteReferenceSet(int referenceSetID) throws EamDbException; public void deleteReferenceSet(int referenceSetID) throws EamDbException;
/** /**
* Check whether a reference set with the given parameters exists in the central repository. * Check whether a reference set with the given parameters exists in the
* Used to check whether reference sets saved in the settings are still present. * central repository. Used to check whether reference sets saved in the
* settings are still present.
*
* @param referenceSetID * @param referenceSetID
* @param referenceSetName * @param referenceSetName
* @param version * @param version
@ -372,36 +373,40 @@ public interface EamDb {
* @throws EamDbException * @throws EamDbException
*/ */
public boolean referenceSetIsValid(int referenceSetID, String referenceSetName, String version) throws EamDbException; public boolean referenceSetIsValid(int referenceSetID, String referenceSetName, String version) throws EamDbException;
/** /**
* Check whether a reference set with the given name/version is in the central repo. * Check whether a reference set with the given name/version is in the
* Used to check for name collisions when creating reference sets. * central repo. Used to check for name collisions when creating reference
* sets.
*
* @param referenceSetName * @param referenceSetName
* @param version * @param version
* @return true if a matching set is found * @return true if a matching set is found
* @throws EamDbException * @throws EamDbException
*/ */
public boolean referenceSetExists(String referenceSetName, String version) throws EamDbException; public boolean referenceSetExists(String referenceSetName, String version) throws EamDbException;
/** /**
* Check if the given file hash is in this reference set. * Check if the given file hash is in this reference set. Only searches the
* Only searches the reference_files table. * reference_files table.
*
* @param hash * @param hash
* @param referenceSetID * @param referenceSetID
* @return true if the hash is found in the reference set * @return true if the hash is found in the reference set
* @throws EamDbException * @throws EamDbException
*/ */
public boolean isFileHashInReferenceSet(String hash, int referenceSetID) throws EamDbException; public boolean isFileHashInReferenceSet(String hash, int referenceSetID) throws EamDbException;
/** /**
* Check if the given value is in a specific reference set * Check if the given value is in a specific reference set
*
* @param value * @param value
* @param referenceSetID * @param referenceSetID
* @param correlationTypeID * @param correlationTypeID
* @return true if the hash is found in the reference set * @return true if the hash is found in the reference set
*/ */
public boolean isValueInReferenceSet(String value, int referenceSetID, int correlationTypeID) throws EamDbException; public boolean isValueInReferenceSet(String value, int referenceSetID, int correlationTypeID) throws EamDbException;
/** /**
* Is the artifact known as bad according to the reference entries? * Is the artifact known as bad according to the reference entries?
* *
@ -418,7 +423,7 @@ public interface EamDb {
* @param eamOrg The organization to add * @param eamOrg The organization to add
* *
* @return the Organization ID of the newly created organization. * @return the Organization ID of the newly created organization.
* *
* @throws EamDbException * @throws EamDbException
*/ */
long newOrganization(EamOrganization eamOrg) throws EamDbException; long newOrganization(EamOrganization eamOrg) throws EamDbException;
@ -445,9 +450,10 @@ public interface EamDb {
/** /**
* Get the organization associated with the given reference set. * Get the organization associated with the given reference set.
*
* @param referenceSetID ID of the reference set * @param referenceSetID ID of the reference set
* @return The organization object * @return The organization object
* @throws EamDbException * @throws EamDbException
*/ */
EamOrganization getReferenceSetOrganization(int referenceSetID) throws EamDbException; EamOrganization getReferenceSetOrganization(int referenceSetID) throws EamDbException;
@ -455,7 +461,7 @@ public interface EamDb {
* Update an existing organization. * Update an existing organization.
* *
* @param updatedOrganization the values the Organization with the same ID * @param updatedOrganization the values the Organization with the same ID
* will be updated to in the database. * will be updated to in the database.
* *
* @throws EamDbException * @throws EamDbException
*/ */
@ -463,13 +469,13 @@ public interface EamDb {
/** /**
* Delete an organization if it is not being used by any case. * Delete an organization if it is not being used by any case.
* *
* @param organizationToDelete the organization to be deleted * @param organizationToDelete the organization to be deleted
* *
* @throws EamDbException * @throws EamDbException
*/ */
void deleteOrganization(EamOrganization organizationToDelete) throws EamDbException; void deleteOrganization(EamOrganization organizationToDelete) throws EamDbException;
/** /**
* Add a new Global Set * Add a new Global Set
* *
@ -491,33 +497,34 @@ public interface EamDb {
* @throws EamDbException * @throws EamDbException
*/ */
EamGlobalSet getReferenceSetByID(int globalSetID) throws EamDbException; EamGlobalSet getReferenceSetByID(int globalSetID) throws EamDbException;
/** /**
* Get all reference sets * Get all reference sets
* *
* @param correlationType Type of sets to return
*
* @return List of all reference sets in the central repository * @return List of all reference sets in the central repository
* *
* @throws EamDbException * @throws EamDbException
*/ */
List<EamGlobalSet> getAllReferenceSets() throws EamDbException; List<EamGlobalSet> getAllReferenceSets(CorrelationAttribute.Type correlationType) throws EamDbException;
/** /**
* Add a new reference instance * Add a new reference instance
* *
* @param eamGlobalFileInstance The reference instance to add * @param eamGlobalFileInstance The reference instance to add
* @param correlationType Correlation Type that this Reference * @param correlationType Correlation Type that this Reference Instance is
* Instance is
* *
* @throws EamDbException * @throws EamDbException
*/ */
void addReferenceInstance(EamGlobalFileInstance eamGlobalFileInstance, CorrelationAttribute.Type correlationType) throws EamDbException; void addReferenceInstance(EamGlobalFileInstance eamGlobalFileInstance, CorrelationAttribute.Type correlationType) throws EamDbException;
/** /**
* Insert the bulk collection of Global File Instances * Insert the bulk collection of Global File Instances
* *
* @param globalInstances a Set of EamGlobalFileInstances to insert into the * @param globalInstances a Set of EamGlobalFileInstances to insert into the
* db. * db.
* @param contentType the Type of the global instances * @param contentType the Type of the global instances
* *
* @throws EamDbException * @throws EamDbException
*/ */
@ -526,7 +533,7 @@ public interface EamDb {
/** /**
* Get all reference entries having a given correlation type and value * Get all reference entries having a given correlation type and value
* *
* @param aType Type to use for matching * @param aType Type to use for matching
* @param aValue Value to use for matching * @param aValue Value to use for matching
* *
* @return List of all global file instances with a type and value * @return List of all global file instances with a type and value
@ -551,7 +558,7 @@ public interface EamDb {
* used to correlate artifacts. * used to correlate artifacts.
* *
* @return List of EamArtifact.Type's. If none are defined in the database, * @return List of EamArtifact.Type's. If none are defined in the database,
* the default list will be returned. * the default list will be returned.
* *
* @throws EamDbException * @throws EamDbException
*/ */
@ -562,7 +569,7 @@ public interface EamDb {
* artifacts. * artifacts.
* *
* @return List of enabled EamArtifact.Type's. If none are defined in the * @return List of enabled EamArtifact.Type's. If none are defined in the
* database, the default list will be returned. * database, the default list will be returned.
* *
* @throws EamDbException * @throws EamDbException
*/ */
@ -573,7 +580,7 @@ public interface EamDb {
* correlate artifacts. * correlate artifacts.
* *
* @return List of supported EamArtifact.Type's. If none are defined in the * @return List of supported EamArtifact.Type's. If none are defined in the
* database, the default list will be returned. * database, the default list will be returned.
* *
* @throws EamDbException * @throws EamDbException
*/ */
@ -598,20 +605,23 @@ public interface EamDb {
* @throws EamDbException * @throws EamDbException
*/ */
public CorrelationAttribute.Type getCorrelationTypeById(int typeId) throws EamDbException; public CorrelationAttribute.Type getCorrelationTypeById(int typeId) throws EamDbException;
/** /**
* Upgrade the schema of the database (if needed) * Upgrade the schema of the database (if needed)
* @throws EamDbException *
* @throws EamDbException
*/ */
public void upgradeSchema() throws EamDbException, SQLException; public void upgradeSchema() throws EamDbException, SQLException;
/** /**
* Gets an exclusive lock (if applicable). * Gets an exclusive lock (if applicable). Will return the lock if
* Will return the lock if successful, null if unsuccessful because locking * successful, null if unsuccessful because locking isn't supported, and
* isn't supported, and throw an exception if we should have been able to get the * throw an exception if we should have been able to get the lock but failed
* lock but failed (meaning the database is in use). * (meaning the database is in use).
*
* @return the lock, or null if locking is not supported * @return the lock, or null if locking is not supported
* @throws EamDbException if the coordination service is running but we fail to get the lock * @throws EamDbException if the coordination service is running but we fail
* to get the lock
*/ */
public CoordinationService.Lock getExclusiveMultiUserDbLock() throws EamDbException; public CoordinationService.Lock getExclusiveMultiUserDbLock() throws EamDbException;
} }

View File

@ -32,6 +32,7 @@ public class EamGlobalSet {
private String version; private String version;
private TskData.FileKnown fileKnownStatus; private TskData.FileKnown fileKnownStatus;
private boolean isReadOnly; private boolean isReadOnly;
private CorrelationAttribute.Type type;
private LocalDate importDate; private LocalDate importDate;
public EamGlobalSet( public EamGlobalSet(
@ -41,6 +42,7 @@ public class EamGlobalSet {
String version, String version,
TskData.FileKnown knownStatus, TskData.FileKnown knownStatus,
boolean isReadOnly, boolean isReadOnly,
CorrelationAttribute.Type type,
LocalDate importDate) { LocalDate importDate) {
this.globalSetID = globalSetID; this.globalSetID = globalSetID;
this.orgID = orgID; this.orgID = orgID;
@ -48,6 +50,7 @@ public class EamGlobalSet {
this.version = version; this.version = version;
this.fileKnownStatus = knownStatus; this.fileKnownStatus = knownStatus;
this.isReadOnly = isReadOnly; this.isReadOnly = isReadOnly;
this.type = type;
this.importDate = importDate; this.importDate = importDate;
} }
@ -57,8 +60,9 @@ public class EamGlobalSet {
String version, String version,
TskData.FileKnown knownStatus, TskData.FileKnown knownStatus,
boolean isReadOnly, boolean isReadOnly,
CorrelationAttribute.Type type,
LocalDate importDate) { LocalDate importDate) {
this(-1, orgID, setName, version, knownStatus, isReadOnly, importDate); this(-1, orgID, setName, version, knownStatus, isReadOnly, type, importDate);
} }
/** /**
@ -77,8 +81,9 @@ public class EamGlobalSet {
String setName, String setName,
String version, String version,
TskData.FileKnown knownStatus, TskData.FileKnown knownStatus,
boolean isReadOnly) { boolean isReadOnly,
this(-1, orgID, setName, version, knownStatus, isReadOnly, LocalDate.now()); CorrelationAttribute.Type type) {
this(-1, orgID, setName, version, knownStatus, isReadOnly, type, LocalDate.now());
} }
/** /**
@ -164,6 +169,24 @@ public class EamGlobalSet {
public void setFileKnownStatus(TskData.FileKnown fileKnownStatus) { public void setFileKnownStatus(TskData.FileKnown fileKnownStatus) {
this.fileKnownStatus = fileKnownStatus; this.fileKnownStatus = fileKnownStatus;
} }
/**
* Get the type of reference set
*
* @return the type (files, phone numbers, etc)
*/
public CorrelationAttribute.Type getType() {
return type;
}
/**
* Sets the type of reference set
*
* @param type
*/
void setType(CorrelationAttribute.Type type) {
this.type = type;
}
/** /**
* @return the importDate * @return the importDate

View File

@ -356,6 +356,7 @@ public final class PostgresEamDbSettings {
createReferenceSetsTable.append("version text NOT NULL,"); createReferenceSetsTable.append("version text NOT NULL,");
createReferenceSetsTable.append("known_status integer NOT NULL,"); createReferenceSetsTable.append("known_status integer NOT NULL,");
createReferenceSetsTable.append("read_only boolean NOT NULL,"); createReferenceSetsTable.append("read_only boolean NOT NULL,");
createReferenceSetsTable.append("type integer NOT NULL,");
createReferenceSetsTable.append("import_date text NOT NULL,"); createReferenceSetsTable.append("import_date text NOT NULL,");
createReferenceSetsTable.append("foreign key (org_id) references organizations(id) ON UPDATE SET NULL ON DELETE SET NULL,"); createReferenceSetsTable.append("foreign key (org_id) references organizations(id) ON UPDATE SET NULL ON DELETE SET NULL,");
createReferenceSetsTable.append("CONSTRAINT hash_set_unique UNIQUE (set_name, version)"); createReferenceSetsTable.append("CONSTRAINT hash_set_unique UNIQUE (set_name, version)");

View File

@ -810,15 +810,17 @@ public class SqliteEamDb extends AbstractSqlEamDb {
/** /**
* Get all reference sets * Get all reference sets
* *
* @param correlationType Type of sets to return
*
* @return List of all reference sets in the central repository * @return List of all reference sets in the central repository
* *
* @throws EamDbException * @throws EamDbException
*/ */
@Override @Override
public List<EamGlobalSet> getAllReferenceSets() throws EamDbException{ public List<EamGlobalSet> getAllReferenceSets(CorrelationAttribute.Type correlationType) throws EamDbException {
try{ try{
acquireSharedLock(); acquireSharedLock();
return super.getAllReferenceSets(); return super.getAllReferenceSets(correlationType);
} finally { } finally {
releaseSharedLock(); releaseSharedLock();
} }

View File

@ -298,6 +298,7 @@ public final class SqliteEamDbSettings {
createReferenceSetsTable.append("version text NOT NULL,"); createReferenceSetsTable.append("version text NOT NULL,");
createReferenceSetsTable.append("known_status integer NOT NULL,"); createReferenceSetsTable.append("known_status integer NOT NULL,");
createReferenceSetsTable.append("read_only boolean NOT NULL,"); createReferenceSetsTable.append("read_only boolean NOT NULL,");
createReferenceSetsTable.append("type integer NOT NULL,");
createReferenceSetsTable.append("import_date text NOT NULL,"); createReferenceSetsTable.append("import_date text NOT NULL,");
createReferenceSetsTable.append("foreign key (org_id) references organizations(id) ON UPDATE SET NULL ON DELETE SET NULL,"); createReferenceSetsTable.append("foreign key (org_id) references organizations(id) ON UPDATE SET NULL ON DELETE SET NULL,");
createReferenceSetsTable.append("CONSTRAINT hash_set_unique UNIQUE (set_name, version)"); createReferenceSetsTable.append("CONSTRAINT hash_set_unique UNIQUE (set_name, version)");

View File

@ -31,6 +31,7 @@ import javax.swing.JOptionPane;
import org.apache.commons.io.FilenameUtils; import org.apache.commons.io.FilenameUtils;
import org.openide.util.NbBundle; import org.openide.util.NbBundle;
import org.openide.windows.WindowManager; import org.openide.windows.WindowManager;
import org.sleuthkit.autopsy.centralrepository.datamodel.CorrelationAttribute;
import org.sleuthkit.autopsy.centralrepository.datamodel.EamDb; import org.sleuthkit.autopsy.centralrepository.datamodel.EamDb;
import org.sleuthkit.autopsy.centralrepository.datamodel.EamDbException; import org.sleuthkit.autopsy.centralrepository.datamodel.EamDbException;
import org.sleuthkit.autopsy.centralrepository.datamodel.EamDbUtil; import org.sleuthkit.autopsy.centralrepository.datamodel.EamDbUtil;
@ -527,7 +528,7 @@ final class HashDbCreateDatabaseDialog extends javax.swing.JDialog {
try{ try{
int referenceSetID = EamDb.getInstance().newReferenceSet(new EamGlobalSet(selectedOrg.getOrgID(), hashSetNameTextField.getText(), int referenceSetID = EamDb.getInstance().newReferenceSet(new EamGlobalSet(selectedOrg.getOrgID(), hashSetNameTextField.getText(),
"", fileKnown, false)); "", fileKnown, false, EamDb.getInstance().getCorrelationTypeById(CorrelationAttribute.FILES_TYPE_ID)));
newHashDb = HashDbManager.getInstance().addExistingCentralRepoHashSet(hashSetNameTextField.getText(), newHashDb = HashDbManager.getInstance().addExistingCentralRepoHashSet(hashSetNameTextField.getText(),
"", referenceSetID, "", referenceSetID,
true, sendIngestMessagesCheckbox.isSelected(), type, false); true, sendIngestMessagesCheckbox.isSelected(), type, false);

View File

@ -490,7 +490,7 @@ public class HashDbManager implements PropertyChangeListener {
List<HashDbInfo> crHashSets = new ArrayList<>(); List<HashDbInfo> crHashSets = new ArrayList<>();
if(EamDb.isEnabled()){ if(EamDb.isEnabled()){
try{ try{
List<EamGlobalSet> crSets = EamDb.getInstance().getAllReferenceSets(); List<EamGlobalSet> crSets = EamDb.getInstance().getAllReferenceSets(EamDb.getInstance().getCorrelationTypeById(CorrelationAttribute.FILES_TYPE_ID));
for(EamGlobalSet globalSet:crSets){ for(EamGlobalSet globalSet:crSets){
// Defaults for fields not stored in the central repository: // Defaults for fields not stored in the central repository:

View File

@ -237,7 +237,8 @@ class ImportCentralRepoDbProgressDialog extends javax.swing.JDialog implements P
// Create an empty hashset in the central repository // Create an empty hashset in the central repository
EamDb dbManager = EamDb.getInstance(); EamDb dbManager = EamDb.getInstance();
referenceSetID.set(dbManager.newReferenceSet(new EamGlobalSet(orgId, hashSetName, version, knownStatus, readOnly))); referenceSetID.set(dbManager.newReferenceSet(new EamGlobalSet(orgId, hashSetName, version, knownStatus,
readOnly, EamDb.getInstance().getCorrelationTypeById(CorrelationAttribute.FILES_TYPE_ID))));
// Get the "FILES" content type. This is a database lookup so we // Get the "FILES" content type. This is a database lookup so we
// only want to do it once. // only want to do it once.