Autopsy  4.6.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-2017 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 
45  static EamDb getInstance() throws EamDbException {
46 
47  EamDbPlatformEnum selectedPlatform = EamDbPlatformEnum.DISABLED;
48  if (EamDbUtil.useCentralRepo()) {
49  selectedPlatform = EamDbPlatformEnum.getSelectedPlatform();
50  }
51  switch (selectedPlatform) {
52  case POSTGRESQL:
53  return PostgresEamDb.getInstance();
54 
55  case SQLITE:
56  return SqliteEamDb.getInstance();
57  default:
58  return null;
59  }
60  }
61 
71  void shutdownConnections() throws EamDbException;
72 
81  void updateSettings();
82 
86  void saveSettings();
87 
91  void reset() throws EamDbException;
92 
98  static boolean isEnabled() {
99  return EamDbUtil.useCentralRepo()
101  }
102 
111  public void newDbInfo(String name, String value) throws EamDbException;
112 
122  public String getDbInfo(String name) throws EamDbException;
123 
132  public void updateDbInfo(String name, String value) throws EamDbException;
133 
141  CorrelationCase newCase(CorrelationCase eamCase) throws EamDbException;
142 
148  CorrelationCase newCase(Case autopsyCase) throws EamDbException;
149 
155  void updateCase(CorrelationCase eamCase) throws EamDbException;
156 
164  CorrelationCase getCase(Case autopsyCase) throws EamDbException;
165 
173  CorrelationCase getCaseByUUID(String caseUUID) throws EamDbException;
174 
180  List<CorrelationCase> getCases() throws EamDbException;
181 
187  void newDataSource(CorrelationDataSource eamDataSource) throws EamDbException;
188 
198  CorrelationDataSource getDataSource(CorrelationCase correlationCase, String dataSourceDeviceId) throws EamDbException;
199 
205  List<CorrelationDataSource> getDataSources() throws EamDbException;
206 
213  void addArtifact(CorrelationAttribute eamArtifact) throws EamDbException;
214 
224  List<CorrelationAttributeInstance> getArtifactInstancesByTypeValue(CorrelationAttribute.Type aType, String value) throws EamDbException;
225 
237  List<CorrelationAttributeInstance> getArtifactInstancesByPath(CorrelationAttribute.Type aType, String filePath) throws EamDbException;
238 
249  Long getCountArtifactInstancesByTypeValue(CorrelationAttribute.Type aType, String value) throws EamDbException;
250 
258  int getFrequencyPercentage(CorrelationAttribute corAttr) throws EamDbException;
259 
270  Long getCountUniqueCaseDataSourceTuplesHavingTypeValue(CorrelationAttribute.Type aType, String value) throws EamDbException;
271 
277  Long getCountUniqueDataSources() throws EamDbException;
278 
290  Long getCountArtifactInstancesByCaseDataSource(String caseUUID, String dataSourceID) throws EamDbException;
291 
299  void prepareBulkArtifact(CorrelationAttribute eamArtifact) throws EamDbException;
300 
305  void bulkInsertArtifacts() throws EamDbException;
306 
310  void bulkInsertCases(List<CorrelationCase> cases) throws EamDbException;
311 
319  void setArtifactInstanceKnownStatus(CorrelationAttribute eamArtifact, TskData.FileKnown knownStatus) throws EamDbException;
320 
330  List<CorrelationAttributeInstance> getArtifactInstancesKnownBad(CorrelationAttribute.Type aType, String value) throws EamDbException;
331 
340  Long getCountArtifactInstancesKnownBad(CorrelationAttribute.Type aType, String value) throws EamDbException;
341 
354  List<String> getListCasesHavingArtifactInstancesKnownBad(CorrelationAttribute.Type aType, String value) throws EamDbException;
355 
362  public void deleteReferenceSet(int referenceSetID) throws EamDbException;
363 
375  public boolean referenceSetIsValid(int referenceSetID, String referenceSetName, String version) throws EamDbException;
376 
387  public boolean referenceSetExists(String referenceSetName, String version) throws EamDbException;
388 
398  public boolean isFileHashInReferenceSet(String hash, int referenceSetID) throws EamDbException;
399 
408  public boolean isValueInReferenceSet(String value, int referenceSetID, int correlationTypeID) throws EamDbException;
409 
418  boolean isArtifactKnownBadByReference(CorrelationAttribute.Type aType, String value) throws EamDbException;
419 
429  long newOrganization(EamOrganization eamOrg) throws EamDbException;
430 
438  List<EamOrganization> getOrganizations() throws EamDbException;
439 
449  EamOrganization getOrganizationByID(int orgID) throws EamDbException;
450 
458  EamOrganization getReferenceSetOrganization(int referenceSetID) throws EamDbException;
459 
468  void updateOrganization(EamOrganization updatedOrganization) throws EamDbException;
469 
477  void deleteOrganization(EamOrganization organizationToDelete) throws EamDbException;
478 
488  int newReferenceSet(EamGlobalSet eamGlobalSet) throws EamDbException;
489 
499  EamGlobalSet getReferenceSetByID(int globalSetID) throws EamDbException;
500 
510  List<EamGlobalSet> getAllReferenceSets(CorrelationAttribute.Type correlationType) throws EamDbException;
511 
520  void addReferenceInstance(EamGlobalFileInstance eamGlobalFileInstance, CorrelationAttribute.Type correlationType) throws EamDbException;
521 
531  void bulkInsertReferenceTypeEntries(Set<EamGlobalFileInstance> globalInstances, CorrelationAttribute.Type contentType) throws EamDbException;
532 
543  List<EamGlobalFileInstance> getReferenceInstancesByTypeValue(CorrelationAttribute.Type aType, String aValue) throws EamDbException;
544 
554  public int newCorrelationType(CorrelationAttribute.Type newType) throws EamDbException;
555 
565  public List<CorrelationAttribute.Type> getDefinedCorrelationTypes() throws EamDbException;
566 
576  public List<CorrelationAttribute.Type> getEnabledCorrelationTypes() throws EamDbException;
577 
587  public List<CorrelationAttribute.Type> getSupportedCorrelationTypes() throws EamDbException;
588 
596  public void updateCorrelationType(CorrelationAttribute.Type aType) throws EamDbException;
597 
607  public CorrelationAttribute.Type getCorrelationTypeById(int typeId) throws EamDbException;
608 
614  public void upgradeSchema() throws EamDbException, SQLException;
615 
626  public CoordinationService.Lock getExclusiveMultiUserDbLock() throws EamDbException;
627 }
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 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)
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)
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)
Long getCountArtifactInstancesByTypeValue(CorrelationAttribute.Type aType, String value)

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