Autopsy  4.7.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-2018 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 import org.sleuthkit.datamodel.CaseDbSchemaVersionNumber;
28 
32 public interface EamDb {
33 
34  public static final int SCHEMA_VERSION = 1;
35  public static final CaseDbSchemaVersionNumber CURRENT_DB_SCHEMA_VERSION
36  = new CaseDbSchemaVersionNumber(1, 1);
37 
38 
46  static EamDb getInstance() throws EamDbException {
47 
48  EamDbPlatformEnum selectedPlatform = EamDbPlatformEnum.DISABLED;
49  if (EamDbUtil.useCentralRepo()) {
50  selectedPlatform = EamDbPlatformEnum.getSelectedPlatform();
51  }
52  switch (selectedPlatform) {
53  case POSTGRESQL:
54  return PostgresEamDb.getInstance();
55 
56  case SQLITE:
57  return SqliteEamDb.getInstance();
58  default:
59  return null;
60  }
61  }
62 
72  void shutdownConnections() throws EamDbException;
73 
82  void updateSettings();
83 
87  void saveSettings();
88 
92  void reset() throws EamDbException;
93 
99  static boolean isEnabled() {
100  return EamDbUtil.useCentralRepo()
102  }
103 
112  public void newDbInfo(String name, String value) throws EamDbException;
113 
123  public String getDbInfo(String name) throws EamDbException;
124 
133  public void updateDbInfo(String name, String value) throws EamDbException;
134 
142  CorrelationCase newCase(CorrelationCase eamCase) throws EamDbException;
143 
149  CorrelationCase newCase(Case autopsyCase) throws EamDbException;
150 
156  void updateCase(CorrelationCase eamCase) throws EamDbException;
157 
167  CorrelationCase getCase(Case autopsyCase) throws EamDbException;
168 
176  CorrelationCase getCaseByUUID(String caseUUID) throws EamDbException;
177 
183  List<CorrelationCase> getCases() throws EamDbException;
184 
190  void newDataSource(CorrelationDataSource eamDataSource) throws EamDbException;
191 
201  CorrelationDataSource getDataSource(CorrelationCase correlationCase, String dataSourceDeviceId) throws EamDbException;
202 
208  List<CorrelationDataSource> getDataSources() throws EamDbException;
209 
216  void addArtifact(CorrelationAttribute eamArtifact) throws EamDbException;
217 
227  List<CorrelationAttributeInstance> getArtifactInstancesByTypeValue(CorrelationAttribute.Type aType, String value) throws EamDbException;
228 
240  List<CorrelationAttributeInstance> getArtifactInstancesByPath(CorrelationAttribute.Type aType, String filePath) throws EamDbException;
241 
252  Long getCountArtifactInstancesByTypeValue(CorrelationAttribute.Type aType, String value) throws EamDbException;
253 
261  int getFrequencyPercentage(CorrelationAttribute corAttr) throws EamDbException;
262 
273  Long getCountUniqueCaseDataSourceTuplesHavingTypeValue(CorrelationAttribute.Type aType, String value) throws EamDbException;
274 
280  Long getCountUniqueDataSources() throws EamDbException;
281 
293  Long getCountArtifactInstancesByCaseDataSource(String caseUUID, String dataSourceID) throws EamDbException;
294 
302  void prepareBulkArtifact(CorrelationAttribute eamArtifact) throws EamDbException;
303 
308  void bulkInsertArtifacts() throws EamDbException;
309 
313  void bulkInsertCases(List<CorrelationCase> cases) throws EamDbException;
314 
324  void updateAttributeInstanceComment(CorrelationAttribute eamArtifact) throws EamDbException;
325 
341  CorrelationDataSource correlationDataSource, String value, String filePath) throws EamDbException;
342 
350  void setArtifactInstanceKnownStatus(CorrelationAttribute eamArtifact, TskData.FileKnown knownStatus) throws EamDbException;
351 
361  List<CorrelationAttributeInstance> getArtifactInstancesKnownBad(CorrelationAttribute.Type aType, String value) throws EamDbException;
362 
380  Long getCountArtifactInstancesKnownBad(CorrelationAttribute.Type aType, String value) throws EamDbException;
381 
394  List<String> getListCasesHavingArtifactInstancesKnownBad(CorrelationAttribute.Type aType, String value) throws EamDbException;
395 
403  public void deleteReferenceSet(int referenceSetID) throws EamDbException;
404 
418  public boolean referenceSetIsValid(int referenceSetID, String referenceSetName, String version) throws EamDbException;
419 
432  public boolean referenceSetExists(String referenceSetName, String version) throws EamDbException;
433 
445  public boolean isFileHashInReferenceSet(String hash, int referenceSetID) throws EamDbException;
446 
456  public boolean isValueInReferenceSet(String value, int referenceSetID, int correlationTypeID) throws EamDbException;
457 
466  boolean isArtifactKnownBadByReference(CorrelationAttribute.Type aType, String value) throws EamDbException;
467 
477  EamOrganization newOrganization(EamOrganization eamOrg) throws EamDbException;
478 
486  List<EamOrganization> getOrganizations() throws EamDbException;
487 
497  EamOrganization getOrganizationByID(int orgID) throws EamDbException;
498 
508  EamOrganization getReferenceSetOrganization(int referenceSetID) throws EamDbException;
509 
518  void updateOrganization(EamOrganization updatedOrganization) throws EamDbException;
519 
527  void deleteOrganization(EamOrganization organizationToDelete) throws EamDbException;
528 
538  int newReferenceSet(EamGlobalSet eamGlobalSet) throws EamDbException;
539 
549  EamGlobalSet getReferenceSetByID(int globalSetID) throws EamDbException;
550 
560  List<EamGlobalSet> getAllReferenceSets(CorrelationAttribute.Type correlationType) throws EamDbException;
561 
571  void addReferenceInstance(EamGlobalFileInstance eamGlobalFileInstance, CorrelationAttribute.Type correlationType) throws EamDbException;
572 
582  void bulkInsertReferenceTypeEntries(Set<EamGlobalFileInstance> globalInstances, CorrelationAttribute.Type contentType) throws EamDbException;
583 
594  List<EamGlobalFileInstance> getReferenceInstancesByTypeValue(CorrelationAttribute.Type aType, String aValue) throws EamDbException;
595 
605  public int newCorrelationType(CorrelationAttribute.Type newType) throws EamDbException;
606 
616  public List<CorrelationAttribute.Type> getDefinedCorrelationTypes() throws EamDbException;
617 
627  public List<CorrelationAttribute.Type> getEnabledCorrelationTypes() throws EamDbException;
628 
638  public List<CorrelationAttribute.Type> getSupportedCorrelationTypes() throws EamDbException;
639 
647  public void updateCorrelationType(CorrelationAttribute.Type aType) throws EamDbException;
648 
658  public CorrelationAttribute.Type getCorrelationTypeById(int typeId) throws EamDbException;
659 
665  public void upgradeSchema() throws EamDbException, SQLException;
666 
678  public CoordinationService.Lock getExclusiveMultiUserDbLock() throws EamDbException;
679 
687  void processInstanceTable(CorrelationAttribute.Type type, InstanceTableCallback instanceTableCallback) throws EamDbException;
688 }
CorrelationDataSource getDataSource(CorrelationCase correlationCase, String dataSourceDeviceId)
int getFrequencyPercentage(CorrelationAttribute corAttr)
boolean isArtifactKnownBadByReference(CorrelationAttribute.Type aType, String value)
CorrelationAttribute.Type getCorrelationTypeById(int typeId)
CorrelationCase getCaseByUUID(String caseUUID)
List< CorrelationAttributeInstance > getArtifactInstancesKnownBad(CorrelationAttribute.Type aType, String value)
List< CorrelationAttribute.Type > getSupportedCorrelationTypes()
void addReferenceInstance(EamGlobalFileInstance eamGlobalFileInstance, CorrelationAttribute.Type correlationType)
void updateAttributeInstanceComment(CorrelationAttribute eamArtifact)
void prepareBulkArtifact(CorrelationAttribute eamArtifact)
CorrelationCase newCase(CorrelationCase eamCase)
boolean isFileHashInReferenceSet(String hash, int referenceSetID)
boolean isValueInReferenceSet(String value, int referenceSetID, int correlationTypeID)
List< CorrelationAttribute.Type > getEnabledCorrelationTypes()
List< String > getListCasesHavingArtifactInstancesKnownBad(CorrelationAttribute.Type aType, String value)
void updateOrganization(EamOrganization updatedOrganization)
void addArtifact(CorrelationAttribute eamArtifact)
List< CorrelationAttributeInstance > getArtifactInstancesByTypeValue(CorrelationAttribute.Type aType, String value)
Long getCountArtifactInstancesKnownBad(CorrelationAttribute.Type aType, String value)
void setArtifactInstanceKnownStatus(CorrelationAttribute eamArtifact, TskData.FileKnown knownStatus)
CorrelationAttribute getCorrelationAttribute(CorrelationAttribute.Type type, CorrelationCase correlationCase, CorrelationDataSource correlationDataSource, String value, String filePath)
List< EamGlobalSet > getAllReferenceSets(CorrelationAttribute.Type correlationType)
int newCorrelationType(CorrelationAttribute.Type newType)
Long getCountArtifactInstancesByCaseDataSource(String caseUUID, String dataSourceID)
boolean referenceSetExists(String referenceSetName, String version)
List< EamGlobalFileInstance > getReferenceInstancesByTypeValue(CorrelationAttribute.Type aType, String aValue)
static final CaseDbSchemaVersionNumber CURRENT_DB_SCHEMA_VERSION
Definition: EamDb.java:36
void updateCorrelationType(CorrelationAttribute.Type aType)
Long getCountUniqueCaseDataSourceTuplesHavingTypeValue(CorrelationAttribute.Type aType, String value)
EamOrganization newOrganization(EamOrganization eamOrg)
void bulkInsertCases(List< CorrelationCase > cases)
boolean referenceSetIsValid(int referenceSetID, String referenceSetName, String version)
List< CorrelationAttributeInstance > getArtifactInstancesByPath(CorrelationAttribute.Type aType, String filePath)
void deleteOrganization(EamOrganization organizationToDelete)
void bulkInsertReferenceTypeEntries(Set< EamGlobalFileInstance > globalInstances, CorrelationAttribute.Type contentType)
EamOrganization getReferenceSetOrganization(int referenceSetID)
List< CorrelationAttribute.Type > getDefinedCorrelationTypes()
void newDataSource(CorrelationDataSource eamDataSource)
void processInstanceTable(CorrelationAttribute.Type type, InstanceTableCallback instanceTableCallback)
Long getCountArtifactInstancesByTypeValue(CorrelationAttribute.Type aType, String value)

Copyright © 2012-2016 Basis Technology. Generated on: Mon Jun 18 2018
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.