Autopsy  4.15.0
Graphical digital forensics platform for The Sleuth Kit and other tools.
CentralRepository.java
Go to the documentation of this file.
1 /*
2  * Central Repository
3  *
4  * Copyright 2015-2020 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.Collection;
23 import java.util.List;
24 import java.util.Set;
25 import org.sleuthkit.datamodel.TskData;
29 import org.sleuthkit.datamodel.HashHitInfo;
30 
34 public interface CentralRepository {
35 
44 
48  }
49  switch (selectedPlatform) {
50  case POSTGRESQL:
51  return PostgresCentralRepo.getInstance();
52 
53  case SQLITE:
54  return SqliteCentralRepo.getInstance();
55  default:
56  return null;
57  }
58  }
59 
70 
79  void updateSettings();
80 
84  void saveSettings();
85 
89  void reset() throws CentralRepoException;
90 
96  static boolean isEnabled() {
99  }
100 
109  public void newDbInfo(String name, String value) throws CentralRepoException;
110 
119  void addDataSourceObjectId(int rowId, long dataSourceObjectId) throws CentralRepoException;
120 
130  public String getDbInfo(String name) throws CentralRepoException;
131 
140  public void updateDbInfo(String name, String value) throws CentralRepoException;
141 
149  CorrelationCase newCase(CorrelationCase eamCase) throws CentralRepoException;
150 
156  CorrelationCase newCase(Case autopsyCase) throws CentralRepoException;
157 
163  void updateCase(CorrelationCase eamCase) throws CentralRepoException;
164 
174  CentralRepoExaminer getOrInsertExaminer(String examinerLoginName) throws CentralRepoException;
175 
185  CorrelationCase getCase(Case autopsyCase) throws CentralRepoException;
186 
194  CorrelationCase getCaseByUUID(String caseUUID) throws CentralRepoException;
195 
203  CorrelationCase getCaseById(int caseId) throws CentralRepoException;
204 
210  List<CorrelationCase> getCases() throws CentralRepoException;
211 
220  CorrelationDataSource newDataSource(CorrelationDataSource eamDataSource) throws CentralRepoException;
221 
227  void updateDataSourceMd5Hash(CorrelationDataSource eamDataSource) throws CentralRepoException;
228 
234  void updateDataSourceSha1Hash(CorrelationDataSource eamDataSource) throws CentralRepoException;
235 
242  void updateDataSourceSha256Hash(CorrelationDataSource eamDataSource) throws CentralRepoException;
243 
253  CorrelationDataSource getDataSource(CorrelationCase correlationCase, Long caseDbDataSourceId) throws CentralRepoException;
254 
264  CorrelationDataSource getDataSourceById(CorrelationCase correlationCase, int dataSourceId) throws CentralRepoException;
265 
271  List<CorrelationDataSource> getDataSources() throws CentralRepoException;
272 
281  void updateDataSourceName(CorrelationDataSource eamDataSource, String newName) throws CentralRepoException;
282 
289  void addArtifactInstance(CorrelationAttributeInstance eamArtifact) throws CentralRepoException;
290 
306 
319  List<CorrelationAttributeInstance> getArtifactInstancesByTypeValue(CorrelationAttributeInstance.Type aType, String value) throws CentralRepoException, CorrelationAttributeNormalizationException;
320 
338  List<CorrelationAttributeInstance> getArtifactInstancesByTypeValuesAndCases(CorrelationAttributeInstance.Type aType, List<String> values, List<Integer> caseIds) throws CentralRepoException, CorrelationAttributeNormalizationException;
339 
350  Long getCountArtifactInstancesByTypeValue(CorrelationAttributeInstance.Type aType, String value) throws CentralRepoException, CorrelationAttributeNormalizationException;
351 
359  int getFrequencyPercentage(CorrelationAttributeInstance corAttr) throws CentralRepoException, CorrelationAttributeNormalizationException;
360 
371  Long getCountUniqueCaseDataSourceTuplesHavingTypeValue(CorrelationAttributeInstance.Type aType, String value) throws CentralRepoException, CorrelationAttributeNormalizationException;
372 
378  Long getCountUniqueDataSources() throws CentralRepoException;
379 
389  Long getCountArtifactInstancesByCaseDataSource(CorrelationDataSource correlationDataSource) throws CentralRepoException;
390 
398  void addAttributeInstanceBulk(CorrelationAttributeInstance eamArtifact) throws CentralRepoException;
399 
404  void commitAttributeInstancesBulk() throws CentralRepoException;
405 
409  void bulkInsertCases(List<CorrelationCase> cases) throws CentralRepoException;
410 
420  void updateAttributeInstanceComment(CorrelationAttributeInstance eamArtifact) throws CentralRepoException;
421 
440  CorrelationDataSource correlationDataSource, String value, String filePath) throws CentralRepoException, CorrelationAttributeNormalizationException;
441 
457  CorrelationDataSource correlationDataSource, long objectID) throws CentralRepoException, CorrelationAttributeNormalizationException;
458 
466  void setAttributeInstanceKnownStatus(CorrelationAttributeInstance eamArtifact, TskData.FileKnown knownStatus) throws CentralRepoException;
467 
476  Long getCountArtifactInstancesKnownBad(CorrelationAttributeInstance.Type aType, String value) throws CentralRepoException, CorrelationAttributeNormalizationException;
477 
490  List<String> getListCasesHavingArtifactInstancesKnownBad(CorrelationAttributeInstance.Type aType, String value) throws CentralRepoException, CorrelationAttributeNormalizationException;
491 
504  List<String> getListCasesHavingArtifactInstances(CorrelationAttributeInstance.Type aType, String value) throws CentralRepoException, CorrelationAttributeNormalizationException;
505 
513  public void deleteReferenceSet(int referenceSetID) throws CentralRepoException;
514 
528  public boolean referenceSetIsValid(int referenceSetID, String referenceSetName, String version) throws CentralRepoException;
529 
542  public boolean referenceSetExists(String referenceSetName, String version) throws CentralRepoException;
543 
555  public boolean isFileHashInReferenceSet(String hash, int referenceSetID) throws CentralRepoException, CorrelationAttributeNormalizationException;
556 
557 
570  HashHitInfo lookupHash(String hash, int referenceSetID) throws CentralRepoException, CorrelationAttributeNormalizationException;
571 
572 
582  public boolean isValueInReferenceSet(String value, int referenceSetID, int correlationTypeID) throws CentralRepoException, CorrelationAttributeNormalizationException;
583 
592  boolean isArtifactKnownBadByReference(CorrelationAttributeInstance.Type aType, String value) throws CentralRepoException, CorrelationAttributeNormalizationException;
593 
603  CentralRepoOrganization newOrganization(CentralRepoOrganization eamOrg) throws CentralRepoException;
604 
612  List<CentralRepoOrganization> getOrganizations() throws CentralRepoException;
613 
623  CentralRepoOrganization getOrganizationByID(int orgID) throws CentralRepoException;
624 
634  CentralRepoOrganization getReferenceSetOrganization(int referenceSetID) throws CentralRepoException;
635 
644  void updateOrganization(CentralRepoOrganization updatedOrganization) throws CentralRepoException;
645 
653  void deleteOrganization(CentralRepoOrganization organizationToDelete) throws CentralRepoException;
654 
664  int newReferenceSet(CentralRepoFileSet eamGlobalSet) throws CentralRepoException;
665 
675  CentralRepoFileSet getReferenceSetByID(int globalSetID) throws CentralRepoException;
676 
686  List<CentralRepoFileSet> getAllReferenceSets(CorrelationAttributeInstance.Type correlationType) throws CentralRepoException;
687 
697  void addReferenceInstance(CentralRepoFileInstance eamGlobalFileInstance, CorrelationAttributeInstance.Type correlationType) throws CentralRepoException;
698 
708  void bulkInsertReferenceTypeEntries(Set<CentralRepoFileInstance> globalInstances, CorrelationAttributeInstance.Type contentType) throws CentralRepoException;
709 
720  List<CentralRepoFileInstance> getReferenceInstancesByTypeValue(CorrelationAttributeInstance.Type aType, String aValue) throws CentralRepoException, CorrelationAttributeNormalizationException;
721 
731  int newCorrelationType(CorrelationAttributeInstance.Type newType) throws CentralRepoException;
732 
742  List<CorrelationAttributeInstance.Type> getDefinedCorrelationTypes() throws CentralRepoException;
743 
753  List<CorrelationAttributeInstance.Type> getEnabledCorrelationTypes() throws CentralRepoException;
754 
764  List<CorrelationAttributeInstance.Type> getSupportedCorrelationTypes() throws CentralRepoException;
765 
773  void updateCorrelationType(CorrelationAttributeInstance.Type aType) throws CentralRepoException;
774 
784  CorrelationAttributeInstance.Type getCorrelationTypeById(int typeId) throws CentralRepoException;
785 
791  public void upgradeSchema() throws CentralRepoException, SQLException, IncompatibleCentralRepoException;
792 
804  public CoordinationService.Lock getExclusiveMultiUserDbLock() throws CentralRepoException;
805 
814  void processInstanceTable(CorrelationAttributeInstance.Type type, InstanceTableCallback instanceTableCallback) throws CentralRepoException;
815 
825  void processInstanceTableWhere(CorrelationAttributeInstance.Type type, String whereClause, InstanceTableCallback instanceTableCallback) throws CentralRepoException;
826 
835  public void processSelectClause(String selectClause, InstanceTableCallback instanceTableCallback) throws CentralRepoException;
836 
837 
844  void executeInsertSQL(String sql) throws CentralRepoException;
845 
854  void executeSelectSQL(String sql, CentralRepositoryDbQueryCallback queryCallback) throws CentralRepoException;
855 
863  void executeUpdateSQL(String sql) throws CentralRepoException;
864 
872  void executeDeleteSQL(String sql) throws CentralRepoException;
873 
881  CentralRepoAccountType getAccountTypeByName(String accountTypeName) throws CentralRepoException;
882 
890  Collection<CentralRepoAccountType> getAllAccountTypes() throws CentralRepoException;
891 
902  CentralRepoAccount getOrCreateAccount(CentralRepoAccount.CentralRepoAccountType crAccountType, String accountUniqueID) throws CentralRepoException;
903 
904 }
void executeSelectSQL(String sql, CentralRepositoryDbQueryCallback queryCallback)
void addAttributeInstanceBulk(CorrelationAttributeInstance eamArtifact)
boolean referenceSetExists(String referenceSetName, String version)
List< String > getListCasesHavingArtifactInstances(CorrelationAttributeInstance.Type aType, String value)
CentralRepoOrganization newOrganization(CentralRepoOrganization eamOrg)
Long getCountArtifactInstancesByTypeValue(CorrelationAttributeInstance.Type aType, String value)
void addReferenceInstance(CentralRepoFileInstance eamGlobalFileInstance, CorrelationAttributeInstance.Type correlationType)
List< CentralRepoFileSet > getAllReferenceSets(CorrelationAttributeInstance.Type correlationType)
List< CorrelationAttributeInstance > getArtifactInstancesByTypeValue(CorrelationAttributeInstance.Type aType, String value)
void deleteOrganization(CentralRepoOrganization organizationToDelete)
boolean isArtifactKnownBadByReference(CorrelationAttributeInstance.Type aType, String value)
CentralRepoExaminer getOrInsertExaminer(String examinerLoginName)
void setAttributeInstanceKnownStatus(CorrelationAttributeInstance eamArtifact, TskData.FileKnown knownStatus)
void addDataSourceObjectId(int rowId, long dataSourceObjectId)
void bulkInsertReferenceTypeEntries(Set< CentralRepoFileInstance > globalInstances, CorrelationAttributeInstance.Type contentType)
void updateAttributeInstanceComment(CorrelationAttributeInstance eamArtifact)
List< String > getListCasesHavingArtifactInstancesKnownBad(CorrelationAttributeInstance.Type aType, String value)
List< CorrelationAttributeInstance.Type > getDefinedCorrelationTypes()
void addArtifactInstance(CorrelationAttributeInstance eamArtifact)
Long getCountArtifactInstancesKnownBad(CorrelationAttributeInstance.Type aType, String value)
List< CentralRepoFileInstance > getReferenceInstancesByTypeValue(CorrelationAttributeInstance.Type aType, String aValue)
void updateDataSourceSha1Hash(CorrelationDataSource eamDataSource)
void processInstanceTableWhere(CorrelationAttributeInstance.Type type, String whereClause, InstanceTableCallback instanceTableCallback)
HashHitInfo lookupHash(String hash, int referenceSetID)
void processInstanceTable(CorrelationAttributeInstance.Type type, InstanceTableCallback instanceTableCallback)
boolean isFileHashInReferenceSet(String hash, int referenceSetID)
List< CorrelationAttributeInstance > getArtifactInstancesByTypeValues(CorrelationAttributeInstance.Type aType, List< String > values)
void updateOrganization(CentralRepoOrganization updatedOrganization)
int newCorrelationType(CorrelationAttributeInstance.Type newType)
boolean referenceSetIsValid(int referenceSetID, String referenceSetName, String version)
void updateDataSourceName(CorrelationDataSource eamDataSource, String newName)
CorrelationAttributeInstance getCorrelationAttributeInstance(CorrelationAttributeInstance.Type type, CorrelationCase correlationCase, CorrelationDataSource correlationDataSource, String value, String filePath)
void updateDataSourceMd5Hash(CorrelationDataSource eamDataSource)
void updateCorrelationType(CorrelationAttributeInstance.Type aType)
CorrelationDataSource newDataSource(CorrelationDataSource eamDataSource)
List< CorrelationAttributeInstance > getArtifactInstancesByTypeValuesAndCases(CorrelationAttributeInstance.Type aType, List< String > values, List< Integer > caseIds)
boolean isValueInReferenceSet(String value, int referenceSetID, int correlationTypeID)
int getFrequencyPercentage(CorrelationAttributeInstance corAttr)
List< CorrelationAttributeInstance.Type > getEnabledCorrelationTypes()
CorrelationDataSource getDataSource(CorrelationCase correlationCase, Long caseDbDataSourceId)
CorrelationAttributeInstance.Type getCorrelationTypeById(int typeId)
List< CorrelationAttributeInstance.Type > getSupportedCorrelationTypes()
void processSelectClause(String selectClause, InstanceTableCallback instanceTableCallback)
Long getCountArtifactInstancesByCaseDataSource(CorrelationDataSource correlationDataSource)
CentralRepoOrganization getReferenceSetOrganization(int referenceSetID)
void updateDataSourceSha256Hash(CorrelationDataSource eamDataSource)
CentralRepoAccountType getAccountTypeByName(String accountTypeName)
Long getCountUniqueCaseDataSourceTuplesHavingTypeValue(CorrelationAttributeInstance.Type aType, String value)
CentralRepoAccount getOrCreateAccount(CentralRepoAccount.CentralRepoAccountType crAccountType, String accountUniqueID)
CorrelationDataSource getDataSourceById(CorrelationCase correlationCase, int dataSourceId)

Copyright © 2012-2020 Basis Technology. Generated on: Mon Jul 6 2020
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.