Autopsy  4.13.0
Graphical digital forensics platform for The Sleuth Kit and other tools.
EamDb.java
Go to the documentation of this file.
1 /*
2  * Central Repository
3  *
4  * Copyright 2015-2019 Basis Technology Corp.
5  * Contact: carrier <at> sleuthkit <dot> org
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  */
19 package org.sleuthkit.autopsy.centralrepository.datamodel;
20 
21 import java.sql.SQLException;
22 import java.util.List;
23 import java.util.Set;
24 import org.sleuthkit.datamodel.TskData;
27 
31 public interface EamDb {
32 
40  static EamDb getInstance() throws EamDbException {
41 
42  EamDbPlatformEnum selectedPlatform = EamDbPlatformEnum.DISABLED;
44  selectedPlatform = EamDbPlatformEnum.getSelectedPlatform();
45  }
46  switch (selectedPlatform) {
47  case POSTGRESQL:
48  return PostgresEamDb.getInstance();
49 
50  case SQLITE:
51  return SqliteEamDb.getInstance();
52  default:
53  return null;
54  }
55  }
56 
66  void shutdownConnections() throws EamDbException;
67 
76  void updateSettings();
77 
81  void saveSettings();
82 
86  void reset() throws EamDbException;
87 
93  static boolean isEnabled() {
96  }
97 
106  public void newDbInfo(String name, String value) throws EamDbException;
107 
116  void addDataSourceObjectId(int rowId, long dataSourceObjectId) throws EamDbException;
117 
127  public String getDbInfo(String name) throws EamDbException;
128 
137  public void updateDbInfo(String name, String value) throws EamDbException;
138 
146  CorrelationCase newCase(CorrelationCase eamCase) throws EamDbException;
147 
153  CorrelationCase newCase(Case autopsyCase) throws EamDbException;
154 
160  void updateCase(CorrelationCase eamCase) throws EamDbException;
161 
171  CorrelationCase getCase(Case autopsyCase) throws EamDbException;
172 
180  CorrelationCase getCaseByUUID(String caseUUID) throws EamDbException;
181 
189  CorrelationCase getCaseById(int caseId) throws EamDbException;
190 
196  List<CorrelationCase> getCases() throws EamDbException;
197 
206  CorrelationDataSource newDataSource(CorrelationDataSource eamDataSource) throws EamDbException;
207 
213  void updateDataSourceMd5Hash(CorrelationDataSource eamDataSource) throws EamDbException;
214 
220  void updateDataSourceSha1Hash(CorrelationDataSource eamDataSource) throws EamDbException;
221 
228  void updateDataSourceSha256Hash(CorrelationDataSource eamDataSource) throws EamDbException;
229 
239  CorrelationDataSource getDataSource(CorrelationCase correlationCase, Long caseDbDataSourceId) throws EamDbException;
240 
250  CorrelationDataSource getDataSourceById(CorrelationCase correlationCase, int dataSourceId) throws EamDbException;
251 
257  List<CorrelationDataSource> getDataSources() throws EamDbException;
258 
267  void updateDataSourceName(CorrelationDataSource eamDataSource, String newName) throws EamDbException;
268 
275  void addArtifactInstance(CorrelationAttributeInstance eamArtifact) throws EamDbException;
276 
292 
305  List<CorrelationAttributeInstance> getArtifactInstancesByTypeValue(CorrelationAttributeInstance.Type aType, String value) throws EamDbException, CorrelationAttributeNormalizationException;
306 
324  List<CorrelationAttributeInstance> getArtifactInstancesByTypeValuesAndCases(CorrelationAttributeInstance.Type aType, List<String> values, List<Integer> caseIds) throws EamDbException, CorrelationAttributeNormalizationException;
325 
336  Long getCountArtifactInstancesByTypeValue(CorrelationAttributeInstance.Type aType, String value) throws EamDbException, CorrelationAttributeNormalizationException;
337 
345  int getFrequencyPercentage(CorrelationAttributeInstance corAttr) throws EamDbException, CorrelationAttributeNormalizationException;
346 
357  Long getCountUniqueCaseDataSourceTuplesHavingTypeValue(CorrelationAttributeInstance.Type aType, String value) throws EamDbException, CorrelationAttributeNormalizationException;
358 
364  Long getCountUniqueDataSources() throws EamDbException;
365 
375  Long getCountArtifactInstancesByCaseDataSource(CorrelationDataSource correlationDataSource) throws EamDbException;
376 
384  void addAttributeInstanceBulk(CorrelationAttributeInstance eamArtifact) throws EamDbException;
385 
390  void commitAttributeInstancesBulk() throws EamDbException;
391 
395  void bulkInsertCases(List<CorrelationCase> cases) throws EamDbException;
396 
406  void updateAttributeInstanceComment(CorrelationAttributeInstance eamArtifact) throws EamDbException;
407 
426  CorrelationDataSource correlationDataSource, String value, String filePath) throws EamDbException, CorrelationAttributeNormalizationException;
427 
443  CorrelationDataSource correlationDataSource, long objectID) throws EamDbException, CorrelationAttributeNormalizationException;
444 
452  void setAttributeInstanceKnownStatus(CorrelationAttributeInstance eamArtifact, TskData.FileKnown knownStatus) throws EamDbException;
453 
462  Long getCountArtifactInstancesKnownBad(CorrelationAttributeInstance.Type aType, String value) throws EamDbException, CorrelationAttributeNormalizationException;
463 
476  List<String> getListCasesHavingArtifactInstancesKnownBad(CorrelationAttributeInstance.Type aType, String value) throws EamDbException, CorrelationAttributeNormalizationException;
477 
490  List<String> getListCasesHavingArtifactInstances(CorrelationAttributeInstance.Type aType, String value) throws EamDbException, CorrelationAttributeNormalizationException;
491 
499  public void deleteReferenceSet(int referenceSetID) throws EamDbException;
500 
514  public boolean referenceSetIsValid(int referenceSetID, String referenceSetName, String version) throws EamDbException;
515 
528  public boolean referenceSetExists(String referenceSetName, String version) throws EamDbException;
529 
541  public boolean isFileHashInReferenceSet(String hash, int referenceSetID) throws EamDbException, CorrelationAttributeNormalizationException;
542 
552  public boolean isValueInReferenceSet(String value, int referenceSetID, int correlationTypeID) throws EamDbException, CorrelationAttributeNormalizationException;
553 
562  boolean isArtifactKnownBadByReference(CorrelationAttributeInstance.Type aType, String value) throws EamDbException, CorrelationAttributeNormalizationException;
563 
573  EamOrganization newOrganization(EamOrganization eamOrg) throws EamDbException;
574 
582  List<EamOrganization> getOrganizations() throws EamDbException;
583 
593  EamOrganization getOrganizationByID(int orgID) throws EamDbException;
594 
604  EamOrganization getReferenceSetOrganization(int referenceSetID) throws EamDbException;
605 
614  void updateOrganization(EamOrganization updatedOrganization) throws EamDbException;
615 
623  void deleteOrganization(EamOrganization organizationToDelete) throws EamDbException;
624 
634  int newReferenceSet(EamGlobalSet eamGlobalSet) throws EamDbException;
635 
645  EamGlobalSet getReferenceSetByID(int globalSetID) throws EamDbException;
646 
656  List<EamGlobalSet> getAllReferenceSets(CorrelationAttributeInstance.Type correlationType) throws EamDbException;
657 
667  void addReferenceInstance(EamGlobalFileInstance eamGlobalFileInstance, CorrelationAttributeInstance.Type correlationType) throws EamDbException;
668 
678  void bulkInsertReferenceTypeEntries(Set<EamGlobalFileInstance> globalInstances, CorrelationAttributeInstance.Type contentType) throws EamDbException;
679 
690  List<EamGlobalFileInstance> getReferenceInstancesByTypeValue(CorrelationAttributeInstance.Type aType, String aValue) throws EamDbException, CorrelationAttributeNormalizationException;
691 
701  int newCorrelationType(CorrelationAttributeInstance.Type newType) throws EamDbException;
702 
712  List<CorrelationAttributeInstance.Type> getDefinedCorrelationTypes() throws EamDbException;
713 
723  List<CorrelationAttributeInstance.Type> getEnabledCorrelationTypes() throws EamDbException;
724 
734  List<CorrelationAttributeInstance.Type> getSupportedCorrelationTypes() throws EamDbException;
735 
743  void updateCorrelationType(CorrelationAttributeInstance.Type aType) throws EamDbException;
744 
754  CorrelationAttributeInstance.Type getCorrelationTypeById(int typeId) throws EamDbException;
755 
761  public void upgradeSchema() throws EamDbException, SQLException, IncompatibleCentralRepoException;
762 
774  public CoordinationService.Lock getExclusiveMultiUserDbLock() throws EamDbException;
775 
784  void processInstanceTable(CorrelationAttributeInstance.Type type, InstanceTableCallback instanceTableCallback) throws EamDbException;
785 
795  void processInstanceTableWhere(CorrelationAttributeInstance.Type type, String whereClause, InstanceTableCallback instanceTableCallback) throws EamDbException;
796 
805  public void processSelectClause(String selectClause, InstanceTableCallback instanceTableCallback) throws EamDbException;
806 }
List< CorrelationAttributeInstance > getArtifactInstancesByTypeValuesAndCases(CorrelationAttributeInstance.Type aType, List< String > values, List< Integer > caseIds)
CorrelationCase getCaseByUUID(String caseUUID)
int getFrequencyPercentage(CorrelationAttributeInstance corAttr)
CorrelationDataSource newDataSource(CorrelationDataSource eamDataSource)
Long getCountArtifactInstancesKnownBad(CorrelationAttributeInstance.Type aType, String value)
List< String > getListCasesHavingArtifactInstancesKnownBad(CorrelationAttributeInstance.Type aType, String value)
void updateDataSourceSha1Hash(CorrelationDataSource eamDataSource)
Long getCountArtifactInstancesByTypeValue(CorrelationAttributeInstance.Type aType, String value)
void processInstanceTable(CorrelationAttributeInstance.Type type, InstanceTableCallback instanceTableCallback)
CorrelationCase newCase(CorrelationCase eamCase)
boolean isFileHashInReferenceSet(String hash, int referenceSetID)
boolean isValueInReferenceSet(String value, int referenceSetID, int correlationTypeID)
void updateDataSourceSha256Hash(CorrelationDataSource eamDataSource)
void bulkInsertReferenceTypeEntries(Set< EamGlobalFileInstance > globalInstances, CorrelationAttributeInstance.Type contentType)
List< CorrelationAttributeInstance > getArtifactInstancesByTypeValue(CorrelationAttributeInstance.Type aType, String value)
void updateOrganization(EamOrganization updatedOrganization)
boolean isArtifactKnownBadByReference(CorrelationAttributeInstance.Type aType, String value)
List< CorrelationAttributeInstance.Type > getDefinedCorrelationTypes()
void addReferenceInstance(EamGlobalFileInstance eamGlobalFileInstance, CorrelationAttributeInstance.Type correlationType)
CorrelationDataSource getDataSourceById(CorrelationCase correlationCase, int dataSourceId)
void addAttributeInstanceBulk(CorrelationAttributeInstance eamArtifact)
Long getCountUniqueCaseDataSourceTuplesHavingTypeValue(CorrelationAttributeInstance.Type aType, String value)
CorrelationDataSource getDataSource(CorrelationCase correlationCase, Long caseDbDataSourceId)
void setAttributeInstanceKnownStatus(CorrelationAttributeInstance eamArtifact, TskData.FileKnown knownStatus)
CorrelationAttributeInstance getCorrelationAttributeInstance(CorrelationAttributeInstance.Type type, CorrelationCase correlationCase, CorrelationDataSource correlationDataSource, String value, String filePath)
CorrelationAttributeInstance.Type getCorrelationTypeById(int typeId)
List< EamGlobalSet > getAllReferenceSets(CorrelationAttributeInstance.Type correlationType)
void addDataSourceObjectId(int rowId, long dataSourceObjectId)
Long getCountArtifactInstancesByCaseDataSource(CorrelationDataSource correlationDataSource)
boolean referenceSetExists(String referenceSetName, String version)
List< EamGlobalFileInstance > getReferenceInstancesByTypeValue(CorrelationAttributeInstance.Type aType, String aValue)
EamOrganization newOrganization(EamOrganization eamOrg)
void bulkInsertCases(List< CorrelationCase > cases)
List< CorrelationAttributeInstance.Type > getSupportedCorrelationTypes()
void processSelectClause(String selectClause, InstanceTableCallback instanceTableCallback)
boolean referenceSetIsValid(int referenceSetID, String referenceSetName, String version)
void deleteOrganization(EamOrganization organizationToDelete)
List< CorrelationAttributeInstance > getArtifactInstancesByTypeValues(CorrelationAttributeInstance.Type aType, List< String > values)
int newCorrelationType(CorrelationAttributeInstance.Type newType)
List< CorrelationAttributeInstance.Type > getEnabledCorrelationTypes()
EamOrganization getReferenceSetOrganization(int referenceSetID)
List< String > getListCasesHavingArtifactInstances(CorrelationAttributeInstance.Type aType, String value)
void processInstanceTableWhere(CorrelationAttributeInstance.Type type, String whereClause, InstanceTableCallback instanceTableCallback)
void updateDataSourceName(CorrelationDataSource eamDataSource, String newName)
void addArtifactInstance(CorrelationAttributeInstance eamArtifact)
void updateAttributeInstanceComment(CorrelationAttributeInstance eamArtifact)
void updateDataSourceMd5Hash(CorrelationDataSource eamDataSource)
void updateCorrelationType(CorrelationAttributeInstance.Type aType)

Copyright © 2012-2019 Basis Technology. Generated on: Tue Jan 7 2020
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.