Autopsy  4.19.1
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-2021 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.Optional;
25 import java.util.Set;
26 import org.sleuthkit.datamodel.TskData;
30 import org.sleuthkit.datamodel.HashHitInfo;
31 import org.sleuthkit.datamodel.InvalidAccountIDException;
32 
36 public interface CentralRepository {
37 
46 
50  }
51  switch (selectedPlatform) {
52  case POSTGRESQL:
53  return PostgresCentralRepo.getInstance();
54 
55  case SQLITE:
56  return SqliteCentralRepo.getInstance();
57  default:
58  return null;
59  }
60  }
61 
73 
82  void updateSettings();
83 
87  void saveSettings();
88 
92  void reset() throws CentralRepoException;
93 
99  static boolean isEnabled() {
102  }
103 
112  void newDbInfo(String name, String value) throws CentralRepoException;
113 
122  void addDataSourceObjectId(int rowId, long dataSourceObjectId) throws CentralRepoException;
123 
133  String getDbInfo(String name) throws CentralRepoException;
134 
143  void updateDbInfo(String name, String value) throws CentralRepoException;
144 
152  CorrelationCase newCase(CorrelationCase eamCase) throws CentralRepoException;
153 
159  CorrelationCase newCase(Case autopsyCase) throws CentralRepoException;
160 
166  void updateCase(CorrelationCase eamCase) throws CentralRepoException;
167 
179  CentralRepoExaminer getOrInsertExaminer(String examinerLoginName) throws CentralRepoException;
180 
190  CorrelationCase getCase(Case autopsyCase) throws CentralRepoException;
191 
199  CorrelationCase getCaseByUUID(String caseUUID) throws CentralRepoException;
200 
208  CorrelationCase getCaseById(int caseId) throws CentralRepoException;
209 
215  List<CorrelationCase> getCases() throws CentralRepoException;
216 
225  CorrelationDataSource newDataSource(CorrelationDataSource eamDataSource) throws CentralRepoException;
226 
232  void updateDataSourceMd5Hash(CorrelationDataSource eamDataSource) throws CentralRepoException;
233 
239  void updateDataSourceSha1Hash(CorrelationDataSource eamDataSource) throws CentralRepoException;
240 
247  void updateDataSourceSha256Hash(CorrelationDataSource eamDataSource) throws CentralRepoException;
248 
258  CorrelationDataSource getDataSource(CorrelationCase correlationCase, Long caseDbDataSourceId) throws CentralRepoException;
259 
269  CorrelationDataSource getDataSourceById(CorrelationCase correlationCase, int dataSourceId) throws CentralRepoException;
270 
276  List<CorrelationDataSource> getDataSources() throws CentralRepoException;
277 
286  void updateDataSourceName(CorrelationDataSource eamDataSource, String newName) throws CentralRepoException;
287 
294  void addArtifactInstance(CorrelationAttributeInstance eamArtifact) throws CentralRepoException;
295 
311 
324  List<CorrelationAttributeInstance> getArtifactInstancesByTypeValue(CorrelationAttributeInstance.Type aType, String value) throws CentralRepoException, CorrelationAttributeNormalizationException;
325 
343  List<CorrelationAttributeInstance> getArtifactInstancesByTypeValuesAndCases(CorrelationAttributeInstance.Type aType, List<String> values, List<Integer> caseIds) throws CentralRepoException, CorrelationAttributeNormalizationException;
344 
355  Long getCountArtifactInstancesByTypeValue(CorrelationAttributeInstance.Type aType, String value) throws CentralRepoException, CorrelationAttributeNormalizationException;
356 
364  int getFrequencyPercentage(CorrelationAttributeInstance corAttr) throws CentralRepoException, CorrelationAttributeNormalizationException;
365 
376  Long getCountUniqueCaseDataSourceTuplesHavingTypeValue(CorrelationAttributeInstance.Type aType, String value) throws CentralRepoException, CorrelationAttributeNormalizationException;
377 
392  Long getCountCasesWithOtherInstances(CorrelationAttributeInstance instance) throws CentralRepoException, CorrelationAttributeNormalizationException;
393 
399  Long getCountUniqueDataSources() throws CentralRepoException;
400 
410  Long getCountArtifactInstancesByCaseDataSource(CorrelationDataSource correlationDataSource) throws CentralRepoException;
411 
419  void addAttributeInstanceBulk(CorrelationAttributeInstance eamArtifact) throws CentralRepoException;
420 
425  void commitAttributeInstancesBulk() throws CentralRepoException;
426 
430  void bulkInsertCases(List<CorrelationCase> cases) throws CentralRepoException;
431 
441  void updateAttributeInstanceComment(CorrelationAttributeInstance eamArtifact) throws CentralRepoException;
442 
461  CorrelationDataSource correlationDataSource, String value, String filePath) throws CentralRepoException, CorrelationAttributeNormalizationException;
462 
478  CorrelationDataSource correlationDataSource, long objectID) throws CentralRepoException, CorrelationAttributeNormalizationException;
479 
487  void setAttributeInstanceKnownStatus(CorrelationAttributeInstance eamArtifact, TskData.FileKnown knownStatus) throws CentralRepoException;
488 
497  Long getCountArtifactInstancesKnownBad(CorrelationAttributeInstance.Type aType, String value) throws CentralRepoException, CorrelationAttributeNormalizationException;
498 
511  List<String> getListCasesHavingArtifactInstancesKnownBad(CorrelationAttributeInstance.Type aType, String value) throws CentralRepoException, CorrelationAttributeNormalizationException;
512 
525  List<String> getListCasesHavingArtifactInstances(CorrelationAttributeInstance.Type aType, String value) throws CentralRepoException, CorrelationAttributeNormalizationException;
526 
534  void deleteReferenceSet(int referenceSetID) throws CentralRepoException;
535 
549  boolean referenceSetIsValid(int referenceSetID, String referenceSetName, String version) throws CentralRepoException;
550 
563  boolean referenceSetExists(String referenceSetName, String version) throws CentralRepoException;
564 
576  boolean isFileHashInReferenceSet(String hash, int referenceSetID) throws CentralRepoException, CorrelationAttributeNormalizationException;
577 
591  HashHitInfo lookupHash(String hash, int referenceSetID) throws CentralRepoException, CorrelationAttributeNormalizationException;
592 
602  boolean isValueInReferenceSet(String value, int referenceSetID, int correlationTypeID) throws CentralRepoException, CorrelationAttributeNormalizationException;
603 
612  boolean isArtifactKnownBadByReference(CorrelationAttributeInstance.Type aType, String value) throws CentralRepoException, CorrelationAttributeNormalizationException;
613 
623  CentralRepoOrganization newOrganization(CentralRepoOrganization eamOrg) throws CentralRepoException;
624 
632  List<CentralRepoOrganization> getOrganizations() throws CentralRepoException;
633 
643  CentralRepoOrganization getOrganizationByID(int orgID) throws CentralRepoException;
644 
654  CentralRepoOrganization getReferenceSetOrganization(int referenceSetID) throws CentralRepoException;
655 
664  void updateOrganization(CentralRepoOrganization updatedOrganization) throws CentralRepoException;
665 
673  void deleteOrganization(CentralRepoOrganization organizationToDelete) throws CentralRepoException;
674 
684  int newReferenceSet(CentralRepoFileSet eamGlobalSet) throws CentralRepoException;
685 
695  CentralRepoFileSet getReferenceSetByID(int globalSetID) throws CentralRepoException;
696 
706  List<CentralRepoFileSet> getAllReferenceSets(CorrelationAttributeInstance.Type correlationType) throws CentralRepoException;
707 
717  void addReferenceInstance(CentralRepoFileInstance eamGlobalFileInstance, CorrelationAttributeInstance.Type correlationType) throws CentralRepoException;
718 
728  void bulkInsertReferenceTypeEntries(Set<CentralRepoFileInstance> globalInstances, CorrelationAttributeInstance.Type contentType) throws CentralRepoException;
729 
740  List<CentralRepoFileInstance> getReferenceInstancesByTypeValue(CorrelationAttributeInstance.Type aType, String aValue) throws CentralRepoException, CorrelationAttributeNormalizationException;
741 
751  int newCorrelationType(CorrelationAttributeInstance.Type newType) throws CentralRepoException;
752 
762  List<CorrelationAttributeInstance.Type> getDefinedCorrelationTypes() throws CentralRepoException;
763 
773  List<CorrelationAttributeInstance.Type> getEnabledCorrelationTypes() throws CentralRepoException;
774 
784  List<CorrelationAttributeInstance.Type> getSupportedCorrelationTypes() throws CentralRepoException;
785 
793  void updateCorrelationType(CorrelationAttributeInstance.Type aType) throws CentralRepoException;
794 
804  CorrelationAttributeInstance.Type getCorrelationTypeById(int typeId) throws CentralRepoException;
805 
811  void upgradeSchema() throws CentralRepoException, SQLException, IncompatibleCentralRepoException;
812 
824  CoordinationService.Lock getExclusiveMultiUserDbLock() throws CentralRepoException;
825 
834  void processInstanceTable(CorrelationAttributeInstance.Type type, InstanceTableCallback instanceTableCallback) throws CentralRepoException;
835 
845  void processInstanceTableWhere(CorrelationAttributeInstance.Type type, String whereClause, InstanceTableCallback instanceTableCallback) throws CentralRepoException;
846 
855  void processSelectClause(String selectClause, InstanceTableCallback instanceTableCallback) throws CentralRepoException;
856 
866  void executeCommand(String sql, List<Object> params) throws CentralRepoException;
867 
878  void executeQuery(String sql, List<Object> params, CentralRepositoryDbQueryCallback queryCallback) throws CentralRepoException;
879 
889  Optional<CentralRepoAccountType> getAccountTypeByName(String accountTypeName) throws CentralRepoException;
890 
898  Collection<CentralRepoAccountType> getAllAccountTypes() throws CentralRepoException;
899 
913  CentralRepoAccount getOrCreateAccount(CentralRepoAccount.CentralRepoAccountType crAccountType, String accountUniqueID) throws InvalidAccountIDException, CentralRepoException;
914 
928  CentralRepoAccount getAccount(CentralRepoAccount.CentralRepoAccountType crAccountType, String accountUniqueID) throws InvalidAccountIDException, CentralRepoException;
929 
930 }
void addAttributeInstanceBulk(CorrelationAttributeInstance eamArtifact)
boolean referenceSetExists(String referenceSetName, String version)
List< String > getListCasesHavingArtifactInstances(CorrelationAttributeInstance.Type aType, String value)
void executeQuery(String sql, List< Object > params, CentralRepositoryDbQueryCallback queryCallback)
CentralRepoOrganization newOrganization(CentralRepoOrganization eamOrg)
Long getCountArtifactInstancesByTypeValue(CorrelationAttributeInstance.Type aType, String value)
void addReferenceInstance(CentralRepoFileInstance eamGlobalFileInstance, CorrelationAttributeInstance.Type correlationType)
List< CentralRepoFileSet > getAllReferenceSets(CorrelationAttributeInstance.Type correlationType)
CentralRepoAccount getAccount(CentralRepoAccount.CentralRepoAccountType crAccountType, String accountUniqueID)
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)
Optional< CentralRepoAccountType > getAccountTypeByName(String accountTypeName)
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)
Long getCountCasesWithOtherInstances(CorrelationAttributeInstance instance)
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)
Long getCountUniqueCaseDataSourceTuplesHavingTypeValue(CorrelationAttributeInstance.Type aType, String value)
CentralRepoAccount getOrCreateAccount(CentralRepoAccount.CentralRepoAccountType crAccountType, String accountUniqueID)
CorrelationDataSource getDataSourceById(CorrelationCase correlationCase, int dataSourceId)

Copyright © 2012-2021 Basis Technology. Generated on: Thu Sep 30 2021
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.