4440 change case node icon, remove case count query and methods

This commit is contained in:
William Schaefer 2018-12-06 13:33:56 -05:00
parent 4d6add63db
commit e5b24b1651
4 changed files with 1 additions and 78 deletions

View File

@ -1119,49 +1119,6 @@ abstract class AbstractSqlEamDb implements EamDb {
return instanceCount; return instanceCount;
} }
/**
* Retrieves number of unique cases in the
* database that are associated with the artifactType and artifactValue of
* the given artifact.
*
* @param aType The type of the artifact
* @param value The correlation value
*
* @return Number of unique cases
*/
@Override
public Long getCountOfCasesWithValue(CorrelationAttributeInstance.Type aType, String value) throws EamDbException, CorrelationAttributeNormalizationException {
String normalizedValue = CorrelationAttributeNormalizer.normalize(aType, value);
Connection conn = connect();
Long instanceCount = 0L;
PreparedStatement preparedStatement = null;
ResultSet resultSet = null;
String tableName = EamDbUtil.correlationTypeToInstanceTableName(aType);
String sql
= "SELECT count(DISTINCT case_id) FROM "
+ tableName
+ " WHERE value=?";
try {
preparedStatement = conn.prepareStatement(sql);
preparedStatement.setString(1, normalizedValue);
resultSet = preparedStatement.executeQuery();
resultSet.next();
instanceCount = resultSet.getLong(1);
} catch (SQLException ex) {
throw new EamDbException("Error counting unique caseDisplayName/dataSource tuples having artifactType and artifactValue.", ex); // NON-NLS
} finally {
EamDbUtil.closeStatement(preparedStatement);
EamDbUtil.closeResultSet(resultSet);
EamDbUtil.closeConnection(conn);
}
return instanceCount;
}
@Override @Override
public Long getCountUniqueDataSources() throws EamDbException { public Long getCountUniqueDataSources() throws EamDbException {
Connection conn = connect(); Connection conn = connect();

View File

@ -304,18 +304,6 @@ public interface EamDb {
*/ */
Long getCountUniqueCaseDataSourceTuplesHavingTypeValue(CorrelationAttributeInstance.Type aType, String value) throws EamDbException, CorrelationAttributeNormalizationException; Long getCountUniqueCaseDataSourceTuplesHavingTypeValue(CorrelationAttributeInstance.Type aType, String value) throws EamDbException, CorrelationAttributeNormalizationException;
/**
* Retrieves number of unique cases in the
* database that are associated with the artifactType and artifactValue of
* the given artifact.
*
* @param aType EamArtifact.Type to search for
* @param value Value to search for
*
* @return Number of unique cases
*/
Long getCountOfCasesWithValue(CorrelationAttributeInstance.Type aType, String value) throws EamDbException, CorrelationAttributeNormalizationException;
/** /**
* Retrieves number of data sources in the database. * Retrieves number of data sources in the database.
* *

View File

@ -544,28 +544,6 @@ final class SqliteEamDb extends AbstractSqlEamDb {
} }
} }
/**
* Retrieves number of unique cases in the
* database that are associated with the artifactType and artifactValue of
* the given artifact.
*
* @param aType The correlation type
* @param value The value to search for
*
* @return Number of unique cases
*
* @throws EamDbException
*/
@Override
public Long getCountOfCasesWithValue(CorrelationAttributeInstance.Type aType, String value) throws EamDbException, CorrelationAttributeNormalizationException {
try {
acquireSharedLock();
return super.getCountUniqueDataSources();
} finally {
releaseSharedLock();
}
}
@Override @Override
public Long getCountUniqueDataSources() throws EamDbException { public Long getCountUniqueDataSources() throws EamDbException {
try { try {

View File

@ -58,7 +58,7 @@ public final class InstanceCaseNode extends DisplayableItemNode {
this.dataSourceToValueList = attributeValues; this.dataSourceToValueList = attributeValues;
this.setDisplayName(this.caseName); this.setDisplayName(this.caseName);
this.setIconBaseWithExtension("org/sleuthkit/autopsy/images/fileset-icon-16.png"); //NON-NLS this.setIconBaseWithExtension("org/sleuthkit/autopsy/images/image.png"); //NON-NLS
} }
/** /**