Autopsy  4.10.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 
337  List<CorrelationAttributeInstance> getArtifactInstancesByPath(CorrelationAttributeInstance.Type aType, String filePath) throws EamDbException;
338 
349  Long getCountArtifactInstancesByTypeValue(CorrelationAttributeInstance.Type aType, String value) throws EamDbException, CorrelationAttributeNormalizationException;
350 
358  int getFrequencyPercentage(CorrelationAttributeInstance corAttr) throws EamDbException, CorrelationAttributeNormalizationException;
359 
370  Long getCountUniqueCaseDataSourceTuplesHavingTypeValue(CorrelationAttributeInstance.Type aType, String value) throws EamDbException, CorrelationAttributeNormalizationException;
371 
377  Long getCountUniqueDataSources() throws EamDbException;
378 
388  Long getCountArtifactInstancesByCaseDataSource(CorrelationDataSource correlationDataSource) throws EamDbException;
389 
397  void addAttributeInstanceBulk(CorrelationAttributeInstance eamArtifact) throws EamDbException;
398 
403  void commitAttributeInstancesBulk() throws EamDbException;
404 
408  void bulkInsertCases(List<CorrelationCase> cases) throws EamDbException;
409 
419  void updateAttributeInstanceComment(CorrelationAttributeInstance eamArtifact) throws EamDbException;
420 
439  CorrelationDataSource correlationDataSource, String value, String filePath) throws EamDbException, CorrelationAttributeNormalizationException;
440 
456  CorrelationDataSource correlationDataSource, long objectID) throws EamDbException, CorrelationAttributeNormalizationException;
457 
465  void setAttributeInstanceKnownStatus(CorrelationAttributeInstance eamArtifact, TskData.FileKnown knownStatus) throws EamDbException;
466 
476  List<CorrelationAttributeInstance> getArtifactInstancesKnownBad(CorrelationAttributeInstance.Type aType, String value) throws EamDbException, CorrelationAttributeNormalizationException;
477 
489 
498  Long getCountArtifactInstancesKnownBad(CorrelationAttributeInstance.Type aType, String value) throws EamDbException, CorrelationAttributeNormalizationException;
499 
512  List<String> getListCasesHavingArtifactInstancesKnownBad(CorrelationAttributeInstance.Type aType, String value) throws EamDbException, CorrelationAttributeNormalizationException;
513 
521  public void deleteReferenceSet(int referenceSetID) throws EamDbException;
522 
536  public boolean referenceSetIsValid(int referenceSetID, String referenceSetName, String version) throws EamDbException;
537 
550  public boolean referenceSetExists(String referenceSetName, String version) throws EamDbException;
551 
563  public boolean isFileHashInReferenceSet(String hash, int referenceSetID) throws EamDbException, CorrelationAttributeNormalizationException;
564 
574  public boolean isValueInReferenceSet(String value, int referenceSetID, int correlationTypeID) throws EamDbException, CorrelationAttributeNormalizationException;
575 
584  boolean isArtifactKnownBadByReference(CorrelationAttributeInstance.Type aType, String value) throws EamDbException, CorrelationAttributeNormalizationException;
585 
595  EamOrganization newOrganization(EamOrganization eamOrg) throws EamDbException;
596 
604  List<EamOrganization> getOrganizations() throws EamDbException;
605 
615  EamOrganization getOrganizationByID(int orgID) throws EamDbException;
616 
626  EamOrganization getReferenceSetOrganization(int referenceSetID) throws EamDbException;
627 
636  void updateOrganization(EamOrganization updatedOrganization) throws EamDbException;
637 
645  void deleteOrganization(EamOrganization organizationToDelete) throws EamDbException;
646 
656  int newReferenceSet(EamGlobalSet eamGlobalSet) throws EamDbException;
657 
667  EamGlobalSet getReferenceSetByID(int globalSetID) throws EamDbException;
668 
678  List<EamGlobalSet> getAllReferenceSets(CorrelationAttributeInstance.Type correlationType) throws EamDbException;
679 
689  void addReferenceInstance(EamGlobalFileInstance eamGlobalFileInstance, CorrelationAttributeInstance.Type correlationType) throws EamDbException;
690 
700  void bulkInsertReferenceTypeEntries(Set<EamGlobalFileInstance> globalInstances, CorrelationAttributeInstance.Type contentType) throws EamDbException;
701 
712  List<EamGlobalFileInstance> getReferenceInstancesByTypeValue(CorrelationAttributeInstance.Type aType, String aValue) throws EamDbException, CorrelationAttributeNormalizationException;
713 
723  int newCorrelationType(CorrelationAttributeInstance.Type newType) throws EamDbException;
724 
734  List<CorrelationAttributeInstance.Type> getDefinedCorrelationTypes() throws EamDbException;
735 
745  List<CorrelationAttributeInstance.Type> getEnabledCorrelationTypes() throws EamDbException;
746 
756  List<CorrelationAttributeInstance.Type> getSupportedCorrelationTypes() throws EamDbException;
757 
765  void updateCorrelationType(CorrelationAttributeInstance.Type aType) throws EamDbException;
766 
776  CorrelationAttributeInstance.Type getCorrelationTypeById(int typeId) throws EamDbException;
777 
783  public void upgradeSchema() throws EamDbException, SQLException, IncompatibleCentralRepoException;
784 
796  public CoordinationService.Lock getExclusiveMultiUserDbLock() throws EamDbException;
797 
806  void processInstanceTable(CorrelationAttributeInstance.Type type, InstanceTableCallback instanceTableCallback) throws EamDbException;
807 
817  void processInstanceTableWhere(CorrelationAttributeInstance.Type type, String whereClause, InstanceTableCallback instanceTableCallback) throws EamDbException;
818 
819 }
List< CorrelationAttributeInstance > getArtifactInstancesByTypeValuesAndCases(CorrelationAttributeInstance.Type aType, List< String > values, List< Integer > caseIds)
CorrelationCase getCaseByUUID(String caseUUID)
int getFrequencyPercentage(CorrelationAttributeInstance corAttr)
CorrelationDataSource newDataSource(CorrelationDataSource eamDataSource)
List< CorrelationAttributeInstance > getArtifactInstancesKnownBad(CorrelationAttributeInstance.Type aType, String value)
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()
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)
void processInstanceTableWhere(CorrelationAttributeInstance.Type type, String whereClause, InstanceTableCallback instanceTableCallback)
void updateDataSourceName(CorrelationDataSource eamDataSource, String newName)
List< CorrelationAttributeInstance > getArtifactInstancesByPath(CorrelationAttributeInstance.Type aType, String filePath)
void addArtifactInstance(CorrelationAttributeInstance eamArtifact)
void updateAttributeInstanceComment(CorrelationAttributeInstance eamArtifact)
void updateDataSourceMd5Hash(CorrelationDataSource eamDataSource)
void updateCorrelationType(CorrelationAttributeInstance.Type aType)

Copyright © 2012-2018 Basis Technology. Generated on: Fri Mar 22 2019
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.