This commit is contained in:
Ann Priestman 2017-11-16 09:40:29 -05:00
parent 143e530c32
commit 61b7f89788
3 changed files with 20 additions and 16 deletions

View File

@ -34,7 +34,6 @@ import java.time.LocalDate;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
import java.util.Set; import java.util.Set;
import org.openide.util.NbBundle;
import org.openide.util.NbBundle.Messages; import org.openide.util.NbBundle.Messages;
import org.sleuthkit.autopsy.casemodule.Case; import org.sleuthkit.autopsy.casemodule.Case;
import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.autopsy.coreutils.Logger;
@ -1312,7 +1311,8 @@ public abstract class AbstractSqlEamDb implements EamDb {
} }
/** /**
* Check whether the given reference set exists in the central repository. * Check whether a reference set with the given parameters exists in the central repository.
* Used to check whether reference sets saved in the settings are still present.
* @param referenceSetID * @param referenceSetID
* @param setName * @param setName
* @param version * @param version
@ -1773,14 +1773,15 @@ public abstract class AbstractSqlEamDb implements EamDb {
} }
/** /**
* 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 central repo.
* @param hashSetName * Used to check for name collisions when creating reference sets.
* @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
*/ */
@Override @Override
public boolean referenceSetExists(String hashSetName, String version) throws EamDbException{ public boolean referenceSetExists(String referenceSetName, String version) throws EamDbException{
Connection conn = connect(); Connection conn = connect();
PreparedStatement preparedStatement1 = null; PreparedStatement preparedStatement1 = null;
@ -1789,7 +1790,7 @@ public abstract class AbstractSqlEamDb implements EamDb {
try { try {
preparedStatement1 = conn.prepareStatement(sql1); preparedStatement1 = conn.prepareStatement(sql1);
preparedStatement1.setString(1, hashSetName); preparedStatement1.setString(1, referenceSetName);
preparedStatement1.setString(2, version); preparedStatement1.setString(2, version);
resultSet = preparedStatement1.executeQuery(); resultSet = preparedStatement1.executeQuery();
return (resultSet.next()); return (resultSet.next());

View File

@ -361,23 +361,25 @@ public interface EamDb {
public void deleteReferenceSet(int referenceSetID) throws EamDbException; public void deleteReferenceSet(int referenceSetID) throws EamDbException;
/** /**
* Check whether the given reference set exists in the central repository. * Check whether a reference set with the given parameters exists in the central repository.
* Used to check whether reference sets saved in the settings are still present.
* @param referenceSetID * @param referenceSetID
* @param hashSetName * @param referenceSetName
* @param version * @param version
* @return true if a matching entry exists in the central repository * @return true if a matching entry exists in the central repository
* @throws EamDbException * @throws EamDbException
*/ */
public boolean referenceSetIsValid(int referenceSetID, String hashSetName, 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 central repo.
* @param hashSetName * Used to check for name collisions when creating reference sets.
* @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 hashSetName, 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.

View File

@ -667,17 +667,18 @@ public class SqliteEamDb extends AbstractSqlEamDb {
} }
/** /**
* 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 central repo.
* @param hashSetName * Used to check for name collisions when creating reference sets.
* @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
*/ */
@Override @Override
public boolean referenceSetExists(String hashSetName, String version) throws EamDbException { public boolean referenceSetExists(String referenceSetName, String version) throws EamDbException {
try{ try{
acquireSharedLock(); acquireSharedLock();
return super.referenceSetExists(hashSetName, version); return super.referenceSetExists(referenceSetName, version);
} finally { } finally {
releaseSharedLock(); releaseSharedLock();
} }