Tidied up ingest framework API

This commit is contained in:
Richard Cordovano 2014-03-26 17:12:24 -04:00
parent 819e10c2eb
commit 4f8617a16a
44 changed files with 119 additions and 128 deletions

View File

@ -108,7 +108,7 @@ public final class AddImageAction extends CallableSystemAction implements Presen
public void actionPerformed(ActionEvent e) {
Logger.noteAction(AddImageAction.class);
if (IngestManager.getDefault().isIngestRunning()) {
if (IngestManager.getInstance().isIngestRunning()) {
final String msg = NbBundle.getMessage(this.getClass(), "AddImageAction.ingestConfig.ongoingIngest.msg");
if (JOptionPane.showConfirmDialog(null, msg,
NbBundle.getMessage(this.getClass(),

View File

@ -282,7 +282,7 @@ public class FileManager implements Closeable {
//for now reusing ingest events, in future this will be replaced by datamodel / observer sending out events
// @@@ Is this the right place for this? A directory tree refresh will be triggered, so this may be creating a race condition
// since the transaction is not yet committed.
IngestServices.getDefault().fireModuleContentEvent(new ModuleContentEvent(localFileAdded));
IngestServices.getInstance().fireModuleContentEvent(new ModuleContentEvent(localFileAdded));
}
}

View File

@ -33,7 +33,7 @@ import org.openide.util.lookup.ProxyLookup;
import org.sleuthkit.autopsy.coreutils.Logger;
import org.sleuthkit.autopsy.datamodel.AbstractContentNode;
import org.sleuthkit.autopsy.datamodel.DisplayableItemNode;
import org.sleuthkit.autopsy.ingest.IngestDialog;
import org.sleuthkit.autopsy.ingest.RunIngestModulesDialog;
import org.sleuthkit.datamodel.AbstractFile;
import org.sleuthkit.datamodel.Content;
import org.sleuthkit.datamodel.Directory;
@ -116,7 +116,7 @@ class DirectoryTreeFilterNode extends FilterNode {
NbBundle.getMessage(this.getClass(), "DirectoryTreeFilterNode.action.runIngestMods.text")) {
@Override
public void actionPerformed(ActionEvent e) {
final IngestDialog ingestDialog = new IngestDialog();
final RunIngestModulesDialog ingestDialog = new RunIngestModulesDialog();
ingestDialog.setDataSources(Collections.<Content>singletonList(content));
ingestDialog.display();
}

View File

@ -45,7 +45,7 @@ public class DataSourceIngestModuleStatusHelper {
*
* @return True if the task has been canceled, false otherwise.
*/
public boolean isCancelled() {
public boolean isIngestJobCancelled() {
return worker.isCancelled();
}

View File

@ -58,9 +58,9 @@ public final class IngestJobContext {
*
* @param files The files to be processed by the file ingest pipeline.
*/
public void addFilesToPipeline(List<AbstractFile> files) {
public void addFiles(List<AbstractFile> files) {
for (AbstractFile file : files) {
IngestManager.getDefault().scheduleFile(ingestJob.getId(), file);
IngestManager.getInstance().scheduleFile(ingestJob.getId(), file);
}
}
}

View File

@ -232,7 +232,7 @@ public final class IngestJobLauncher {
}
if ((!enabledModuleTemplates.isEmpty()) && (dataSources != null) && (!dataSources.isEmpty())) {
IngestManager.getDefault().scheduleDataSourceTasks(dataSources, enabledModuleTemplates, ingestConfigPanel.getProcessUnallocSpace());
IngestManager.getInstance().scheduleDataSourceTasks(dataSources, enabledModuleTemplates, ingestConfigPanel.getProcessUnallocSpace());
}
}
}

View File

@ -111,7 +111,7 @@ public class IngestManager {
*
* @returns Instance of class.
*/
synchronized public static IngestManager getDefault() {
synchronized public static IngestManager getInstance() {
if (instance == null) {
instance = new IngestManager();
}
@ -409,7 +409,7 @@ public class IngestManager {
if (progress != null) {
progress.setDisplayName(displayName + " (Cancelling...)");
}
IngestManager.getDefault().stopAll();
IngestManager.getInstance().stopAll();
return true;
}
});
@ -509,7 +509,7 @@ public class IngestManager {
"IngestManager.DataSourceTaskWorker.process.cancelling",
"Data source ingest"));
}
IngestManager.getDefault().stopAll();
IngestManager.getInstance().stopAll();
return true;
}
});
@ -529,7 +529,7 @@ public class IngestManager {
}
logger.log(Level.INFO, "Data source ingest thread (id={0}) completed", this.id);
IngestManager.getDefault().reportThreadDone(this.id);
IngestManager.getInstance().reportThreadDone(this.id);
return null;
}
@ -539,11 +539,11 @@ public class IngestManager {
super.get();
} catch (CancellationException | InterruptedException e) {
logger.log(Level.INFO, "Data source ingest thread (id={0}) cancelled", this.id);
IngestManager.getDefault().reportThreadDone(this.id);
IngestManager.getInstance().reportThreadDone(this.id);
} catch (Exception ex) {
String message = String.format("Data source ingest thread (id=%d) experienced a fatal error", this.id);
logger.log(Level.SEVERE, message, ex);
IngestManager.getDefault().reportThreadDone(this.id);
IngestManager.getInstance().reportThreadDone(this.id);
} finally {
progress.finish();
}
@ -580,7 +580,7 @@ public class IngestManager {
NbBundle.getMessage(this.getClass(), "IngestManager.FileTaskWorker.process.cancelling",
displayName));
}
IngestManager.getDefault().stopAll();
IngestManager.getInstance().stopAll();
return true;
}
});
@ -593,7 +593,7 @@ public class IngestManager {
int processedFiles = 0;
while (fileScheduler.hasNext()) {
if (isCancelled()) {
IngestManager.getDefault().reportThreadDone(this.id);
IngestManager.getInstance().reportThreadDone(this.id);
logger.log(Level.INFO, "File ingest thread (id={0}) cancelled", this.id);
return null;
}
@ -617,7 +617,7 @@ public class IngestManager {
}
logger.log(Level.INFO, "File ingest thread (id={0}) completed", this.id);
IngestManager.getDefault().reportThreadDone(this.id);
IngestManager.getInstance().reportThreadDone(this.id);
return null;
}
@ -627,11 +627,11 @@ public class IngestManager {
super.get();
} catch (CancellationException | InterruptedException e) {
logger.log(Level.INFO, "File ingest thread (id={0}) cancelled", this.id);
IngestManager.getDefault().reportThreadDone(this.id);
IngestManager.getInstance().reportThreadDone(this.id);
} catch (Exception ex) {
String message = String.format("File ingest thread {0} experienced a fatal error", this.id);
logger.log(Level.SEVERE, message, ex);
IngestManager.getDefault().reportThreadDone(this.id);
IngestManager.getInstance().reportThreadDone(this.id);
} finally {
progress.finish();
}

View File

@ -126,7 +126,7 @@ import org.sleuthkit.datamodel.Content;
super.componentOpened();
//create manager instance
if (manager == null) {
manager = IngestManager.getDefault();
manager = IngestManager.getInstance();
}
}
@ -221,7 +221,7 @@ import org.sleuthkit.datamodel.Content;
}
//stop workers if running
if (manager == null) {
manager = IngestManager.getDefault();
manager = IngestManager.getInstance();
}
try {
manager.stopAll();

View File

@ -45,7 +45,7 @@ public abstract class IngestModuleFactoryAdapter implements IngestModuleFactory
@Override
public IngestModuleIngestJobSettings getDefaultModuleSettings() {
return new NoIngestModuleSettings();
return new NoIngestModuleIngestJobSettings();
}
@Override

View File

@ -151,7 +151,7 @@ public final class IngestMonitor {
@Override
public void actionPerformed(ActionEvent e) {
final IngestManager manager = IngestManager.getDefault();
final IngestManager manager = IngestManager.getInstance();
//runs checks only if ingest is running
if (manager.isIngestRunning() == false) {
@ -166,7 +166,7 @@ public final class IngestMonitor {
MONITOR_LOGGER.log(Level.SEVERE, "Stopping ingest due to low disk space on disk " + diskPath);
logger.log(Level.SEVERE, "Stopping ingest due to low disk space on disk " + diskPath);
manager.stopAll();
IngestServices.getDefault().postMessage(IngestMessage.createManagerErrorMessage(
IngestServices.getInstance().postMessage(IngestMessage.createManagerErrorMessage(
NbBundle.getMessage(this.getClass(), "IngestMonitor.mgrErrMsg.lowDiskSpace.title", diskPath),
NbBundle.getMessage(this.getClass(), "IngestMonitor.mgrErrMsg.lowDiskSpace.msg", diskPath)));
}

View File

@ -19,11 +19,9 @@
package org.sleuthkit.autopsy.ingest;
import java.util.Map;
import java.util.logging.Level;
import org.sleuthkit.autopsy.casemodule.Case;
import org.sleuthkit.autopsy.coreutils.Logger;
import org.sleuthkit.autopsy.coreutils.ModuleSettings;
import org.sleuthkit.datamodel.AbstractFile;
import org.sleuthkit.datamodel.SleuthkitCase;
/**
@ -33,12 +31,10 @@ import org.sleuthkit.datamodel.SleuthkitCase;
*/
public final class IngestServices {
private static final Logger logger = Logger.getLogger(IngestServices.class.getName());
private IngestManager manager;
private static IngestServices instance;
private static IngestServices instance = null;
private final IngestManager manager = IngestManager.getInstance();
private IngestServices() {
this.manager = IngestManager.getDefault();
}
/**
@ -46,7 +42,7 @@ public final class IngestServices {
*
* @return The ingest services singleton.
*/
public static synchronized IngestServices getDefault() {
public static synchronized IngestServices getInstance() {
if (instance == null) {
instance = new IngestServices();
}
@ -54,7 +50,7 @@ public final class IngestServices {
}
/**
* Get the current Autopsy case.
* Get the current Autopsy case.
*
* @return The current case.
*/
@ -71,17 +67,17 @@ public final class IngestServices {
return Case.getCurrentCase().getSleuthkitCase();
}
/**
* Get a logger that incorporates the display name of an ingest module in
/**
* Get a logger that incorporates the display name of an ingest module in
* messages written to the Autopsy log files.
*
*
* @param moduleClassName The display name of the ingest module.
* @return The custom logger for the ingest module.
* @return The custom logger for the ingest module.
*/
public Logger getLogger(String moduleDisplayName) {
return Logger.getLogger(moduleDisplayName);
}
/**
* Post message to the ingest messages in box.
*
@ -90,21 +86,10 @@ public final class IngestServices {
public void postMessage(final IngestMessage message) {
manager.postIngestMessage(message);
}
/**
* Fire module event to notify registered module event listeners
*
* @param eventType the event type, defined in
* IngestManager.IngestManagerEvents
* @param moduleName the module name
*/
public void fireModuleEvent(String eventType, String moduleName) {
IngestManager.fireModuleEvent(eventType, moduleName);
}
/**
* Fire module data event to notify registered module data event listeners
* that there is new data of a given type from a module
* that there is new data of a given type from a module.
*
* @param moduleDataEvent module data event, encapsulating blackboard
* artifact data
@ -133,10 +118,11 @@ public final class IngestServices {
*/
public long getFreeDiskSpace() {
return manager.getFreeDiskSpace();
}
/**
}
/**
* Gets a specific name/value configuration setting for a module
*
* @param moduleName moduleName identifier unique to that module
* @param settingName setting name to retrieve
* @return setting value for the module / setting name, or null if not found
@ -144,9 +130,10 @@ public final class IngestServices {
public String getConfigSetting(String moduleName, String settingName) {
return ModuleSettings.getConfigSetting(moduleName, settingName);
}
/**
* Sets a specific name/value configuration setting for a module
*
* @param moduleName moduleName identifier unique to that module
* @param settingName setting name to set
* @param settingVal setting value to set
@ -154,23 +141,27 @@ public final class IngestServices {
public void setConfigSetting(String moduleName, String settingName, String settingVal) {
ModuleSettings.setConfigSetting(moduleName, settingName, settingVal);
}
/**
* Gets all name/value configuration settings for a module
*
* @param moduleName moduleName identifier unique to that module
* @return settings for the module / setting name
*/
public Map<String,String> getConfigSettings(String moduleName) {
public Map<String, String> getConfigSettings(String moduleName) {
return ModuleSettings.getConfigSettings(moduleName);
}
/**
* Sets all name/value configuration setting for a module. Names not in the list will have settings preserved.
/**
* Sets all name/value configuration setting for a module. Names not in the
* list will have settings preserved.
*
* @param moduleName moduleName identifier unique to that module
* @param settings settings to set and replace old settings, keeping settings not specified in the map.
*
* @param settings settings to set and replace old settings, keeping
* settings not specified in the map.
*
*/
public void setConfigSettings(String moduleName, Map<String,String>settings) {
public void setConfigSettings(String moduleName, Map<String, String> settings) {
ModuleSettings.setConfigSettings(moduleName, settings);
}
}

View File

@ -46,7 +46,7 @@ public class Installer extends ModuleInstall {
Logger logger = Logger.getLogger(Installer.class.getName());
logger.log(Level.INFO, "Initializing ingest manager");
final IngestManager manager = IngestManager.getDefault();
final IngestManager manager = IngestManager.getInstance();
WindowManager.getDefault().invokeWhenUIReady(new Runnable() {
@Override
public void run() {

View File

@ -22,7 +22,7 @@ package org.sleuthkit.autopsy.ingest;
* Implementation of the IngestModuleOptions interface for use by ingest modules
* that do not have per ingest job options.
*/
public final class NoIngestModuleSettings implements IngestModuleIngestJobSettings {
public final class NoIngestModuleIngestJobSettings implements IngestModuleIngestJobSettings {
private final String setting = "None";

View File

@ -37,19 +37,19 @@ import org.openide.util.NbBundle;
import org.sleuthkit.datamodel.Content;
/**
* Dialog box that allows ingest modules to be run on a data source. Used
* outside of the wizards.
* Dialog box that allows ingest modules to be run on a data source that has
* already been added to a case.
*/
public final class IngestDialog extends JDialog {
public final class RunIngestModulesDialog extends JDialog {
private static final String TITLE = NbBundle.getMessage(IngestDialog.class, "IngestDialog.title.text");
private static final String TITLE = NbBundle.getMessage(RunIngestModulesDialog.class, "IngestDialog.title.text");
private static Dimension DIMENSIONS = new Dimension(500, 300);
private List<Content> dataSources = new ArrayList<>();
private IngestJobLauncher ingestJobLauncher;
public IngestDialog(JFrame frame, String title, boolean modal) {
public RunIngestModulesDialog(JFrame frame, String title, boolean modal) {
super(frame, title, modal);
ingestJobLauncher = new IngestJobLauncher(IngestDialog.class.getCanonicalName());
ingestJobLauncher = new IngestJobLauncher(RunIngestModulesDialog.class.getCanonicalName());
List<String> messages = ingestJobLauncher.getIngestJobConfigWarnings();
if (messages.isEmpty() == false) {
StringBuilder warning = new StringBuilder();
@ -60,7 +60,7 @@ public final class IngestDialog extends JDialog {
}
}
public IngestDialog() {
public RunIngestModulesDialog() {
this(new JFrame(TITLE), TITLE, true);
}

View File

@ -91,7 +91,7 @@ import org.sleuthkit.datamodel.*;
// Check if ingest has finished
String ingestwarning = "";
if (IngestManager.getDefault().isIngestRunning()) {
if (IngestManager.getInstance().isIngestRunning()) {
ingestwarning = NbBundle.getMessage(this.getClass(), "ReportBodyFile.ingestWarning.text");
}

View File

@ -963,7 +963,7 @@ import org.sleuthkit.datamodel.TskData.TSK_DB_FILES_TYPE_ENUM;
StringBuilder summary = new StringBuilder();
boolean running = false;
if (IngestManager.getDefault().isIngestRunning() || IngestManager.getDefault().isIngestRunning()) {
if (IngestManager.getInstance().isIngestRunning()) {
running = true;
}

View File

@ -56,7 +56,7 @@ import org.sleuthkit.datamodel.TskData.TSK_DB_FILES_TYPE_ENUM;
public final class ExifParserFileIngestModule extends IngestModuleAdapter implements FileIngestModule {
private static final Logger logger = Logger.getLogger(ExifParserFileIngestModule.class.getName());
private final IngestServices services = IngestServices.getDefault();
private final IngestServices services = IngestServices.getInstance();
private int filesProcessed = 0;
private boolean filesToFire = false;

View File

@ -50,7 +50,7 @@ public class FileExtMismatchContextMenuActionsProvider implements ContextMenuAct
ArrayList<Action> actions = new ArrayList<>();
// Ignore if file ingest is in progress.
if (!IngestManager.getDefault().isIngestRunning()) {
if (!IngestManager.getInstance().isIngestRunning()) {
final Collection<? extends BlackboardArtifact> selectedArts = Utilities.actionsGlobalContext().lookupAll(BlackboardArtifact.class);

View File

@ -48,7 +48,7 @@ public class FileExtMismatchIngestModule extends IngestModuleAdapter implements
private static final Logger logger = Logger.getLogger(FileExtMismatchIngestModule.class.getName());
private static int messageId = 0; // RJCTODO: This is not thread safe
private final IngestServices services = IngestServices.getDefault();
private final IngestServices services = IngestServices.getInstance();
private final FileExtMismatchDetectorModuleSettings settings;
private HashMap<String, String[]> SigTypeToExtMap = new HashMap<>();
private long processTime = 0;

View File

@ -109,7 +109,7 @@ public class FileTypeIdIngestModule extends IngestModuleAdapter implements FileI
.append(NbBundle.getMessage(this.getClass(), "FileTypeIdIngestModule.complete.totalFiles"))
.append("</td><td>").append(numFiles).append("</td></tr>\n");
detailsSb.append("</table>");
IngestServices.getDefault().postMessage(IngestMessage.createMessage(++messageId, IngestMessage.MessageType.INFO, FileTypeIdModuleFactory.getModuleName(),
IngestServices.getInstance().postMessage(IngestMessage.createMessage(++messageId, IngestMessage.MessageType.INFO, FileTypeIdModuleFactory.getModuleName(),
NbBundle.getMessage(this.getClass(),
"FileTypeIdIngestModule.complete.srvMsg.text"),
detailsSb.toString()));

View File

@ -82,7 +82,7 @@ final class AddContentToHashDbAction extends AbstractAction implements Presenter
super(SINGLE_SELECTION_NAME);
// Disable the menu if file ingest is in progress.
if (IngestManager.getDefault().isIngestRunning()) {
if (IngestManager.getInstance().isIngestRunning()) {
setEnabled(false);
return;
}

View File

@ -48,7 +48,7 @@ public class HashDbIngestModule extends IngestModuleAdapter implements FileInges
private static final Logger logger = Logger.getLogger(HashDbIngestModule.class.getName());
private static final int MAX_COMMENT_SIZE = 500;
private static int messageId = 0; // RJCTODO: This is not thread safe
private final IngestServices services = IngestServices.getDefault();
private final IngestServices services = IngestServices.getInstance();
private final Hash hasher = new Hash();
private final SleuthkitCase skCase = Case.getCurrentCase().getSleuthkitCase();
private final HashDbManager hashDbManager = HashDbManager.getInstance();

View File

@ -345,7 +345,7 @@ public class HashDbManager implements PropertyChangeListener {
*/
public synchronized void removeHashDatabase(HashDb hashDb) throws HashDbManagerException {
// Don't remove a database if ingest is running
boolean ingestIsRunning = IngestManager.getDefault().isIngestRunning();
boolean ingestIsRunning = IngestManager.getInstance().isIngestRunning();
if (ingestIsRunning) {
throw new HashDbManagerException(NbBundle.getMessage(this.getClass(), "HashDbManager.ingestRunningExceptionMsg"));
}

View File

@ -55,7 +55,7 @@ import org.sleuthkit.autopsy.ingest.IngestManager;
* Check if ingest is currently running and refresh the panel accordingly.
*/
public void refresh() {
boolean running = IngestManager.getDefault().isIngestRunning();
boolean running = IngestManager.getInstance().isIngestRunning();
if(running) {
titleLabel.setForeground(Color.red);
titleLabel.setText(NbBundle.getMessage(this.getClass(), "HashDbSearchPanel.titleText.ingestOngoing"));

View File

@ -105,7 +105,7 @@ public final class HashLookupSettingsPanel extends IngestModuleGlobalSetttingsPa
}
private void updateComponentsForNoSelection() {
boolean ingestIsRunning = IngestManager.getDefault().isIngestRunning();
boolean ingestIsRunning = IngestManager.getInstance().isIngestRunning();
// Update descriptive labels.
hashDbNameLabel.setText(NO_SELECTION_TEXT);
@ -135,7 +135,7 @@ public final class HashLookupSettingsPanel extends IngestModuleGlobalSetttingsPa
}
private void updateComponentsForSelection(HashDb db) {
boolean ingestIsRunning = IngestManager.getDefault().isIngestRunning();
boolean ingestIsRunning = IngestManager.getInstance().isIngestRunning();
// Update descriptive labels.
hashDbNameLabel.setText(db.getHashSetName());

View File

@ -86,7 +86,7 @@ abstract class AbstractKeywordSearchPerformer extends javax.swing.JPanel impleme
@Override
public void search() {
boolean isIngestRunning = IngestManager.getDefault().isIngestRunning();
boolean isIngestRunning = IngestManager.getInstance().isIngestRunning();
if (filesIndexed == 0) {
if (isIngestRunning) {

View File

@ -124,7 +124,7 @@ class KeywordSearchEditListPanel extends javax.swing.JPanel implements ListSelec
pasteMenuItem.addActionListener(actList);
selectAllMenuItem.addActionListener(actList);
if (IngestManager.getDefault().isIngestRunning()) {
if (IngestManager.getInstance().isIngestRunning()) {
initIngest(0);
} else {
initIngest(1);

View File

@ -130,7 +130,7 @@ class KeywordSearchGlobalLanguageSettingsPanel extends javax.swing.JPanel implem
enableUTF8Checkbox.setSelected(utf8);
final boolean extractEnabled = utf16 || utf8;
boolean ingestNotRunning = !IngestManager.getDefault().isIngestRunning() && !IngestManager.getDefault().isIngestRunning();
boolean ingestNotRunning = !IngestManager.getInstance().isIngestRunning() && !IngestManager.getInstance().isIngestRunning();
//enable / disable checboxes
activateScriptsCheckboxes(extractEnabled && ingestNotRunning);
enableUTF16Checkbox.setEnabled(ingestNotRunning);

View File

@ -44,7 +44,7 @@ class KeywordSearchGlobalSearchSettingsPanel extends javax.swing.JPanel implemen
private void activateWidgets() {
skipNSRLCheckBox.setSelected(KeywordSearchSettings.getSkipKnown());
showSnippetsCB.setSelected(KeywordSearchSettings.getShowSnippets());
boolean enable = !IngestManager.getDefault().isIngestRunning();
boolean enable = !IngestManager.getInstance().isIngestRunning();
skipNSRLCheckBox.setEnabled(enable);
setTimeSettingEnabled(enable);

View File

@ -95,7 +95,7 @@ public final class KeywordSearchIngestModule extends IngestModuleAdapter impleme
}
};
private static final Logger logger = Logger.getLogger(KeywordSearchIngestModule.class.getName());
private IngestServices services = IngestServices.getDefault();
private IngestServices services = IngestServices.getInstance();
private Ingester ingester = null;
private volatile boolean commitIndex = false; //whether to commit index next time
private volatile boolean runSearcher = false; //whether to run searcher next time

View File

@ -114,7 +114,7 @@ class KeywordSearchListsViewerPanel extends AbstractKeywordSearchPerformer {
}
});
if (IngestManager.getDefault().isIngestRunning()) {
if (IngestManager.getInstance().isIngestRunning()) {
initIngest(true);
} else {
initIngest(false);

View File

@ -543,7 +543,7 @@ class KeywordSearchResultFactory extends ChildFactory<KeyValueQuery> {
});
if (!this.isCancelled() && !na.isEmpty()) {
IngestServices.getDefault().fireModuleDataEvent(new ModuleDataEvent(KeywordSearchModuleFactory.getModuleName(), ARTIFACT_TYPE.TSK_KEYWORD_HIT, na));
IngestServices.getInstance().fireModuleDataEvent(new ModuleDataEvent(KeywordSearchModuleFactory.getModuleName(), ARTIFACT_TYPE.TSK_KEYWORD_HIT, na));
}
}

View File

@ -126,7 +126,7 @@ class Chrome extends Extract {
continue;
}
File dbFile = new File(temps);
if (controller.isCancelled()) {
if (controller.isIngestJobCancelled()) {
dbFile.delete();
break;
}
@ -158,7 +158,7 @@ class Chrome extends Extract {
dbFile.delete();
}
IngestServices.getDefault().fireModuleDataEvent(new ModuleDataEvent(NbBundle.getMessage(this.getClass(), "Chrome.parentModuleName"),
IngestServices.getInstance().fireModuleDataEvent(new ModuleDataEvent(NbBundle.getMessage(this.getClass(), "Chrome.parentModuleName"),
BlackboardArtifact.ARTIFACT_TYPE.TSK_WEB_HISTORY));
}
@ -204,7 +204,7 @@ class Chrome extends Extract {
logger.log(Level.INFO, "{0}- Now getting Bookmarks from {1}", new Object[]{moduleName, temps});
File dbFile = new File(temps);
if (controller.isCancelled()) {
if (controller.isIngestJobCancelled()) {
dbFile.delete();
break;
}
@ -300,7 +300,7 @@ class Chrome extends Extract {
dbFile.delete();
}
IngestServices.getDefault().fireModuleDataEvent(new ModuleDataEvent(NbBundle.getMessage(this.getClass(), "Chrome.parentModuleName"), BlackboardArtifact.ARTIFACT_TYPE.TSK_WEB_BOOKMARK));
IngestServices.getInstance().fireModuleDataEvent(new ModuleDataEvent(NbBundle.getMessage(this.getClass(), "Chrome.parentModuleName"), BlackboardArtifact.ARTIFACT_TYPE.TSK_WEB_BOOKMARK));
}
/**
@ -344,7 +344,7 @@ class Chrome extends Extract {
continue;
}
File dbFile = new File(temps);
if (controller.isCancelled()) {
if (controller.isIngestJobCancelled()) {
dbFile.delete();
break;
}
@ -378,7 +378,7 @@ class Chrome extends Extract {
dbFile.delete();
}
IngestServices.getDefault().fireModuleDataEvent(new ModuleDataEvent(NbBundle.getMessage(this.getClass(), "Chrome.parentModuleName"), BlackboardArtifact.ARTIFACT_TYPE.TSK_WEB_COOKIE));
IngestServices.getInstance().fireModuleDataEvent(new ModuleDataEvent(NbBundle.getMessage(this.getClass(), "Chrome.parentModuleName"), BlackboardArtifact.ARTIFACT_TYPE.TSK_WEB_COOKIE));
}
/**
@ -420,7 +420,7 @@ class Chrome extends Extract {
continue;
}
File dbFile = new File(temps);
if (controller.isCancelled()) {
if (controller.isIngestJobCancelled()) {
dbFile.delete();
break;
}
@ -467,7 +467,7 @@ class Chrome extends Extract {
dbFile.delete();
}
IngestServices.getDefault().fireModuleDataEvent(new ModuleDataEvent(NbBundle.getMessage(this.getClass(), "Chrome.parentModuleName"),
IngestServices.getInstance().fireModuleDataEvent(new ModuleDataEvent(NbBundle.getMessage(this.getClass(), "Chrome.parentModuleName"),
BlackboardArtifact.ARTIFACT_TYPE.TSK_WEB_DOWNLOAD));
}
@ -511,7 +511,7 @@ class Chrome extends Extract {
continue;
}
File dbFile = new File(temps);
if (controller.isCancelled()) {
if (controller.isIngestJobCancelled()) {
dbFile.delete();
break;
}
@ -552,7 +552,7 @@ class Chrome extends Extract {
dbFile.delete();
}
IngestServices.getDefault().fireModuleDataEvent(new ModuleDataEvent(NbBundle.getMessage(this.getClass(), "Chrome.parentModuleName"), BlackboardArtifact.ARTIFACT_TYPE.TSK_WEB_HISTORY));
IngestServices.getInstance().fireModuleDataEvent(new ModuleDataEvent(NbBundle.getMessage(this.getClass(), "Chrome.parentModuleName"), BlackboardArtifact.ARTIFACT_TYPE.TSK_WEB_HISTORY));
}
private boolean isChromePreVersion30(String temps) {

View File

@ -60,7 +60,7 @@ import org.sleuthkit.datamodel.*;
*/
class ExtractIE extends Extract {
private static final Logger logger = Logger.getLogger(ExtractIE.class.getName());
private IngestServices services = IngestServices.getDefault();
private IngestServices services = IngestServices.getInstance();
private String moduleTempResultsDir;
private String PASCO_LIB_PATH;
private String JAVA_PATH;
@ -110,7 +110,7 @@ class ExtractIE extends Extract {
continue;
}
if (controller.isCancelled()) {
if (controller.isIngestJobCancelled()) {
break;
}
@ -202,7 +202,7 @@ class ExtractIE extends Extract {
dataFound = true;
for (AbstractFile cookiesFile : cookiesFiles) {
if (controller.isCancelled()) {
if (controller.isIngestJobCancelled()) {
break;
}
if (cookiesFile.getSize() == 0) {
@ -312,7 +312,7 @@ class ExtractIE extends Extract {
//indexFileName = "index" + Long.toString(bbart.getArtifactID()) + ".dat";
temps = RAImageIngestModule.getRATempPath(currentCase, "IE") + File.separator + indexFileName;
File datFile = new File(temps);
if (controller.isCancelled()) {
if (controller.isIngestJobCancelled()) {
break;
}
try {

View File

@ -171,7 +171,7 @@ class ExtractRegistry extends Extract {
continue;
}
if (controller.isCancelled()) {
if (controller.isIngestJobCancelled()) {
break;
}
@ -187,7 +187,7 @@ class ExtractRegistry extends Extract {
logger.log(Level.INFO, moduleName + "- Now getting registry information from " + regFileNameLocal);
RegOutputFiles regOutputFiles = executeRegRip(regFileNameLocal, outputPathBase);
if (controller.isCancelled()) {
if (controller.isIngestJobCancelled()) {
break;
}

View File

@ -58,7 +58,7 @@ class Firefox extends Extract {
private static final String bookmarkQuery = "SELECT fk, moz_bookmarks.title, url, (moz_bookmarks.dateAdded/1000000) as dateAdded FROM moz_bookmarks INNER JOIN moz_places ON moz_bookmarks.fk=moz_places.id";
private static final String downloadQuery = "SELECT target, source,(startTime/1000000) as startTime, maxBytes FROM moz_downloads";
private static final String downloadQueryVersion24 = "SELECT url, content as target, (lastModified/1000000) as lastModified FROM moz_places, moz_annos WHERE moz_places.id = moz_annos.place_id AND moz_annos.anno_attribute_id = 3";
private final IngestServices services = IngestServices.getDefault();
private final IngestServices services = IngestServices.getInstance();
Firefox() {
moduleName = NbBundle.getMessage(Firefox.class, "Firefox.moduleName");
@ -111,7 +111,7 @@ class Firefox extends Extract {
continue;
}
File dbFile = new File(temps);
if (controller.isCancelled()) {
if (controller.isIngestJobCancelled()) {
dbFile.delete();
break;
}
@ -195,7 +195,7 @@ class Firefox extends Extract {
continue;
}
File dbFile = new File(temps);
if (controller.isCancelled()) {
if (controller.isIngestJobCancelled()) {
dbFile.delete();
break;
}
@ -278,7 +278,7 @@ class Firefox extends Extract {
continue;
}
File dbFile = new File(temps);
if (controller.isCancelled()) {
if (controller.isIngestJobCancelled()) {
dbFile.delete();
break;
}
@ -392,7 +392,7 @@ class Firefox extends Extract {
continue;
}
File dbFile = new File(temps);
if (controller.isCancelled()) {
if (controller.isIngestJobCancelled()) {
dbFile.delete();
break;
}
@ -504,7 +504,7 @@ class Firefox extends Extract {
continue;
}
File dbFile = new File(temps);
if (controller.isCancelled()) {
if (controller.isIngestJobCancelled()) {
dbFile.delete();
break;
}

View File

@ -48,7 +48,7 @@ public final class RAImageIngestModule extends IngestModuleAdapter implements Da
private static int messageId = 0;
private final List<Extract> extracters = new ArrayList<>();
private final List<Extract> browserExtracters = new ArrayList<>();
private IngestServices services = IngestServices.getDefault();
private IngestServices services = IngestServices.getInstance();
private StringBuilder subCompleted = new StringBuilder();
RAImageIngestModule() {
@ -93,7 +93,7 @@ public final class RAImageIngestModule extends IngestModuleAdapter implements Da
for (int i = 0; i < extracters.size(); i++) {
Extract extracter = extracters.get(i);
if (controller.isCancelled()) {
if (controller.isIngestJobCancelled()) {
logger.log(Level.INFO, "Recent Activity has been canceled, quitting before {0}", extracter.getName());
break;
}

View File

@ -48,7 +48,7 @@ import org.sleuthkit.datamodel.*;
*/
class RecentDocumentsByLnk extends Extract {
private static final Logger logger = Logger.getLogger(RecentDocumentsByLnk.class.getName());
private IngestServices services = IngestServices.getDefault();
private IngestServices services = IngestServices.getInstance();
/**
* Find the documents that Windows stores about recent documents and make artifacts.
@ -76,7 +76,7 @@ class RecentDocumentsByLnk extends Extract {
dataFound = true;
for (AbstractFile recentFile : recentFiles) {
if (controller.isCancelled()) {
if (controller.isIngestJobCancelled()) {
break;
}

View File

@ -255,7 +255,7 @@ class SearchEngineURLQueryAnalyzer extends Extract {
Collection<BlackboardAttribute> listAttributes = currentCase.getSleuthkitCase().getMatchingAttributes("Where `artifact_id` = " + artifact.getArtifactID());
getAttributes:
for (BlackboardAttribute attribute : listAttributes) {
if (controller.isCancelled()) {
if (controller.isIngestJobCancelled()) {
break getAll; //User cancled the process.
}
if (attribute.getAttributeTypeID() == BlackboardAttribute.ATTRIBUTE_TYPE.TSK_URL.getTypeID()) {
@ -292,10 +292,10 @@ class SearchEngineURLQueryAnalyzer extends Extract {
} catch (TskException e) {
logger.log(Level.SEVERE, "Encountered error retrieving artifacts for search engine queries", e);
} finally {
if (controller.isCancelled()) {
if (controller.isIngestJobCancelled()) {
logger.info("Operation terminated by user.");
}
IngestServices.getDefault().fireModuleDataEvent(new ModuleDataEvent(
IngestServices.getInstance().fireModuleDataEvent(new ModuleDataEvent(
NbBundle.getMessage(this.getClass(), "SearchEngineURLQueryAnalyzer.parentModuleName.noSpace"),
BlackboardArtifact.ARTIFACT_TYPE.TSK_WEB_SEARCH_QUERY));
logger.info("Extracted " + totalQueries + " queries from the blackboard");

View File

@ -201,7 +201,7 @@ class ScalpelCarverIngestModule extends IngestModuleAdapter implements FileInges
}
// get the IngestServices object
IngestServices is = IngestServices.getDefault();
IngestServices is = IngestServices.getInstance();
// get the parent directory of the carved files
Content carvedFileDir = null;
@ -221,7 +221,7 @@ class ScalpelCarverIngestModule extends IngestModuleAdapter implements FileInges
}
// reschedule carved files
context.addFilesToPipeline(new ArrayList<AbstractFile>(carvedFiles));
context.addFiles(new ArrayList<AbstractFile>(carvedFiles));
return ProcessResult.OK;
}

View File

@ -68,7 +68,7 @@ import org.sleuthkit.autopsy.ingest.ModuleDataEvent;
public final class SevenZipIngestModule extends IngestModuleAdapter implements FileIngestModule {
private static final Logger logger = Logger.getLogger(SevenZipIngestModule.class.getName());
private IngestServices services = IngestServices.getDefault();
private IngestServices services = IngestServices.getInstance();
private volatile int messageID = 0; // RJCTODO: This is not actually thread safe
static final String[] SUPPORTED_EXTENSIONS = {"zip", "rar", "arj", "7z", "7zip", "gzip", "gz", "bzip2", "tar", "tgz",}; // "iso"};
private String unpackDir; //relative to the case, to store in db
@ -174,7 +174,7 @@ public final class SevenZipIngestModule extends IngestModuleAdapter implements F
List<AbstractFile> unpackedFiles = unpack(abstractFile);
if (!unpackedFiles.isEmpty()) {
sendNewFilesEvent(abstractFile, unpackedFiles);
context.addFilesToPipeline(unpackedFiles);
context.addFiles(unpackedFiles);
}
return ProcessResult.OK;

View File

@ -1164,7 +1164,7 @@ public class Timeline extends CallableSystemAction implements Presenter.Toolbar,
logger.log(Level.INFO, "Error creating timeline, there are no data sources. ");
} else {
if (IngestManager.getDefault().isIngestRunning()) {
if (IngestManager.getInstance().isIngestRunning()) {
int answer = JOptionPane.showConfirmDialog(new JFrame(),
NbBundle.getMessage(this.getClass(),
"Timeline.initTimeline.confDlg.genBeforeIngest.msg"),

View File

@ -45,7 +45,7 @@ public class EwfVerifyIngestModule extends IngestModuleAdapter implements DataSo
private static final Logger logger = Logger.getLogger(EwfVerifyIngestModule.class.getName());
private static final long DEFAULT_CHUNK_SIZE = 32 * 1024;
private static final IngestServices services = IngestServices.getDefault();
private static final IngestServices services = IngestServices.getInstance();
private Image img;
private String imgName;
private MessageDigest messageDigest;
@ -146,7 +146,7 @@ public class EwfVerifyIngestModule extends IngestModuleAdapter implements DataSo
// Read in byte size chunks and update the hash value with the data.
for (int i = 0; i < totalChunks; i++) {
if (statusHelper.isCancelled()) {
if (statusHelper.isIngestJobCancelled()) {
return ProcessResult.OK;
}
data = new byte[(int) chunkSize];

View File

@ -53,7 +53,7 @@ import org.sleuthkit.datamodel.TskException;
public final class ThunderbirdMboxFileIngestModule extends IngestModuleAdapter implements FileIngestModule {
private static final Logger logger = Logger.getLogger(ThunderbirdMboxFileIngestModule.class.getName());
private IngestServices services = IngestServices.getDefault();
private IngestServices services = IngestServices.getInstance();
private int messageId = 0; // RJCTODO: Not thread safe
private FileManager fileManager;
private IngestJobContext context;
@ -291,7 +291,7 @@ public final class ThunderbirdMboxFileIngestModule extends IngestModuleAdapter i
services.fireModuleContentEvent(new ModuleContentEvent(derived));
}
}
context.addFilesToPipeline(derivedFiles);
context.addFiles(derivedFiles);
services.fireModuleDataEvent(new ModuleDataEvent(EmailParserModuleFactory.getModuleName(), BlackboardArtifact.ARTIFACT_TYPE.TSK_EMAIL_MSG));
}