Autopsy  4.14.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.List;
23 import java.util.Set;
24 import org.sleuthkit.datamodel.TskData;
28 
32 public interface CentralRepository {
33 
42 
46  }
47  switch (selectedPlatform) {
48  case POSTGRESQL:
49  return PostgresCentralRepo.getInstance();
50 
51  case SQLITE:
52  return SqliteCentralRepo.getInstance();
53  default:
54  return null;
55  }
56  }
57 
68 
77  void updateSettings();
78 
82  void saveSettings();
83 
87  void reset() throws CentralRepoException;
88 
94  static boolean isEnabled() {
97  }
98 
107  public void newDbInfo(String name, String value) throws CentralRepoException;
108 
117  void addDataSourceObjectId(int rowId, long dataSourceObjectId) throws CentralRepoException;
118 
128  public String getDbInfo(String name) throws CentralRepoException;
129 
138  public void updateDbInfo(String name, String value) throws CentralRepoException;
139 
147  CorrelationCase newCase(CorrelationCase eamCase) throws CentralRepoException;
148 
154  CorrelationCase newCase(Case autopsyCase) throws CentralRepoException;
155 
161  void updateCase(CorrelationCase eamCase) throws CentralRepoException;
162 
172  CorrelationCase getCase(Case autopsyCase) throws CentralRepoException;
173 
181  CorrelationCase getCaseByUUID(String caseUUID) throws CentralRepoException;
182 
190  CorrelationCase getCaseById(int caseId) throws CentralRepoException;
191 
197  List<CorrelationCase> getCases() throws CentralRepoException;
198 
207  CorrelationDataSource newDataSource(CorrelationDataSource eamDataSource) throws CentralRepoException;
208 
214  void updateDataSourceMd5Hash(CorrelationDataSource eamDataSource) throws CentralRepoException;
215 
221  void updateDataSourceSha1Hash(CorrelationDataSource eamDataSource) throws CentralRepoException;
222 
229  void updateDataSourceSha256Hash(CorrelationDataSource eamDataSource) throws CentralRepoException;
230 
240  CorrelationDataSource getDataSource(CorrelationCase correlationCase, Long caseDbDataSourceId) throws CentralRepoException;
241 
251  CorrelationDataSource getDataSourceById(CorrelationCase correlationCase, int dataSourceId) throws CentralRepoException;
252 
258  List<CorrelationDataSource> getDataSources() throws CentralRepoException;
259 
268  void updateDataSourceName(CorrelationDataSource eamDataSource, String newName) throws CentralRepoException;
269 
276  void addArtifactInstance(CorrelationAttributeInstance eamArtifact) throws CentralRepoException;
277 
293 
306  List<CorrelationAttributeInstance> getArtifactInstancesByTypeValue(CorrelationAttributeInstance.Type aType, String value) throws CentralRepoException, CorrelationAttributeNormalizationException;
307 
325  List<CorrelationAttributeInstance> getArtifactInstancesByTypeValuesAndCases(CorrelationAttributeInstance.Type aType, List<String> values, List<Integer> caseIds) throws CentralRepoException, CorrelationAttributeNormalizationException;
326 
337  Long getCountArtifactInstancesByTypeValue(CorrelationAttributeInstance.Type aType, String value) throws CentralRepoException, CorrelationAttributeNormalizationException;
338 
346  int getFrequencyPercentage(CorrelationAttributeInstance corAttr) throws CentralRepoException, CorrelationAttributeNormalizationException;
347 
358  Long getCountUniqueCaseDataSourceTuplesHavingTypeValue(CorrelationAttributeInstance.Type aType, String value) throws CentralRepoException, CorrelationAttributeNormalizationException;
359 
365  Long getCountUniqueDataSources() throws CentralRepoException;
366 
376  Long getCountArtifactInstancesByCaseDataSource(CorrelationDataSource correlationDataSource) throws CentralRepoException;
377 
385  void addAttributeInstanceBulk(CorrelationAttributeInstance eamArtifact) throws CentralRepoException;
386 
391  void commitAttributeInstancesBulk() throws CentralRepoException;
392 
396  void bulkInsertCases(List<CorrelationCase> cases) throws CentralRepoException;
397 
407  void updateAttributeInstanceComment(CorrelationAttributeInstance eamArtifact) throws CentralRepoException;
408 
427  CorrelationDataSource correlationDataSource, String value, String filePath) throws CentralRepoException, CorrelationAttributeNormalizationException;
428 
444  CorrelationDataSource correlationDataSource, long objectID) throws CentralRepoException, CorrelationAttributeNormalizationException;
445 
453  void setAttributeInstanceKnownStatus(CorrelationAttributeInstance eamArtifact, TskData.FileKnown knownStatus) throws CentralRepoException;
454 
463  Long getCountArtifactInstancesKnownBad(CorrelationAttributeInstance.Type aType, String value) throws CentralRepoException, CorrelationAttributeNormalizationException;
464 
477  List<String> getListCasesHavingArtifactInstancesKnownBad(CorrelationAttributeInstance.Type aType, String value) throws CentralRepoException, CorrelationAttributeNormalizationException;
478 
491  List<String> getListCasesHavingArtifactInstances(CorrelationAttributeInstance.Type aType, String value) throws CentralRepoException, CorrelationAttributeNormalizationException;
492 
500  public void deleteReferenceSet(int referenceSetID) throws CentralRepoException;
501 
515  public boolean referenceSetIsValid(int referenceSetID, String referenceSetName, String version) throws CentralRepoException;
516 
529  public boolean referenceSetExists(String referenceSetName, String version) throws CentralRepoException;
530 
542  public boolean isFileHashInReferenceSet(String hash, int referenceSetID) throws CentralRepoException, CorrelationAttributeNormalizationException;
543 
553  public boolean isValueInReferenceSet(String value, int referenceSetID, int correlationTypeID) throws CentralRepoException, CorrelationAttributeNormalizationException;
554 
563  boolean isArtifactKnownBadByReference(CorrelationAttributeInstance.Type aType, String value) throws CentralRepoException, CorrelationAttributeNormalizationException;
564 
574  CentralRepoOrganization newOrganization(CentralRepoOrganization eamOrg) throws CentralRepoException;
575 
583  List<CentralRepoOrganization> getOrganizations() throws CentralRepoException;
584 
594  CentralRepoOrganization getOrganizationByID(int orgID) throws CentralRepoException;
595 
605  CentralRepoOrganization getReferenceSetOrganization(int referenceSetID) throws CentralRepoException;
606 
615  void updateOrganization(CentralRepoOrganization updatedOrganization) throws CentralRepoException;
616 
624  void deleteOrganization(CentralRepoOrganization organizationToDelete) throws CentralRepoException;
625 
635  int newReferenceSet(CentralRepoFileSet eamGlobalSet) throws CentralRepoException;
636 
646  CentralRepoFileSet getReferenceSetByID(int globalSetID) throws CentralRepoException;
647 
657  List<CentralRepoFileSet> getAllReferenceSets(CorrelationAttributeInstance.Type correlationType) throws CentralRepoException;
658 
668  void addReferenceInstance(CentralRepoFileInstance eamGlobalFileInstance, CorrelationAttributeInstance.Type correlationType) throws CentralRepoException;
669 
679  void bulkInsertReferenceTypeEntries(Set<CentralRepoFileInstance> globalInstances, CorrelationAttributeInstance.Type contentType) throws CentralRepoException;
680 
691  List<CentralRepoFileInstance> getReferenceInstancesByTypeValue(CorrelationAttributeInstance.Type aType, String aValue) throws CentralRepoException, CorrelationAttributeNormalizationException;
692 
702  int newCorrelationType(CorrelationAttributeInstance.Type newType) throws CentralRepoException;
703 
713  List<CorrelationAttributeInstance.Type> getDefinedCorrelationTypes() throws CentralRepoException;
714 
724  List<CorrelationAttributeInstance.Type> getEnabledCorrelationTypes() throws CentralRepoException;
725 
735  List<CorrelationAttributeInstance.Type> getSupportedCorrelationTypes() throws CentralRepoException;
736 
744  void updateCorrelationType(CorrelationAttributeInstance.Type aType) throws CentralRepoException;
745 
755  CorrelationAttributeInstance.Type getCorrelationTypeById(int typeId) throws CentralRepoException;
756 
762  public void upgradeSchema() throws CentralRepoException, SQLException, IncompatibleCentralRepoException;
763 
775  public CoordinationService.Lock getExclusiveMultiUserDbLock() throws CentralRepoException;
776 
785  void processInstanceTable(CorrelationAttributeInstance.Type type, InstanceTableCallback instanceTableCallback) throws CentralRepoException;
786 
796  void processInstanceTableWhere(CorrelationAttributeInstance.Type type, String whereClause, InstanceTableCallback instanceTableCallback) throws CentralRepoException;
797 
806  public void processSelectClause(String selectClause, InstanceTableCallback instanceTableCallback) throws CentralRepoException;
807 
808 
816  CentralRepoAccountType getAccountTypeByName(String accountTypeName) throws CentralRepoException;
817 
828  CentralRepoAccount getOrCreateAccount(CentralRepoAccount.CentralRepoAccountType crAccountType, String accountUniqueID) throws CentralRepoException;
829 
830 
831 }
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)
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)
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: Wed Apr 8 2020
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.