19package org.sleuthkit.autopsy.centralrepository.datamodel;
21import java.io.Serializable;
22import org.sleuthkit.autopsy.casemodule.Case;
23import org.sleuthkit.autopsy.casemodule.NoCurrentCaseException;
24import org.sleuthkit.datamodel.Content;
25import org.sleuthkit.datamodel.Image;
26import org.sleuthkit.datamodel.TskCoreException;
27import org.sleuthkit.datamodel.TskDataException;
63 Long dataSourceObjectId,
86 Long dataSourceObjectId,
91 this.dataSourceID = dataSourceId;
92 this.deviceID = deviceId;
94 this.dataSourceObjectID = dataSourceObjectId;
117 throw new CentralRepoException(String.format(
"Central repository is not enabled, cannot create central repository data source for '%s'", dataSource));
128 if (correlationDataSource ==
null) {
132 String sha256 =
null;
134 deviceId = curCase.
getSleuthkitCase().getDataSource(dataSource.getId()).getDeviceId();
136 if (dataSource instanceof Image) {
137 Image image = (Image) dataSource;
138 md5 = image.getMd5();
139 sha1 = image.getSha1();
140 sha256 = image.getSha256();
142 }
catch (TskDataException | TskCoreException ex) {
145 correlationDataSource =
new CorrelationDataSource(correlationCase, deviceId, dataSource.getName(), dataSource.getId(), md5, sha1, sha256);
149 return correlationDataSource;
154 StringBuilder str =
new StringBuilder();
156 str.append(
"ID=").append(Integer.toString(
getID()));
157 str.append(
",caseID=").append(Integer.toString(
getCaseID()));
159 str.append(
",name=").append(
getName());
161 return str.toString();
SleuthkitCase getSleuthkitCase()
static Case getCurrentCaseThrows()
void setMd5(String md5Hash)
final Long dataSourceObjectID
CorrelationDataSource(CorrelationCase correlationCase, String deviceId, String name, Long dataSourceObjectId, String md5Hash, String sha1Hash, String sha256Hash)
Long getDataSourceObjectID()
void setSha1(String sha1Hash)
static final long serialVersionUID
static CorrelationDataSource fromTSKDataSource(CorrelationCase correlationCase, Content dataSource)
void setSha256(String sha256Hash)
static CentralRepository getInstance()
void updateDataSourceMd5Hash(CorrelationDataSource eamDataSource)
void updateDataSourceSha256Hash(CorrelationDataSource eamDataSource)
CorrelationDataSource getDataSource(CorrelationCase correlationCase, Long caseDbDataSourceId)
void updateDataSourceSha1Hash(CorrelationDataSource eamDataSource)
static boolean isEnabled()
CorrelationDataSource newDataSource(CorrelationDataSource eamDataSource)