From c78462d6a4a963e7590b49b900c27b52700bbec3 Mon Sep 17 00:00:00 2001 From: adam-m Date: Wed, 29 Aug 2012 16:46:34 -0400 Subject: [PATCH] Ingests API changes. Rename "service" to "module" --- .../DirectoryTreeTopComponent.java | 4 +- ...e.java => ExifParserFileIngestModule.java} | 40 +- .../sleuthkit/autopsy/exifparser/layer.xml | 8 +- ...stService.java => HashDbIngestModule.java} | 38 +- .../sleuthkit/autopsy/hashdatabase/layer.xml | 6 +- .../autopsy/ingest/Bundle.properties | 6 +- .../autopsy/ingest/IngestDialogPanel.form | 17 +- .../autopsy/ingest/IngestDialogPanel.java | 130 +++-- .../autopsy/ingest/IngestImageThread.java | 10 +- .../autopsy/ingest/IngestManager.java | 456 +++++++++--------- .../autopsy/ingest/IngestManagerProxy.java | 40 +- .../autopsy/ingest/IngestMessage.java | 30 +- .../autopsy/ingest/IngestMessagePanel.java | 36 +- ...bstract.java => IngestModuleAbstract.java} | 44 +- ...ile.java => IngestModuleAbstractFile.java} | 6 +- ...rviceImage.java => IngestModuleImage.java} | 16 +- ...iceDataEvent.java => ModuleDataEvent.java} | 8 +- ...a => ExampleAbstractFileIngestModule.java} | 36 +- ...ice.java => ExampleImageIngestModule.java} | 18 +- .../org/sleuthkit/autopsy/ingest/layer.xml | 14 +- .../AbstractFileHtmlExtract.java | 6 +- .../AbstractFileStringExtract.java | 6 +- .../AbstractFileTikaTextExtract.java | 10 +- .../AbstractKeywordSearchPerformer.java | 4 +- .../KeywordSearchConfigurationPanel2.java | 8 +- .../KeywordSearchConfigurationPanel3.java | 6 +- .../KeywordSearchEditListPanel.java | 10 +- ...ce.java => KeywordSearchIngestModule.java} | 50 +- .../KeywordSearchIngestSimplePanel.java | 2 +- .../KeywordSearchListsViewerPanel.java | 12 +- .../KeywordSearchResultFactory.java | 4 +- .../autopsy/keywordsearch/LuceneQuery.java | 2 +- .../keywordsearch/TermComponentQuery.java | 2 +- .../sleuthkit/autopsy/keywordsearch/layer.xml | 6 +- .../autopsy/recentactivity/Chrome.java | 20 +- .../autopsy/recentactivity/Extract.java | 4 +- .../autopsy/recentactivity/ExtractIE.java | 18 +- .../recentactivity/ExtractRegistry.java | 8 +- .../autopsy/recentactivity/Firefox.java | 18 +- ...tService.java => RAImageIngestModule.java} | 26 +- .../SearchEngineURLQueryAnalyzer.java | 12 +- .../autopsy/recentactivity/layer.xml | 6 +- .../sleuthkit/autopsy/report/ReportHTML.java | 2 +- .../autopsy/testing/RegressionTest.java | 2 +- .../ThunderbirdEmailParser.java | 2 +- ...a => ThunderbirdMboxFileIngestModule.java} | 52 +- .../autopsy/thunderbirdparser/layer.xml | 6 +- 47 files changed, 628 insertions(+), 639 deletions(-) rename ExifParser/src/org/sleuthkit/autopsy/exifparser/{ExifParserFileIngestService.java => ExifParserFileIngestModule.java} (86%) rename HashDatabase/src/org/sleuthkit/autopsy/hashdatabase/{HashDbIngestService.java => HashDbIngestModule.java} (91%) rename Ingest/src/org/sleuthkit/autopsy/ingest/{IngestServiceAbstract.java => IngestModuleAbstract.java} (78%) rename Ingest/src/org/sleuthkit/autopsy/ingest/{IngestServiceAbstractFile.java => IngestModuleAbstractFile.java} (87%) rename Ingest/src/org/sleuthkit/autopsy/ingest/{IngestServiceImage.java => IngestModuleImage.java} (72%) rename Ingest/src/org/sleuthkit/autopsy/ingest/{ServiceDataEvent.java => ModuleDataEvent.java} (89%) rename Ingest/src/org/sleuthkit/autopsy/ingest/example/{ExampleAbstractFileIngestService.java => ExampleAbstractFileIngestModule.java} (74%) rename Ingest/src/org/sleuthkit/autopsy/ingest/example/{ExampleImageIngestService.java => ExampleImageIngestModule.java} (90%) rename KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/{KeywordSearchIngestService.java => KeywordSearchIngestModule.java} (96%) rename RecentActivity/src/org/sleuthkit/autopsy/recentactivity/{RAImageIngestService.java => RAImageIngestModule.java} (89%) rename thunderbirdparser/src/org/sleuthkit/autopsy/thunderbirdparser/{ThunderbirdMboxFileIngestService.java => ThunderbirdMboxFileIngestModule.java} (85%) diff --git a/DirectoryTree/src/org/sleuthkit/autopsy/directorytree/DirectoryTreeTopComponent.java b/DirectoryTree/src/org/sleuthkit/autopsy/directorytree/DirectoryTreeTopComponent.java index 398a85ae26..48c71eb89c 100644 --- a/DirectoryTree/src/org/sleuthkit/autopsy/directorytree/DirectoryTreeTopComponent.java +++ b/DirectoryTree/src/org/sleuthkit/autopsy/directorytree/DirectoryTreeTopComponent.java @@ -64,7 +64,7 @@ import org.sleuthkit.autopsy.datamodel.Views; import org.sleuthkit.autopsy.datamodel.ViewsNode; import org.sleuthkit.autopsy.ingest.IngestManager; import org.sleuthkit.autopsy.ingest.IngestManager.IngestModuleEvent; -import org.sleuthkit.autopsy.ingest.ServiceDataEvent; +import org.sleuthkit.autopsy.ingest.ModuleDataEvent; import org.sleuthkit.datamodel.BlackboardArtifact; import org.sleuthkit.datamodel.BlackboardAttribute; import org.sleuthkit.datamodel.Content; @@ -685,7 +685,7 @@ public final class DirectoryTreeTopComponent extends TopComponent implements Dat } if (changed.equals(IngestModuleEvent.DATA.toString())) { - final ServiceDataEvent event = (ServiceDataEvent) oldValue; + final ModuleDataEvent event = (ModuleDataEvent) oldValue; SwingUtilities.invokeLater(new Runnable() { @Override public void run() { diff --git a/ExifParser/src/org/sleuthkit/autopsy/exifparser/ExifParserFileIngestService.java b/ExifParser/src/org/sleuthkit/autopsy/exifparser/ExifParserFileIngestModule.java similarity index 86% rename from ExifParser/src/org/sleuthkit/autopsy/exifparser/ExifParserFileIngestService.java rename to ExifParser/src/org/sleuthkit/autopsy/exifparser/ExifParserFileIngestModule.java index 7df81dabee..c224f00aa4 100644 --- a/ExifParser/src/org/sleuthkit/autopsy/exifparser/ExifParserFileIngestService.java +++ b/ExifParser/src/org/sleuthkit/autopsy/exifparser/ExifParserFileIngestModule.java @@ -35,8 +35,8 @@ import java.util.logging.Logger; import org.sleuthkit.autopsy.ingest.IngestManagerProxy; import org.sleuthkit.autopsy.ingest.IngestMessage; import org.sleuthkit.autopsy.ingest.IngestMessage.MessageType; -import org.sleuthkit.autopsy.ingest.IngestServiceAbstract; -import org.sleuthkit.autopsy.ingest.IngestServiceAbstractFile; +import org.sleuthkit.autopsy.ingest.IngestModuleAbstract; +import org.sleuthkit.autopsy.ingest.IngestModuleAbstractFile; import org.sleuthkit.datamodel.AbstractFile; import org.sleuthkit.datamodel.BlackboardArtifact; import org.sleuthkit.datamodel.BlackboardAttribute; @@ -51,29 +51,29 @@ import org.sleuthkit.datamodel.TskData.TSK_DB_FILES_TYPE_ENUM; * Ingests an image file and, if available, adds it's date, latitude, longitude, * altitude, device model, and device make to a blackboard artifact. */ -public final class ExifParserFileIngestService implements IngestServiceAbstractFile { +public final class ExifParserFileIngestModule implements IngestModuleAbstractFile { final String MODULE_NAME = "Exif Parser"; - private static final Logger logger = Logger.getLogger(ExifParserFileIngestService.class.getName()); - private static ExifParserFileIngestService defaultInstance = null; + private static final Logger logger = Logger.getLogger(ExifParserFileIngestModule.class.getName()); + private static ExifParserFileIngestModule defaultInstance = null; private IngestManagerProxy managerProxy; private static int messageId = 0; - //file ingest services require a private constructor + //file ingest modules require a private constructor //to ensure singleton instances - private ExifParserFileIngestService() { + private ExifParserFileIngestModule() { } - //default instance used for service registration - public static synchronized ExifParserFileIngestService getDefault() { + //default instance used for module registration + public static synchronized ExifParserFileIngestModule getDefault() { if (defaultInstance == null) { - defaultInstance = new ExifParserFileIngestService(); + defaultInstance = new ExifParserFileIngestModule(); } return defaultInstance; } @Override - public IngestServiceAbstractFile.ProcessResult process(AbstractFile content) { + public IngestModuleAbstractFile.ProcessResult process(AbstractFile content) { if(content.getType().equals(TSK_DB_FILES_TYPE_ENUM.FS)) { FsContent fsContent = (FsContent) content; if(fsContent.isFile()) { @@ -83,10 +83,10 @@ public final class ExifParserFileIngestService implements IngestServiceAbstractF } } - return IngestServiceAbstractFile.ProcessResult.UNKNOWN; + return IngestModuleAbstractFile.ProcessResult.UNKNOWN; } - public IngestServiceAbstractFile.ProcessResult processFile(FsContent f) { + public IngestModuleAbstractFile.ProcessResult processFile(FsContent f) { InputStream in = null; BufferedInputStream bin = null; @@ -144,10 +144,10 @@ public final class ExifParserFileIngestService implements IngestServiceAbstractF bba.addAttributes(attributes); } - return IngestServiceAbstractFile.ProcessResult.OK; + return IngestModuleAbstractFile.ProcessResult.OK; } catch (TskCoreException ex) { - Logger.getLogger(ExifParserFileIngestService.class.getName()).log(Level.SEVERE, null, ex); + Logger.getLogger(ExifParserFileIngestModule.class.getName()).log(Level.SEVERE, null, ex); } catch (ImageProcessingException ex) { logger.log(Level.WARNING, "Failed to process the image.", ex); } catch (IOException ex) { @@ -162,7 +162,7 @@ public final class ExifParserFileIngestService implements IngestServiceAbstractF } // If we got here, there was an error - return IngestServiceAbstractFile.ProcessResult.ERROR; + return IngestModuleAbstractFile.ProcessResult.ERROR; } private boolean parsableFormat(FsContent f) { @@ -187,7 +187,7 @@ public final class ExifParserFileIngestService implements IngestServiceAbstractF final IngestMessage msg = IngestMessage.createMessage(++messageId, MessageType.INFO, this, "Complete"); managerProxy.postMessage(msg); - //service specific cleanup due to completion here + //module specific cleanup due to completion here } @Override @@ -212,12 +212,12 @@ public final class ExifParserFileIngestService implements IngestServiceAbstractF logger.log(Level.INFO, "stop()"); managerProxy.postMessage(IngestMessage.createMessage(++messageId, MessageType.INFO, this, "Stopped")); - //service specific cleanup due to interruption here + //module specific cleanup due to interruption here } @Override - public IngestServiceAbstract.ServiceType getType() { - return IngestServiceAbstract.ServiceType.AbstractFile; + public IngestModuleAbstract.ModuleType getType() { + return IngestModuleAbstract.ModuleType.AbstractFile; } @Override diff --git a/ExifParser/src/org/sleuthkit/autopsy/exifparser/layer.xml b/ExifParser/src/org/sleuthkit/autopsy/exifparser/layer.xml index 67b03b3564..c8fa4fd8aa 100644 --- a/ExifParser/src/org/sleuthkit/autopsy/exifparser/layer.xml +++ b/ExifParser/src/org/sleuthkit/autopsy/exifparser/layer.xml @@ -2,10 +2,10 @@ - - - + + + - \ No newline at end of file + diff --git a/HashDatabase/src/org/sleuthkit/autopsy/hashdatabase/HashDbIngestService.java b/HashDatabase/src/org/sleuthkit/autopsy/hashdatabase/HashDbIngestModule.java similarity index 91% rename from HashDatabase/src/org/sleuthkit/autopsy/hashdatabase/HashDbIngestService.java rename to HashDatabase/src/org/sleuthkit/autopsy/hashdatabase/HashDbIngestModule.java index 9520015a94..83818159f8 100644 --- a/HashDatabase/src/org/sleuthkit/autopsy/hashdatabase/HashDbIngestService.java +++ b/HashDatabase/src/org/sleuthkit/autopsy/hashdatabase/HashDbIngestModule.java @@ -28,8 +28,8 @@ import org.sleuthkit.autopsy.casemodule.Case; import org.sleuthkit.autopsy.ingest.IngestManager; import org.sleuthkit.autopsy.ingest.IngestManagerProxy; import org.sleuthkit.autopsy.ingest.IngestMessage; -import org.sleuthkit.autopsy.ingest.IngestServiceAbstractFile; -import org.sleuthkit.autopsy.ingest.ServiceDataEvent; +import org.sleuthkit.autopsy.ingest.IngestModuleAbstractFile; +import org.sleuthkit.autopsy.ingest.ModuleDataEvent; import org.sleuthkit.datamodel.BlackboardArtifact; import org.sleuthkit.datamodel.BlackboardArtifact.ARTIFACT_TYPE; import org.sleuthkit.datamodel.BlackboardAttribute; @@ -44,12 +44,12 @@ import org.sleuthkit.datamodel.SleuthkitCase; import org.sleuthkit.datamodel.TskData; import org.sleuthkit.datamodel.TskException; -public class HashDbIngestService implements IngestServiceAbstractFile { +public class HashDbIngestModule implements IngestModuleAbstractFile { - private static HashDbIngestService instance = null; + private static HashDbIngestModule instance = null; public final static String MODULE_NAME = "Hash Lookup"; public final static String MODULE_DESCRIPTION = "Identifies known and notables files using supplied hash databases, such as a standard NSRL database."; - private static final Logger logger = Logger.getLogger(HashDbIngestService.class.getName()); + private static final Logger logger = Logger.getLogger(HashDbIngestModule.class.getName()); private Processor processor = new Processor(); private IngestManagerProxy managerProxy; private SleuthkitCase skCase; @@ -66,20 +66,20 @@ public class HashDbIngestService implements IngestServiceAbstractFile { private Map knownBadSets = new HashMap(); - private HashDbIngestService() { + private HashDbIngestModule() { count = 0; } - public static synchronized HashDbIngestService getDefault() { + public static synchronized HashDbIngestModule getDefault() { if (instance == null) { - instance = new HashDbIngestService(); + instance = new HashDbIngestModule(); } return instance; } /** * notification from manager that brand new processing should be initiated. - * Service loads its configuration and performs initialization + * Module loads its configuration and performs initialization * * @param managerProxy handle to the manager to postMessage() to */ @@ -129,7 +129,7 @@ public class HashDbIngestService implements IngestServiceAbstractFile { /** * notification from manager that there is no more content to process and all work is done. - * Service performs any clean-up, notifies viewers and may also write results to the black-board + * Module performs any clean-up, notifies viewers and may also write results to the black-board */ @Override public void complete() { @@ -173,9 +173,9 @@ public class HashDbIngestService implements IngestServiceAbstractFile { } /** - * get specific name of the service - * should be unique across services, a user-friendly name of the service shown in GUI - * @return The name of this Ingest Service + * get specific name of the module + * should be unique across modules, a user-friendly name of the module shown in GUI + * @return The name of this Ingest Module */ @Override public String getName() { @@ -199,8 +199,8 @@ public class HashDbIngestService implements IngestServiceAbstractFile { } @Override - public ServiceType getType() { - return ServiceType.AbstractFile; + public ModuleType getType() { + return ModuleType.AbstractFile; } @Override @@ -272,7 +272,7 @@ public class HashDbIngestService implements IngestServiceAbstractFile { abstractFile.getName() + md5Hash, badFile)); } - IngestManagerProxy.fireServiceDataEvent(new ServiceDataEvent(MODULE_NAME, ARTIFACT_TYPE.TSK_HASHSET_HIT, Collections.singletonList(badFile))); + IngestManagerProxy.fireModuleDataEvent(new ModuleDataEvent(MODULE_NAME, ARTIFACT_TYPE.TSK_HASHSET_HIT, Collections.singletonList(badFile))); } catch (TskException ex) { logger.log(Level.WARNING, "Error creating blackboard artifact", ex); } @@ -332,12 +332,12 @@ public class HashDbIngestService implements IngestServiceAbstractFile { } } catch (TskException ex) { logger.log(Level.WARNING, "Couldn't analyze file " + name + " - see sleuthkit log for details", ex); - managerProxy.postMessage(IngestMessage.createErrorMessage(++messageId, HashDbIngestService.this, "Hash Lookup Error: " + name, + managerProxy.postMessage(IngestMessage.createErrorMessage(++messageId, HashDbIngestModule.this, "Hash Lookup Error: " + name, "Error encountered while updating the hash values for " + name + ".")); ret = ProcessResult.ERROR; } catch (IOException ex) { logger.log(Level.WARNING, "Error reading file " + name, ex); - managerProxy.postMessage(IngestMessage.createErrorMessage(++messageId, HashDbIngestService.this, "Read Error: " + name, + managerProxy.postMessage(IngestMessage.createErrorMessage(++messageId, HashDbIngestModule.this, "Read Error: " + name, "Error encountered while calculating the hash value for " + name + ".")); ret = ProcessResult.ERROR; } @@ -354,7 +354,7 @@ public class HashDbIngestService implements IngestServiceAbstractFile { } catch (IOException ex) { logger.log(Level.WARNING, "Error reading file " + name, ex); - managerProxy.postMessage(IngestMessage.createErrorMessage(++messageId, HashDbIngestService.this, "Read Error: " + name, + managerProxy.postMessage(IngestMessage.createErrorMessage(++messageId, HashDbIngestModule.this, "Read Error: " + name, "Error encountered while calculating the hash value for " + name + " without databases.")); } } diff --git a/HashDatabase/src/org/sleuthkit/autopsy/hashdatabase/layer.xml b/HashDatabase/src/org/sleuthkit/autopsy/hashdatabase/layer.xml index bb8f30f38c..28e9ac47ff 100644 --- a/HashDatabase/src/org/sleuthkit/autopsy/hashdatabase/layer.xml +++ b/HashDatabase/src/org/sleuthkit/autopsy/hashdatabase/layer.xml @@ -40,9 +40,9 @@ - - - + + + diff --git a/Ingest/src/org/sleuthkit/autopsy/ingest/Bundle.properties b/Ingest/src/org/sleuthkit/autopsy/ingest/Bundle.properties index 99d6f07eec..28d381ebd3 100644 --- a/Ingest/src/org/sleuthkit/autopsy/ingest/Bundle.properties +++ b/Ingest/src/org/sleuthkit/autopsy/ingest/Bundle.properties @@ -7,14 +7,14 @@ HINT_IngestTopComponent=Ingest window OpenIDE-Module-Name=Ingest IngestTopComponent.messageFrame.title=Messages IngestTopComponent.ingestProgressLabel.text=File Ingest Progress -IngestControlPanel.topLable.text=Image ingest services +IngestControlPanel.topLable.text=Image ingest modules IngestControlPanel.startButton.text=Start -IngestDialogPanel.ingestServicesLabel.text=Image Ingest Services +IngestDialogPanel.ingestServicesLabel.text=Image Ingest Modules IngestDialogForm2.okButton.text=OK IngestDialogForm2.cancelButton.text=Cancel IngestDialogForm.cancelButton.text=Cancel IngestDialogForm.startButton.text=Start -IngestDialogForm.jLabel1.text=Ingest Services +IngestDialogForm.jLabel1.text=Ingest Modules IngestTopComponent.refreshFreqLabel.text=Refresh frequency IngestMessageDetailsPanel.backButton.text= IngestMessageDetailsPanel.viewArtifactButton.text=Go to Result diff --git a/Ingest/src/org/sleuthkit/autopsy/ingest/IngestDialogPanel.form b/Ingest/src/org/sleuthkit/autopsy/ingest/IngestDialogPanel.form index c66e78dca8..6c04f5dc84 100644 --- a/Ingest/src/org/sleuthkit/autopsy/ingest/IngestDialogPanel.form +++ b/Ingest/src/org/sleuthkit/autopsy/ingest/IngestDialogPanel.form @@ -74,7 +74,7 @@ - + @@ -180,17 +180,10 @@ - - - - - - - - - - - + + + + diff --git a/Ingest/src/org/sleuthkit/autopsy/ingest/IngestDialogPanel.java b/Ingest/src/org/sleuthkit/autopsy/ingest/IngestDialogPanel.java index e5440189aa..e19441eb53 100644 --- a/Ingest/src/org/sleuthkit/autopsy/ingest/IngestDialogPanel.java +++ b/Ingest/src/org/sleuthkit/autopsy/ingest/IngestDialogPanel.java @@ -44,15 +44,15 @@ import org.sleuthkit.autopsy.ingest.IngestManager.UpdateFrequency; import org.sleuthkit.datamodel.Image; /** - * main configuration panel for all ingest services, reusable JPanel component + * main configuration panel for all ingest modules, reusable JPanel component */ public class IngestDialogPanel extends javax.swing.JPanel implements IngestConfigurator { private IngestManager manager = null; - private List services; - private IngestServiceAbstract currentService; - private Map serviceStates; - private ServicesTableModel tableModel; + private List modules; + private IngestModuleAbstract currentModule; + private Map moduleStates; + private ModulesTableModel tableModel; private static final Logger logger = Logger.getLogger(IngestDialogPanel.class.getName()); // The image that's just been added to the database private Image image; @@ -60,9 +60,9 @@ public class IngestDialogPanel extends javax.swing.JPanel implements IngestConfi /** Creates new form IngestDialogPanel */ private IngestDialogPanel() { - tableModel = new ServicesTableModel(); - services = new ArrayList(); - serviceStates = new HashMap(); + tableModel = new ModulesTableModel(); + modules = new ArrayList(); + moduleStates = new HashMap(); initComponents(); customizeComponents(); } @@ -75,14 +75,14 @@ public class IngestDialogPanel extends javax.swing.JPanel implements IngestConfi } private void customizeComponents() { - servicesTable.setModel(tableModel); + modulesTable.setModel(tableModel); this.manager = IngestManager.getDefault(); - Collection imageServices = IngestManager.enumerateImageServices(); - for (final IngestServiceImage service : imageServices) { + Collection imageServices = IngestManager.enumerateImageModules(); + for (final IngestModuleImage service : imageServices) { addService(service); } - Collection fsServices = IngestManager.enumerateAbstractFileServices(); - for (final IngestServiceAbstractFile service : fsServices) { + Collection fsServices = IngestManager.enumerateAbstractFileModules(); + for (final IngestModuleAbstractFile service : fsServices) { addService(service); } @@ -113,17 +113,17 @@ public class IngestDialogPanel extends javax.swing.JPanel implements IngestConfi // } - servicesTable.setTableHeader(null); - servicesTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); + modulesTable.setTableHeader(null); + modulesTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); //custom renderer for tooltips - ServiceTableRenderer renderer = new ServiceTableRenderer(); + ModulesTableRenderer renderer = new ModulesTableRenderer(); //customize column witdhs final int width = servicesScrollPane.getPreferredSize().width; TableColumn column = null; - for (int i = 0; i < servicesTable.getColumnCount(); i++) { - column = servicesTable.getColumnModel().getColumn(i); + for (int i = 0; i < modulesTable.getColumnCount(); i++) { + column = modulesTable.getColumnModel().getColumn(i); if (i == 0) { column.setPreferredWidth(((int) (width * 0.15))); } else { @@ -132,7 +132,7 @@ public class IngestDialogPanel extends javax.swing.JPanel implements IngestConfi } } - servicesTable.getSelectionModel().addListSelectionListener(new ListSelectionListener() { + modulesTable.getSelectionModel().addListSelectionListener(new ListSelectionListener() { @Override public void valueChanged(ListSelectionEvent e) { @@ -140,11 +140,11 @@ public class IngestDialogPanel extends javax.swing.JPanel implements IngestConfi if (!listSelectionModel.isSelectionEmpty()) { save(); int index = listSelectionModel.getMinSelectionIndex(); - currentService = services.get(index); + currentModule = modules.get(index); reloadSimpleConfiguration(); - advancedButton.setEnabled(currentService.hasAdvancedConfiguration()); + advancedButton.setEnabled(currentModule.hasAdvancedConfiguration()); } else { - currentService = null; + currentModule = null; } } }); @@ -176,10 +176,10 @@ public class IngestDialogPanel extends javax.swing.JPanel implements IngestConfi } } - private void addService(IngestServiceAbstract service) { + private void addService(IngestModuleAbstract service) { final String serviceName = service.getName(); - services.add(service); - serviceStates.put(serviceName, true); + modules.add(service); + moduleStates.put(serviceName, true); } /** This method is called from within the constructor to @@ -193,7 +193,7 @@ public class IngestDialogPanel extends javax.swing.JPanel implements IngestConfi timeGroup = new javax.swing.ButtonGroup(); servicesScrollPane = new javax.swing.JScrollPane(); - servicesTable = new javax.swing.JTable(); + modulesTable = new javax.swing.JTable(); jPanel1 = new javax.swing.JPanel(); advancedButton = new javax.swing.JButton(); jSeparator2 = new javax.swing.JSeparator(); @@ -212,8 +212,8 @@ public class IngestDialogPanel extends javax.swing.JPanel implements IngestConfi servicesScrollPane.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(160, 160, 160))); servicesScrollPane.setPreferredSize(new java.awt.Dimension(160, 160)); - servicesTable.setBackground(new java.awt.Color(240, 240, 240)); - servicesTable.setModel(new javax.swing.table.DefaultTableModel( + modulesTable.setBackground(new java.awt.Color(240, 240, 240)); + modulesTable.setModel(new javax.swing.table.DefaultTableModel( new Object [][] { }, @@ -221,9 +221,9 @@ public class IngestDialogPanel extends javax.swing.JPanel implements IngestConfi } )); - servicesTable.setShowHorizontalLines(false); - servicesTable.setShowVerticalLines(false); - servicesScrollPane.setViewportView(servicesTable); + modulesTable.setShowHorizontalLines(false); + modulesTable.setShowVerticalLines(false); + servicesScrollPane.setViewportView(modulesTable); jPanel1.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(160, 160, 160))); jPanel1.setPreferredSize(new java.awt.Dimension(338, 257)); @@ -290,14 +290,10 @@ public class IngestDialogPanel extends javax.swing.JPanel implements IngestConfi .addGroup(timePanelLayout.createSequentialGroup() .addContainerGap() .addGroup(timePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(timePanelLayout.createSequentialGroup() - .addGap(0, 0, 0) - .addComponent(timeRadioButton1)) - .addGroup(timePanelLayout.createSequentialGroup() - .addGroup(timePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(timeLabel) - .addComponent(timeRadioButton2) - .addComponent(timeRadioButton3)))) + .addComponent(timeRadioButton1) + .addComponent(timeLabel) + .addComponent(timeRadioButton2) + .addComponent(timeRadioButton3)) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); timePanelLayout.setVerticalGroup( @@ -377,11 +373,11 @@ public class IngestDialogPanel extends javax.swing.JPanel implements IngestConfi @Override public void actionPerformed(ActionEvent e) { dialog.close(); - currentService.saveAdvancedConfiguration(); + currentModule.saveAdvancedConfiguration(); reloadSimpleConfiguration(); } }); - dialog.display(currentService.getAdvancedConfiguration()); + dialog.display(currentModule.getAdvancedConfiguration()); }//GEN-LAST:event_advancedButtonActionPerformed private void timeRadioButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_timeRadioButton1ActionPerformed @@ -397,10 +393,10 @@ private void timeRadioButton1ActionPerformed(java.awt.event.ActionEvent evt) {// private javax.swing.JPanel jPanel1; private javax.swing.JScrollPane jScrollPane1; private javax.swing.JSeparator jSeparator2; + private javax.swing.JTable modulesTable; private javax.swing.JCheckBox processUnallocCheckbox; private javax.swing.JPanel processUnallocPanel; private javax.swing.JScrollPane servicesScrollPane; - private javax.swing.JTable servicesTable; private javax.swing.JPanel simplePanel; private javax.swing.ButtonGroup timeGroup; private javax.swing.JLabel timeLabel; @@ -410,11 +406,11 @@ private void timeRadioButton1ActionPerformed(java.awt.event.ActionEvent evt) {// private javax.swing.JRadioButton timeRadioButton3; // End of variables declaration//GEN-END:variables - private class ServicesTableModel extends AbstractTableModel { + private class ModulesTableModel extends AbstractTableModel { @Override public int getRowCount() { - return services.size(); + return modules.size(); } @Override @@ -424,9 +420,9 @@ private void timeRadioButton1ActionPerformed(java.awt.event.ActionEvent evt) {// @Override public Object getValueAt(int rowIndex, int columnIndex) { - String name = services.get(rowIndex).getName(); + String name = modules.get(rowIndex).getName(); if (columnIndex == 0) { - return serviceStates.get(name); + return moduleStates.get(name); } else { return name; } @@ -440,7 +436,7 @@ private void timeRadioButton1ActionPerformed(java.awt.event.ActionEvent evt) {// @Override public void setValueAt(Object aValue, int rowIndex, int columnIndex) { if (columnIndex == 0) { - serviceStates.put((String) getValueAt(rowIndex, 1), (Boolean) aValue); + moduleStates.put((String) getValueAt(rowIndex, 1), (Boolean) aValue); } } @@ -451,15 +447,15 @@ private void timeRadioButton1ActionPerformed(java.awt.event.ActionEvent evt) {// } } - List getServicesToStart() { - List servicesToStart = new ArrayList(); - for (IngestServiceAbstract service : services) { - boolean serviceEnabled = serviceStates.get(service.getName()); - if (serviceEnabled) { - servicesToStart.add(service); + List getModulesToStart() { + List modulesToStart = new ArrayList(); + for (IngestModuleAbstract module : modules) { + boolean moduleEnabled = moduleStates.get(module.getName()); + if (moduleEnabled) { + modulesToStart.add(module); } } - return servicesToStart; + return modulesToStart; } private boolean timeSelectionEnabled() { @@ -482,8 +478,8 @@ private void timeRadioButton1ActionPerformed(java.awt.event.ActionEvent evt) {// private void reloadSimpleConfiguration() { simplePanel.removeAll(); - if (currentService.hasSimpleConfiguration()) { - simplePanel.add(currentService.getSimpleConfiguration()); + if (currentModule.hasSimpleConfiguration()) { + simplePanel.add(currentModule.getSimpleConfiguration()); } simplePanel.revalidate(); simplePanel.repaint(); @@ -495,8 +491,8 @@ private void timeRadioButton1ActionPerformed(java.awt.event.ActionEvent evt) {// */ @Override public void save() { - if (currentService != null && currentService.hasSimpleConfiguration()) { - currentService.saveSimpleConfiguration(); + if (currentModule != null && currentModule.hasSimpleConfiguration()) { + currentModule.saveSimpleConfiguration(); } } @@ -512,11 +508,11 @@ private void timeRadioButton1ActionPerformed(java.awt.event.ActionEvent evt) {// @Override public void start() { - //pick the services - List servicesToStart = getServicesToStart(); + //pick the modules + List modulesToStart = getModulesToStart(); - if (!servicesToStart.isEmpty()) { - manager.execute(servicesToStart, image); + if (!modulesToStart.isEmpty()) { + manager.execute(modulesToStart, image); } //update ingest freq. refresh @@ -537,9 +533,9 @@ private void timeRadioButton1ActionPerformed(java.awt.event.ActionEvent evt) {// /** - * Custom cell renderer for tooltips with service description + * Custom cell renderer for tooltips with module description */ - private class ServiceTableRenderer extends DefaultTableCellRenderer { + private class ModulesTableRenderer extends DefaultTableCellRenderer { @Override public Component getTableCellRendererComponent( @@ -551,9 +547,9 @@ private void timeRadioButton1ActionPerformed(java.awt.event.ActionEvent evt) {// if (column == 1) { //String serviceName = (String) table.getModel().getValueAt(row, column); - IngestServiceAbstract service = services.get(row); - String serviceDescr = service.getDescription(); - setToolTipText(serviceDescr); + IngestModuleAbstract module = modules.get(row); + String moduleDescr = module.getDescription(); + setToolTipText(moduleDescr); } diff --git a/Ingest/src/org/sleuthkit/autopsy/ingest/IngestImageThread.java b/Ingest/src/org/sleuthkit/autopsy/ingest/IngestImageThread.java index 6dc856df47..ee1fbb9d79 100644 --- a/Ingest/src/org/sleuthkit/autopsy/ingest/IngestImageThread.java +++ b/Ingest/src/org/sleuthkit/autopsy/ingest/IngestImageThread.java @@ -39,11 +39,11 @@ public class IngestImageThread extends SwingWorker { private Logger logger = Logger.getLogger(IngestImageThread.class.getName()); private ProgressHandle progress; private Image image; - private IngestServiceImage service; + private IngestModuleImage service; private IngestImageWorkerController controller; private IngestManager manager; - IngestImageThread(IngestManager manager, Image image, IngestServiceImage service) { + IngestImageThread(IngestManager manager, Image image, IngestModuleImage service) { this.manager = manager; this.image = image; this.service = service; @@ -53,7 +53,7 @@ public class IngestImageThread extends SwingWorker { return image; } - IngestServiceImage getService() { + IngestModuleImage getModule() { return service; } @@ -113,7 +113,7 @@ public class IngestImageThread extends SwingWorker { catch (Exception e) { logger.log(Level.INFO, "Error completing the service " + service.getName(), e); } - IngestManager.fireServiceEvent(IngestModuleEvent.COMPLETED.toString(), service.getName()); + IngestManager.fireModuleEvent(IngestModuleEvent.COMPLETED.toString(), service.getName()); } else { logger.log(Level.INFO, "Service " + service.getName() + " stopped"); try { @@ -122,7 +122,7 @@ public class IngestImageThread extends SwingWorker { catch (Exception e) { logger.log(Level.INFO, "Error stopping the service" + service.getName(), e); } - IngestManager.fireServiceEvent(IngestModuleEvent.STOPPED.toString(), service.getName()); + IngestManager.fireModuleEvent(IngestModuleEvent.STOPPED.toString(), service.getName()); } } diff --git a/Ingest/src/org/sleuthkit/autopsy/ingest/IngestManager.java b/Ingest/src/org/sleuthkit/autopsy/ingest/IngestManager.java index ae054dc088..eb168868e3 100755 --- a/Ingest/src/org/sleuthkit/autopsy/ingest/IngestManager.java +++ b/Ingest/src/org/sleuthkit/autopsy/ingest/IngestManager.java @@ -1,7 +1,7 @@ /* * Autopsy Forensic Browser * - * Copyright 2011 Basis Technology Corp. + * Copyright 2012 Basis Technology Corp. * Contact: carrier sleuthkit org * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -50,9 +50,9 @@ import org.sleuthkit.datamodel.Image; import org.sleuthkit.datamodel.TskData; /** - * IngestManager sets up and manages ingest services runs them in a background - * thread notifies services when work is complete or should be interrupted - * processes messages from services via messenger proxy and posts them to GUI. + * IngestManager sets up and manages ingest modules runs them in a background + * thread notifies modules when work is complete or should be interrupted + * processes messages from modules via messenger proxy and posts them to GUI. * * This runs as a singleton and you can access it using the getDefault() method. * @@ -79,18 +79,18 @@ public class IngestManager { private volatile UpdateFrequency updateFrequency = UpdateFrequency.AVG; private boolean processUnallocSpace = true; //queues - private final ImageQueue imageQueue = new ImageQueue(); // list of services and images to analyze + private final ImageQueue imageQueue = new ImageQueue(); // list of modules and images to analyze private final AbstractFileQueue abstractFileQueue = new AbstractFileQueue(); private final Object queuesLock = new Object(); //workers private IngestAbstractFileThread abstractFileIngester; private List imageIngesters; private SwingWorker queueWorker; - //services - private final List imageServices = enumerateImageServices(); - private final List abstractFileServices = enumerateAbstractFileServices(); - // service return values - private final Map abstractFileServiceResults = new HashMap(); + //modules + private final List imageModules = enumerateImageModules(); + private final List abstractFileModules = enumerateAbstractFileModules(); + // module return values + private final Map abstractFileModulesRetValues = new HashMap(); //manager proxy final IngestManagerProxy managerProxy = new IngestManagerProxy(this); //notifications @@ -128,9 +128,9 @@ public class IngestManager { STOPPED, /** * Event sent when ingest module has new data. Second argument of the - * property change fired contains ServiceDataEvent object and third + * property change fired contains ModuleDataEvent object and third * argument is null. The object can contain encapsulated new data - * created by the service. Listener can also query new data as needed. + * created by the module. Listener can also query new data as needed. * */ DATA @@ -170,46 +170,46 @@ public class IngestManager { pcs.addPropertyChangeListener(l); } - static synchronized void fireServiceEvent(String eventType, String serviceName) { - pcs.firePropertyChange(eventType, serviceName, null); + static synchronized void fireModuleEvent(String eventType, String moduleName) { + pcs.firePropertyChange(eventType, moduleName, null); } - static synchronized void fireServiceDataEvent(ServiceDataEvent serviceDataEvent) { - pcs.firePropertyChange(IngestModuleEvent.DATA.toString(), serviceDataEvent, null); + static synchronized void fireModuleDataEvent(ModuleDataEvent moduleDataEvent) { + pcs.firePropertyChange(IngestModuleEvent.DATA.toString(), moduleDataEvent, null); } /** * Returns the return value from a previously run module on the file being - * curently analyzed. + * currently analyzed. * - * @param serviceName Name of module. + * @param moduleName Name of module. * @returns Return value from that module if it was previously run. */ - IngestServiceAbstractFile.ProcessResult getAbstractFileServiceResult(String serviceName) { - synchronized (abstractFileServiceResults) { - if (abstractFileServiceResults.containsKey(serviceName)) { - return abstractFileServiceResults.get(serviceName); + IngestModuleAbstractFile.ProcessResult getAbstractFileModuleResult(String moduleName) { + synchronized (abstractFileModulesRetValues) { + if (abstractFileModulesRetValues.containsKey(moduleName)) { + return abstractFileModulesRetValues.get(moduleName); } else { - return IngestServiceAbstractFile.ProcessResult.UNKNOWN; + return IngestModuleAbstractFile.ProcessResult.UNKNOWN; } } } /** * Multiple image version of execute, enqueues multiple images and - * associated services at once + * associated modules at once * - * @param services services to execute on every image - * @param images images to execute services on + * @param modules modules to execute on every image + * @param images images to execute modules on */ - void execute(final List services, final List images) { - logger.log(Level.INFO, "Will enqueue number of images: " + images.size() + " to " + services.size() + " services."); + void execute(final List modules, final List images) { + logger.log(Level.INFO, "Will enqueue number of images: " + images.size() + " to " + modules.size() + " modules."); if (!isIngestRunning()) { ui.clearMessages(); } - queueWorker = new EnqueueWorker(services, images); + queueWorker = new EnqueueWorker(modules, images); queueWorker.execute(); ui.restoreMessages(); @@ -219,29 +219,29 @@ public class IngestManager { /** * IngestManager entry point, enqueues image to be processed. Spawns * background thread which enumerates all sorted files and executes chosen - * services per file in a pre-determined order. Notifies services when work + * modules per file in a pre-determined order. Notifies modules when work * is complete or should be interrupted using complete() and stop() calls. * Does not block and can be called multiple times to enqueue more work to * already running background process. * - * @param services services to execute on the image - * @param image image to execute services on + * @param modules modules to execute on the image + * @param image image to execute modules on */ - void execute(final List services, final Image image) { + void execute(final List modules, final Image image) { List images = new ArrayList(); images.add(image); logger.log(Level.INFO, "Will enqueue image: " + image.getName()); - execute(services, images); + execute(modules, images); } /** * Starts the needed worker threads. * - * if AbstractFile service is still running, do nothing and allow it to + * if AbstractFile module is still running, do nothing and allow it to * consume queue otherwise start /restart AbstractFile worker * - * image workers run per (service,image). Check if one for the - * (service,image) is already running otherwise start/restart the worker + * image workers run per (module,image). Check if one for the + * (module,image) is already running otherwise start/restart the worker */ private synchronized void startAll() { logger.log(Level.INFO, "Image queue: " + this.imageQueue.toString()); @@ -255,38 +255,38 @@ public class IngestManager { // cycle through each image in the queue while (hasNextImage()) { //dequeue - // get next image and set of services - final Map.Entry> qu = + // get next image and set of modules + final Map.Entry> qu = this.getNextImage(); - // check if each service for this image is already running + // check if each module for this image is already running //synchronized (this) { - for (IngestServiceImage quService : qu.getValue()) { + for (IngestModuleImage quModule : qu.getValue()) { boolean alreadyRunning = false; for (IngestImageThread worker : imageIngesters) { // ignore threads that are on different images if (!worker.getImage().equals(qu.getKey())) { continue; //check next worker } - //same image, check service (by name, not id, since different instances) - if (worker.getService().getName().equals(quService.getName())) { + //same image, check module (by name, not id, since different instances) + if (worker.getModule().getName().equals(quModule.getName())) { alreadyRunning = true; - logger.log(Level.INFO, "Image Ingester <" + qu.getKey() + ", " + quService.getName() + "> is already running"); + logger.log(Level.INFO, "Image Ingester <" + qu.getKey() + ", " + quModule.getName() + "> is already running"); break; } } //checked all workers if (alreadyRunning == false) { - logger.log(Level.INFO, "Starting new image Ingester <" + qu.getKey() + ", " + quService.getName() + ">"); - IngestImageThread newImageWorker = new IngestImageThread(this, qu.getKey(), quService); + logger.log(Level.INFO, "Starting new image Ingester <" + qu.getKey() + ", " + quModule.getName() + ">"); + IngestImageThread newImageWorker = new IngestImageThread(this, qu.getKey(), quModule); imageIngesters.add(newImageWorker); - //image services are now initialized per instance - quService.init(managerProxy); + //image modules are now initialized per instance + quModule.init(managerProxy); newImageWorker.execute(); - IngestManager.fireServiceEvent(IngestModuleEvent.STARTED.toString(), quService.getName()); + IngestManager.fireModuleEvent(IngestModuleEvent.STARTED.toString(), quModule.getName()); } } } @@ -312,8 +312,8 @@ public class IngestManager { if (startAbstractFileIngester) { stats = new IngestManagerStats(); abstractFileIngester = new IngestAbstractFileThread(); - //init all fs services, everytime new worker starts - for (IngestServiceAbstractFile s : abstractFileServices) { + //init all fs modules, everytime new worker starts + for (IngestModuleAbstractFile s : abstractFileModules) { s.init(managerProxy); } abstractFileIngester.execute(); @@ -334,15 +334,15 @@ public class IngestManager { emptyAbstractFiles(); emptyImages(); - //stop service workers + //stop module workers if (abstractFileIngester != null) { - //send signals to all file services - for (IngestServiceAbstractFile s : this.abstractFileServices) { - if (isServiceRunning(s)) { + //send signals to all file modules + for (IngestModuleAbstractFile s : this.abstractFileModules) { + if (isModuleRunning(s)) { try { s.stop(); } catch (Exception e) { - logger.log(Level.WARNING, "Exception while stopping service: " + s.getName(), e); + logger.log(Level.WARNING, "Exception while stopping module: " + s.getName(), e); } } @@ -361,20 +361,20 @@ public class IngestManager { for (IngestImageThread imageWorker : toStop) { - IngestServiceImage s = imageWorker.getService(); + IngestModuleImage s = imageWorker.getModule(); //stop the worker thread if thread is running boolean cancelled = imageWorker.cancel(true); if (!cancelled) { - logger.log(Level.INFO, "Unable to cancel image ingest worker for service: " + imageWorker.getService().getName() + " img: " + imageWorker.getImage().getName()); + logger.log(Level.INFO, "Unable to cancel image ingest worker for module: " + imageWorker.getModule().getName() + " img: " + imageWorker.getImage().getName()); } - //stop notification to service to cleanup resources - if (isServiceRunning(s)) { + //stop notification to module to cleanup resources + if (isModuleRunning(s)) { try { - imageWorker.getService().stop(); + imageWorker.getModule().stop(); } catch (Exception e) { - logger.log(Level.WARNING, "Exception while stopping service: " + s.getName(), e); + logger.log(Level.WARNING, "Exception while stopping module: " + s.getName(), e); } } @@ -402,18 +402,18 @@ public class IngestManager { } /** - * Test is any file ingest services are running. + * Test is any file ingest modules are running. * - * @return true if any ingest services are running, false otherwise + * @return true if any ingest modules are running, false otherwise */ - public synchronized boolean areServicesRunning() { - for (IngestServiceAbstract serv : abstractFileServices) { + public synchronized boolean areModulesRunning() { + for (IngestModuleAbstract serv : abstractFileModules) { if(serv.hasBackgroundJobsRunning()) { return true; } } for (IngestImageThread thread : imageIngesters) { - if(isServiceRunning(thread.getService())) { + if(isModuleRunning(thread.getModule())) { return false; } } @@ -464,34 +464,34 @@ public class IngestManager { } /** - * check if the service is running (was started and not yet + * check if the module is running (was started and not yet * complete/stopped) give a complete answer, i.e. it's already consumed all * files but it might have background threads running * */ - public boolean isServiceRunning(final IngestServiceAbstract service) { + public boolean isModuleRunning(final IngestModuleAbstract module) { - if (service.getType() == IngestServiceAbstract.ServiceType.AbstractFile) { + if (module.getType() == IngestModuleAbstract.ModuleType.AbstractFile) { synchronized (queuesLock) { - if (abstractFileQueue.hasServiceEnqueued((IngestServiceAbstractFile) service)) { + if (abstractFileQueue.hasModuleEnqueued((IngestModuleAbstractFile) module)) { //has work enqueued, so running return true; } else { //not in the queue, but could still have bkg work running - return service.hasBackgroundJobsRunning(); + return module.hasBackgroundJobsRunning(); } } } else { - //image service + //image module synchronized (this) { if (imageIngesters.isEmpty()) { return false; } IngestImageThread imt = null; for (IngestImageThread ii : imageIngesters) { - if (ii.getService().equals(service)) { + if (ii.getModule().equals(module)) { imt = ii; break; } @@ -514,7 +514,7 @@ public class IngestManager { } /** - * returns the current minimal update frequency setting in minutes Services + * returns the current minimal update frequency setting in minutes Modules * should call this at init() to get current setting and use the setting to * change notification and data refresh intervals */ @@ -523,7 +523,7 @@ public class IngestManager { } /** - * set new minimal update frequency services should use + * set new minimal update frequency modules should use * * @param frequency to use in minutes */ @@ -557,9 +557,9 @@ public class IngestManager { } /** - * Service publishes message using InegestManager handle Does not block. The + * Module publishes message using InegestManager handle Does not block. The * message gets enqueued in the GUI thread and displayed in a widget - * IngestService should make an attempt not to publish the same message + * IngestModule should make an attempt not to publish the same message * multiple times. Viewer will attempt to identify duplicate messages and * filter them out (slower) */ @@ -575,62 +575,62 @@ public class IngestManager { } /** - * helper to return all image services managed (using Lookup API) sorted in + * helper to return all image modules managed (using Lookup API) sorted in * Lookup position order */ - public static List enumerateImageServices() { - List ret = new ArrayList(); - for (IngestServiceImage list : Lookup.getDefault().lookupAll(IngestServiceImage.class)) { + public static List enumerateImageModules() { + List ret = new ArrayList(); + for (IngestModuleImage list : Lookup.getDefault().lookupAll(IngestModuleImage.class)) { ret.add(list); } return ret; } /** - * helper to return all file/dir services managed (using Lookup API) sorted + * helper to return all file/dir modules managed (using Lookup API) sorted * in Lookup position order */ - public static List enumerateAbstractFileServices() { - List ret = new ArrayList(); - for (IngestServiceAbstractFile list : Lookup.getDefault().lookupAll(IngestServiceAbstractFile.class)) { + public static List enumerateAbstractFileModules() { + List ret = new ArrayList(); + for (IngestModuleAbstractFile list : Lookup.getDefault().lookupAll(IngestModuleAbstractFile.class)) { ret.add(list); } return ret; } /** - * Queue up an image to be processed by a given service. + * Queue up an image to be processed by a given module. * - * @param service Service to analyze image + * @param module Module to analyze image * @param image Image to analyze */ - private void addImage(IngestServiceImage service, Image image) { + private void addImage(IngestModuleImage module, Image image) { synchronized (queuesLock) { - imageQueue.enqueue(image, service); + imageQueue.enqueue(image, module); } } /** - * Queue up an image to be processed by a given File service. + * Queue up an image to be processed by a given File module. * - * @param service service for which to enqueue the files + * @param module module for which to enqueue the files * @param abstractFiles files to enqueue */ - private void addAbstractFile(IngestServiceAbstractFile service, Collection abstractFiles) { + private void addAbstractFile(IngestModuleAbstractFile module, Collection abstractFiles) { synchronized (queuesLock) { for (AbstractFile abstractFile : abstractFiles) { - abstractFileQueue.enqueue(abstractFile, service); + abstractFileQueue.enqueue(abstractFile, module); } } } /** - * get next file/dir and associated list of services to process the queue of + * get next file/dir and associated list of modules to process the queue of * AbstractFile to process is maintained internally and could be dynamically * sorted as data comes in */ - private Map.Entry> getNextAbstractFile() { - Map.Entry> ret = null; + private Map.Entry> getNextAbstractFile() { + Map.Entry> ret = null; synchronized (queuesLock) { ret = abstractFileQueue.dequeue(); } @@ -666,11 +666,11 @@ public class IngestManager { } /** - * get next Image/Service pair to process the queue of Images to process is + * get next Image/Module pair to process the queue of Images to process is * maintained internally and could be dynamically sorted as data comes in */ - private Map.Entry> getNextImage() { - Map.Entry> ret = null; + private Map.Entry> getNextImage() { + Map.Entry> ret = null; synchronized (queuesLock) { ret = imageQueue.dequeue(); } @@ -767,7 +767,7 @@ public class IngestManager { /** * manages queue of pending AbstractFile and list of associated - * IngestServiceAbstractFile to use on that content sorted based on + * IngestModuleAbstractFile to use on that content sorted based on * AbstractFilePriotity */ private class AbstractFileQueue { @@ -785,26 +785,26 @@ public class IngestManager { } }; - final TreeMap> AbstractFileUnits = new TreeMap>(sorter); + final TreeMap> AbstractFileUnits = new TreeMap>(sorter); - void enqueue(AbstractFile AbstractFile, IngestServiceAbstractFile service) { - //AbstractFileUnits.put(AbstractFile, Collections.singletonList(service)); - List services = AbstractFileUnits.get(AbstractFile); - if (services == null) { - services = new ArrayList(); - AbstractFileUnits.put(AbstractFile, services); + void enqueue(AbstractFile AbstractFile, IngestModuleAbstractFile module) { + //AbstractFileUnits.put(AbstractFile, Collections.singletonList(module)); + List modules = AbstractFileUnits.get(AbstractFile); + if (modules == null) { + modules = new ArrayList(); + AbstractFileUnits.put(AbstractFile, modules); } - services.add(service); + modules.add(module); } - void enqueue(AbstractFile AbstractFile, List services) { + void enqueue(AbstractFile AbstractFile, List modules) { - List oldServices = AbstractFileUnits.get(AbstractFile); - if (oldServices == null) { - oldServices = new ArrayList(); - AbstractFileUnits.put(AbstractFile, oldServices); + List oldModules = AbstractFileUnits.get(AbstractFile); + if (oldModules == null) { + oldModules = new ArrayList(); + AbstractFileUnits.put(AbstractFile, oldModules); } - oldServices.addAll(services); + oldModules.addAll(modules); } boolean hasNext() { @@ -820,11 +820,11 @@ public class IngestManager { } /** - * Returns next AbstractFile and list of associated services + * Returns next AbstractFile and list of associated modules * * @return */ - Map.Entry> dequeue() { + Map.Entry> dequeue() { if (!hasNext()) { throw new UnsupportedOperationException("AbstractFile processing queue is empty"); } @@ -834,14 +834,14 @@ public class IngestManager { } /** - * checks if the service has any work enqueued + * checks if the module has any work enqueued * - * @param service to check for - * @return true if the service is enqueued to do work + * @param module to check for + * @return true if the module is enqueued to do work */ - boolean hasServiceEnqueued(IngestServiceAbstractFile service) { - for (List list : AbstractFileUnits.values()) { - if (list.contains(service)) { + boolean hasModuleEnqueued(IngestModuleAbstractFile module) { + for (List list : AbstractFileUnits.values()) { + if (list.contains(module)) { return true; } } @@ -855,7 +855,7 @@ public class IngestManager { public String printQueue() { StringBuilder sb = new StringBuilder(); - /*for (QueueUnit u : AbstractFileUnits) { + /*for (QueueUnit u : AbstractFileUnits) { sb.append(u.toString()); sb.append("\n"); }*/ @@ -864,9 +864,9 @@ public class IngestManager { } /** - * manages queue of pending Images and IngestServiceImage to use on that - * image. image / service pairs are added one at a time and internally, it - * keeps track of all services for a given image. + * manages queue of pending Images and IngestModuleImage to use on that + * image. image / module pairs are added one at a time and internally, it + * keeps track of all modules for a given image. */ private class ImageQueue { @@ -877,24 +877,24 @@ public class IngestManager { } }; - private TreeMap> imageUnits = new TreeMap>(sorter); + private TreeMap> imageUnits = new TreeMap>(sorter); - void enqueue(Image image, IngestServiceImage service) { - List services = imageUnits.get(image); - if (services == null) { - services = new ArrayList(); - imageUnits.put(image, services); + void enqueue(Image image, IngestModuleImage module) { + List modules = imageUnits.get(image); + if (modules == null) { + modules = new ArrayList(); + imageUnits.put(image, modules); } - services.add(service); + modules.add(module); } - void enqueue(Image image, List services) { - List oldServices = imageUnits.get(image); - if (oldServices == null) { - oldServices = new ArrayList(); - imageUnits.put(image, oldServices); + void enqueue(Image image, List modules) { + List oldModules = imageUnits.get(image); + if (oldModules == null) { + oldModules = new ArrayList(); + imageUnits.put(image, oldModules); } - oldServices.addAll(services); + oldModules.addAll(modules); } boolean hasNext() { @@ -910,12 +910,12 @@ public class IngestManager { } /** - * Return a QueueUnit that contains an image and set of services to run + * Return a QueueUnit that contains an image and set of modules to run * on it. * * @return */ - Map.Entry> dequeue() { + Map.Entry> dequeue() { if (!hasNext()) { throw new UnsupportedOperationException("Image processing queue is empty"); } @@ -937,55 +937,55 @@ public class IngestManager { private Date startTime; private Date endTime; private int errorsTotal; - private Map errors; + private Map errors; private final DateFormat dateFormatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); private final StopWatch timer = new StopWatch(); - private IngestServiceAbstract currentServiceForTimer; - //file service timing stats, image service timers are logged in IngestImageThread class - private final Map fileServiceTimers = new HashMap(); + private IngestModuleAbstract currentModuleForTimer; + //file module timing stats, image module timers are logged in IngestImageThread class + private final Map fileModuleTimers = new HashMap(); IngestManagerStats() { - errors = new HashMap(); + errors = new HashMap(); } /** - * records start time of the file process for the service must be - * followed by logFileServiceEndProcess for the same service + * records start time of the file process for the module must be + * followed by logFileModuleEndProcess for the same module * - * @param service to record start time for processing a file + * @param module to record start time for processing a file */ - void logFileServiceStartProcess(IngestServiceAbstract service) { + void logFileModuleStartProcess(IngestModuleAbstract module) { timer.reset(); timer.start(); - currentServiceForTimer = service; + currentModuleForTimer = module; } /** - * records stop time of the file process for the service must be - * preceded by logFileServiceStartProcess for the same service + * records stop time of the file process for the module must be + * preceded by logFileModuleStartProcess for the same module * - * @param service to record stop time for processing a file + * @param module to record stop time for processing a file */ - void logFileServiceEndProcess(IngestServiceAbstract service) { + void logFileModuleEndProcess(IngestModuleAbstract module) { timer.stop(); - if (service != currentServiceForTimer) { - logger.log(Level.WARNING, "Invalid service passed in to record stop processing: " + service.getName() - + ", expected: " + currentServiceForTimer.getName()); + if (module != currentModuleForTimer) { + logger.log(Level.WARNING, "Invalid module passed in to record stop processing: " + module.getName() + + ", expected: " + currentModuleForTimer.getName()); } else { final long elapsed = timer.getElapsedTime(); - final long current = fileServiceTimers.get(service.getName()); - fileServiceTimers.put(service.getName(), elapsed + current); + final long current = fileModuleTimers.get(module.getName()); + fileModuleTimers.put(module.getName(), elapsed + current); } - currentServiceForTimer = null; + currentModuleForTimer = null; } - String getFileServiceStats() { + String getFileModuleStats() { StringBuilder sb = new StringBuilder(); - for (final String serviceName : fileServiceTimers.keySet()) { - sb.append(serviceName).append(" took: ") - .append(fileServiceTimers.get(serviceName) / 1000) + for (final String moduleName : fileModuleTimers.keySet()) { + sb.append(moduleName).append(" took: ") + .append(fileModuleTimers.get(moduleName) / 1000) .append(" secs. to process()").append('\n'); } return sb.toString(); @@ -1004,10 +1004,10 @@ public class IngestManager { sb.append("Total ingest time: ").append(getTotalTimeString()).append(EOL); sb.append("Total errors: ").append(errorsTotal).append(EOL); if (errorsTotal > 0) { - sb.append("Errors per service:"); - for (IngestServiceAbstract service : errors.keySet()) { - final int errorsService = errors.get(service); - sb.append("\t").append(service.getName()).append(": ").append(errorsService).append(EOL); + sb.append("Errors per module:"); + for (IngestModuleAbstract module : errors.keySet()) { + final int errorsModule = errors.get(module); + sb.append("\t").append(module.getName()).append(": ").append(errorsModule).append(EOL); } } return sb.toString(); @@ -1021,10 +1021,10 @@ public class IngestManager { sb.append("Total errors: ").append(errorsTotal).append("
"); /* if (errorsTotal > 0) { - sb.append("Errors per service:"); - for (IngestServiceAbstract service : errors.keySet()) { - final int errorsService = errors.get(service); - sb.append("\t").append(service.getName()).append(": ").append(errorsService).append("
"); + sb.append("Errors per module:"); + for (IngestModuleAbstract module : errors.keySet()) { + final int errorsModule = errors.get(module); + sb.append("\t").append(module.getName()).append(": ").append(errorsModule).append("
"); } } * */ @@ -1036,8 +1036,8 @@ public class IngestManager { void start() { startTime = new Date(); - for (IngestServiceAbstractFile service : abstractFileServices) { - fileServiceTimers.put(service.getName(), 0L); + for (IngestModuleAbstractFile module : abstractFileModules) { + fileModuleTimers.put(module.getName(), 0L); } } @@ -1072,13 +1072,13 @@ public class IngestManager { return sb.toString(); } - synchronized void addError(IngestServiceAbstract source) { + synchronized void addError(IngestModuleAbstract source) { ++errorsTotal; - Integer curServiceErrorI = errors.get(source); - if (curServiceErrorI == null) { + Integer curModuleErrorI = errors.get(source); + if (curModuleErrorI == null) { errors.put(source, 1); } else { - errors.put(source, curServiceErrorI + 1); + errors.put(source, curModuleErrorI + 1); } } } @@ -1097,9 +1097,9 @@ public class IngestManager { logger.log(Level.INFO, "Starting background processing"); stats.start(); - //notify main thread services started - for (IngestServiceAbstractFile s : abstractFileServices) { - IngestManager.fireServiceEvent(IngestModuleEvent.STARTED.toString(), s.getName()); + //notify main thread modules started + for (IngestModuleAbstractFile s : abstractFileModules) { + IngestManager.fireModuleEvent(IngestModuleEvent.STARTED.toString(), s.getName()); } final String displayName = "File Ingest"; @@ -1121,18 +1121,18 @@ public class IngestManager { int processedFiles = 0; //process AbstractFiles queue while (hasNextAbstractFile()) { - Map.Entry> unit = getNextAbstractFile(); - //clear return values from services for last file - synchronized (abstractFileServiceResults) { - abstractFileServiceResults.clear(); + Map.Entry> unit = getNextAbstractFile(); + //clear return values from modules for last file + synchronized (abstractFileModulesRetValues) { + abstractFileModulesRetValues.clear(); } final AbstractFile fileToProcess = unit.getKey(); progress.progress(fileToProcess.getName(), processedFiles); - for (IngestServiceAbstractFile service : unit.getValue()) { - //process the file with every file service + for (IngestModuleAbstractFile module : unit.getValue()) { + //process the file with every file module if (isCancelled()) { logger.log(Level.INFO, "Terminating file ingest due to cancellation."); return null; @@ -1140,18 +1140,18 @@ public class IngestManager { try { - stats.logFileServiceStartProcess(service); - IngestServiceAbstractFile.ProcessResult result = service.process(fileToProcess); - stats.logFileServiceEndProcess(service); + stats.logFileModuleStartProcess(module); + IngestModuleAbstractFile.ProcessResult result = module.process(fileToProcess); + stats.logFileModuleEndProcess(module); - //store the result for subsequent services for this file - synchronized (abstractFileServiceResults) { - abstractFileServiceResults.put(service.getName(), result); + //store the result for subsequent modules for this file + synchronized (abstractFileModulesRetValues) { + abstractFileModulesRetValues.put(module.getName(), result); } } catch (Exception e) { - logger.log(Level.WARNING, "Exception from service: " + service.getName(), e); - stats.addError(service); + logger.log(Level.WARNING, "Exception from module: " + module.getName(), e); + stats.addError(module); } } int newAbstractFiles = getNumAbstractFiles(); @@ -1172,11 +1172,11 @@ public class IngestManager { protected void done() { try { super.get(); //block and get all exceptions thrown while doInBackground() - //notify services of completion + //notify modules of completion if (!this.isCancelled()) { - for (IngestServiceAbstractFile s : abstractFileServices) { + for (IngestModuleAbstractFile s : abstractFileModules) { s.complete(); - IngestManager.fireServiceEvent(IngestModuleEvent.COMPLETED.toString(), s.getName()); + IngestManager.fireModuleEvent(IngestModuleEvent.COMPLETED.toString(), s.getName()); } } @@ -1199,7 +1199,7 @@ public class IngestManager { if (!this.isCancelled()) { logger.log(Level.INFO, "Summary Report: " + stats.toString()); - logger.log(Level.INFO, "File service timings: " + stats.getFileServiceStats()); + logger.log(Level.INFO, "File module timings: " + stats.getFileModuleStats()); logger.log(Level.INFO, "Ingest messages count: " + ui.getMessagesCount()); //ui.displayReport(stats.toHtmlString()); IngestManager.this.postMessage(IngestMessage.createManagerMessage("File Ingest Complete", stats.toHtmlString())); @@ -1209,30 +1209,30 @@ public class IngestManager { } private void handleInterruption() { - for (IngestServiceAbstractFile s : abstractFileServices) { - if (isServiceRunning(s)) { + for (IngestModuleAbstractFile s : abstractFileModules) { + if (isModuleRunning(s)) { try { s.stop(); } catch (Exception e) { - logger.log(Level.WARNING, "Exception while stopping service: " + s.getName(), e); + logger.log(Level.WARNING, "Exception while stopping module: " + s.getName(), e); } } - IngestManager.fireServiceEvent(IngestModuleEvent.STOPPED.toString(), s.getName()); + IngestManager.fireModuleEvent(IngestModuleEvent.STOPPED.toString(), s.getName()); } //empty queues emptyAbstractFiles(); } } - /* Thread that adds image/file and service pairs to queues */ + /* Thread that adds image/file and module pairs to queues */ private class EnqueueWorker extends SwingWorker { - List services; + List modules; final List images; int total; - EnqueueWorker(final List services, final List images) { - this.services = services; + EnqueueWorker(final List modules, final List images) { + this.modules = modules; this.images = images; } private ProgressHandle progress; @@ -1252,10 +1252,10 @@ public class IngestManager { } }); - total = services.size() * images.size(); + total = modules.size() * images.size(); progress.start(total); //progress.switchToIndeterminate(); - queueAll(services, images); + queueAll(modules, images); return null; } @@ -1289,32 +1289,32 @@ public class IngestManager { } } - private void queueAll(List services, final List images) { + private void queueAll(List modules, final List images) { int processed = 0; for (Image image : images) { final String imageName = image.getName(); Collection files = null; - for (IngestServiceAbstract service : services) { + for (IngestModuleAbstract module : modules) { if (isCancelled()) { logger.log(Level.INFO, "Terminating ingest queueing due to cancellation."); return; } - final String serviceName = service.getName(); - progress.progress(serviceName + " " + imageName, processed); - switch (service.getType()) { + final String moduleName = module.getName(); + progress.progress(moduleName + " " + imageName, processed); + switch (module.getType()) { case Image: - //enqueue a new instance of image service + //enqueue a new instance of image module try { - final IngestServiceImage newServiceInstance = (IngestServiceImage) (service.getClass()).newInstance(); - addImage(newServiceInstance, image); - logger.log(Level.INFO, "Added image " + image.getName() + " with service " + service.getName()); + final IngestModuleImage newModuleInstance = (IngestModuleImage) (module.getClass()).newInstance(); + addImage(newModuleInstance, image); + logger.log(Level.INFO, "Added image " + image.getName() + " with module " + module.getName()); } catch (InstantiationException e) { - logger.log(Level.SEVERE, "Cannot instantiate service: " + service.getName(), e); + logger.log(Level.SEVERE, "Cannot instantiate module: " + module.getName(), e); } catch (IllegalAccessException e) { - logger.log(Level.SEVERE, "Cannot instantiate service: " + service.getName(), e); + logger.log(Level.SEVERE, "Cannot instantiate module: " + module.getName(), e); } - //addImage((IngestServiceImage) service, image); + //addImage((IngestModuleImage) module, image); break; case AbstractFile: if (files == null) { @@ -1322,14 +1322,14 @@ public class IngestManager { files = new GetAllFilesContentVisitor(processUnallocSpace).visit(image); logger.info("Get all files took " + (System.currentTimeMillis() - start) + "ms"); } - //enqueue the same singleton AbstractFile service - logger.log(Level.INFO, "Adding image " + image.getName() + " with " + files.size() + " number of AbstractFile to service " + service.getName()); - addAbstractFile((IngestServiceAbstractFile) service, files); + //enqueue the same singleton AbstractFile module + logger.log(Level.INFO, "Adding image " + image.getName() + " with " + files.size() + " number of AbstractFile to module " + module.getName()); + addAbstractFile((IngestModuleAbstractFile) module, files); break; default: - logger.log(Level.SEVERE, "Unexpected service type: " + service.getType().name()); + logger.log(Level.SEVERE, "Unexpected module type: " + module.getType().name()); } - progress.progress(serviceName + " " + imageName, ++processed); + progress.progress(moduleName + " " + imageName, ++processed); } if (files != null) { files.clear(); diff --git a/Ingest/src/org/sleuthkit/autopsy/ingest/IngestManagerProxy.java b/Ingest/src/org/sleuthkit/autopsy/ingest/IngestManagerProxy.java index 145039b50a..9e6b93e095 100644 --- a/Ingest/src/org/sleuthkit/autopsy/ingest/IngestManagerProxy.java +++ b/Ingest/src/org/sleuthkit/autopsy/ingest/IngestManagerProxy.java @@ -22,9 +22,9 @@ package org.sleuthkit.autopsy.ingest; /** - * Ingest manager facade used by ingest services + * Services available to ingest modules * - * Facility for services to interact with the ingest manager + * Facility for modules to interact with the ingest manager * for sending data events, ingest messages, getting configuration, such as * update frequency configuration * @@ -39,36 +39,36 @@ public class IngestManagerProxy { /** * Post ingest message - * @param message ingest message to be posted by ingest service + * @param message ingest message to be posted by ingest module */ public void postMessage(final IngestMessage message) { manager.postMessage(message); } /** - * Fire service event to notify registered service event listeners + * Fire module event to notify registered module event listeners * @param eventType the event type, defined in IngestManager.IngestManagerEvents - * @param serviceName the service name + * @param moduleName the module name */ - public static void fireServiceEvent(String eventType, String serviceName) { - IngestManager.fireServiceEvent(eventType, serviceName); + public static void fireModuleEvent(String eventType, String moduleName) { + IngestManager.fireModuleEvent(eventType, moduleName); } /** - * Fire service data event to notify registered service data event listeners - * @param serviceDataEvent service data event, encapsulating blackboard artifact data + * Fire module data event to notify registered module data event listeners + * @param moduleDataEvent module data event, encapsulating blackboard artifact data */ - public static void fireServiceDataEvent(ServiceDataEvent serviceDataEvent) { - IngestManager.fireServiceDataEvent(serviceDataEvent);; + public static void fireModuleDataEvent(ModuleDataEvent moduleDataEvent) { + IngestManager.fireModuleDataEvent(moduleDataEvent); } /** - * Facility for the service to query the currently set recommended data update frequency in minutes - * Services that post data in controlled time intervals, should obey this setting + * Facility for the module to query the currently set recommended data update frequency in minutes + * Modules that post data in controlled time intervals, should obey this setting * - * @return max. number of minutes before service posts new data, if data is available + * @return max. number of minutes before module posts new data, if data is available */ public int getUpdateFrequency() { return manager.getUpdateFrequency().getTime(); @@ -76,15 +76,15 @@ public class IngestManagerProxy { /** - * Facility for a file ingest service to check a return value from another file ingest service + * Facility for a file ingest module to check a return value from another file ingest module * that executed for the same file earlier in the file ingest pipeline - * The service return value can be used as a guideline to skip processing the file + * The module return value can be used as a guideline to skip processing the file * - * @param serviceName registered service name of the service to check the return value of - * @return the return value of the previously executed service for the currently processed file in the file ingest pipeline + * @param moduleName registered module name of the module to check the return value of + * @return the return value of the previously executed module for the currently processed file in the file ingest pipeline */ - public IngestServiceAbstractFile.ProcessResult getAbstractFileServiceResult(String serviceName) { - return manager.getAbstractFileServiceResult(serviceName); + public IngestModuleAbstractFile.ProcessResult getAbstractFileModuleResult(String moduleName) { + return manager.getAbstractFileModuleResult(moduleName); } diff --git a/Ingest/src/org/sleuthkit/autopsy/ingest/IngestMessage.java b/Ingest/src/org/sleuthkit/autopsy/ingest/IngestMessage.java index 46bdc12aa3..87b24efe3b 100644 --- a/Ingest/src/org/sleuthkit/autopsy/ingest/IngestMessage.java +++ b/Ingest/src/org/sleuthkit/autopsy/ingest/IngestMessage.java @@ -24,7 +24,7 @@ import org.sleuthkit.autopsy.datamodel.KeyValue; import org.sleuthkit.datamodel.BlackboardArtifact; /** - * Representation of subject posted by ingest services + * Representation of subject posted by ingest modules * * Message should have a unique ID within context of originating source * @@ -37,7 +37,7 @@ public class IngestMessage { }; private long ID; private MessageType messageType; - private IngestServiceAbstract source; + private IngestModuleAbstract source; private String subject; private String detailsHtml; private String uniqueKey; @@ -46,7 +46,7 @@ public class IngestMessage { private static SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); private static int managerMessageId = 0; - private IngestMessage(long ID, MessageType messageType, IngestServiceAbstract source, String subject, String detailsHtml, String uniqueKey) { + private IngestMessage(long ID, MessageType messageType, IngestModuleAbstract source, String subject, String detailsHtml, String uniqueKey) { this.ID = ID; this.source = source; this.messageType = messageType; @@ -63,7 +63,7 @@ public class IngestMessage { return ID; } - public IngestServiceAbstract getSource() { + public IngestModuleAbstract getSource() { return source; } @@ -163,12 +163,12 @@ public class IngestMessage { * Create a simple message with a subject only * @param ID ID of the message, unique in the context of module that generated it * @param messageType message type - * @param source originating service + * @param source originating module * @param subject message subject to be displayed * @param details message details to be displayed, or null * @return */ - public static IngestMessage createMessage(long ID, MessageType messageType, IngestServiceAbstract source, String subject, String details) { + public static IngestMessage createMessage(long ID, MessageType messageType, IngestModuleAbstract source, String subject, String details) { if (messageType == null || source == null || subject == null) { throw new IllegalArgumentException("message type, source and subject cannot be null"); } @@ -179,11 +179,11 @@ public class IngestMessage { * Create a simple message with a subject only * @param ID ID of the message, unique in the context of module that generated it * @param messageType message type - * @param source originating service + * @param source originating module * @param subject message subject to be displayed * @return */ - public static IngestMessage createMessage(long ID, MessageType messageType, IngestServiceAbstract source, String subject) { + public static IngestMessage createMessage(long ID, MessageType messageType, IngestModuleAbstract source, String subject) { return createMessage(ID, messageType, source, subject, null); } @@ -191,12 +191,12 @@ public class IngestMessage { /** * Create error message * @param ID ID of the message, unique in the context of module that generated it - * @param source originating service + * @param source originating module * @param subject message subject to be displayed * @param details message details to be displayed, or null * @return */ - public static IngestMessage createErrorMessage(long ID, IngestServiceAbstract source, String subject, String details) { + public static IngestMessage createErrorMessage(long ID, IngestModuleAbstract source, String subject, String details) { if (source == null || subject == null) { throw new IllegalArgumentException("source and subject cannot be null"); } @@ -206,12 +206,12 @@ public class IngestMessage { /** * Create warning message * @param ID ID of the message, unique in the context of module that generated it - * @param source originating service + * @param source originating module * @param subject message subject to be displayed * @param details message details to be displayed, or null * @return */ - public static IngestMessage createWarningMessage(long ID, IngestServiceAbstract source, String subject, String details) { + public static IngestMessage createWarningMessage(long ID, IngestModuleAbstract source, String subject, String details) { if (source == null || subject == null) { throw new IllegalArgumentException("source and subject cannot be null"); } @@ -221,14 +221,14 @@ public class IngestMessage { /** * * @param ID ID of the message, unique in the context of module that generated it - * @param source originating service + * @param source originating module * @param subject message subject to be displayed * @param detailsHtml html formatted detailed message (without leading and closing <html> tags), for instance, a human-readable representation of the data. * @param uniqueKey unique key determining uniqueness of the message, or null. Helps grouping similar messages and determine their importance. Subsequent messages with the same uniqueKey will be treated with lower priority. - * @param data data blackboard artifact associated with the message, the same as fired in ServiceDataEvent by the service + * @param data data blackboard artifact associated with the message, the same as fired in ModuleDataEvent by the module * @return */ - public static IngestMessage createDataMessage(long ID, IngestServiceAbstract source, String subject, String detailsHtml, String uniqueKey, BlackboardArtifact data) { + public static IngestMessage createDataMessage(long ID, IngestModuleAbstract source, String subject, String detailsHtml, String uniqueKey, BlackboardArtifact data) { if (source == null || subject == null || detailsHtml == null || data == null) { throw new IllegalArgumentException("source, subject, details and data cannot be null"); } diff --git a/Ingest/src/org/sleuthkit/autopsy/ingest/IngestMessagePanel.java b/Ingest/src/org/sleuthkit/autopsy/ingest/IngestMessagePanel.java index 7b178c6f3f..67c3475caf 100644 --- a/Ingest/src/org/sleuthkit/autopsy/ingest/IngestMessagePanel.java +++ b/Ingest/src/org/sleuthkit/autopsy/ingest/IngestMessagePanel.java @@ -45,7 +45,7 @@ import org.sleuthkit.autopsy.ingest.IngestMessage.*; import org.sleuthkit.datamodel.BlackboardArtifact; /** - * Notification window showing messages from services to user + * Notification window showing messages from modules to user * */ class IngestMessagePanel extends javax.swing.JPanel { @@ -62,7 +62,7 @@ class IngestMessagePanel extends javax.swing.JPanel { private enum COLUMN { - SUBJECT, COUNT, SERVICE + SUBJECT, COUNT, MODULE }; private static PropertyChangeSupport messagePcs = new PropertyChangeSupport(IngestMessagePanel.class); static final String MESSAGE_CHANGE_EVT = "MESSAGE_CHANGE_EVT"; //number of unread messages changed @@ -320,10 +320,10 @@ class IngestMessagePanel extends javax.swing.JPanel { //data private List messageData = new ArrayList(); - //for keeping track of messages to group, per service, by uniqness - private Map>> groupings = new HashMap>>(); + //for keeping track of messages to group, per module, by uniqness + private Map>> groupings = new HashMap>>(); private boolean chronoSort = true; //chronological sort default - private static final int MESSAGE_GROUP_THRESH = 3; //group messages after 3 messages per service with same uniqness + private static final int MESSAGE_GROUP_THRESH = 3; //group messages after 3 messages per module with same uniqness private Logger logger = Logger.getLogger(MessageTableModel.class.getName()); MessageTableModel() { @@ -331,12 +331,12 @@ class IngestMessagePanel extends javax.swing.JPanel { } private void init() { - //initialize groupings map with services - for (IngestServiceAbstract service : IngestManager.enumerateAbstractFileServices()) { - groupings.put(service, new HashMap>()); + //initialize groupings map with modules + for (IngestModuleAbstract module : IngestManager.enumerateAbstractFileModules()) { + groupings.put(module, new HashMap>()); } - for (IngestServiceAbstract service : IngestManager.enumerateImageServices()) { - groupings.put(service, new HashMap>()); + for (IngestModuleAbstract module : IngestManager.enumerateImageModules()) { + groupings.put(module, new HashMap>()); } } @@ -418,8 +418,8 @@ class IngestMessagePanel extends javax.swing.JPanel { switch (columnIndex) { case 0: - Object service = entry.messageGroup.getSource(); - if (service == null) { + Object module = entry.messageGroup.getSource(); + if (module == null) { ret = ""; } else { ret = (Object) entry.messageGroup.getSource().getName(); @@ -462,13 +462,13 @@ class IngestMessagePanel extends javax.swing.JPanel { } synchronized public void addMessage(IngestMessage m) { - //check how many messages per service with the same uniqness + //check how many messages per module with the same uniqness //and add to existing group or create a new group - IngestServiceAbstract service = m.getSource(); + IngestModuleAbstract module = m.getSource(); IngestMessageGroup messageGroup = null; - if (service != null && m.getMessageType() == IngestMessage.MessageType.DATA) { + if (module != null && m.getMessageType() == IngestMessage.MessageType.DATA) { //not a manager message, a data message, then group - final Map> groups = groupings.get(service); + final Map> groups = groupings.get(module); //groups for this uniqueness final String uniqueness = m.getUniqueKey(); List uniqGroups = groups.get(uniqueness); @@ -732,9 +732,9 @@ class IngestMessagePanel extends javax.swing.JPanel { } /* - * return source service, should be the same for all msgs + * return source module, should be the same for all msgs */ - IngestServiceAbstract getSource() { + IngestModuleAbstract getSource() { return messages.get(0).getSource(); } diff --git a/Ingest/src/org/sleuthkit/autopsy/ingest/IngestServiceAbstract.java b/Ingest/src/org/sleuthkit/autopsy/ingest/IngestModuleAbstract.java similarity index 78% rename from Ingest/src/org/sleuthkit/autopsy/ingest/IngestServiceAbstract.java rename to Ingest/src/org/sleuthkit/autopsy/ingest/IngestModuleAbstract.java index fa67d53571..aeeae45cf0 100644 --- a/Ingest/src/org/sleuthkit/autopsy/ingest/IngestServiceAbstract.java +++ b/Ingest/src/org/sleuthkit/autopsy/ingest/IngestModuleAbstract.java @@ -21,32 +21,32 @@ package org.sleuthkit.autopsy.ingest; /** - * Base interface for ingest services + * Base interface for ingest modules */ -public interface IngestServiceAbstract { +public interface IngestModuleAbstract { /** - * Possible service types for the implementing classes + * Possible module types for the implementing classes */ - public enum ServiceType { + public enum ModuleType { /** - * Image type service + * Image type module */ Image, /** - * AbstractFile type service + * AbstractFile type module */ AbstractFile }; /** * Notification from manager that brand new ingest should be initiated. - * Service loads its configuration and performs initialization + * Module loads its configuration and performs initialization * Invoked once per new worker thread, per ingest * - * @param managerProxy manager facade that can be used by the service to communicate with the manager, e.g. - * for posting messages, getting configurations + * @param managerProxy services available to the module by the ingest manager, e.g. + * for posting messages, getting configurations, firing events */ public void init(IngestManagerProxy managerProxy); @@ -65,31 +65,31 @@ public interface IngestServiceAbstract { public void stop(); /** - * Gets specific name of the service - * The name should be unique across services - * @return unique service name + * Gets specific name of the module + * The name should be unique across modules + * @return unique module name */ public String getName(); /** - * Gets user-friendly description of the service - * @return service description + * Gets user-friendly description of the module + * @return module description */ public String getDescription(); /** - * Returns type of the service - * @return service type + * Returns type of the module + * @return module type */ - public ServiceType getType(); + public ModuleType getType(); /** - * A service can manage and use additional threads to perform some work in the background. - * This method provides insight to the manager if the service has truly completed its work or not. + * A module can manage and use additional threads to perform some work in the background. + * This method provides insight to the manager if the module has truly completed its work or not. * * - * @return true if any background threads/workers managed by this service are still running or are pending to be run, - * false if all work has been done, or if background threads are not used/managed by this service + * @return true if any background threads/workers managed by this module are still running or are pending to be run, + * false if all work has been done, or if background threads are not used/managed by this module */ public boolean hasBackgroundJobsRunning(); @@ -98,7 +98,7 @@ public interface IngestServiceAbstract { * Used to determine if a module has implemented a simple (run-time) * configuration panel that is displayed by the ingest manager. * - * @return true if this service has a simple (run-time) configuration + * @return true if this module has a simple (run-time) configuration */ public boolean hasSimpleConfiguration(); diff --git a/Ingest/src/org/sleuthkit/autopsy/ingest/IngestServiceAbstractFile.java b/Ingest/src/org/sleuthkit/autopsy/ingest/IngestModuleAbstractFile.java similarity index 87% rename from Ingest/src/org/sleuthkit/autopsy/ingest/IngestServiceAbstractFile.java rename to Ingest/src/org/sleuthkit/autopsy/ingest/IngestModuleAbstractFile.java index 9b12cb24ad..c1115adbfa 100644 --- a/Ingest/src/org/sleuthkit/autopsy/ingest/IngestServiceAbstractFile.java +++ b/Ingest/src/org/sleuthkit/autopsy/ingest/IngestModuleAbstractFile.java @@ -21,9 +21,9 @@ package org.sleuthkit.autopsy.ingest; import org.sleuthkit.datamodel.AbstractFile; /** - * Ingest service interface that will be called for every file in the image + * Ingest module interface that will be called for every file in the image */ -public interface IngestServiceAbstractFile extends IngestServiceAbstract { +public interface IngestModuleAbstractFile extends IngestModuleAbstract { /** * Return value resulting from processing AbstractFile @@ -37,7 +37,7 @@ public interface IngestServiceAbstractFile extends IngestServiceAbstract { }; /** - * Entry point to process file / directory by the service. See \ref ingestmodule_making for details + * Entry point to process file / directory by the module. See \ref ingestmodule_making for details * on what modules are responsible for doing. * * @param abstractFile file to process diff --git a/Ingest/src/org/sleuthkit/autopsy/ingest/IngestServiceImage.java b/Ingest/src/org/sleuthkit/autopsy/ingest/IngestModuleImage.java similarity index 72% rename from Ingest/src/org/sleuthkit/autopsy/ingest/IngestServiceImage.java rename to Ingest/src/org/sleuthkit/autopsy/ingest/IngestModuleImage.java index 25058c8853..6f360b18b2 100644 --- a/Ingest/src/org/sleuthkit/autopsy/ingest/IngestServiceImage.java +++ b/Ingest/src/org/sleuthkit/autopsy/ingest/IngestModuleImage.java @@ -22,26 +22,26 @@ import org.sleuthkit.datamodel.Image; /** * - * Ingest service that acts on entire image - * Image ingest services run each in its own background thread + * Ingest module that acts on entire image + * Image ingest modules run each in its own background thread * in parallel to the file processing ingest pipeline and other image ingest modules */ -public interface IngestServiceImage extends IngestServiceAbstract { +public interface IngestModuleImage extends IngestModuleAbstract { /** - * Entry point to process the image by the service. + * Entry point to process the image by the module. * * Service does all the processing work in this method. * It is responsible for extracting content of interest from the image (i.e. using DataModel API) and processing it. * Results of processing, such as extracted data or analysis results, should be posted to the blackboard. * - * The service notifies the ingest inbox of interesting events (data, errors, warnings, infos) + * The module notifies the ingest inbox of interesting events (data, errors, warnings, infos) * by posting ingest messages - * The service notifies data viewers by firing events using IngestManager.fireServiceDataEvent + * The module notifies data viewers by firing events using IngestManagerProxy.fireServiceDataEvent * - * The service is responsible for posting progress to controller - * And to periodically check controller if it should break out of the processing loop because task has been cancelled + * The module is responsible for posting progress to controller + * And to periodically check controller if it should break out of the processing loop because task has been canceled * * @param image to process * @param controller to post progress to and to use for checking if cancellation has occurred diff --git a/Ingest/src/org/sleuthkit/autopsy/ingest/ServiceDataEvent.java b/Ingest/src/org/sleuthkit/autopsy/ingest/ModuleDataEvent.java similarity index 89% rename from Ingest/src/org/sleuthkit/autopsy/ingest/ServiceDataEvent.java rename to Ingest/src/org/sleuthkit/autopsy/ingest/ModuleDataEvent.java index a044422b16..21dada9661 100644 --- a/Ingest/src/org/sleuthkit/autopsy/ingest/ServiceDataEvent.java +++ b/Ingest/src/org/sleuthkit/autopsy/ingest/ModuleDataEvent.java @@ -32,12 +32,12 @@ import org.sleuthkit.datamodel.BlackboardArtifact.ARTIFACT_TYPE; * The object wraps a collection of blackboard artifacts and their associated attributes that are to be reported as the new data to listeners. * Passing the data as part of the event reduces memory footprint and decreases number of garbage collections of the blackboard artifacts and attributes objects (the objects are expected to be reused by the data event listeners). * - * If a service does not pass the data as part of ServiceDataEvent (ServiceDataEvent.getArtifacts() returns null) - it is an indication that the service + * If a service does not pass the data as part of ModuleDataEvent (ModuleDataEvent.getArtifacts() returns null) - it is an indication that the service * has new data but it does not implement new data tracking. The listener can then perform a blackboard query to get the latest data of interest (e.g. by artifact type). * * By design, only a single type of artifacts can be contained in a single data event. */ -public class ServiceDataEvent { +public class ModuleDataEvent { private String serviceName; private ARTIFACT_TYPE artifactType; @@ -47,7 +47,7 @@ public class ServiceDataEvent { * @param serviceName Module name * @param artifactType Type of artifact that was posted to blackboard */ - public ServiceDataEvent(String serviceName, ARTIFACT_TYPE artifactType) { + public ModuleDataEvent(String serviceName, ARTIFACT_TYPE artifactType) { this.serviceName = serviceName; this.artifactType = artifactType; } @@ -57,7 +57,7 @@ public class ServiceDataEvent { * @param artifactType Type of artifact that was posted to blackboard * @param artifactIDs List of specific artifact ID values that were added to blackboard */ - public ServiceDataEvent(String serviceName, ARTIFACT_TYPE artifactType, Collection artifactIDs) { + public ModuleDataEvent(String serviceName, ARTIFACT_TYPE artifactType, Collection artifactIDs) { this(serviceName, artifactType); this.artifactIDs = artifactIDs; } diff --git a/Ingest/src/org/sleuthkit/autopsy/ingest/example/ExampleAbstractFileIngestService.java b/Ingest/src/org/sleuthkit/autopsy/ingest/example/ExampleAbstractFileIngestModule.java similarity index 74% rename from Ingest/src/org/sleuthkit/autopsy/ingest/example/ExampleAbstractFileIngestService.java rename to Ingest/src/org/sleuthkit/autopsy/ingest/example/ExampleAbstractFileIngestModule.java index 405e2a00e2..8cb831d545 100644 --- a/Ingest/src/org/sleuthkit/autopsy/ingest/example/ExampleAbstractFileIngestService.java +++ b/Ingest/src/org/sleuthkit/autopsy/ingest/example/ExampleAbstractFileIngestModule.java @@ -24,30 +24,30 @@ import java.util.logging.Logger; import org.sleuthkit.autopsy.ingest.IngestManagerProxy; import org.sleuthkit.autopsy.ingest.IngestMessage; import org.sleuthkit.autopsy.ingest.IngestMessage.MessageType; -import org.sleuthkit.autopsy.ingest.IngestServiceAbstract.ServiceType; -import org.sleuthkit.autopsy.ingest.IngestServiceAbstractFile; +import org.sleuthkit.autopsy.ingest.IngestModuleAbstract.ModuleType; +import org.sleuthkit.autopsy.ingest.IngestModuleAbstractFile; import org.sleuthkit.datamodel.AbstractFile; /** - * Example implementation of a fscontent image ingest service + * Example implementation of a file ingest module * */ -public class ExampleAbstractFileIngestService implements IngestServiceAbstractFile { +public class ExampleAbstractFileIngestModule implements IngestModuleAbstractFile { - private static final Logger logger = Logger.getLogger(ExampleAbstractFileIngestService.class.getName()); - private static ExampleAbstractFileIngestService instance = null; + private static final Logger logger = Logger.getLogger(ExampleAbstractFileIngestModule.class.getName()); + private static ExampleAbstractFileIngestModule instance = null; private IngestManagerProxy managerProxy; private static int messageId = 0; - //file ingest services require a private constructor + //file ingest modules require a private constructor //to ensure singleton instances - private ExampleAbstractFileIngestService() { + private ExampleAbstractFileIngestModule() { } - public static synchronized ExampleAbstractFileIngestService getDefault() { + public static synchronized ExampleAbstractFileIngestModule getDefault() { if (instance == null) { - instance = new ExampleAbstractFileIngestService(); + instance = new ExampleAbstractFileIngestModule(); } return instance; } @@ -56,7 +56,7 @@ public class ExampleAbstractFileIngestService implements IngestServiceAbstractFi public ProcessResult process(AbstractFile fsContent) { managerProxy.postMessage(IngestMessage.createMessage(++messageId, MessageType.INFO, this, "Processing " + fsContent.getName())); - //service specific AbstractFile processing code here + //module specific AbstractFile processing code here try { Thread.sleep(100); } catch (InterruptedException e) { @@ -70,17 +70,17 @@ public class ExampleAbstractFileIngestService implements IngestServiceAbstractFi logger.log(Level.INFO, "complete()"); managerProxy.postMessage(IngestMessage.createMessage(++messageId, MessageType.INFO, this, "Complete")); - //service specific cleanup due completion here + //module specific cleanup due completion here } @Override public String getName() { - return "Example AbstractFile Service"; + return "Example AbstractFile Module"; } @Override public String getDescription() { - return "Example AbstractFile Service description"; + return "Example AbstractFile Module description"; } @@ -90,7 +90,7 @@ public class ExampleAbstractFileIngestService implements IngestServiceAbstractFi logger.log(Level.INFO, "init()"); this.managerProxy = managerProxy; - //service specific initialization here + //module specific initialization here } @Override @@ -98,12 +98,12 @@ public class ExampleAbstractFileIngestService implements IngestServiceAbstractFi logger.log(Level.INFO, "stop()"); managerProxy.postMessage(IngestMessage.createMessage(++messageId, MessageType.INFO, this, "Stopped")); - //service specific cleanup due interruption here + //module specific cleanup due interruption here } @Override - public ServiceType getType() { - return ServiceType.AbstractFile; + public ModuleType getType() { + return ModuleType.AbstractFile; } @Override diff --git a/Ingest/src/org/sleuthkit/autopsy/ingest/example/ExampleImageIngestService.java b/Ingest/src/org/sleuthkit/autopsy/ingest/example/ExampleImageIngestModule.java similarity index 90% rename from Ingest/src/org/sleuthkit/autopsy/ingest/example/ExampleImageIngestService.java rename to Ingest/src/org/sleuthkit/autopsy/ingest/example/ExampleImageIngestModule.java index c1c1950672..89de129e55 100644 --- a/Ingest/src/org/sleuthkit/autopsy/ingest/example/ExampleImageIngestService.java +++ b/Ingest/src/org/sleuthkit/autopsy/ingest/example/ExampleImageIngestModule.java @@ -25,29 +25,29 @@ import org.sleuthkit.autopsy.ingest.IngestImageWorkerController; import org.sleuthkit.autopsy.ingest.IngestManagerProxy; import org.sleuthkit.autopsy.ingest.IngestMessage; import org.sleuthkit.autopsy.ingest.IngestMessage.MessageType; -import org.sleuthkit.autopsy.ingest.IngestServiceImage; +import org.sleuthkit.autopsy.ingest.IngestModuleImage; import org.sleuthkit.datamodel.Image; /** * Example implementation of an image ingest service * */ -public final class ExampleImageIngestService implements IngestServiceImage { +public final class ExampleImageIngestModule implements IngestModuleImage { - private static final Logger logger = Logger.getLogger(ExampleImageIngestService.class.getName()); - private static ExampleImageIngestService defaultInstance = null; + private static final Logger logger = Logger.getLogger(ExampleImageIngestModule.class.getName()); + private static ExampleImageIngestModule defaultInstance = null; private IngestManagerProxy managerProxy; private static int messageId = 0; //public constructor is required //as multiple instances are created for processing multiple images simultenously - public ExampleImageIngestService() { + public ExampleImageIngestModule() { } //default instance used for service registration - public static synchronized ExampleImageIngestService getDefault() { + public static synchronized ExampleImageIngestModule getDefault() { if (defaultInstance == null) { - defaultInstance = new ExampleImageIngestService(); + defaultInstance = new ExampleImageIngestModule(); } return defaultInstance; } @@ -125,8 +125,8 @@ public final class ExampleImageIngestService implements IngestServiceImage { } @Override - public ServiceType getType() { - return ServiceType.Image; + public ModuleType getType() { + return ModuleType.Image; } @Override diff --git a/Ingest/src/org/sleuthkit/autopsy/ingest/layer.xml b/Ingest/src/org/sleuthkit/autopsy/ingest/layer.xml index 142910fafc..eae2ad2d6c 100644 --- a/Ingest/src/org/sleuthkit/autopsy/ingest/layer.xml +++ b/Ingest/src/org/sleuthkit/autopsy/ingest/layer.xml @@ -14,17 +14,17 @@ --> - + diff --git a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/AbstractFileHtmlExtract.java b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/AbstractFileHtmlExtract.java index f871826185..c0289935f9 100644 --- a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/AbstractFileHtmlExtract.java +++ b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/AbstractFileHtmlExtract.java @@ -43,7 +43,7 @@ public class AbstractFileHtmlExtract implements AbstractFileExtract { private static final int SINGLE_READ_CHARS = 1024; private static final int EXTRA_CHARS = 128; //for whitespace private static final char[] TEXT_CHUNK_BUF = new char[MAX_EXTR_TEXT_CHARS]; - private KeywordSearchIngestService service; + private KeywordSearchIngestModule module; private Ingester ingester; private AbstractFile sourceFile; private int numChunks = 0; @@ -53,7 +53,7 @@ public class AbstractFileHtmlExtract implements AbstractFileExtract { }; AbstractFileHtmlExtract() { - this.service = KeywordSearchIngestService.getDefault(); + this.module = KeywordSearchIngestModule.getDefault(); ingester = Server.getIngester(); } @@ -161,7 +161,7 @@ public class AbstractFileHtmlExtract implements AbstractFileExtract { //check if need invoke commit/search between chunks //not to delay commit if timer has gone off - service.checkRunCommitSearch(); + module.checkRunCommitSearch(); } } catch (IOException ex) { logger.log(Level.WARNING, "Unable to read content stream from " + sourceFile.getId() + ": " + sourceFile.getName(), ex); diff --git a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/AbstractFileStringExtract.java b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/AbstractFileStringExtract.java index 0ac22999f5..6f67028656 100644 --- a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/AbstractFileStringExtract.java +++ b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/AbstractFileStringExtract.java @@ -39,7 +39,7 @@ import org.sleuthkit.datamodel.AbstractFile; */ class AbstractFileStringExtract implements AbstractFileExtract { - private KeywordSearchIngestService service; + private KeywordSearchIngestModule module; private Ingester ingester; private int numChunks; private static final Logger logger = Logger.getLogger(AbstractFileStringExtract.class.getName()); @@ -61,7 +61,7 @@ class AbstractFileStringExtract implements AbstractFileExtract { } public AbstractFileStringExtract() { - this.service = KeywordSearchIngestService.getDefault(); + this.module = KeywordSearchIngestModule.getDefault(); this.ingester = Server.getIngester(); this.extractScripts.add(DEFAULT_SCRIPT); } @@ -122,7 +122,7 @@ class AbstractFileStringExtract implements AbstractFileExtract { //check if need invoke commit/search between chunks //not to delay commit if timer has gone off - service.checkRunCommitSearch(); + module.checkRunCommitSearch(); //debug.close(); } diff --git a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/AbstractFileTikaTextExtract.java b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/AbstractFileTikaTextExtract.java index 000d1fd257..76ae4844e9 100644 --- a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/AbstractFileTikaTextExtract.java +++ b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/AbstractFileTikaTextExtract.java @@ -32,7 +32,7 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; import java.util.logging.Level; import java.util.logging.Logger; -import org.sleuthkit.autopsy.ingest.IngestServiceAbstractFile; +import org.sleuthkit.autopsy.ingest.IngestModuleAbstractFile; import org.sleuthkit.datamodel.AbstractFile; import org.sleuthkit.datamodel.ReadContentInputStream; import org.apache.tika.Tika; @@ -52,7 +52,7 @@ import org.sleuthkit.autopsy.keywordsearch.Ingester.IngesterException; */ public class AbstractFileTikaTextExtract implements AbstractFileExtract { - private static final Logger logger = Logger.getLogger(IngestServiceAbstractFile.class.getName()); + private static final Logger logger = Logger.getLogger(IngestModuleAbstractFile.class.getName()); private static final Logger tikaLogger = KeywordSearch.getTikaLogger(); private static final Charset OUTPUT_CHARSET = Server.DEFAULT_INDEXED_TEXT_CHARSET; static final int MAX_EXTR_TEXT_CHARS = 512 * 1024; @@ -60,7 +60,7 @@ public class AbstractFileTikaTextExtract implements AbstractFileExtract { private static final int EXTRA_CHARS = 128; //for whitespace private static final char[] TEXT_CHUNK_BUF = new char[MAX_EXTR_TEXT_CHARS]; //private Tika tika; - private KeywordSearchIngestService service; + private KeywordSearchIngestModule module; private static Ingester ingester; private AbstractFile sourceFile; //currently processed file private int numChunks = 0; @@ -74,7 +74,7 @@ public class AbstractFileTikaTextExtract implements AbstractFileExtract { "pst", "xml", "class", "dwg", "eml", "emlx", "mbox", "mht"}; AbstractFileTikaTextExtract() { - this.service = KeywordSearchIngestService.getDefault(); + this.module = KeywordSearchIngestModule.getDefault(); ingester = Server.getIngester(); } @@ -216,7 +216,7 @@ public class AbstractFileTikaTextExtract implements AbstractFileExtract { //check if need invoke commit/search between chunks //not to delay commit if timer has gone off - service.checkRunCommitSearch(); + module.checkRunCommitSearch(); } } catch (IOException ex) { final String msg = "Unable to read content stream from " + sourceFile.getId() + ": " + sourceFile.getName(); diff --git a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/AbstractKeywordSearchPerformer.java b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/AbstractKeywordSearchPerformer.java index 77033795e6..fe5cec511e 100644 --- a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/AbstractKeywordSearchPerformer.java +++ b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/AbstractKeywordSearchPerformer.java @@ -79,8 +79,8 @@ abstract class AbstractKeywordSearchPerformer extends javax.swing.JPanel impleme return; } - //check if keyword search service ingest is running (indexing, etc) - if (IngestManager.getDefault().isServiceRunning(KeywordSearchIngestService.getDefault())) { + //check if keyword search module ingest is running (indexing, etc) + if (IngestManager.getDefault().isModuleRunning(KeywordSearchIngestModule.getDefault())) { if (KeywordSearchUtil.displayConfirmDialog("Keyword Search Ingest in Progress", "Keyword Search Ingest is currently running.
" + "Not all files have been indexed and this search might yield incomplete results.
" diff --git a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordSearchConfigurationPanel2.java b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordSearchConfigurationPanel2.java index 2696d70436..289e2307ee 100644 --- a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordSearchConfigurationPanel2.java +++ b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordSearchConfigurationPanel2.java @@ -59,10 +59,10 @@ public class KeywordSearchConfigurationPanel2 extends javax.swing.JPanel { } private void activateWidgets() { - final KeywordSearchIngestService service = KeywordSearchIngestService.getDefault(); + final KeywordSearchIngestModule service = KeywordSearchIngestModule.getDefault(); skipNSRLCheckBox.setSelected(service.getSkipKnown()); boolean enable = !IngestManager.getDefault().isIngestRunning() - && ! IngestManager.getDefault().isServiceRunning(KeywordSearchIngestService.getDefault()); + && ! IngestManager.getDefault().isModuleRunning(KeywordSearchIngestModule.getDefault()); skipNSRLCheckBox.setEnabled(enable); } @@ -139,7 +139,7 @@ public class KeywordSearchConfigurationPanel2 extends javax.swing.JPanel { }// //GEN-END:initComponents private void skipNSRLCheckBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_skipNSRLCheckBoxActionPerformed - KeywordSearchIngestService.getDefault().setSkipKnown(skipNSRLCheckBox.isSelected()); + KeywordSearchIngestModule.getDefault().setSkipKnown(skipNSRLCheckBox.isSelected()); }//GEN-LAST:event_skipNSRLCheckBoxActionPerformed // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JLabel chunksLabel; @@ -152,7 +152,7 @@ private void skipNSRLCheckBoxActionPerformed(java.awt.event.ActionEvent evt) {// // End of variables declaration//GEN-END:variables private void customizeComponents() { - this.skipNSRLCheckBox.setSelected(KeywordSearchIngestService.getDefault().getSkipKnown()); + this.skipNSRLCheckBox.setSelected(KeywordSearchIngestModule.getDefault().getSkipKnown()); try { filesIndexedValue.setText(Integer.toString(KeywordSearch.getServer().queryNumIndexedFiles())); diff --git a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordSearchConfigurationPanel3.java b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordSearchConfigurationPanel3.java index f74cc9384d..904b62748a 100644 --- a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordSearchConfigurationPanel3.java +++ b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordSearchConfigurationPanel3.java @@ -64,7 +64,7 @@ public class KeywordSearchConfigurationPanel3 extends javax.swing.JPanel { toUpdate.add(s); } } - KeywordSearchIngestService.getDefault().setStringExtractScripts(toUpdate); + KeywordSearchIngestModule.getDefault().setStringExtractScripts(toUpdate); } }; @@ -104,7 +104,7 @@ public class KeywordSearchConfigurationPanel3 extends javax.swing.JPanel { } private void reloadScriptsCheckBoxes() { - final KeywordSearchIngestService service = KeywordSearchIngestService.getDefault(); + final KeywordSearchIngestModule service = KeywordSearchIngestModule.getDefault(); final List