Autopsy  4.19.3
Graphical digital forensics platform for The Sleuth Kit and other tools.
IngestServices.java
Go to the documentation of this file.
1 /*
2  * Autopsy Forensic Browser
3  *
4  * Copyright 2012-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.ingest;
20 
21 import java.util.Map;
22 import java.util.logging.Level;
27 import org.sleuthkit.datamodel.Blackboard;
28 import org.sleuthkit.datamodel.SleuthkitCase;
29 
34 public final class IngestServices {
35 
36  private final static Logger logger = Logger.getLogger(IngestServices.class.getName());
37  private static IngestServices instance = null;
38 
44  private IngestServices() {
45  }
46 
54  public static synchronized IngestServices getInstance() {
55  if (instance == null) {
56  instance = new IngestServices();
57  }
58  return instance;
59  }
60 
69  return Case.getCurrentCaseThrows();
70  }
71 
79  public SleuthkitCase getCaseDatabase() throws NoCurrentCaseException {
81  }
82 
91  public Logger getLogger(String moduleDisplayName) {
92  return Logger.getLogger(moduleDisplayName);
93  }
94 
100  public void postMessage(final IngestMessage message) {
101  IngestManager.getInstance().postIngestMessage(message);
102  }
103 
114  @Deprecated
115  public void fireModuleDataEvent(ModuleDataEvent moduleDataEvent) {
116  try {
117  Blackboard blackboard = Case.getCurrentCaseThrows().getSleuthkitCase().getBlackboard();
118  blackboard.postArtifacts(moduleDataEvent.getArtifacts(), moduleDataEvent.getModuleName(), null);
119  } catch (NoCurrentCaseException | Blackboard.BlackboardException ex) {
120  logger.log(Level.SEVERE, "Failed to post artifacts", ex);
121  }
122  }
123 
132  public void fireModuleContentEvent(ModuleContentEvent moduleContentEvent) {
133  IngestManager.getInstance().fireIngestModuleContentEvent(moduleContentEvent);
134  }
135 
143  public long getFreeDiskSpace() {
144  return IngestManager.getInstance().getFreeDiskSpace();
145  }
146 
155  public String getConfigSetting(String moduleName, String settingName) {
156  return ModuleSettings.getConfigSetting(moduleName, settingName);
157  }
158 
166  public void setConfigSetting(String moduleName, String settingName, String setting) {
167  ModuleSettings.setConfigSetting(moduleName, settingName, setting);
168  }
169 
177  public Map<String, String> getConfigSettings(String moduleName) {
178  return ModuleSettings.getConfigSettings(moduleName);
179  }
180 
187  public void setConfigSettings(String moduleName, Map<String, String> settings) {
188  ModuleSettings.setConfigSettings(moduleName, settings);
189  }
190 
198  @Deprecated
199  public SleuthkitCase getCurrentSleuthkitCaseDb() {
201  }
202 
210  @Deprecated
211  public Case getCurrentCase() {
212  return Case.getCurrentCase();
213  }
214 
215 }
static synchronized String getConfigSetting(String moduleName, String settingName)
Collection< BlackboardArtifact > getArtifacts()
static synchronized IngestManager getInstance()
Logger getLogger(String moduleDisplayName)
static synchronized void setConfigSetting(String moduleName, String settingName, String settingVal)
void setConfigSettings(String moduleName, Map< String, String > settings)
void postMessage(final IngestMessage message)
void fireModuleDataEvent(ModuleDataEvent moduleDataEvent)
String getConfigSetting(String moduleName, String settingName)
static synchronized void setConfigSettings(String moduleName, Map< String, String > settings)
void fireModuleContentEvent(ModuleContentEvent moduleContentEvent)
synchronized static Logger getLogger(String name)
Definition: Logger.java:124
Map< String, String > getConfigSettings(String moduleName)
void setConfigSetting(String moduleName, String settingName, String setting)
static synchronized Map< String, String > getConfigSettings(String moduleName)
static synchronized IngestServices getInstance()

Copyright © 2012-2022 Basis Technology. Generated on: Tue Jun 27 2023
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.