19 package org.sleuthkit.autopsy.datasourcesummary.datamodel;
21 import java.sql.ResultSet;
22 import java.sql.SQLException;
23 import java.util.Collections;
24 import java.util.HashMap;
26 import java.util.logging.Level;
35 class DataSourceSingleValueCallback
implements CaseDbAccessManager.CaseDbAccessQueryCallback {
37 private static final Logger logger = Logger.getLogger(DataSourceSingleValueCallback.class.getName());
38 private final Map<Long, Long> dataSourceObjIdValues =
new HashMap<>();
41 public void process(ResultSet rs) {
45 dataSourceObjIdValues.put(rs.getLong(
"data_source_obj_id"), rs.getLong(
"value"));
46 }
catch (SQLException ex) {
47 logger.log(Level.WARNING,
"Unable to get data_source_obj_id or value from result set", ex);
50 }
catch (SQLException ex) {
51 logger.log(Level.WARNING,
"Failed to get next result for valuess by datasource", ex);
62 Map<Long, Long> getMapOfValues() {
63 return Collections.unmodifiableMap(dataSourceObjIdValues);