mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-06 21:00:22 +00:00
Ingests API changes.
Rename "service" to "module"
This commit is contained in:
parent
8518a01867
commit
c78462d6a4
@ -64,7 +64,7 @@ import org.sleuthkit.autopsy.datamodel.Views;
|
|||||||
import org.sleuthkit.autopsy.datamodel.ViewsNode;
|
import org.sleuthkit.autopsy.datamodel.ViewsNode;
|
||||||
import org.sleuthkit.autopsy.ingest.IngestManager;
|
import org.sleuthkit.autopsy.ingest.IngestManager;
|
||||||
import org.sleuthkit.autopsy.ingest.IngestManager.IngestModuleEvent;
|
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.BlackboardArtifact;
|
||||||
import org.sleuthkit.datamodel.BlackboardAttribute;
|
import org.sleuthkit.datamodel.BlackboardAttribute;
|
||||||
import org.sleuthkit.datamodel.Content;
|
import org.sleuthkit.datamodel.Content;
|
||||||
@ -685,7 +685,7 @@ public final class DirectoryTreeTopComponent extends TopComponent implements Dat
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (changed.equals(IngestModuleEvent.DATA.toString())) {
|
if (changed.equals(IngestModuleEvent.DATA.toString())) {
|
||||||
final ServiceDataEvent event = (ServiceDataEvent) oldValue;
|
final ModuleDataEvent event = (ModuleDataEvent) oldValue;
|
||||||
SwingUtilities.invokeLater(new Runnable() {
|
SwingUtilities.invokeLater(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
|
@ -35,8 +35,8 @@ import java.util.logging.Logger;
|
|||||||
import org.sleuthkit.autopsy.ingest.IngestManagerProxy;
|
import org.sleuthkit.autopsy.ingest.IngestManagerProxy;
|
||||||
import org.sleuthkit.autopsy.ingest.IngestMessage;
|
import org.sleuthkit.autopsy.ingest.IngestMessage;
|
||||||
import org.sleuthkit.autopsy.ingest.IngestMessage.MessageType;
|
import org.sleuthkit.autopsy.ingest.IngestMessage.MessageType;
|
||||||
import org.sleuthkit.autopsy.ingest.IngestServiceAbstract;
|
import org.sleuthkit.autopsy.ingest.IngestModuleAbstract;
|
||||||
import org.sleuthkit.autopsy.ingest.IngestServiceAbstractFile;
|
import org.sleuthkit.autopsy.ingest.IngestModuleAbstractFile;
|
||||||
import org.sleuthkit.datamodel.AbstractFile;
|
import org.sleuthkit.datamodel.AbstractFile;
|
||||||
import org.sleuthkit.datamodel.BlackboardArtifact;
|
import org.sleuthkit.datamodel.BlackboardArtifact;
|
||||||
import org.sleuthkit.datamodel.BlackboardAttribute;
|
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,
|
* Ingests an image file and, if available, adds it's date, latitude, longitude,
|
||||||
* altitude, device model, and device make to a blackboard artifact.
|
* 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";
|
final String MODULE_NAME = "Exif Parser";
|
||||||
private static final Logger logger = Logger.getLogger(ExifParserFileIngestService.class.getName());
|
private static final Logger logger = Logger.getLogger(ExifParserFileIngestModule.class.getName());
|
||||||
private static ExifParserFileIngestService defaultInstance = null;
|
private static ExifParserFileIngestModule defaultInstance = null;
|
||||||
private IngestManagerProxy managerProxy;
|
private IngestManagerProxy managerProxy;
|
||||||
private static int messageId = 0;
|
private static int messageId = 0;
|
||||||
|
|
||||||
//file ingest services require a private constructor
|
//file ingest modules require a private constructor
|
||||||
//to ensure singleton instances
|
//to ensure singleton instances
|
||||||
private ExifParserFileIngestService() {
|
private ExifParserFileIngestModule() {
|
||||||
}
|
}
|
||||||
|
|
||||||
//default instance used for service registration
|
//default instance used for module registration
|
||||||
public static synchronized ExifParserFileIngestService getDefault() {
|
public static synchronized ExifParserFileIngestModule getDefault() {
|
||||||
if (defaultInstance == null) {
|
if (defaultInstance == null) {
|
||||||
defaultInstance = new ExifParserFileIngestService();
|
defaultInstance = new ExifParserFileIngestModule();
|
||||||
}
|
}
|
||||||
return defaultInstance;
|
return defaultInstance;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IngestServiceAbstractFile.ProcessResult process(AbstractFile content) {
|
public IngestModuleAbstractFile.ProcessResult process(AbstractFile content) {
|
||||||
if(content.getType().equals(TSK_DB_FILES_TYPE_ENUM.FS)) {
|
if(content.getType().equals(TSK_DB_FILES_TYPE_ENUM.FS)) {
|
||||||
FsContent fsContent = (FsContent) content;
|
FsContent fsContent = (FsContent) content;
|
||||||
if(fsContent.isFile()) {
|
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;
|
InputStream in = null;
|
||||||
BufferedInputStream bin = null;
|
BufferedInputStream bin = null;
|
||||||
|
|
||||||
@ -144,10 +144,10 @@ public final class ExifParserFileIngestService implements IngestServiceAbstractF
|
|||||||
bba.addAttributes(attributes);
|
bba.addAttributes(attributes);
|
||||||
}
|
}
|
||||||
|
|
||||||
return IngestServiceAbstractFile.ProcessResult.OK;
|
return IngestModuleAbstractFile.ProcessResult.OK;
|
||||||
|
|
||||||
} catch (TskCoreException ex) {
|
} 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) {
|
} catch (ImageProcessingException ex) {
|
||||||
logger.log(Level.WARNING, "Failed to process the image.", ex);
|
logger.log(Level.WARNING, "Failed to process the image.", ex);
|
||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
@ -162,7 +162,7 @@ public final class ExifParserFileIngestService implements IngestServiceAbstractF
|
|||||||
}
|
}
|
||||||
|
|
||||||
// If we got here, there was an error
|
// If we got here, there was an error
|
||||||
return IngestServiceAbstractFile.ProcessResult.ERROR;
|
return IngestModuleAbstractFile.ProcessResult.ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean parsableFormat(FsContent f) {
|
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");
|
final IngestMessage msg = IngestMessage.createMessage(++messageId, MessageType.INFO, this, "Complete");
|
||||||
managerProxy.postMessage(msg);
|
managerProxy.postMessage(msg);
|
||||||
|
|
||||||
//service specific cleanup due to completion here
|
//module specific cleanup due to completion here
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -212,12 +212,12 @@ public final class ExifParserFileIngestService implements IngestServiceAbstractF
|
|||||||
logger.log(Level.INFO, "stop()");
|
logger.log(Level.INFO, "stop()");
|
||||||
managerProxy.postMessage(IngestMessage.createMessage(++messageId, MessageType.INFO, this, "Stopped"));
|
managerProxy.postMessage(IngestMessage.createMessage(++messageId, MessageType.INFO, this, "Stopped"));
|
||||||
|
|
||||||
//service specific cleanup due to interruption here
|
//module specific cleanup due to interruption here
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IngestServiceAbstract.ServiceType getType() {
|
public IngestModuleAbstract.ModuleType getType() {
|
||||||
return IngestServiceAbstract.ServiceType.AbstractFile;
|
return IngestModuleAbstract.ModuleType.AbstractFile;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
@ -2,10 +2,10 @@
|
|||||||
<!DOCTYPE filesystem PUBLIC "-//NetBeans//DTD Filesystem 1.2//EN" "http://www.netbeans.org/dtds/filesystem-1_2.dtd">
|
<!DOCTYPE filesystem PUBLIC "-//NetBeans//DTD Filesystem 1.2//EN" "http://www.netbeans.org/dtds/filesystem-1_2.dtd">
|
||||||
<filesystem>
|
<filesystem>
|
||||||
<folder name="Services">
|
<folder name="Services">
|
||||||
<file name="org-sleuthkit-autopsy-exifparser-ExifParserFileIngestService.instance">
|
<file name="org-sleuthkit-autopsy-exifparser-ExifParserFileIngestModule.instance">
|
||||||
<attr name="instanceOf" stringvalue="org.sleuthkit.autopsy.ingest.IngestServiceAbstractFile"/>
|
<attr name="instanceOf" stringvalue="org.sleuthkit.autopsy.ingest.IngestModuleAbstractFile"/>
|
||||||
<attr name="instanceCreate" methodvalue="org.sleuthkit.autopsy.exifparser.ExifParserFileIngestService.getDefault"/>
|
<attr name="instanceCreate" methodvalue="org.sleuthkit.autopsy.exifparser.ExifParserFileIngestModule.getDefault"/>
|
||||||
<attr name="position" intvalue="110"/>
|
<attr name="position" intvalue="110"/>
|
||||||
</file>
|
</file>
|
||||||
</folder>
|
</folder>
|
||||||
</filesystem>
|
</filesystem>
|
||||||
|
@ -28,8 +28,8 @@ import org.sleuthkit.autopsy.casemodule.Case;
|
|||||||
import org.sleuthkit.autopsy.ingest.IngestManager;
|
import org.sleuthkit.autopsy.ingest.IngestManager;
|
||||||
import org.sleuthkit.autopsy.ingest.IngestManagerProxy;
|
import org.sleuthkit.autopsy.ingest.IngestManagerProxy;
|
||||||
import org.sleuthkit.autopsy.ingest.IngestMessage;
|
import org.sleuthkit.autopsy.ingest.IngestMessage;
|
||||||
import org.sleuthkit.autopsy.ingest.IngestServiceAbstractFile;
|
import org.sleuthkit.autopsy.ingest.IngestModuleAbstractFile;
|
||||||
import org.sleuthkit.autopsy.ingest.ServiceDataEvent;
|
import org.sleuthkit.autopsy.ingest.ModuleDataEvent;
|
||||||
import org.sleuthkit.datamodel.BlackboardArtifact;
|
import org.sleuthkit.datamodel.BlackboardArtifact;
|
||||||
import org.sleuthkit.datamodel.BlackboardArtifact.ARTIFACT_TYPE;
|
import org.sleuthkit.datamodel.BlackboardArtifact.ARTIFACT_TYPE;
|
||||||
import org.sleuthkit.datamodel.BlackboardAttribute;
|
import org.sleuthkit.datamodel.BlackboardAttribute;
|
||||||
@ -44,12 +44,12 @@ import org.sleuthkit.datamodel.SleuthkitCase;
|
|||||||
import org.sleuthkit.datamodel.TskData;
|
import org.sleuthkit.datamodel.TskData;
|
||||||
import org.sleuthkit.datamodel.TskException;
|
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_NAME = "Hash Lookup";
|
||||||
public final static String MODULE_DESCRIPTION = "Identifies known and notables files using supplied hash databases, such as a standard NSRL database.";
|
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 Processor processor = new Processor();
|
||||||
private IngestManagerProxy managerProxy;
|
private IngestManagerProxy managerProxy;
|
||||||
private SleuthkitCase skCase;
|
private SleuthkitCase skCase;
|
||||||
@ -66,20 +66,20 @@ public class HashDbIngestService implements IngestServiceAbstractFile {
|
|||||||
private Map<Integer, HashDb> knownBadSets = new HashMap<Integer, HashDb>();
|
private Map<Integer, HashDb> knownBadSets = new HashMap<Integer, HashDb>();
|
||||||
|
|
||||||
|
|
||||||
private HashDbIngestService() {
|
private HashDbIngestModule() {
|
||||||
count = 0;
|
count = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static synchronized HashDbIngestService getDefault() {
|
public static synchronized HashDbIngestModule getDefault() {
|
||||||
if (instance == null) {
|
if (instance == null) {
|
||||||
instance = new HashDbIngestService();
|
instance = new HashDbIngestModule();
|
||||||
}
|
}
|
||||||
return instance;
|
return instance;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* notification from manager that brand new processing should be initiated.
|
* 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
|
* @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.
|
* 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
|
@Override
|
||||||
public void complete() {
|
public void complete() {
|
||||||
@ -173,9 +173,9 @@ public class HashDbIngestService implements IngestServiceAbstractFile {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* get specific name of the service
|
* get specific name of the module
|
||||||
* should be unique across services, a user-friendly name of the service shown in GUI
|
* should be unique across modules, a user-friendly name of the module shown in GUI
|
||||||
* @return The name of this Ingest Service
|
* @return The name of this Ingest Module
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public String getName() {
|
public String getName() {
|
||||||
@ -199,8 +199,8 @@ public class HashDbIngestService implements IngestServiceAbstractFile {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ServiceType getType() {
|
public ModuleType getType() {
|
||||||
return ServiceType.AbstractFile;
|
return ModuleType.AbstractFile;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -272,7 +272,7 @@ public class HashDbIngestService implements IngestServiceAbstractFile {
|
|||||||
abstractFile.getName() + md5Hash,
|
abstractFile.getName() + md5Hash,
|
||||||
badFile));
|
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) {
|
} catch (TskException ex) {
|
||||||
logger.log(Level.WARNING, "Error creating blackboard artifact", ex);
|
logger.log(Level.WARNING, "Error creating blackboard artifact", ex);
|
||||||
}
|
}
|
||||||
@ -332,12 +332,12 @@ public class HashDbIngestService implements IngestServiceAbstractFile {
|
|||||||
}
|
}
|
||||||
} catch (TskException ex) {
|
} catch (TskException ex) {
|
||||||
logger.log(Level.WARNING, "Couldn't analyze file " + name + " - see sleuthkit log for details", 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 + "."));
|
"Error encountered while updating the hash values for " + name + "."));
|
||||||
ret = ProcessResult.ERROR;
|
ret = ProcessResult.ERROR;
|
||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
logger.log(Level.WARNING, "Error reading file " + name, 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 + "."));
|
"Error encountered while calculating the hash value for " + name + "."));
|
||||||
ret = ProcessResult.ERROR;
|
ret = ProcessResult.ERROR;
|
||||||
}
|
}
|
||||||
@ -354,7 +354,7 @@ public class HashDbIngestService implements IngestServiceAbstractFile {
|
|||||||
}
|
}
|
||||||
catch (IOException ex) {
|
catch (IOException ex) {
|
||||||
logger.log(Level.WARNING, "Error reading file " + name, 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."));
|
"Error encountered while calculating the hash value for " + name + " without databases."));
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -40,9 +40,9 @@
|
|||||||
</folder>
|
</folder>
|
||||||
</folder>
|
</folder>
|
||||||
<folder name="Services">
|
<folder name="Services">
|
||||||
<file name="org-sleuthkit-autopsy-hashdatabase-HashDbIngestService.instance">
|
<file name="org-sleuthkit-autopsy-hashdatabase-HashDbIngestModule.instance">
|
||||||
<attr name="instanceOf" stringvalue="org.sleuthkit.autopsy.ingest.IngestServiceAbstractFile"/>
|
<attr name="instanceOf" stringvalue="org.sleuthkit.autopsy.ingest.IngestModuleAbstractFile"/>
|
||||||
<attr name="instanceCreate" methodvalue="org.sleuthkit.autopsy.hashdatabase.HashDbIngestService.getDefault"/>
|
<attr name="instanceCreate" methodvalue="org.sleuthkit.autopsy.hashdatabase.HashDbIngestModule.getDefault"/>
|
||||||
<attr name="position" intvalue="200"/>
|
<attr name="position" intvalue="200"/>
|
||||||
</file>
|
</file>
|
||||||
</folder>
|
</folder>
|
||||||
|
@ -7,14 +7,14 @@ HINT_IngestTopComponent=Ingest window
|
|||||||
OpenIDE-Module-Name=Ingest
|
OpenIDE-Module-Name=Ingest
|
||||||
IngestTopComponent.messageFrame.title=Messages
|
IngestTopComponent.messageFrame.title=Messages
|
||||||
IngestTopComponent.ingestProgressLabel.text=File Ingest Progress
|
IngestTopComponent.ingestProgressLabel.text=File Ingest Progress
|
||||||
IngestControlPanel.topLable.text=Image ingest services
|
IngestControlPanel.topLable.text=Image ingest modules
|
||||||
IngestControlPanel.startButton.text=Start
|
IngestControlPanel.startButton.text=Start
|
||||||
IngestDialogPanel.ingestServicesLabel.text=Image Ingest Services
|
IngestDialogPanel.ingestServicesLabel.text=Image Ingest Modules
|
||||||
IngestDialogForm2.okButton.text=OK
|
IngestDialogForm2.okButton.text=OK
|
||||||
IngestDialogForm2.cancelButton.text=Cancel
|
IngestDialogForm2.cancelButton.text=Cancel
|
||||||
IngestDialogForm.cancelButton.text=Cancel
|
IngestDialogForm.cancelButton.text=Cancel
|
||||||
IngestDialogForm.startButton.text=Start
|
IngestDialogForm.startButton.text=Start
|
||||||
IngestDialogForm.jLabel1.text=Ingest Services
|
IngestDialogForm.jLabel1.text=Ingest Modules
|
||||||
IngestTopComponent.refreshFreqLabel.text=Refresh frequency
|
IngestTopComponent.refreshFreqLabel.text=Refresh frequency
|
||||||
IngestMessageDetailsPanel.backButton.text=
|
IngestMessageDetailsPanel.backButton.text=
|
||||||
IngestMessageDetailsPanel.viewArtifactButton.text=Go to Result
|
IngestMessageDetailsPanel.viewArtifactButton.text=Go to Result
|
||||||
|
@ -74,7 +74,7 @@
|
|||||||
|
|
||||||
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
|
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
|
||||||
<SubComponents>
|
<SubComponents>
|
||||||
<Component class="javax.swing.JTable" name="servicesTable">
|
<Component class="javax.swing.JTable" name="modulesTable">
|
||||||
<Properties>
|
<Properties>
|
||||||
<Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
|
<Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
|
||||||
<Color blue="f0" green="f0" red="f0" type="rgb"/>
|
<Color blue="f0" green="f0" red="f0" type="rgb"/>
|
||||||
@ -180,17 +180,10 @@
|
|||||||
<Group type="102" attributes="0">
|
<Group type="102" attributes="0">
|
||||||
<EmptySpace max="-2" attributes="0"/>
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
<Group type="103" groupAlignment="0" attributes="0">
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
<Group type="102" alignment="0" attributes="0">
|
<Component id="timeRadioButton1" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||||
<EmptySpace min="-2" pref="0" max="-2" attributes="0"/>
|
<Component id="timeLabel" min="-2" max="-2" attributes="0"/>
|
||||||
<Component id="timeRadioButton1" min="-2" max="-2" attributes="0"/>
|
<Component id="timeRadioButton2" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||||
</Group>
|
<Component id="timeRadioButton3" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||||
<Group type="102" attributes="0">
|
|
||||||
<Group type="103" groupAlignment="0" attributes="0">
|
|
||||||
<Component id="timeLabel" min="-2" max="-2" attributes="0"/>
|
|
||||||
<Component id="timeRadioButton2" alignment="0" min="-2" max="-2" attributes="0"/>
|
|
||||||
<Component id="timeRadioButton3" alignment="0" min="-2" max="-2" attributes="0"/>
|
|
||||||
</Group>
|
|
||||||
</Group>
|
|
||||||
</Group>
|
</Group>
|
||||||
<EmptySpace max="32767" attributes="0"/>
|
<EmptySpace max="32767" attributes="0"/>
|
||||||
</Group>
|
</Group>
|
||||||
|
@ -44,15 +44,15 @@ import org.sleuthkit.autopsy.ingest.IngestManager.UpdateFrequency;
|
|||||||
import org.sleuthkit.datamodel.Image;
|
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 {
|
public class IngestDialogPanel extends javax.swing.JPanel implements IngestConfigurator {
|
||||||
|
|
||||||
private IngestManager manager = null;
|
private IngestManager manager = null;
|
||||||
private List<IngestServiceAbstract> services;
|
private List<IngestModuleAbstract> modules;
|
||||||
private IngestServiceAbstract currentService;
|
private IngestModuleAbstract currentModule;
|
||||||
private Map<String, Boolean> serviceStates;
|
private Map<String, Boolean> moduleStates;
|
||||||
private ServicesTableModel tableModel;
|
private ModulesTableModel tableModel;
|
||||||
private static final Logger logger = Logger.getLogger(IngestDialogPanel.class.getName());
|
private static final Logger logger = Logger.getLogger(IngestDialogPanel.class.getName());
|
||||||
// The image that's just been added to the database
|
// The image that's just been added to the database
|
||||||
private Image image;
|
private Image image;
|
||||||
@ -60,9 +60,9 @@ public class IngestDialogPanel extends javax.swing.JPanel implements IngestConfi
|
|||||||
|
|
||||||
/** Creates new form IngestDialogPanel */
|
/** Creates new form IngestDialogPanel */
|
||||||
private IngestDialogPanel() {
|
private IngestDialogPanel() {
|
||||||
tableModel = new ServicesTableModel();
|
tableModel = new ModulesTableModel();
|
||||||
services = new ArrayList<IngestServiceAbstract>();
|
modules = new ArrayList<IngestModuleAbstract>();
|
||||||
serviceStates = new HashMap<String, Boolean>();
|
moduleStates = new HashMap<String, Boolean>();
|
||||||
initComponents();
|
initComponents();
|
||||||
customizeComponents();
|
customizeComponents();
|
||||||
}
|
}
|
||||||
@ -75,14 +75,14 @@ public class IngestDialogPanel extends javax.swing.JPanel implements IngestConfi
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void customizeComponents() {
|
private void customizeComponents() {
|
||||||
servicesTable.setModel(tableModel);
|
modulesTable.setModel(tableModel);
|
||||||
this.manager = IngestManager.getDefault();
|
this.manager = IngestManager.getDefault();
|
||||||
Collection<IngestServiceImage> imageServices = IngestManager.enumerateImageServices();
|
Collection<IngestModuleImage> imageServices = IngestManager.enumerateImageModules();
|
||||||
for (final IngestServiceImage service : imageServices) {
|
for (final IngestModuleImage service : imageServices) {
|
||||||
addService(service);
|
addService(service);
|
||||||
}
|
}
|
||||||
Collection<IngestServiceAbstractFile> fsServices = IngestManager.enumerateAbstractFileServices();
|
Collection<IngestModuleAbstractFile> fsServices = IngestManager.enumerateAbstractFileModules();
|
||||||
for (final IngestServiceAbstractFile service : fsServices) {
|
for (final IngestModuleAbstractFile service : fsServices) {
|
||||||
addService(service);
|
addService(service);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -113,17 +113,17 @@ public class IngestDialogPanel extends javax.swing.JPanel implements IngestConfi
|
|||||||
//
|
//
|
||||||
}
|
}
|
||||||
|
|
||||||
servicesTable.setTableHeader(null);
|
modulesTable.setTableHeader(null);
|
||||||
servicesTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
|
modulesTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
|
||||||
|
|
||||||
//custom renderer for tooltips
|
//custom renderer for tooltips
|
||||||
|
|
||||||
ServiceTableRenderer renderer = new ServiceTableRenderer();
|
ModulesTableRenderer renderer = new ModulesTableRenderer();
|
||||||
//customize column witdhs
|
//customize column witdhs
|
||||||
final int width = servicesScrollPane.getPreferredSize().width;
|
final int width = servicesScrollPane.getPreferredSize().width;
|
||||||
TableColumn column = null;
|
TableColumn column = null;
|
||||||
for (int i = 0; i < servicesTable.getColumnCount(); i++) {
|
for (int i = 0; i < modulesTable.getColumnCount(); i++) {
|
||||||
column = servicesTable.getColumnModel().getColumn(i);
|
column = modulesTable.getColumnModel().getColumn(i);
|
||||||
if (i == 0) {
|
if (i == 0) {
|
||||||
column.setPreferredWidth(((int) (width * 0.15)));
|
column.setPreferredWidth(((int) (width * 0.15)));
|
||||||
} else {
|
} 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
|
@Override
|
||||||
public void valueChanged(ListSelectionEvent e) {
|
public void valueChanged(ListSelectionEvent e) {
|
||||||
@ -140,11 +140,11 @@ public class IngestDialogPanel extends javax.swing.JPanel implements IngestConfi
|
|||||||
if (!listSelectionModel.isSelectionEmpty()) {
|
if (!listSelectionModel.isSelectionEmpty()) {
|
||||||
save();
|
save();
|
||||||
int index = listSelectionModel.getMinSelectionIndex();
|
int index = listSelectionModel.getMinSelectionIndex();
|
||||||
currentService = services.get(index);
|
currentModule = modules.get(index);
|
||||||
reloadSimpleConfiguration();
|
reloadSimpleConfiguration();
|
||||||
advancedButton.setEnabled(currentService.hasAdvancedConfiguration());
|
advancedButton.setEnabled(currentModule.hasAdvancedConfiguration());
|
||||||
} else {
|
} 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();
|
final String serviceName = service.getName();
|
||||||
services.add(service);
|
modules.add(service);
|
||||||
serviceStates.put(serviceName, true);
|
moduleStates.put(serviceName, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** This method is called from within the constructor to
|
/** 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();
|
timeGroup = new javax.swing.ButtonGroup();
|
||||||
servicesScrollPane = new javax.swing.JScrollPane();
|
servicesScrollPane = new javax.swing.JScrollPane();
|
||||||
servicesTable = new javax.swing.JTable();
|
modulesTable = new javax.swing.JTable();
|
||||||
jPanel1 = new javax.swing.JPanel();
|
jPanel1 = new javax.swing.JPanel();
|
||||||
advancedButton = new javax.swing.JButton();
|
advancedButton = new javax.swing.JButton();
|
||||||
jSeparator2 = new javax.swing.JSeparator();
|
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.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(160, 160, 160)));
|
||||||
servicesScrollPane.setPreferredSize(new java.awt.Dimension(160, 160));
|
servicesScrollPane.setPreferredSize(new java.awt.Dimension(160, 160));
|
||||||
|
|
||||||
servicesTable.setBackground(new java.awt.Color(240, 240, 240));
|
modulesTable.setBackground(new java.awt.Color(240, 240, 240));
|
||||||
servicesTable.setModel(new javax.swing.table.DefaultTableModel(
|
modulesTable.setModel(new javax.swing.table.DefaultTableModel(
|
||||||
new Object [][] {
|
new Object [][] {
|
||||||
|
|
||||||
},
|
},
|
||||||
@ -221,9 +221,9 @@ public class IngestDialogPanel extends javax.swing.JPanel implements IngestConfi
|
|||||||
|
|
||||||
}
|
}
|
||||||
));
|
));
|
||||||
servicesTable.setShowHorizontalLines(false);
|
modulesTable.setShowHorizontalLines(false);
|
||||||
servicesTable.setShowVerticalLines(false);
|
modulesTable.setShowVerticalLines(false);
|
||||||
servicesScrollPane.setViewportView(servicesTable);
|
servicesScrollPane.setViewportView(modulesTable);
|
||||||
|
|
||||||
jPanel1.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(160, 160, 160)));
|
jPanel1.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(160, 160, 160)));
|
||||||
jPanel1.setPreferredSize(new java.awt.Dimension(338, 257));
|
jPanel1.setPreferredSize(new java.awt.Dimension(338, 257));
|
||||||
@ -290,14 +290,10 @@ public class IngestDialogPanel extends javax.swing.JPanel implements IngestConfi
|
|||||||
.addGroup(timePanelLayout.createSequentialGroup()
|
.addGroup(timePanelLayout.createSequentialGroup()
|
||||||
.addContainerGap()
|
.addContainerGap()
|
||||||
.addGroup(timePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
.addGroup(timePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
.addGroup(timePanelLayout.createSequentialGroup()
|
.addComponent(timeRadioButton1)
|
||||||
.addGap(0, 0, 0)
|
.addComponent(timeLabel)
|
||||||
.addComponent(timeRadioButton1))
|
.addComponent(timeRadioButton2)
|
||||||
.addGroup(timePanelLayout.createSequentialGroup()
|
.addComponent(timeRadioButton3))
|
||||||
.addGroup(timePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
|
||||||
.addComponent(timeLabel)
|
|
||||||
.addComponent(timeRadioButton2)
|
|
||||||
.addComponent(timeRadioButton3))))
|
|
||||||
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||||
);
|
);
|
||||||
timePanelLayout.setVerticalGroup(
|
timePanelLayout.setVerticalGroup(
|
||||||
@ -377,11 +373,11 @@ public class IngestDialogPanel extends javax.swing.JPanel implements IngestConfi
|
|||||||
@Override
|
@Override
|
||||||
public void actionPerformed(ActionEvent e) {
|
public void actionPerformed(ActionEvent e) {
|
||||||
dialog.close();
|
dialog.close();
|
||||||
currentService.saveAdvancedConfiguration();
|
currentModule.saveAdvancedConfiguration();
|
||||||
reloadSimpleConfiguration();
|
reloadSimpleConfiguration();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
dialog.display(currentService.getAdvancedConfiguration());
|
dialog.display(currentModule.getAdvancedConfiguration());
|
||||||
}//GEN-LAST:event_advancedButtonActionPerformed
|
}//GEN-LAST:event_advancedButtonActionPerformed
|
||||||
|
|
||||||
private void timeRadioButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_timeRadioButton1ActionPerformed
|
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.JPanel jPanel1;
|
||||||
private javax.swing.JScrollPane jScrollPane1;
|
private javax.swing.JScrollPane jScrollPane1;
|
||||||
private javax.swing.JSeparator jSeparator2;
|
private javax.swing.JSeparator jSeparator2;
|
||||||
|
private javax.swing.JTable modulesTable;
|
||||||
private javax.swing.JCheckBox processUnallocCheckbox;
|
private javax.swing.JCheckBox processUnallocCheckbox;
|
||||||
private javax.swing.JPanel processUnallocPanel;
|
private javax.swing.JPanel processUnallocPanel;
|
||||||
private javax.swing.JScrollPane servicesScrollPane;
|
private javax.swing.JScrollPane servicesScrollPane;
|
||||||
private javax.swing.JTable servicesTable;
|
|
||||||
private javax.swing.JPanel simplePanel;
|
private javax.swing.JPanel simplePanel;
|
||||||
private javax.swing.ButtonGroup timeGroup;
|
private javax.swing.ButtonGroup timeGroup;
|
||||||
private javax.swing.JLabel timeLabel;
|
private javax.swing.JLabel timeLabel;
|
||||||
@ -410,11 +406,11 @@ private void timeRadioButton1ActionPerformed(java.awt.event.ActionEvent evt) {//
|
|||||||
private javax.swing.JRadioButton timeRadioButton3;
|
private javax.swing.JRadioButton timeRadioButton3;
|
||||||
// End of variables declaration//GEN-END:variables
|
// End of variables declaration//GEN-END:variables
|
||||||
|
|
||||||
private class ServicesTableModel extends AbstractTableModel {
|
private class ModulesTableModel extends AbstractTableModel {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getRowCount() {
|
public int getRowCount() {
|
||||||
return services.size();
|
return modules.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -424,9 +420,9 @@ private void timeRadioButton1ActionPerformed(java.awt.event.ActionEvent evt) {//
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Object getValueAt(int rowIndex, int columnIndex) {
|
public Object getValueAt(int rowIndex, int columnIndex) {
|
||||||
String name = services.get(rowIndex).getName();
|
String name = modules.get(rowIndex).getName();
|
||||||
if (columnIndex == 0) {
|
if (columnIndex == 0) {
|
||||||
return serviceStates.get(name);
|
return moduleStates.get(name);
|
||||||
} else {
|
} else {
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
@ -440,7 +436,7 @@ private void timeRadioButton1ActionPerformed(java.awt.event.ActionEvent evt) {//
|
|||||||
@Override
|
@Override
|
||||||
public void setValueAt(Object aValue, int rowIndex, int columnIndex) {
|
public void setValueAt(Object aValue, int rowIndex, int columnIndex) {
|
||||||
if (columnIndex == 0) {
|
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<IngestServiceAbstract> getServicesToStart() {
|
List<IngestModuleAbstract> getModulesToStart() {
|
||||||
List<IngestServiceAbstract> servicesToStart = new ArrayList<IngestServiceAbstract>();
|
List<IngestModuleAbstract> modulesToStart = new ArrayList<IngestModuleAbstract>();
|
||||||
for (IngestServiceAbstract service : services) {
|
for (IngestModuleAbstract module : modules) {
|
||||||
boolean serviceEnabled = serviceStates.get(service.getName());
|
boolean moduleEnabled = moduleStates.get(module.getName());
|
||||||
if (serviceEnabled) {
|
if (moduleEnabled) {
|
||||||
servicesToStart.add(service);
|
modulesToStart.add(module);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return servicesToStart;
|
return modulesToStart;
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean timeSelectionEnabled() {
|
private boolean timeSelectionEnabled() {
|
||||||
@ -482,8 +478,8 @@ private void timeRadioButton1ActionPerformed(java.awt.event.ActionEvent evt) {//
|
|||||||
|
|
||||||
private void reloadSimpleConfiguration() {
|
private void reloadSimpleConfiguration() {
|
||||||
simplePanel.removeAll();
|
simplePanel.removeAll();
|
||||||
if (currentService.hasSimpleConfiguration()) {
|
if (currentModule.hasSimpleConfiguration()) {
|
||||||
simplePanel.add(currentService.getSimpleConfiguration());
|
simplePanel.add(currentModule.getSimpleConfiguration());
|
||||||
}
|
}
|
||||||
simplePanel.revalidate();
|
simplePanel.revalidate();
|
||||||
simplePanel.repaint();
|
simplePanel.repaint();
|
||||||
@ -495,8 +491,8 @@ private void timeRadioButton1ActionPerformed(java.awt.event.ActionEvent evt) {//
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void save() {
|
public void save() {
|
||||||
if (currentService != null && currentService.hasSimpleConfiguration()) {
|
if (currentModule != null && currentModule.hasSimpleConfiguration()) {
|
||||||
currentService.saveSimpleConfiguration();
|
currentModule.saveSimpleConfiguration();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -512,11 +508,11 @@ private void timeRadioButton1ActionPerformed(java.awt.event.ActionEvent evt) {//
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void start() {
|
public void start() {
|
||||||
//pick the services
|
//pick the modules
|
||||||
List<IngestServiceAbstract> servicesToStart = getServicesToStart();
|
List<IngestModuleAbstract> modulesToStart = getModulesToStart();
|
||||||
|
|
||||||
if (!servicesToStart.isEmpty()) {
|
if (!modulesToStart.isEmpty()) {
|
||||||
manager.execute(servicesToStart, image);
|
manager.execute(modulesToStart, image);
|
||||||
}
|
}
|
||||||
|
|
||||||
//update ingest freq. refresh
|
//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
|
@Override
|
||||||
public Component getTableCellRendererComponent(
|
public Component getTableCellRendererComponent(
|
||||||
@ -551,9 +547,9 @@ private void timeRadioButton1ActionPerformed(java.awt.event.ActionEvent evt) {//
|
|||||||
|
|
||||||
if (column == 1) {
|
if (column == 1) {
|
||||||
//String serviceName = (String) table.getModel().getValueAt(row, column);
|
//String serviceName = (String) table.getModel().getValueAt(row, column);
|
||||||
IngestServiceAbstract service = services.get(row);
|
IngestModuleAbstract module = modules.get(row);
|
||||||
String serviceDescr = service.getDescription();
|
String moduleDescr = module.getDescription();
|
||||||
setToolTipText(serviceDescr);
|
setToolTipText(moduleDescr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -39,11 +39,11 @@ public class IngestImageThread extends SwingWorker<Object, Void> {
|
|||||||
private Logger logger = Logger.getLogger(IngestImageThread.class.getName());
|
private Logger logger = Logger.getLogger(IngestImageThread.class.getName());
|
||||||
private ProgressHandle progress;
|
private ProgressHandle progress;
|
||||||
private Image image;
|
private Image image;
|
||||||
private IngestServiceImage service;
|
private IngestModuleImage service;
|
||||||
private IngestImageWorkerController controller;
|
private IngestImageWorkerController controller;
|
||||||
private IngestManager manager;
|
private IngestManager manager;
|
||||||
|
|
||||||
IngestImageThread(IngestManager manager, Image image, IngestServiceImage service) {
|
IngestImageThread(IngestManager manager, Image image, IngestModuleImage service) {
|
||||||
this.manager = manager;
|
this.manager = manager;
|
||||||
this.image = image;
|
this.image = image;
|
||||||
this.service = service;
|
this.service = service;
|
||||||
@ -53,7 +53,7 @@ public class IngestImageThread extends SwingWorker<Object, Void> {
|
|||||||
return image;
|
return image;
|
||||||
}
|
}
|
||||||
|
|
||||||
IngestServiceImage getService() {
|
IngestModuleImage getModule() {
|
||||||
return service;
|
return service;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -113,7 +113,7 @@ public class IngestImageThread extends SwingWorker<Object, Void> {
|
|||||||
catch (Exception e) {
|
catch (Exception e) {
|
||||||
logger.log(Level.INFO, "Error completing the service " + service.getName(), 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 {
|
} else {
|
||||||
logger.log(Level.INFO, "Service " + service.getName() + " stopped");
|
logger.log(Level.INFO, "Service " + service.getName() + " stopped");
|
||||||
try {
|
try {
|
||||||
@ -122,7 +122,7 @@ public class IngestImageThread extends SwingWorker<Object, Void> {
|
|||||||
catch (Exception e) {
|
catch (Exception e) {
|
||||||
logger.log(Level.INFO, "Error stopping the service" + service.getName(), 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());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* Autopsy Forensic Browser
|
* Autopsy Forensic Browser
|
||||||
*
|
*
|
||||||
* Copyright 2011 Basis Technology Corp.
|
* Copyright 2012 Basis Technology Corp.
|
||||||
* Contact: carrier <at> sleuthkit <dot> org
|
* Contact: carrier <at> sleuthkit <dot> org
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
@ -50,9 +50,9 @@ import org.sleuthkit.datamodel.Image;
|
|||||||
import org.sleuthkit.datamodel.TskData;
|
import org.sleuthkit.datamodel.TskData;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* IngestManager sets up and manages ingest services runs them in a background
|
* IngestManager sets up and manages ingest modules runs them in a background
|
||||||
* thread notifies services when work is complete or should be interrupted
|
* thread notifies modules when work is complete or should be interrupted
|
||||||
* processes messages from services via messenger proxy and posts them to GUI.
|
* 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.
|
* 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 volatile UpdateFrequency updateFrequency = UpdateFrequency.AVG;
|
||||||
private boolean processUnallocSpace = true;
|
private boolean processUnallocSpace = true;
|
||||||
//queues
|
//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 AbstractFileQueue abstractFileQueue = new AbstractFileQueue();
|
||||||
private final Object queuesLock = new Object();
|
private final Object queuesLock = new Object();
|
||||||
//workers
|
//workers
|
||||||
private IngestAbstractFileThread abstractFileIngester;
|
private IngestAbstractFileThread abstractFileIngester;
|
||||||
private List<IngestImageThread> imageIngesters;
|
private List<IngestImageThread> imageIngesters;
|
||||||
private SwingWorker<Object, Void> queueWorker;
|
private SwingWorker<Object, Void> queueWorker;
|
||||||
//services
|
//modules
|
||||||
private final List<IngestServiceImage> imageServices = enumerateImageServices();
|
private final List<IngestModuleImage> imageModules = enumerateImageModules();
|
||||||
private final List<IngestServiceAbstractFile> abstractFileServices = enumerateAbstractFileServices();
|
private final List<IngestModuleAbstractFile> abstractFileModules = enumerateAbstractFileModules();
|
||||||
// service return values
|
// module return values
|
||||||
private final Map<String, IngestServiceAbstractFile.ProcessResult> abstractFileServiceResults = new HashMap<String, IngestServiceAbstractFile.ProcessResult>();
|
private final Map<String, IngestModuleAbstractFile.ProcessResult> abstractFileModulesRetValues = new HashMap<String, IngestModuleAbstractFile.ProcessResult>();
|
||||||
//manager proxy
|
//manager proxy
|
||||||
final IngestManagerProxy managerProxy = new IngestManagerProxy(this);
|
final IngestManagerProxy managerProxy = new IngestManagerProxy(this);
|
||||||
//notifications
|
//notifications
|
||||||
@ -128,9 +128,9 @@ public class IngestManager {
|
|||||||
STOPPED,
|
STOPPED,
|
||||||
/**
|
/**
|
||||||
* Event sent when ingest module has new data. Second argument of the
|
* 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
|
* 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
|
DATA
|
||||||
@ -170,46 +170,46 @@ public class IngestManager {
|
|||||||
pcs.addPropertyChangeListener(l);
|
pcs.addPropertyChangeListener(l);
|
||||||
}
|
}
|
||||||
|
|
||||||
static synchronized void fireServiceEvent(String eventType, String serviceName) {
|
static synchronized void fireModuleEvent(String eventType, String moduleName) {
|
||||||
pcs.firePropertyChange(eventType, serviceName, null);
|
pcs.firePropertyChange(eventType, moduleName, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
static synchronized void fireServiceDataEvent(ServiceDataEvent serviceDataEvent) {
|
static synchronized void fireModuleDataEvent(ModuleDataEvent moduleDataEvent) {
|
||||||
pcs.firePropertyChange(IngestModuleEvent.DATA.toString(), serviceDataEvent, null);
|
pcs.firePropertyChange(IngestModuleEvent.DATA.toString(), moduleDataEvent, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the return value from a previously run module on the file being
|
* 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.
|
* @returns Return value from that module if it was previously run.
|
||||||
*/
|
*/
|
||||||
IngestServiceAbstractFile.ProcessResult getAbstractFileServiceResult(String serviceName) {
|
IngestModuleAbstractFile.ProcessResult getAbstractFileModuleResult(String moduleName) {
|
||||||
synchronized (abstractFileServiceResults) {
|
synchronized (abstractFileModulesRetValues) {
|
||||||
if (abstractFileServiceResults.containsKey(serviceName)) {
|
if (abstractFileModulesRetValues.containsKey(moduleName)) {
|
||||||
return abstractFileServiceResults.get(serviceName);
|
return abstractFileModulesRetValues.get(moduleName);
|
||||||
} else {
|
} else {
|
||||||
return IngestServiceAbstractFile.ProcessResult.UNKNOWN;
|
return IngestModuleAbstractFile.ProcessResult.UNKNOWN;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Multiple image version of execute, enqueues multiple images and
|
* 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 modules modules to execute on every image
|
||||||
* @param images images to execute services on
|
* @param images images to execute modules on
|
||||||
*/
|
*/
|
||||||
void execute(final List<IngestServiceAbstract> services, final List<Image> images) {
|
void execute(final List<IngestModuleAbstract> modules, final List<Image> images) {
|
||||||
logger.log(Level.INFO, "Will enqueue number of images: " + images.size() + " to " + services.size() + " services.");
|
logger.log(Level.INFO, "Will enqueue number of images: " + images.size() + " to " + modules.size() + " modules.");
|
||||||
|
|
||||||
if (!isIngestRunning()) {
|
if (!isIngestRunning()) {
|
||||||
ui.clearMessages();
|
ui.clearMessages();
|
||||||
}
|
}
|
||||||
|
|
||||||
queueWorker = new EnqueueWorker(services, images);
|
queueWorker = new EnqueueWorker(modules, images);
|
||||||
queueWorker.execute();
|
queueWorker.execute();
|
||||||
|
|
||||||
ui.restoreMessages();
|
ui.restoreMessages();
|
||||||
@ -219,29 +219,29 @@ public class IngestManager {
|
|||||||
/**
|
/**
|
||||||
* IngestManager entry point, enqueues image to be processed. Spawns
|
* IngestManager entry point, enqueues image to be processed. Spawns
|
||||||
* background thread which enumerates all sorted files and executes chosen
|
* 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.
|
* 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
|
* Does not block and can be called multiple times to enqueue more work to
|
||||||
* already running background process.
|
* already running background process.
|
||||||
*
|
*
|
||||||
* @param services services to execute on the image
|
* @param modules modules to execute on the image
|
||||||
* @param image image to execute services on
|
* @param image image to execute modules on
|
||||||
*/
|
*/
|
||||||
void execute(final List<IngestServiceAbstract> services, final Image image) {
|
void execute(final List<IngestModuleAbstract> modules, final Image image) {
|
||||||
List<Image> images = new ArrayList<Image>();
|
List<Image> images = new ArrayList<Image>();
|
||||||
images.add(image);
|
images.add(image);
|
||||||
logger.log(Level.INFO, "Will enqueue image: " + image.getName());
|
logger.log(Level.INFO, "Will enqueue image: " + image.getName());
|
||||||
execute(services, images);
|
execute(modules, images);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Starts the needed worker threads.
|
* 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
|
* consume queue otherwise start /restart AbstractFile worker
|
||||||
*
|
*
|
||||||
* image workers run per (service,image). Check if one for the
|
* image workers run per (module,image). Check if one for the
|
||||||
* (service,image) is already running otherwise start/restart the worker
|
* (module,image) is already running otherwise start/restart the worker
|
||||||
*/
|
*/
|
||||||
private synchronized void startAll() {
|
private synchronized void startAll() {
|
||||||
logger.log(Level.INFO, "Image queue: " + this.imageQueue.toString());
|
logger.log(Level.INFO, "Image queue: " + this.imageQueue.toString());
|
||||||
@ -255,38 +255,38 @@ public class IngestManager {
|
|||||||
// cycle through each image in the queue
|
// cycle through each image in the queue
|
||||||
while (hasNextImage()) {
|
while (hasNextImage()) {
|
||||||
//dequeue
|
//dequeue
|
||||||
// get next image and set of services
|
// get next image and set of modules
|
||||||
final Map.Entry<Image, List<IngestServiceImage>> qu =
|
final Map.Entry<Image, List<IngestModuleImage>> qu =
|
||||||
this.getNextImage();
|
this.getNextImage();
|
||||||
|
|
||||||
|
|
||||||
// check if each service for this image is already running
|
// check if each module for this image is already running
|
||||||
//synchronized (this) {
|
//synchronized (this) {
|
||||||
for (IngestServiceImage quService : qu.getValue()) {
|
for (IngestModuleImage quModule : qu.getValue()) {
|
||||||
boolean alreadyRunning = false;
|
boolean alreadyRunning = false;
|
||||||
for (IngestImageThread worker : imageIngesters) {
|
for (IngestImageThread worker : imageIngesters) {
|
||||||
// ignore threads that are on different images
|
// ignore threads that are on different images
|
||||||
if (!worker.getImage().equals(qu.getKey())) {
|
if (!worker.getImage().equals(qu.getKey())) {
|
||||||
continue; //check next worker
|
continue; //check next worker
|
||||||
}
|
}
|
||||||
//same image, check service (by name, not id, since different instances)
|
//same image, check module (by name, not id, since different instances)
|
||||||
if (worker.getService().getName().equals(quService.getName())) {
|
if (worker.getModule().getName().equals(quModule.getName())) {
|
||||||
alreadyRunning = true;
|
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;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//checked all workers
|
//checked all workers
|
||||||
if (alreadyRunning == false) {
|
if (alreadyRunning == false) {
|
||||||
logger.log(Level.INFO, "Starting new image Ingester <" + qu.getKey() + ", " + quService.getName() + ">");
|
logger.log(Level.INFO, "Starting new image Ingester <" + qu.getKey() + ", " + quModule.getName() + ">");
|
||||||
IngestImageThread newImageWorker = new IngestImageThread(this, qu.getKey(), quService);
|
IngestImageThread newImageWorker = new IngestImageThread(this, qu.getKey(), quModule);
|
||||||
|
|
||||||
imageIngesters.add(newImageWorker);
|
imageIngesters.add(newImageWorker);
|
||||||
|
|
||||||
//image services are now initialized per instance
|
//image modules are now initialized per instance
|
||||||
quService.init(managerProxy);
|
quModule.init(managerProxy);
|
||||||
newImageWorker.execute();
|
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) {
|
if (startAbstractFileIngester) {
|
||||||
stats = new IngestManagerStats();
|
stats = new IngestManagerStats();
|
||||||
abstractFileIngester = new IngestAbstractFileThread();
|
abstractFileIngester = new IngestAbstractFileThread();
|
||||||
//init all fs services, everytime new worker starts
|
//init all fs modules, everytime new worker starts
|
||||||
for (IngestServiceAbstractFile s : abstractFileServices) {
|
for (IngestModuleAbstractFile s : abstractFileModules) {
|
||||||
s.init(managerProxy);
|
s.init(managerProxy);
|
||||||
}
|
}
|
||||||
abstractFileIngester.execute();
|
abstractFileIngester.execute();
|
||||||
@ -334,15 +334,15 @@ public class IngestManager {
|
|||||||
emptyAbstractFiles();
|
emptyAbstractFiles();
|
||||||
emptyImages();
|
emptyImages();
|
||||||
|
|
||||||
//stop service workers
|
//stop module workers
|
||||||
if (abstractFileIngester != null) {
|
if (abstractFileIngester != null) {
|
||||||
//send signals to all file services
|
//send signals to all file modules
|
||||||
for (IngestServiceAbstractFile s : this.abstractFileServices) {
|
for (IngestModuleAbstractFile s : this.abstractFileModules) {
|
||||||
if (isServiceRunning(s)) {
|
if (isModuleRunning(s)) {
|
||||||
try {
|
try {
|
||||||
s.stop();
|
s.stop();
|
||||||
} catch (Exception e) {
|
} 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) {
|
for (IngestImageThread imageWorker : toStop) {
|
||||||
IngestServiceImage s = imageWorker.getService();
|
IngestModuleImage s = imageWorker.getModule();
|
||||||
|
|
||||||
//stop the worker thread if thread is running
|
//stop the worker thread if thread is running
|
||||||
boolean cancelled = imageWorker.cancel(true);
|
boolean cancelled = imageWorker.cancel(true);
|
||||||
if (!cancelled) {
|
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
|
//stop notification to module to cleanup resources
|
||||||
if (isServiceRunning(s)) {
|
if (isModuleRunning(s)) {
|
||||||
try {
|
try {
|
||||||
imageWorker.getService().stop();
|
imageWorker.getModule().stop();
|
||||||
} catch (Exception e) {
|
} 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() {
|
public synchronized boolean areModulesRunning() {
|
||||||
for (IngestServiceAbstract serv : abstractFileServices) {
|
for (IngestModuleAbstract serv : abstractFileModules) {
|
||||||
if(serv.hasBackgroundJobsRunning()) {
|
if(serv.hasBackgroundJobsRunning()) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (IngestImageThread thread : imageIngesters) {
|
for (IngestImageThread thread : imageIngesters) {
|
||||||
if(isServiceRunning(thread.getService())) {
|
if(isModuleRunning(thread.getModule())) {
|
||||||
return false;
|
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
|
* complete/stopped) give a complete answer, i.e. it's already consumed all
|
||||||
* files but it might have background threads running
|
* 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) {
|
synchronized (queuesLock) {
|
||||||
if (abstractFileQueue.hasServiceEnqueued((IngestServiceAbstractFile) service)) {
|
if (abstractFileQueue.hasModuleEnqueued((IngestModuleAbstractFile) module)) {
|
||||||
//has work enqueued, so running
|
//has work enqueued, so running
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
//not in the queue, but could still have bkg work running
|
//not in the queue, but could still have bkg work running
|
||||||
return service.hasBackgroundJobsRunning();
|
return module.hasBackgroundJobsRunning();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
//image service
|
//image module
|
||||||
synchronized (this) {
|
synchronized (this) {
|
||||||
if (imageIngesters.isEmpty()) {
|
if (imageIngesters.isEmpty()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
IngestImageThread imt = null;
|
IngestImageThread imt = null;
|
||||||
for (IngestImageThread ii : imageIngesters) {
|
for (IngestImageThread ii : imageIngesters) {
|
||||||
if (ii.getService().equals(service)) {
|
if (ii.getModule().equals(module)) {
|
||||||
imt = ii;
|
imt = ii;
|
||||||
break;
|
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
|
* should call this at init() to get current setting and use the setting to
|
||||||
* change notification and data refresh intervals
|
* 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
|
* @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
|
* 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
|
* multiple times. Viewer will attempt to identify duplicate messages and
|
||||||
* filter them out (slower)
|
* 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
|
* Lookup position order
|
||||||
*/
|
*/
|
||||||
public static List<IngestServiceImage> enumerateImageServices() {
|
public static List<IngestModuleImage> enumerateImageModules() {
|
||||||
List<IngestServiceImage> ret = new ArrayList<IngestServiceImage>();
|
List<IngestModuleImage> ret = new ArrayList<IngestModuleImage>();
|
||||||
for (IngestServiceImage list : Lookup.getDefault().lookupAll(IngestServiceImage.class)) {
|
for (IngestModuleImage list : Lookup.getDefault().lookupAll(IngestModuleImage.class)) {
|
||||||
ret.add(list);
|
ret.add(list);
|
||||||
}
|
}
|
||||||
return ret;
|
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
|
* in Lookup position order
|
||||||
*/
|
*/
|
||||||
public static List<IngestServiceAbstractFile> enumerateAbstractFileServices() {
|
public static List<IngestModuleAbstractFile> enumerateAbstractFileModules() {
|
||||||
List<IngestServiceAbstractFile> ret = new ArrayList<IngestServiceAbstractFile>();
|
List<IngestModuleAbstractFile> ret = new ArrayList<IngestModuleAbstractFile>();
|
||||||
for (IngestServiceAbstractFile list : Lookup.getDefault().lookupAll(IngestServiceAbstractFile.class)) {
|
for (IngestModuleAbstractFile list : Lookup.getDefault().lookupAll(IngestModuleAbstractFile.class)) {
|
||||||
ret.add(list);
|
ret.add(list);
|
||||||
}
|
}
|
||||||
return ret;
|
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
|
* @param image Image to analyze
|
||||||
*/
|
*/
|
||||||
private void addImage(IngestServiceImage service, Image image) {
|
private void addImage(IngestModuleImage module, Image image) {
|
||||||
synchronized (queuesLock) {
|
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
|
* @param abstractFiles files to enqueue
|
||||||
*/
|
*/
|
||||||
private void addAbstractFile(IngestServiceAbstractFile service, Collection<AbstractFile> abstractFiles) {
|
private void addAbstractFile(IngestModuleAbstractFile module, Collection<AbstractFile> abstractFiles) {
|
||||||
synchronized (queuesLock) {
|
synchronized (queuesLock) {
|
||||||
for (AbstractFile abstractFile : abstractFiles) {
|
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
|
* AbstractFile to process is maintained internally and could be dynamically
|
||||||
* sorted as data comes in
|
* sorted as data comes in
|
||||||
*/
|
*/
|
||||||
private Map.Entry<AbstractFile, List<IngestServiceAbstractFile>> getNextAbstractFile() {
|
private Map.Entry<AbstractFile, List<IngestModuleAbstractFile>> getNextAbstractFile() {
|
||||||
Map.Entry<AbstractFile, List<IngestServiceAbstractFile>> ret = null;
|
Map.Entry<AbstractFile, List<IngestModuleAbstractFile>> ret = null;
|
||||||
synchronized (queuesLock) {
|
synchronized (queuesLock) {
|
||||||
ret = abstractFileQueue.dequeue();
|
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
|
* maintained internally and could be dynamically sorted as data comes in
|
||||||
*/
|
*/
|
||||||
private Map.Entry<Image, List<IngestServiceImage>> getNextImage() {
|
private Map.Entry<Image, List<IngestModuleImage>> getNextImage() {
|
||||||
Map.Entry<Image, List<IngestServiceImage>> ret = null;
|
Map.Entry<Image, List<IngestModuleImage>> ret = null;
|
||||||
synchronized (queuesLock) {
|
synchronized (queuesLock) {
|
||||||
ret = imageQueue.dequeue();
|
ret = imageQueue.dequeue();
|
||||||
}
|
}
|
||||||
@ -767,7 +767,7 @@ public class IngestManager {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* manages queue of pending AbstractFile and list of associated
|
* 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
|
* AbstractFilePriotity
|
||||||
*/
|
*/
|
||||||
private class AbstractFileQueue {
|
private class AbstractFileQueue {
|
||||||
@ -785,26 +785,26 @@ public class IngestManager {
|
|||||||
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
final TreeMap<AbstractFile, List<IngestServiceAbstractFile>> AbstractFileUnits = new TreeMap<AbstractFile, List<IngestServiceAbstractFile>>(sorter);
|
final TreeMap<AbstractFile, List<IngestModuleAbstractFile>> AbstractFileUnits = new TreeMap<AbstractFile, List<IngestModuleAbstractFile>>(sorter);
|
||||||
|
|
||||||
void enqueue(AbstractFile AbstractFile, IngestServiceAbstractFile service) {
|
void enqueue(AbstractFile AbstractFile, IngestModuleAbstractFile module) {
|
||||||
//AbstractFileUnits.put(AbstractFile, Collections.singletonList(service));
|
//AbstractFileUnits.put(AbstractFile, Collections.singletonList(module));
|
||||||
List<IngestServiceAbstractFile> services = AbstractFileUnits.get(AbstractFile);
|
List<IngestModuleAbstractFile> modules = AbstractFileUnits.get(AbstractFile);
|
||||||
if (services == null) {
|
if (modules == null) {
|
||||||
services = new ArrayList<IngestServiceAbstractFile>();
|
modules = new ArrayList<IngestModuleAbstractFile>();
|
||||||
AbstractFileUnits.put(AbstractFile, services);
|
AbstractFileUnits.put(AbstractFile, modules);
|
||||||
}
|
}
|
||||||
services.add(service);
|
modules.add(module);
|
||||||
}
|
}
|
||||||
|
|
||||||
void enqueue(AbstractFile AbstractFile, List<IngestServiceAbstractFile> services) {
|
void enqueue(AbstractFile AbstractFile, List<IngestModuleAbstractFile> modules) {
|
||||||
|
|
||||||
List<IngestServiceAbstractFile> oldServices = AbstractFileUnits.get(AbstractFile);
|
List<IngestModuleAbstractFile> oldModules = AbstractFileUnits.get(AbstractFile);
|
||||||
if (oldServices == null) {
|
if (oldModules == null) {
|
||||||
oldServices = new ArrayList<IngestServiceAbstractFile>();
|
oldModules = new ArrayList<IngestModuleAbstractFile>();
|
||||||
AbstractFileUnits.put(AbstractFile, oldServices);
|
AbstractFileUnits.put(AbstractFile, oldModules);
|
||||||
}
|
}
|
||||||
oldServices.addAll(services);
|
oldModules.addAll(modules);
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean hasNext() {
|
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
|
* @return
|
||||||
*/
|
*/
|
||||||
Map.Entry<AbstractFile, List<IngestServiceAbstractFile>> dequeue() {
|
Map.Entry<AbstractFile, List<IngestModuleAbstractFile>> dequeue() {
|
||||||
if (!hasNext()) {
|
if (!hasNext()) {
|
||||||
throw new UnsupportedOperationException("AbstractFile processing queue is empty");
|
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
|
* @param module to check for
|
||||||
* @return true if the service is enqueued to do work
|
* @return true if the module is enqueued to do work
|
||||||
*/
|
*/
|
||||||
boolean hasServiceEnqueued(IngestServiceAbstractFile service) {
|
boolean hasModuleEnqueued(IngestModuleAbstractFile module) {
|
||||||
for (List<IngestServiceAbstractFile> list : AbstractFileUnits.values()) {
|
for (List<IngestModuleAbstractFile> list : AbstractFileUnits.values()) {
|
||||||
if (list.contains(service)) {
|
if (list.contains(module)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -855,7 +855,7 @@ public class IngestManager {
|
|||||||
|
|
||||||
public String printQueue() {
|
public String printQueue() {
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
/*for (QueueUnit<AbstractFile, IngestServiceAbstractFile> u : AbstractFileUnits) {
|
/*for (QueueUnit<AbstractFile, IngestModuleAbstractFile> u : AbstractFileUnits) {
|
||||||
sb.append(u.toString());
|
sb.append(u.toString());
|
||||||
sb.append("\n");
|
sb.append("\n");
|
||||||
}*/
|
}*/
|
||||||
@ -864,9 +864,9 @@ public class IngestManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* manages queue of pending Images and IngestServiceImage to use on that
|
* manages queue of pending Images and IngestModuleImage to use on that
|
||||||
* image. image / service pairs are added one at a time and internally, it
|
* image. image / module pairs are added one at a time and internally, it
|
||||||
* keeps track of all services for a given image.
|
* keeps track of all modules for a given image.
|
||||||
*/
|
*/
|
||||||
private class ImageQueue {
|
private class ImageQueue {
|
||||||
|
|
||||||
@ -877,24 +877,24 @@ public class IngestManager {
|
|||||||
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
private TreeMap<Image, List<IngestServiceImage>> imageUnits = new TreeMap<Image, List<IngestServiceImage>>(sorter);
|
private TreeMap<Image, List<IngestModuleImage>> imageUnits = new TreeMap<Image, List<IngestModuleImage>>(sorter);
|
||||||
|
|
||||||
void enqueue(Image image, IngestServiceImage service) {
|
void enqueue(Image image, IngestModuleImage module) {
|
||||||
List<IngestServiceImage> services = imageUnits.get(image);
|
List<IngestModuleImage> modules = imageUnits.get(image);
|
||||||
if (services == null) {
|
if (modules == null) {
|
||||||
services = new ArrayList<IngestServiceImage>();
|
modules = new ArrayList<IngestModuleImage>();
|
||||||
imageUnits.put(image, services);
|
imageUnits.put(image, modules);
|
||||||
}
|
}
|
||||||
services.add(service);
|
modules.add(module);
|
||||||
}
|
}
|
||||||
|
|
||||||
void enqueue(Image image, List<IngestServiceImage> services) {
|
void enqueue(Image image, List<IngestModuleImage> modules) {
|
||||||
List<IngestServiceImage> oldServices = imageUnits.get(image);
|
List<IngestModuleImage> oldModules = imageUnits.get(image);
|
||||||
if (oldServices == null) {
|
if (oldModules == null) {
|
||||||
oldServices = new ArrayList<IngestServiceImage>();
|
oldModules = new ArrayList<IngestModuleImage>();
|
||||||
imageUnits.put(image, oldServices);
|
imageUnits.put(image, oldModules);
|
||||||
}
|
}
|
||||||
oldServices.addAll(services);
|
oldModules.addAll(modules);
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean hasNext() {
|
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.
|
* on it.
|
||||||
*
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
Map.Entry<Image, List<IngestServiceImage>> dequeue() {
|
Map.Entry<Image, List<IngestModuleImage>> dequeue() {
|
||||||
if (!hasNext()) {
|
if (!hasNext()) {
|
||||||
throw new UnsupportedOperationException("Image processing queue is empty");
|
throw new UnsupportedOperationException("Image processing queue is empty");
|
||||||
}
|
}
|
||||||
@ -937,55 +937,55 @@ public class IngestManager {
|
|||||||
private Date startTime;
|
private Date startTime;
|
||||||
private Date endTime;
|
private Date endTime;
|
||||||
private int errorsTotal;
|
private int errorsTotal;
|
||||||
private Map<IngestServiceAbstract, Integer> errors;
|
private Map<IngestModuleAbstract, Integer> errors;
|
||||||
private final DateFormat dateFormatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
private final DateFormat dateFormatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||||
private final StopWatch timer = new StopWatch();
|
private final StopWatch timer = new StopWatch();
|
||||||
private IngestServiceAbstract currentServiceForTimer;
|
private IngestModuleAbstract currentModuleForTimer;
|
||||||
//file service timing stats, image service timers are logged in IngestImageThread class
|
//file module timing stats, image module timers are logged in IngestImageThread class
|
||||||
private final Map<String, Long> fileServiceTimers = new HashMap<String, Long>();
|
private final Map<String, Long> fileModuleTimers = new HashMap<String, Long>();
|
||||||
|
|
||||||
IngestManagerStats() {
|
IngestManagerStats() {
|
||||||
errors = new HashMap<IngestServiceAbstract, Integer>();
|
errors = new HashMap<IngestModuleAbstract, Integer>();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* records start time of the file process for the service must be
|
* records start time of the file process for the module must be
|
||||||
* followed by logFileServiceEndProcess for the same service
|
* 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.reset();
|
||||||
timer.start();
|
timer.start();
|
||||||
currentServiceForTimer = service;
|
currentModuleForTimer = module;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* records stop time of the file process for the service must be
|
* records stop time of the file process for the module must be
|
||||||
* preceded by logFileServiceStartProcess for the same service
|
* 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();
|
timer.stop();
|
||||||
if (service != currentServiceForTimer) {
|
if (module != currentModuleForTimer) {
|
||||||
logger.log(Level.WARNING, "Invalid service passed in to record stop processing: " + service.getName()
|
logger.log(Level.WARNING, "Invalid module passed in to record stop processing: " + module.getName()
|
||||||
+ ", expected: " + currentServiceForTimer.getName());
|
+ ", expected: " + currentModuleForTimer.getName());
|
||||||
} else {
|
} else {
|
||||||
final long elapsed = timer.getElapsedTime();
|
final long elapsed = timer.getElapsedTime();
|
||||||
final long current = fileServiceTimers.get(service.getName());
|
final long current = fileModuleTimers.get(module.getName());
|
||||||
fileServiceTimers.put(service.getName(), elapsed + current);
|
fileModuleTimers.put(module.getName(), elapsed + current);
|
||||||
}
|
}
|
||||||
|
|
||||||
currentServiceForTimer = null;
|
currentModuleForTimer = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
String getFileServiceStats() {
|
String getFileModuleStats() {
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
for (final String serviceName : fileServiceTimers.keySet()) {
|
for (final String moduleName : fileModuleTimers.keySet()) {
|
||||||
sb.append(serviceName).append(" took: ")
|
sb.append(moduleName).append(" took: ")
|
||||||
.append(fileServiceTimers.get(serviceName) / 1000)
|
.append(fileModuleTimers.get(moduleName) / 1000)
|
||||||
.append(" secs. to process()").append('\n');
|
.append(" secs. to process()").append('\n');
|
||||||
}
|
}
|
||||||
return sb.toString();
|
return sb.toString();
|
||||||
@ -1004,10 +1004,10 @@ public class IngestManager {
|
|||||||
sb.append("Total ingest time: ").append(getTotalTimeString()).append(EOL);
|
sb.append("Total ingest time: ").append(getTotalTimeString()).append(EOL);
|
||||||
sb.append("Total errors: ").append(errorsTotal).append(EOL);
|
sb.append("Total errors: ").append(errorsTotal).append(EOL);
|
||||||
if (errorsTotal > 0) {
|
if (errorsTotal > 0) {
|
||||||
sb.append("Errors per service:");
|
sb.append("Errors per module:");
|
||||||
for (IngestServiceAbstract service : errors.keySet()) {
|
for (IngestModuleAbstract module : errors.keySet()) {
|
||||||
final int errorsService = errors.get(service);
|
final int errorsModule = errors.get(module);
|
||||||
sb.append("\t").append(service.getName()).append(": ").append(errorsService).append(EOL);
|
sb.append("\t").append(module.getName()).append(": ").append(errorsModule).append(EOL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return sb.toString();
|
return sb.toString();
|
||||||
@ -1021,10 +1021,10 @@ public class IngestManager {
|
|||||||
sb.append("Total errors: ").append(errorsTotal).append("<br />");
|
sb.append("Total errors: ").append(errorsTotal).append("<br />");
|
||||||
/*
|
/*
|
||||||
if (errorsTotal > 0) {
|
if (errorsTotal > 0) {
|
||||||
sb.append("Errors per service:");
|
sb.append("Errors per module:");
|
||||||
for (IngestServiceAbstract service : errors.keySet()) {
|
for (IngestModuleAbstract module : errors.keySet()) {
|
||||||
final int errorsService = errors.get(service);
|
final int errorsModule = errors.get(module);
|
||||||
sb.append("\t").append(service.getName()).append(": ").append(errorsService).append("<br />");
|
sb.append("\t").append(module.getName()).append(": ").append(errorsModule).append("<br />");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
* */
|
* */
|
||||||
@ -1036,8 +1036,8 @@ public class IngestManager {
|
|||||||
void start() {
|
void start() {
|
||||||
startTime = new Date();
|
startTime = new Date();
|
||||||
|
|
||||||
for (IngestServiceAbstractFile service : abstractFileServices) {
|
for (IngestModuleAbstractFile module : abstractFileModules) {
|
||||||
fileServiceTimers.put(service.getName(), 0L);
|
fileModuleTimers.put(module.getName(), 0L);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1072,13 +1072,13 @@ public class IngestManager {
|
|||||||
return sb.toString();
|
return sb.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
synchronized void addError(IngestServiceAbstract source) {
|
synchronized void addError(IngestModuleAbstract source) {
|
||||||
++errorsTotal;
|
++errorsTotal;
|
||||||
Integer curServiceErrorI = errors.get(source);
|
Integer curModuleErrorI = errors.get(source);
|
||||||
if (curServiceErrorI == null) {
|
if (curModuleErrorI == null) {
|
||||||
errors.put(source, 1);
|
errors.put(source, 1);
|
||||||
} else {
|
} 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");
|
logger.log(Level.INFO, "Starting background processing");
|
||||||
stats.start();
|
stats.start();
|
||||||
|
|
||||||
//notify main thread services started
|
//notify main thread modules started
|
||||||
for (IngestServiceAbstractFile s : abstractFileServices) {
|
for (IngestModuleAbstractFile s : abstractFileModules) {
|
||||||
IngestManager.fireServiceEvent(IngestModuleEvent.STARTED.toString(), s.getName());
|
IngestManager.fireModuleEvent(IngestModuleEvent.STARTED.toString(), s.getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
final String displayName = "File Ingest";
|
final String displayName = "File Ingest";
|
||||||
@ -1121,18 +1121,18 @@ public class IngestManager {
|
|||||||
int processedFiles = 0;
|
int processedFiles = 0;
|
||||||
//process AbstractFiles queue
|
//process AbstractFiles queue
|
||||||
while (hasNextAbstractFile()) {
|
while (hasNextAbstractFile()) {
|
||||||
Map.Entry<AbstractFile, List<IngestServiceAbstractFile>> unit = getNextAbstractFile();
|
Map.Entry<AbstractFile, List<IngestModuleAbstractFile>> unit = getNextAbstractFile();
|
||||||
//clear return values from services for last file
|
//clear return values from modules for last file
|
||||||
synchronized (abstractFileServiceResults) {
|
synchronized (abstractFileModulesRetValues) {
|
||||||
abstractFileServiceResults.clear();
|
abstractFileModulesRetValues.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
final AbstractFile fileToProcess = unit.getKey();
|
final AbstractFile fileToProcess = unit.getKey();
|
||||||
|
|
||||||
progress.progress(fileToProcess.getName(), processedFiles);
|
progress.progress(fileToProcess.getName(), processedFiles);
|
||||||
|
|
||||||
for (IngestServiceAbstractFile service : unit.getValue()) {
|
for (IngestModuleAbstractFile module : unit.getValue()) {
|
||||||
//process the file with every file service
|
//process the file with every file module
|
||||||
if (isCancelled()) {
|
if (isCancelled()) {
|
||||||
logger.log(Level.INFO, "Terminating file ingest due to cancellation.");
|
logger.log(Level.INFO, "Terminating file ingest due to cancellation.");
|
||||||
return null;
|
return null;
|
||||||
@ -1140,18 +1140,18 @@ public class IngestManager {
|
|||||||
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
stats.logFileServiceStartProcess(service);
|
stats.logFileModuleStartProcess(module);
|
||||||
IngestServiceAbstractFile.ProcessResult result = service.process(fileToProcess);
|
IngestModuleAbstractFile.ProcessResult result = module.process(fileToProcess);
|
||||||
stats.logFileServiceEndProcess(service);
|
stats.logFileModuleEndProcess(module);
|
||||||
|
|
||||||
//store the result for subsequent services for this file
|
//store the result for subsequent modules for this file
|
||||||
synchronized (abstractFileServiceResults) {
|
synchronized (abstractFileModulesRetValues) {
|
||||||
abstractFileServiceResults.put(service.getName(), result);
|
abstractFileModulesRetValues.put(module.getName(), result);
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.log(Level.WARNING, "Exception from service: " + service.getName(), e);
|
logger.log(Level.WARNING, "Exception from module: " + module.getName(), e);
|
||||||
stats.addError(service);
|
stats.addError(module);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
int newAbstractFiles = getNumAbstractFiles();
|
int newAbstractFiles = getNumAbstractFiles();
|
||||||
@ -1172,11 +1172,11 @@ public class IngestManager {
|
|||||||
protected void done() {
|
protected void done() {
|
||||||
try {
|
try {
|
||||||
super.get(); //block and get all exceptions thrown while doInBackground()
|
super.get(); //block and get all exceptions thrown while doInBackground()
|
||||||
//notify services of completion
|
//notify modules of completion
|
||||||
if (!this.isCancelled()) {
|
if (!this.isCancelled()) {
|
||||||
for (IngestServiceAbstractFile s : abstractFileServices) {
|
for (IngestModuleAbstractFile s : abstractFileModules) {
|
||||||
s.complete();
|
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()) {
|
if (!this.isCancelled()) {
|
||||||
logger.log(Level.INFO, "Summary Report: " + stats.toString());
|
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());
|
logger.log(Level.INFO, "Ingest messages count: " + ui.getMessagesCount());
|
||||||
//ui.displayReport(stats.toHtmlString());
|
//ui.displayReport(stats.toHtmlString());
|
||||||
IngestManager.this.postMessage(IngestMessage.createManagerMessage("File Ingest Complete", stats.toHtmlString()));
|
IngestManager.this.postMessage(IngestMessage.createManagerMessage("File Ingest Complete", stats.toHtmlString()));
|
||||||
@ -1209,30 +1209,30 @@ public class IngestManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void handleInterruption() {
|
private void handleInterruption() {
|
||||||
for (IngestServiceAbstractFile s : abstractFileServices) {
|
for (IngestModuleAbstractFile s : abstractFileModules) {
|
||||||
if (isServiceRunning(s)) {
|
if (isModuleRunning(s)) {
|
||||||
try {
|
try {
|
||||||
s.stop();
|
s.stop();
|
||||||
} catch (Exception e) {
|
} 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
|
//empty queues
|
||||||
emptyAbstractFiles();
|
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<Object, Void> {
|
private class EnqueueWorker extends SwingWorker<Object, Void> {
|
||||||
|
|
||||||
List<IngestServiceAbstract> services;
|
List<IngestModuleAbstract> modules;
|
||||||
final List<Image> images;
|
final List<Image> images;
|
||||||
int total;
|
int total;
|
||||||
|
|
||||||
EnqueueWorker(final List<IngestServiceAbstract> services, final List<Image> images) {
|
EnqueueWorker(final List<IngestModuleAbstract> modules, final List<Image> images) {
|
||||||
this.services = services;
|
this.modules = modules;
|
||||||
this.images = images;
|
this.images = images;
|
||||||
}
|
}
|
||||||
private ProgressHandle progress;
|
private ProgressHandle progress;
|
||||||
@ -1252,10 +1252,10 @@ public class IngestManager {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
total = services.size() * images.size();
|
total = modules.size() * images.size();
|
||||||
progress.start(total);
|
progress.start(total);
|
||||||
//progress.switchToIndeterminate();
|
//progress.switchToIndeterminate();
|
||||||
queueAll(services, images);
|
queueAll(modules, images);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1289,32 +1289,32 @@ public class IngestManager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void queueAll(List<IngestServiceAbstract> services, final List<Image> images) {
|
private void queueAll(List<IngestModuleAbstract> modules, final List<Image> images) {
|
||||||
int processed = 0;
|
int processed = 0;
|
||||||
for (Image image : images) {
|
for (Image image : images) {
|
||||||
final String imageName = image.getName();
|
final String imageName = image.getName();
|
||||||
Collection<AbstractFile> files = null;
|
Collection<AbstractFile> files = null;
|
||||||
for (IngestServiceAbstract service : services) {
|
for (IngestModuleAbstract module : modules) {
|
||||||
if (isCancelled()) {
|
if (isCancelled()) {
|
||||||
logger.log(Level.INFO, "Terminating ingest queueing due to cancellation.");
|
logger.log(Level.INFO, "Terminating ingest queueing due to cancellation.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
final String serviceName = service.getName();
|
final String moduleName = module.getName();
|
||||||
progress.progress(serviceName + " " + imageName, processed);
|
progress.progress(moduleName + " " + imageName, processed);
|
||||||
switch (service.getType()) {
|
switch (module.getType()) {
|
||||||
case Image:
|
case Image:
|
||||||
//enqueue a new instance of image service
|
//enqueue a new instance of image module
|
||||||
try {
|
try {
|
||||||
final IngestServiceImage newServiceInstance = (IngestServiceImage) (service.getClass()).newInstance();
|
final IngestModuleImage newModuleInstance = (IngestModuleImage) (module.getClass()).newInstance();
|
||||||
addImage(newServiceInstance, image);
|
addImage(newModuleInstance, image);
|
||||||
logger.log(Level.INFO, "Added image " + image.getName() + " with service " + service.getName());
|
logger.log(Level.INFO, "Added image " + image.getName() + " with module " + module.getName());
|
||||||
} catch (InstantiationException e) {
|
} 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) {
|
} 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;
|
break;
|
||||||
case AbstractFile:
|
case AbstractFile:
|
||||||
if (files == null) {
|
if (files == null) {
|
||||||
@ -1322,14 +1322,14 @@ public class IngestManager {
|
|||||||
files = new GetAllFilesContentVisitor(processUnallocSpace).visit(image);
|
files = new GetAllFilesContentVisitor(processUnallocSpace).visit(image);
|
||||||
logger.info("Get all files took " + (System.currentTimeMillis() - start) + "ms");
|
logger.info("Get all files took " + (System.currentTimeMillis() - start) + "ms");
|
||||||
}
|
}
|
||||||
//enqueue the same singleton AbstractFile service
|
//enqueue the same singleton AbstractFile module
|
||||||
logger.log(Level.INFO, "Adding image " + image.getName() + " with " + files.size() + " number of AbstractFile to service " + service.getName());
|
logger.log(Level.INFO, "Adding image " + image.getName() + " with " + files.size() + " number of AbstractFile to module " + module.getName());
|
||||||
addAbstractFile((IngestServiceAbstractFile) service, files);
|
addAbstractFile((IngestModuleAbstractFile) module, files);
|
||||||
break;
|
break;
|
||||||
default:
|
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) {
|
if (files != null) {
|
||||||
files.clear();
|
files.clear();
|
||||||
|
@ -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
|
* for sending data events, ingest messages, getting configuration, such as
|
||||||
* update frequency configuration
|
* update frequency configuration
|
||||||
*
|
*
|
||||||
@ -39,36 +39,36 @@ public class IngestManagerProxy {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Post ingest message
|
* 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) {
|
public void postMessage(final IngestMessage message) {
|
||||||
manager.postMessage(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 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) {
|
public static void fireModuleEvent(String eventType, String moduleName) {
|
||||||
IngestManager.fireServiceEvent(eventType, serviceName);
|
IngestManager.fireModuleEvent(eventType, moduleName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fire service data event to notify registered service data event listeners
|
* Fire module data event to notify registered module data event listeners
|
||||||
* @param serviceDataEvent service data event, encapsulating blackboard artifact data
|
* @param moduleDataEvent module data event, encapsulating blackboard artifact data
|
||||||
*/
|
*/
|
||||||
public static void fireServiceDataEvent(ServiceDataEvent serviceDataEvent) {
|
public static void fireModuleDataEvent(ModuleDataEvent moduleDataEvent) {
|
||||||
IngestManager.fireServiceDataEvent(serviceDataEvent);;
|
IngestManager.fireModuleDataEvent(moduleDataEvent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Facility for the service to query the currently set recommended data update frequency in minutes
|
* Facility for the module to query the currently set recommended data update frequency in minutes
|
||||||
* Services that post data in controlled time intervals, should obey this setting
|
* 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() {
|
public int getUpdateFrequency() {
|
||||||
return manager.getUpdateFrequency().getTime();
|
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
|
* 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
|
* @param moduleName registered module name of the module 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
|
* @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) {
|
public IngestModuleAbstractFile.ProcessResult getAbstractFileModuleResult(String moduleName) {
|
||||||
return manager.getAbstractFileServiceResult(serviceName);
|
return manager.getAbstractFileModuleResult(moduleName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -24,7 +24,7 @@ import org.sleuthkit.autopsy.datamodel.KeyValue;
|
|||||||
import org.sleuthkit.datamodel.BlackboardArtifact;
|
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
|
* Message should have a unique ID within context of originating source
|
||||||
*
|
*
|
||||||
@ -37,7 +37,7 @@ public class IngestMessage {
|
|||||||
};
|
};
|
||||||
private long ID;
|
private long ID;
|
||||||
private MessageType messageType;
|
private MessageType messageType;
|
||||||
private IngestServiceAbstract source;
|
private IngestModuleAbstract source;
|
||||||
private String subject;
|
private String subject;
|
||||||
private String detailsHtml;
|
private String detailsHtml;
|
||||||
private String uniqueKey;
|
private String uniqueKey;
|
||||||
@ -46,7 +46,7 @@ public class IngestMessage {
|
|||||||
private static SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
private static SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||||
private static int managerMessageId = 0;
|
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.ID = ID;
|
||||||
this.source = source;
|
this.source = source;
|
||||||
this.messageType = messageType;
|
this.messageType = messageType;
|
||||||
@ -63,7 +63,7 @@ public class IngestMessage {
|
|||||||
return ID;
|
return ID;
|
||||||
}
|
}
|
||||||
|
|
||||||
public IngestServiceAbstract getSource() {
|
public IngestModuleAbstract getSource() {
|
||||||
return source;
|
return source;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -163,12 +163,12 @@ public class IngestMessage {
|
|||||||
* Create a simple message with a subject only
|
* Create a simple message with a subject only
|
||||||
* @param ID ID of the message, unique in the context of module that generated it
|
* @param ID ID of the message, unique in the context of module that generated it
|
||||||
* @param messageType message type
|
* @param messageType message type
|
||||||
* @param source originating service
|
* @param source originating module
|
||||||
* @param subject message subject to be displayed
|
* @param subject message subject to be displayed
|
||||||
* @param details message details to be displayed, or null
|
* @param details message details to be displayed, or null
|
||||||
* @return
|
* @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) {
|
if (messageType == null || source == null || subject == null) {
|
||||||
throw new IllegalArgumentException("message type, source and subject cannot be 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
|
* Create a simple message with a subject only
|
||||||
* @param ID ID of the message, unique in the context of module that generated it
|
* @param ID ID of the message, unique in the context of module that generated it
|
||||||
* @param messageType message type
|
* @param messageType message type
|
||||||
* @param source originating service
|
* @param source originating module
|
||||||
* @param subject message subject to be displayed
|
* @param subject message subject to be displayed
|
||||||
* @return
|
* @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);
|
return createMessage(ID, messageType, source, subject, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -191,12 +191,12 @@ public class IngestMessage {
|
|||||||
/**
|
/**
|
||||||
* Create error message
|
* Create error message
|
||||||
* @param ID ID of the message, unique in the context of module that generated it
|
* @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 subject message subject to be displayed
|
||||||
* @param details message details to be displayed, or null
|
* @param details message details to be displayed, or null
|
||||||
* @return
|
* @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) {
|
if (source == null || subject == null) {
|
||||||
throw new IllegalArgumentException("source and subject cannot be null");
|
throw new IllegalArgumentException("source and subject cannot be null");
|
||||||
}
|
}
|
||||||
@ -206,12 +206,12 @@ public class IngestMessage {
|
|||||||
/**
|
/**
|
||||||
* Create warning message
|
* Create warning message
|
||||||
* @param ID ID of the message, unique in the context of module that generated it
|
* @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 subject message subject to be displayed
|
||||||
* @param details message details to be displayed, or null
|
* @param details message details to be displayed, or null
|
||||||
* @return
|
* @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) {
|
if (source == null || subject == null) {
|
||||||
throw new IllegalArgumentException("source and subject cannot be 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 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 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 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 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
|
* @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) {
|
if (source == null || subject == null || detailsHtml == null || data == null) {
|
||||||
throw new IllegalArgumentException("source, subject, details and data cannot be null");
|
throw new IllegalArgumentException("source, subject, details and data cannot be null");
|
||||||
}
|
}
|
||||||
|
@ -45,7 +45,7 @@ import org.sleuthkit.autopsy.ingest.IngestMessage.*;
|
|||||||
import org.sleuthkit.datamodel.BlackboardArtifact;
|
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 {
|
class IngestMessagePanel extends javax.swing.JPanel {
|
||||||
@ -62,7 +62,7 @@ class IngestMessagePanel extends javax.swing.JPanel {
|
|||||||
|
|
||||||
private enum COLUMN {
|
private enum COLUMN {
|
||||||
|
|
||||||
SUBJECT, COUNT, SERVICE
|
SUBJECT, COUNT, MODULE
|
||||||
};
|
};
|
||||||
private static PropertyChangeSupport messagePcs = new PropertyChangeSupport(IngestMessagePanel.class);
|
private static PropertyChangeSupport messagePcs = new PropertyChangeSupport(IngestMessagePanel.class);
|
||||||
static final String MESSAGE_CHANGE_EVT = "MESSAGE_CHANGE_EVT"; //number of unread messages changed
|
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
|
//data
|
||||||
|
|
||||||
private List<TableEntry> messageData = new ArrayList<TableEntry>();
|
private List<TableEntry> messageData = new ArrayList<TableEntry>();
|
||||||
//for keeping track of messages to group, per service, by uniqness
|
//for keeping track of messages to group, per module, by uniqness
|
||||||
private Map<IngestServiceAbstract, Map<String, List<IngestMessageGroup>>> groupings = new HashMap<IngestServiceAbstract, Map<String, List<IngestMessageGroup>>>();
|
private Map<IngestModuleAbstract, Map<String, List<IngestMessageGroup>>> groupings = new HashMap<IngestModuleAbstract, Map<String, List<IngestMessageGroup>>>();
|
||||||
private boolean chronoSort = true; //chronological sort default
|
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());
|
private Logger logger = Logger.getLogger(MessageTableModel.class.getName());
|
||||||
|
|
||||||
MessageTableModel() {
|
MessageTableModel() {
|
||||||
@ -331,12 +331,12 @@ class IngestMessagePanel extends javax.swing.JPanel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void init() {
|
private void init() {
|
||||||
//initialize groupings map with services
|
//initialize groupings map with modules
|
||||||
for (IngestServiceAbstract service : IngestManager.enumerateAbstractFileServices()) {
|
for (IngestModuleAbstract module : IngestManager.enumerateAbstractFileModules()) {
|
||||||
groupings.put(service, new HashMap<String, List<IngestMessageGroup>>());
|
groupings.put(module, new HashMap<String, List<IngestMessageGroup>>());
|
||||||
}
|
}
|
||||||
for (IngestServiceAbstract service : IngestManager.enumerateImageServices()) {
|
for (IngestModuleAbstract module : IngestManager.enumerateImageModules()) {
|
||||||
groupings.put(service, new HashMap<String, List<IngestMessageGroup>>());
|
groupings.put(module, new HashMap<String, List<IngestMessageGroup>>());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -418,8 +418,8 @@ class IngestMessagePanel extends javax.swing.JPanel {
|
|||||||
|
|
||||||
switch (columnIndex) {
|
switch (columnIndex) {
|
||||||
case 0:
|
case 0:
|
||||||
Object service = entry.messageGroup.getSource();
|
Object module = entry.messageGroup.getSource();
|
||||||
if (service == null) {
|
if (module == null) {
|
||||||
ret = "";
|
ret = "";
|
||||||
} else {
|
} else {
|
||||||
ret = (Object) entry.messageGroup.getSource().getName();
|
ret = (Object) entry.messageGroup.getSource().getName();
|
||||||
@ -462,13 +462,13 @@ class IngestMessagePanel extends javax.swing.JPanel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
synchronized public void addMessage(IngestMessage m) {
|
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
|
//and add to existing group or create a new group
|
||||||
IngestServiceAbstract service = m.getSource();
|
IngestModuleAbstract module = m.getSource();
|
||||||
IngestMessageGroup messageGroup = null;
|
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
|
//not a manager message, a data message, then group
|
||||||
final Map<String, List<IngestMessageGroup>> groups = groupings.get(service);
|
final Map<String, List<IngestMessageGroup>> groups = groupings.get(module);
|
||||||
//groups for this uniqueness
|
//groups for this uniqueness
|
||||||
final String uniqueness = m.getUniqueKey();
|
final String uniqueness = m.getUniqueKey();
|
||||||
List<IngestMessageGroup> uniqGroups = groups.get(uniqueness);
|
List<IngestMessageGroup> 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();
|
return messages.get(0).getSource();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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,
|
Image,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* AbstractFile type service
|
* AbstractFile type module
|
||||||
*/
|
*/
|
||||||
AbstractFile
|
AbstractFile
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Notification from manager that brand new ingest should be initiated.
|
* 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
|
* 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.
|
* @param managerProxy services available to the module by the ingest manager, e.g.
|
||||||
* for posting messages, getting configurations
|
* for posting messages, getting configurations, firing events
|
||||||
*/
|
*/
|
||||||
public void init(IngestManagerProxy managerProxy);
|
public void init(IngestManagerProxy managerProxy);
|
||||||
|
|
||||||
@ -65,31 +65,31 @@ public interface IngestServiceAbstract {
|
|||||||
public void stop();
|
public void stop();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets specific name of the service
|
* Gets specific name of the module
|
||||||
* The name should be unique across services
|
* The name should be unique across modules
|
||||||
* @return unique service name
|
* @return unique module name
|
||||||
*/
|
*/
|
||||||
public String getName();
|
public String getName();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets user-friendly description of the service
|
* Gets user-friendly description of the module
|
||||||
* @return service description
|
* @return module description
|
||||||
*/
|
*/
|
||||||
public String getDescription();
|
public String getDescription();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns type of the service
|
* Returns type of the module
|
||||||
* @return service type
|
* @return module type
|
||||||
*/
|
*/
|
||||||
public ServiceType getType();
|
public ModuleType getType();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A service can manage and use additional threads to perform some work in the background.
|
* A module 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.
|
* 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,
|
* @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 service
|
* false if all work has been done, or if background threads are not used/managed by this module
|
||||||
*/
|
*/
|
||||||
public boolean hasBackgroundJobsRunning();
|
public boolean hasBackgroundJobsRunning();
|
||||||
|
|
||||||
@ -98,7 +98,7 @@ public interface IngestServiceAbstract {
|
|||||||
* Used to determine if a module has implemented a simple (run-time)
|
* Used to determine if a module has implemented a simple (run-time)
|
||||||
* configuration panel that is displayed by the ingest manager.
|
* 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();
|
public boolean hasSimpleConfiguration();
|
||||||
|
|
@ -21,9 +21,9 @@ package org.sleuthkit.autopsy.ingest;
|
|||||||
import org.sleuthkit.datamodel.AbstractFile;
|
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
|
* 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.
|
* on what modules are responsible for doing.
|
||||||
*
|
*
|
||||||
* @param abstractFile file to process
|
* @param abstractFile file to process
|
@ -22,26 +22,26 @@ import org.sleuthkit.datamodel.Image;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* Ingest service that acts on entire image
|
* Ingest module that acts on entire image
|
||||||
* Image ingest services run each in its own background thread
|
* Image ingest modules run each in its own background thread
|
||||||
* in parallel to the file processing ingest pipeline and other image ingest modules
|
* 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.
|
* 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.
|
* 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.
|
* 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
|
* 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
|
* 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 cancelled
|
* And to periodically check controller if it should break out of the processing loop because task has been canceled
|
||||||
*
|
*
|
||||||
* @param image to process
|
* @param image to process
|
||||||
* @param controller to post progress to and to use for checking if cancellation has occurred
|
* @param controller to post progress to and to use for checking if cancellation has occurred
|
@ -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.
|
* 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).
|
* 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).
|
* 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.
|
* 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 String serviceName;
|
||||||
private ARTIFACT_TYPE artifactType;
|
private ARTIFACT_TYPE artifactType;
|
||||||
@ -47,7 +47,7 @@ public class ServiceDataEvent {
|
|||||||
* @param serviceName Module name
|
* @param serviceName Module name
|
||||||
* @param artifactType Type of artifact that was posted to blackboard
|
* @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.serviceName = serviceName;
|
||||||
this.artifactType = artifactType;
|
this.artifactType = artifactType;
|
||||||
}
|
}
|
||||||
@ -57,7 +57,7 @@ public class ServiceDataEvent {
|
|||||||
* @param artifactType Type of artifact that was posted to blackboard
|
* @param artifactType Type of artifact that was posted to blackboard
|
||||||
* @param artifactIDs List of specific artifact ID values that were added to blackboard
|
* @param artifactIDs List of specific artifact ID values that were added to blackboard
|
||||||
*/
|
*/
|
||||||
public ServiceDataEvent(String serviceName, ARTIFACT_TYPE artifactType, Collection<BlackboardArtifact> artifactIDs) {
|
public ModuleDataEvent(String serviceName, ARTIFACT_TYPE artifactType, Collection<BlackboardArtifact> artifactIDs) {
|
||||||
this(serviceName, artifactType);
|
this(serviceName, artifactType);
|
||||||
this.artifactIDs = artifactIDs;
|
this.artifactIDs = artifactIDs;
|
||||||
}
|
}
|
@ -24,30 +24,30 @@ import java.util.logging.Logger;
|
|||||||
import org.sleuthkit.autopsy.ingest.IngestManagerProxy;
|
import org.sleuthkit.autopsy.ingest.IngestManagerProxy;
|
||||||
import org.sleuthkit.autopsy.ingest.IngestMessage;
|
import org.sleuthkit.autopsy.ingest.IngestMessage;
|
||||||
import org.sleuthkit.autopsy.ingest.IngestMessage.MessageType;
|
import org.sleuthkit.autopsy.ingest.IngestMessage.MessageType;
|
||||||
import org.sleuthkit.autopsy.ingest.IngestServiceAbstract.ServiceType;
|
import org.sleuthkit.autopsy.ingest.IngestModuleAbstract.ModuleType;
|
||||||
import org.sleuthkit.autopsy.ingest.IngestServiceAbstractFile;
|
import org.sleuthkit.autopsy.ingest.IngestModuleAbstractFile;
|
||||||
import org.sleuthkit.datamodel.AbstractFile;
|
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 final Logger logger = Logger.getLogger(ExampleAbstractFileIngestModule.class.getName());
|
||||||
private static ExampleAbstractFileIngestService instance = null;
|
private static ExampleAbstractFileIngestModule instance = null;
|
||||||
private IngestManagerProxy managerProxy;
|
private IngestManagerProxy managerProxy;
|
||||||
private static int messageId = 0;
|
private static int messageId = 0;
|
||||||
|
|
||||||
//file ingest services require a private constructor
|
//file ingest modules require a private constructor
|
||||||
//to ensure singleton instances
|
//to ensure singleton instances
|
||||||
private ExampleAbstractFileIngestService() {
|
private ExampleAbstractFileIngestModule() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static synchronized ExampleAbstractFileIngestService getDefault() {
|
public static synchronized ExampleAbstractFileIngestModule getDefault() {
|
||||||
if (instance == null) {
|
if (instance == null) {
|
||||||
instance = new ExampleAbstractFileIngestService();
|
instance = new ExampleAbstractFileIngestModule();
|
||||||
}
|
}
|
||||||
return instance;
|
return instance;
|
||||||
}
|
}
|
||||||
@ -56,7 +56,7 @@ public class ExampleAbstractFileIngestService implements IngestServiceAbstractFi
|
|||||||
public ProcessResult process(AbstractFile fsContent) {
|
public ProcessResult process(AbstractFile fsContent) {
|
||||||
managerProxy.postMessage(IngestMessage.createMessage(++messageId, MessageType.INFO, this, "Processing " + fsContent.getName()));
|
managerProxy.postMessage(IngestMessage.createMessage(++messageId, MessageType.INFO, this, "Processing " + fsContent.getName()));
|
||||||
|
|
||||||
//service specific AbstractFile processing code here
|
//module specific AbstractFile processing code here
|
||||||
try {
|
try {
|
||||||
Thread.sleep(100);
|
Thread.sleep(100);
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
@ -70,17 +70,17 @@ public class ExampleAbstractFileIngestService implements IngestServiceAbstractFi
|
|||||||
logger.log(Level.INFO, "complete()");
|
logger.log(Level.INFO, "complete()");
|
||||||
managerProxy.postMessage(IngestMessage.createMessage(++messageId, MessageType.INFO, this, "Complete"));
|
managerProxy.postMessage(IngestMessage.createMessage(++messageId, MessageType.INFO, this, "Complete"));
|
||||||
|
|
||||||
//service specific cleanup due completion here
|
//module specific cleanup due completion here
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return "Example AbstractFile Service";
|
return "Example AbstractFile Module";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getDescription() {
|
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()");
|
logger.log(Level.INFO, "init()");
|
||||||
this.managerProxy = managerProxy;
|
this.managerProxy = managerProxy;
|
||||||
|
|
||||||
//service specific initialization here
|
//module specific initialization here
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -98,12 +98,12 @@ public class ExampleAbstractFileIngestService implements IngestServiceAbstractFi
|
|||||||
logger.log(Level.INFO, "stop()");
|
logger.log(Level.INFO, "stop()");
|
||||||
managerProxy.postMessage(IngestMessage.createMessage(++messageId, MessageType.INFO, this, "Stopped"));
|
managerProxy.postMessage(IngestMessage.createMessage(++messageId, MessageType.INFO, this, "Stopped"));
|
||||||
|
|
||||||
//service specific cleanup due interruption here
|
//module specific cleanup due interruption here
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ServiceType getType() {
|
public ModuleType getType() {
|
||||||
return ServiceType.AbstractFile;
|
return ModuleType.AbstractFile;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
@ -25,29 +25,29 @@ import org.sleuthkit.autopsy.ingest.IngestImageWorkerController;
|
|||||||
import org.sleuthkit.autopsy.ingest.IngestManagerProxy;
|
import org.sleuthkit.autopsy.ingest.IngestManagerProxy;
|
||||||
import org.sleuthkit.autopsy.ingest.IngestMessage;
|
import org.sleuthkit.autopsy.ingest.IngestMessage;
|
||||||
import org.sleuthkit.autopsy.ingest.IngestMessage.MessageType;
|
import org.sleuthkit.autopsy.ingest.IngestMessage.MessageType;
|
||||||
import org.sleuthkit.autopsy.ingest.IngestServiceImage;
|
import org.sleuthkit.autopsy.ingest.IngestModuleImage;
|
||||||
import org.sleuthkit.datamodel.Image;
|
import org.sleuthkit.datamodel.Image;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Example implementation of an image ingest service
|
* 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 final Logger logger = Logger.getLogger(ExampleImageIngestModule.class.getName());
|
||||||
private static ExampleImageIngestService defaultInstance = null;
|
private static ExampleImageIngestModule defaultInstance = null;
|
||||||
private IngestManagerProxy managerProxy;
|
private IngestManagerProxy managerProxy;
|
||||||
private static int messageId = 0;
|
private static int messageId = 0;
|
||||||
|
|
||||||
//public constructor is required
|
//public constructor is required
|
||||||
//as multiple instances are created for processing multiple images simultenously
|
//as multiple instances are created for processing multiple images simultenously
|
||||||
public ExampleImageIngestService() {
|
public ExampleImageIngestModule() {
|
||||||
}
|
}
|
||||||
|
|
||||||
//default instance used for service registration
|
//default instance used for service registration
|
||||||
public static synchronized ExampleImageIngestService getDefault() {
|
public static synchronized ExampleImageIngestModule getDefault() {
|
||||||
if (defaultInstance == null) {
|
if (defaultInstance == null) {
|
||||||
defaultInstance = new ExampleImageIngestService();
|
defaultInstance = new ExampleImageIngestModule();
|
||||||
}
|
}
|
||||||
return defaultInstance;
|
return defaultInstance;
|
||||||
}
|
}
|
||||||
@ -125,8 +125,8 @@ public final class ExampleImageIngestService implements IngestServiceImage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ServiceType getType() {
|
public ModuleType getType() {
|
||||||
return ServiceType.Image;
|
return ModuleType.Image;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
@ -14,17 +14,17 @@
|
|||||||
<attr name="instanceCreate" methodvalue="org.sleuthkit.autopsy.ingest.IngestMessageTopComponent.findInstance"/>
|
<attr name="instanceCreate" methodvalue="org.sleuthkit.autopsy.ingest.IngestMessageTopComponent.findInstance"/>
|
||||||
<attr name="position" intvalue="100"/>
|
<attr name="position" intvalue="100"/>
|
||||||
</file> -->
|
</file> -->
|
||||||
<!-- example services -->
|
<!-- example modules -->
|
||||||
<!--
|
<!--
|
||||||
<file name="org-sleuthkit-autopsy-ingest-example-ExampleImageIngestService.instance">
|
<file name="org-sleuthkit-autopsy-ingest-example-ExampleImageIngestModule.instance">
|
||||||
<attr name="instanceOf" stringvalue="org.sleuthkit.autopsy.ingest.IngestServiceImage"/>
|
<attr name="instanceOf" stringvalue="org.sleuthkit.autopsy.ingest.IngestModuleImage"/>
|
||||||
<attr name="instanceCreate" methodvalue="org.sleuthkit.autopsy.ingest.example.ExampleImageIngestService.getDefault"/>
|
<attr name="instanceCreate" methodvalue="org.sleuthkit.autopsy.ingest.example.ExampleImageIngestModule.getDefault"/>
|
||||||
<attr name="position" intvalue="1000"/>
|
<attr name="position" intvalue="1000"/>
|
||||||
</file>
|
</file>
|
||||||
|
|
||||||
<file name="org-sleuthkit-autopsy-ingest-example-ExampleAbstractFileIngestService.instance">
|
<file name="org-sleuthkit-autopsy-ingest-example-ExampleAbstractFileIngestModule.instance">
|
||||||
<attr name="instanceOf" stringvalue="org.sleuthkit.autopsy.ingest.IngestServiceAbstractFile"/>
|
<attr name="instanceOf" stringvalue="org.sleuthkit.autopsy.ingest.IngestModuleAbstractFile"/>
|
||||||
<attr name="instanceCreate" methodvalue="org.sleuthkit.autopsy.ingest.example.ExampleAbstractFileIngestService.getDefault"/>
|
<attr name="instanceCreate" methodvalue="org.sleuthkit.autopsy.ingest.example.ExampleAbstractFileIngestModule.getDefault"/>
|
||||||
<attr name="position" intvalue="1100"/>
|
<attr name="position" intvalue="1100"/>
|
||||||
</file>
|
</file>
|
||||||
-->
|
-->
|
||||||
|
@ -43,7 +43,7 @@ public class AbstractFileHtmlExtract implements AbstractFileExtract {
|
|||||||
private static final int SINGLE_READ_CHARS = 1024;
|
private static final int SINGLE_READ_CHARS = 1024;
|
||||||
private static final int EXTRA_CHARS = 128; //for whitespace
|
private static final int EXTRA_CHARS = 128; //for whitespace
|
||||||
private static final char[] TEXT_CHUNK_BUF = new char[MAX_EXTR_TEXT_CHARS];
|
private static final char[] TEXT_CHUNK_BUF = new char[MAX_EXTR_TEXT_CHARS];
|
||||||
private KeywordSearchIngestService service;
|
private KeywordSearchIngestModule module;
|
||||||
private Ingester ingester;
|
private Ingester ingester;
|
||||||
private AbstractFile sourceFile;
|
private AbstractFile sourceFile;
|
||||||
private int numChunks = 0;
|
private int numChunks = 0;
|
||||||
@ -53,7 +53,7 @@ public class AbstractFileHtmlExtract implements AbstractFileExtract {
|
|||||||
};
|
};
|
||||||
|
|
||||||
AbstractFileHtmlExtract() {
|
AbstractFileHtmlExtract() {
|
||||||
this.service = KeywordSearchIngestService.getDefault();
|
this.module = KeywordSearchIngestModule.getDefault();
|
||||||
ingester = Server.getIngester();
|
ingester = Server.getIngester();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -161,7 +161,7 @@ public class AbstractFileHtmlExtract implements AbstractFileExtract {
|
|||||||
|
|
||||||
//check if need invoke commit/search between chunks
|
//check if need invoke commit/search between chunks
|
||||||
//not to delay commit if timer has gone off
|
//not to delay commit if timer has gone off
|
||||||
service.checkRunCommitSearch();
|
module.checkRunCommitSearch();
|
||||||
}
|
}
|
||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
logger.log(Level.WARNING, "Unable to read content stream from " + sourceFile.getId() + ": " + sourceFile.getName(), ex);
|
logger.log(Level.WARNING, "Unable to read content stream from " + sourceFile.getId() + ": " + sourceFile.getName(), ex);
|
||||||
|
@ -39,7 +39,7 @@ import org.sleuthkit.datamodel.AbstractFile;
|
|||||||
*/
|
*/
|
||||||
class AbstractFileStringExtract implements AbstractFileExtract {
|
class AbstractFileStringExtract implements AbstractFileExtract {
|
||||||
|
|
||||||
private KeywordSearchIngestService service;
|
private KeywordSearchIngestModule module;
|
||||||
private Ingester ingester;
|
private Ingester ingester;
|
||||||
private int numChunks;
|
private int numChunks;
|
||||||
private static final Logger logger = Logger.getLogger(AbstractFileStringExtract.class.getName());
|
private static final Logger logger = Logger.getLogger(AbstractFileStringExtract.class.getName());
|
||||||
@ -61,7 +61,7 @@ class AbstractFileStringExtract implements AbstractFileExtract {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public AbstractFileStringExtract() {
|
public AbstractFileStringExtract() {
|
||||||
this.service = KeywordSearchIngestService.getDefault();
|
this.module = KeywordSearchIngestModule.getDefault();
|
||||||
this.ingester = Server.getIngester();
|
this.ingester = Server.getIngester();
|
||||||
this.extractScripts.add(DEFAULT_SCRIPT);
|
this.extractScripts.add(DEFAULT_SCRIPT);
|
||||||
}
|
}
|
||||||
@ -122,7 +122,7 @@ class AbstractFileStringExtract implements AbstractFileExtract {
|
|||||||
|
|
||||||
//check if need invoke commit/search between chunks
|
//check if need invoke commit/search between chunks
|
||||||
//not to delay commit if timer has gone off
|
//not to delay commit if timer has gone off
|
||||||
service.checkRunCommitSearch();
|
module.checkRunCommitSearch();
|
||||||
|
|
||||||
//debug.close();
|
//debug.close();
|
||||||
}
|
}
|
||||||
|
@ -32,7 +32,7 @@ import java.util.concurrent.TimeUnit;
|
|||||||
import java.util.concurrent.TimeoutException;
|
import java.util.concurrent.TimeoutException;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
import java.util.logging.Logger;
|
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.AbstractFile;
|
||||||
import org.sleuthkit.datamodel.ReadContentInputStream;
|
import org.sleuthkit.datamodel.ReadContentInputStream;
|
||||||
import org.apache.tika.Tika;
|
import org.apache.tika.Tika;
|
||||||
@ -52,7 +52,7 @@ import org.sleuthkit.autopsy.keywordsearch.Ingester.IngesterException;
|
|||||||
*/
|
*/
|
||||||
public class AbstractFileTikaTextExtract implements AbstractFileExtract {
|
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 Logger tikaLogger = KeywordSearch.getTikaLogger();
|
||||||
private static final Charset OUTPUT_CHARSET = Server.DEFAULT_INDEXED_TEXT_CHARSET;
|
private static final Charset OUTPUT_CHARSET = Server.DEFAULT_INDEXED_TEXT_CHARSET;
|
||||||
static final int MAX_EXTR_TEXT_CHARS = 512 * 1024;
|
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 int EXTRA_CHARS = 128; //for whitespace
|
||||||
private static final char[] TEXT_CHUNK_BUF = new char[MAX_EXTR_TEXT_CHARS];
|
private static final char[] TEXT_CHUNK_BUF = new char[MAX_EXTR_TEXT_CHARS];
|
||||||
//private Tika tika;
|
//private Tika tika;
|
||||||
private KeywordSearchIngestService service;
|
private KeywordSearchIngestModule module;
|
||||||
private static Ingester ingester;
|
private static Ingester ingester;
|
||||||
private AbstractFile sourceFile; //currently processed file
|
private AbstractFile sourceFile; //currently processed file
|
||||||
private int numChunks = 0;
|
private int numChunks = 0;
|
||||||
@ -74,7 +74,7 @@ public class AbstractFileTikaTextExtract implements AbstractFileExtract {
|
|||||||
"pst", "xml", "class", "dwg", "eml", "emlx", "mbox", "mht"};
|
"pst", "xml", "class", "dwg", "eml", "emlx", "mbox", "mht"};
|
||||||
|
|
||||||
AbstractFileTikaTextExtract() {
|
AbstractFileTikaTextExtract() {
|
||||||
this.service = KeywordSearchIngestService.getDefault();
|
this.module = KeywordSearchIngestModule.getDefault();
|
||||||
ingester = Server.getIngester();
|
ingester = Server.getIngester();
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -216,7 +216,7 @@ public class AbstractFileTikaTextExtract implements AbstractFileExtract {
|
|||||||
|
|
||||||
//check if need invoke commit/search between chunks
|
//check if need invoke commit/search between chunks
|
||||||
//not to delay commit if timer has gone off
|
//not to delay commit if timer has gone off
|
||||||
service.checkRunCommitSearch();
|
module.checkRunCommitSearch();
|
||||||
}
|
}
|
||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
final String msg = "Unable to read content stream from " + sourceFile.getId() + ": " + sourceFile.getName();
|
final String msg = "Unable to read content stream from " + sourceFile.getId() + ": " + sourceFile.getName();
|
||||||
|
@ -79,8 +79,8 @@ abstract class AbstractKeywordSearchPerformer extends javax.swing.JPanel impleme
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
//check if keyword search service ingest is running (indexing, etc)
|
//check if keyword search module ingest is running (indexing, etc)
|
||||||
if (IngestManager.getDefault().isServiceRunning(KeywordSearchIngestService.getDefault())) {
|
if (IngestManager.getDefault().isModuleRunning(KeywordSearchIngestModule.getDefault())) {
|
||||||
if (KeywordSearchUtil.displayConfirmDialog("Keyword Search Ingest in Progress",
|
if (KeywordSearchUtil.displayConfirmDialog("Keyword Search Ingest in Progress",
|
||||||
"<html>Keyword Search Ingest is currently running.<br />"
|
"<html>Keyword Search Ingest is currently running.<br />"
|
||||||
+ "Not all files have been indexed and this search might yield incomplete results.<br />"
|
+ "Not all files have been indexed and this search might yield incomplete results.<br />"
|
||||||
|
@ -59,10 +59,10 @@ public class KeywordSearchConfigurationPanel2 extends javax.swing.JPanel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void activateWidgets() {
|
private void activateWidgets() {
|
||||||
final KeywordSearchIngestService service = KeywordSearchIngestService.getDefault();
|
final KeywordSearchIngestModule service = KeywordSearchIngestModule.getDefault();
|
||||||
skipNSRLCheckBox.setSelected(service.getSkipKnown());
|
skipNSRLCheckBox.setSelected(service.getSkipKnown());
|
||||||
boolean enable = !IngestManager.getDefault().isIngestRunning()
|
boolean enable = !IngestManager.getDefault().isIngestRunning()
|
||||||
&& ! IngestManager.getDefault().isServiceRunning(KeywordSearchIngestService.getDefault());
|
&& ! IngestManager.getDefault().isModuleRunning(KeywordSearchIngestModule.getDefault());
|
||||||
skipNSRLCheckBox.setEnabled(enable);
|
skipNSRLCheckBox.setEnabled(enable);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -139,7 +139,7 @@ public class KeywordSearchConfigurationPanel2 extends javax.swing.JPanel {
|
|||||||
}// </editor-fold>//GEN-END:initComponents
|
}// </editor-fold>//GEN-END:initComponents
|
||||||
|
|
||||||
private void skipNSRLCheckBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_skipNSRLCheckBoxActionPerformed
|
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
|
}//GEN-LAST:event_skipNSRLCheckBoxActionPerformed
|
||||||
// Variables declaration - do not modify//GEN-BEGIN:variables
|
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||||
private javax.swing.JLabel chunksLabel;
|
private javax.swing.JLabel chunksLabel;
|
||||||
@ -152,7 +152,7 @@ private void skipNSRLCheckBoxActionPerformed(java.awt.event.ActionEvent evt) {//
|
|||||||
// End of variables declaration//GEN-END:variables
|
// End of variables declaration//GEN-END:variables
|
||||||
|
|
||||||
private void customizeComponents() {
|
private void customizeComponents() {
|
||||||
this.skipNSRLCheckBox.setSelected(KeywordSearchIngestService.getDefault().getSkipKnown());
|
this.skipNSRLCheckBox.setSelected(KeywordSearchIngestModule.getDefault().getSkipKnown());
|
||||||
|
|
||||||
try {
|
try {
|
||||||
filesIndexedValue.setText(Integer.toString(KeywordSearch.getServer().queryNumIndexedFiles()));
|
filesIndexedValue.setText(Integer.toString(KeywordSearch.getServer().queryNumIndexedFiles()));
|
||||||
|
@ -64,7 +64,7 @@ public class KeywordSearchConfigurationPanel3 extends javax.swing.JPanel {
|
|||||||
toUpdate.add(s);
|
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() {
|
private void reloadScriptsCheckBoxes() {
|
||||||
final KeywordSearchIngestService service = KeywordSearchIngestService.getDefault();
|
final KeywordSearchIngestModule service = KeywordSearchIngestModule.getDefault();
|
||||||
final List<SCRIPT> serviceScripts = service.getStringExtractScripts();
|
final List<SCRIPT> serviceScripts = service.getStringExtractScripts();
|
||||||
final int components = checkPanel.getComponentCount();
|
final int components = checkPanel.getComponentCount();
|
||||||
for (int i = 0; i < components; ++i) {
|
for (int i = 0; i < components; ++i) {
|
||||||
@ -118,7 +118,7 @@ public class KeywordSearchConfigurationPanel3 extends javax.swing.JPanel {
|
|||||||
private void activateWidgets() {
|
private void activateWidgets() {
|
||||||
reloadScriptsCheckBoxes();
|
reloadScriptsCheckBoxes();
|
||||||
boolean enable = !IngestManager.getDefault().isIngestRunning()
|
boolean enable = !IngestManager.getDefault().isIngestRunning()
|
||||||
&& ! IngestManager.getDefault().isServiceRunning(KeywordSearchIngestService.getDefault());;
|
&& ! IngestManager.getDefault().isModuleRunning(KeywordSearchIngestModule.getDefault());;
|
||||||
//enable / disable checboxes
|
//enable / disable checboxes
|
||||||
activateScriptsCheckboxes(enable);
|
activateScriptsCheckboxes(enable);
|
||||||
}
|
}
|
||||||
|
@ -178,7 +178,7 @@ class KeywordSearchEditListPanel extends javax.swing.JPanel implements ListSelec
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (IngestManager.getDefault().isServiceRunning(KeywordSearchIngestService.getDefault())) {
|
if (IngestManager.getDefault().isModuleRunning(KeywordSearchIngestModule.getDefault())) {
|
||||||
initIngest(0);
|
initIngest(0);
|
||||||
} else {
|
} else {
|
||||||
initIngest(1);
|
initIngest(1);
|
||||||
@ -191,13 +191,13 @@ class KeywordSearchEditListPanel extends javax.swing.JPanel implements ListSelec
|
|||||||
String changed = evt.getPropertyName();
|
String changed = evt.getPropertyName();
|
||||||
Object oldValue = evt.getOldValue();
|
Object oldValue = evt.getOldValue();
|
||||||
if (changed.equals(IngestModuleEvent.COMPLETED.toString() )
|
if (changed.equals(IngestModuleEvent.COMPLETED.toString() )
|
||||||
&& ((String) oldValue).equals(KeywordSearchIngestService.MODULE_NAME)) {
|
&& ((String) oldValue).equals(KeywordSearchIngestModule.MODULE_NAME)) {
|
||||||
initIngest(1);
|
initIngest(1);
|
||||||
} else if (changed.equals(IngestModuleEvent.STARTED.toString() )
|
} else if (changed.equals(IngestModuleEvent.STARTED.toString() )
|
||||||
&& ((String) oldValue).equals(KeywordSearchIngestService.MODULE_NAME)) {
|
&& ((String) oldValue).equals(KeywordSearchIngestModule.MODULE_NAME)) {
|
||||||
initIngest(0);
|
initIngest(0);
|
||||||
} else if (changed.equals(IngestModuleEvent.STOPPED.toString() )
|
} else if (changed.equals(IngestModuleEvent.STOPPED.toString() )
|
||||||
&& ((String) oldValue).equals(KeywordSearchIngestService.MODULE_NAME)) {
|
&& ((String) oldValue).equals(KeywordSearchIngestModule.MODULE_NAME)) {
|
||||||
initIngest(1);
|
initIngest(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -249,7 +249,7 @@ class KeywordSearchEditListPanel extends javax.swing.JPanel implements ListSelec
|
|||||||
// Certain buttons will be disabled if ingest is ongoing on this list
|
// Certain buttons will be disabled if ingest is ongoing on this list
|
||||||
List<String> ingestLists = new ArrayList<String>();
|
List<String> ingestLists = new ArrayList<String>();
|
||||||
if (ingestOngoing) {
|
if (ingestOngoing) {
|
||||||
ingestLists = KeywordSearchIngestService.getDefault().getKeywordLists();
|
ingestLists = KeywordSearchIngestModule.getDefault().getKeywordLists();
|
||||||
}
|
}
|
||||||
boolean inIngest = !listSet ? false : ingestLists.contains(currentKeywordList.getName());
|
boolean inIngest = !listSet ? false : ingestLists.contains(currentKeywordList.getName());
|
||||||
|
|
||||||
|
@ -44,8 +44,8 @@ import org.sleuthkit.autopsy.coreutils.StringExtract.StringExtractUnicodeTable.S
|
|||||||
import org.sleuthkit.autopsy.ingest.IngestManagerProxy;
|
import org.sleuthkit.autopsy.ingest.IngestManagerProxy;
|
||||||
import org.sleuthkit.autopsy.ingest.IngestMessage;
|
import org.sleuthkit.autopsy.ingest.IngestMessage;
|
||||||
import org.sleuthkit.autopsy.ingest.IngestMessage.MessageType;
|
import org.sleuthkit.autopsy.ingest.IngestMessage.MessageType;
|
||||||
import org.sleuthkit.autopsy.ingest.IngestServiceAbstractFile;
|
import org.sleuthkit.autopsy.ingest.IngestModuleAbstractFile;
|
||||||
import org.sleuthkit.autopsy.ingest.ServiceDataEvent;
|
import org.sleuthkit.autopsy.ingest.ModuleDataEvent;
|
||||||
import org.sleuthkit.autopsy.keywordsearch.Ingester.IngesterException;
|
import org.sleuthkit.autopsy.keywordsearch.Ingester.IngesterException;
|
||||||
import org.sleuthkit.datamodel.BlackboardArtifact;
|
import org.sleuthkit.datamodel.BlackboardArtifact;
|
||||||
import org.sleuthkit.datamodel.BlackboardArtifact.ARTIFACT_TYPE;
|
import org.sleuthkit.datamodel.BlackboardArtifact.ARTIFACT_TYPE;
|
||||||
@ -60,21 +60,21 @@ import org.sleuthkit.datamodel.TskData;
|
|||||||
import org.sleuthkit.datamodel.TskData.FileKnown;
|
import org.sleuthkit.datamodel.TskData.FileKnown;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An ingest service on a file level Performs indexing of allocated and Solr
|
* An ingest module on a file level Performs indexing of allocated and Solr
|
||||||
* supported files, string extraction and indexing of unallocated and not Solr
|
* supported files, string extraction and indexing of unallocated and not Solr
|
||||||
* supported files Index commit is done periodically (determined by user set
|
* supported files Index commit is done periodically (determined by user set
|
||||||
* ingest update interval) Runs a periodic keyword / regular expression search
|
* ingest update interval) Runs a periodic keyword / regular expression search
|
||||||
* on currently configured lists for ingest and writes results to blackboard
|
* on currently configured lists for ingest and writes results to blackboard
|
||||||
* Reports interesting events to Inbox and to viewers
|
* Reports interesting events to Inbox and to viewers
|
||||||
*
|
*
|
||||||
* Registered as a service in layer.xml
|
* Registered as a module in layer.xml
|
||||||
*/
|
*/
|
||||||
public final class KeywordSearchIngestService implements IngestServiceAbstractFile {
|
public final class KeywordSearchIngestModule implements IngestModuleAbstractFile {
|
||||||
|
|
||||||
private static final Logger logger = Logger.getLogger(KeywordSearchIngestService.class.getName());
|
private static final Logger logger = Logger.getLogger(KeywordSearchIngestModule.class.getName());
|
||||||
public static final String MODULE_NAME = "Keyword Search";
|
public static final String MODULE_NAME = "Keyword Search";
|
||||||
public static final String MODULE_DESCRIPTION = "Performs file indexing and periodic search using keywords and regular expressions in lists.";
|
public static final String MODULE_DESCRIPTION = "Performs file indexing and periodic search using keywords and regular expressions in lists.";
|
||||||
private static KeywordSearchIngestService instance = null;
|
private static KeywordSearchIngestModule instance = null;
|
||||||
private IngestManagerProxy managerProxy;
|
private IngestManagerProxy managerProxy;
|
||||||
private Ingester ingester = null;
|
private Ingester ingester = null;
|
||||||
private volatile boolean commitIndex = false; //whether to commit index next time
|
private volatile boolean commitIndex = false; //whether to commit index next time
|
||||||
@ -95,7 +95,7 @@ public final class KeywordSearchIngestService implements IngestServiceAbstractFi
|
|||||||
private volatile int messageID = 0;
|
private volatile int messageID = 0;
|
||||||
private boolean processedFiles;
|
private boolean processedFiles;
|
||||||
private volatile boolean finalSearcherDone = true; //mark as done, until it's inited
|
private volatile boolean finalSearcherDone = true; //mark as done, until it's inited
|
||||||
private final String hashDBServiceName = "Hash Lookup"; //NOTE this needs to match the HashDB service getName()
|
private final String hashDBModuleName = "Hash Lookup"; //NOTE this needs to match the HashDB module getName()
|
||||||
private SleuthkitCase caseHandle = null;
|
private SleuthkitCase caseHandle = null;
|
||||||
private boolean skipKnown = true;
|
private boolean skipKnown = true;
|
||||||
private boolean initialized = false;
|
private boolean initialized = false;
|
||||||
@ -111,20 +111,20 @@ public final class KeywordSearchIngestService implements IngestServiceAbstractFi
|
|||||||
private Map<Long, IngestStatus> ingestStatus;
|
private Map<Long, IngestStatus> ingestStatus;
|
||||||
|
|
||||||
//private constructor to ensure singleton instance
|
//private constructor to ensure singleton instance
|
||||||
private KeywordSearchIngestService() {
|
private KeywordSearchIngestModule() {
|
||||||
//set default script
|
//set default script
|
||||||
stringExtractScripts.add(SCRIPT.LATIN_1);
|
stringExtractScripts.add(SCRIPT.LATIN_1);
|
||||||
stringExtractScripts.add(SCRIPT.LATIN_2);
|
stringExtractScripts.add(SCRIPT.LATIN_2);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns singleton instance of the service, creates one if needed
|
* Returns singleton instance of the module, creates one if needed
|
||||||
*
|
*
|
||||||
* @return instance of the service
|
* @return instance of the module
|
||||||
*/
|
*/
|
||||||
public static synchronized KeywordSearchIngestService getDefault() {
|
public static synchronized KeywordSearchIngestModule getDefault() {
|
||||||
if (instance == null) {
|
if (instance == null) {
|
||||||
instance = new KeywordSearchIngestService();
|
instance = new KeywordSearchIngestModule();
|
||||||
}
|
}
|
||||||
return instance;
|
return instance;
|
||||||
}
|
}
|
||||||
@ -145,13 +145,13 @@ public final class KeywordSearchIngestService implements IngestServiceAbstractFi
|
|||||||
return ProcessResult.OK;
|
return ProcessResult.OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
//check if we should index meta-data only when 1) it is known 2) HashDb service errored on it
|
//check if we should index meta-data only when 1) it is known 2) HashDb module errored on it
|
||||||
IngestServiceAbstractFile.ProcessResult hashDBResult = managerProxy.getAbstractFileServiceResult(hashDBServiceName);
|
IngestModuleAbstractFile.ProcessResult hashDBResult = managerProxy.getAbstractFileModuleResult(hashDBModuleName);
|
||||||
//logger.log(Level.INFO, "hashdb result: " + hashDBResult + "file: " + AbstractFile.getName());
|
//logger.log(Level.INFO, "hashdb result: " + hashDBResult + "file: " + AbstractFile.getName());
|
||||||
if (hashDBResult == IngestServiceAbstractFile.ProcessResult.ERROR) {
|
if (hashDBResult == IngestModuleAbstractFile.ProcessResult.ERROR) {
|
||||||
//index meta-data only
|
//index meta-data only
|
||||||
indexer.indexFile(abstractFile, false);
|
indexer.indexFile(abstractFile, false);
|
||||||
//notify depending service that keyword search (would) encountered error for this file
|
//notify depending module that keyword search (would) encountered error for this file
|
||||||
return ProcessResult.ERROR;
|
return ProcessResult.ERROR;
|
||||||
}
|
}
|
||||||
else if (skipKnown && abstractFile.accept(getIsFileKnown) == true) {
|
else if (skipKnown && abstractFile.accept(getIsFileKnown) == true) {
|
||||||
@ -289,7 +289,7 @@ public final class KeywordSearchIngestService implements IngestServiceAbstractFi
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initializes the service for new ingest run Sets up threads, timers,
|
* Initializes the module for new ingest run Sets up threads, timers,
|
||||||
* retrieves settings, keyword lists to run on
|
* retrieves settings, keyword lists to run on
|
||||||
*
|
*
|
||||||
* @param managerProxy
|
* @param managerProxy
|
||||||
@ -357,8 +357,8 @@ public final class KeywordSearchIngestService implements IngestServiceAbstractFi
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ServiceType getType() {
|
public ModuleType getType() {
|
||||||
return ServiceType.AbstractFile;
|
return ModuleType.AbstractFile;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -390,7 +390,7 @@ public final class KeywordSearchIngestService implements IngestServiceAbstractFi
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The services maintains background threads, return true if background
|
* The modules maintains background threads, return true if background
|
||||||
* threads are running or there are pending tasks to be run in the future,
|
* threads are running or there are pending tasks to be run in the future,
|
||||||
* such as the final search post-ingest completion
|
* such as the final search post-ingest completion
|
||||||
*
|
*
|
||||||
@ -919,7 +919,7 @@ public final class KeywordSearchIngestService implements IngestServiceAbstractFi
|
|||||||
|
|
||||||
//update artifact browser
|
//update artifact browser
|
||||||
if (!newArtifacts.isEmpty()) {
|
if (!newArtifacts.isEmpty()) {
|
||||||
IngestManagerProxy.fireServiceDataEvent(new ServiceDataEvent(MODULE_NAME, ARTIFACT_TYPE.TSK_KEYWORD_HIT, newArtifacts));
|
IngestManagerProxy.fireModuleDataEvent(new ModuleDataEvent(MODULE_NAME, ARTIFACT_TYPE.TSK_KEYWORD_HIT, newArtifacts));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
progress.progress(queryStr, ++numSearched);
|
progress.progress(queryStr, ++numSearched);
|
||||||
@ -987,7 +987,7 @@ public final class KeywordSearchIngestService implements IngestServiceAbstractFi
|
|||||||
//reset current resuls earlier to potentially garbage collect sooner
|
//reset current resuls earlier to potentially garbage collect sooner
|
||||||
currentResults = new HashMap<Keyword, List<Long>>();
|
currentResults = new HashMap<Keyword, List<Long>>();
|
||||||
|
|
||||||
managerProxy.postMessage(IngestMessage.createMessage(++messageID, MessageType.INFO, KeywordSearchIngestService.instance, "Completed"));
|
managerProxy.postMessage(IngestMessage.createMessage(++messageID, MessageType.INFO, KeywordSearchIngestModule.instance, "Completed"));
|
||||||
} else {
|
} else {
|
||||||
//start counting time for a new searcher to start
|
//start counting time for a new searcher to start
|
||||||
//unless final searcher is pending
|
//unless final searcher is pending
|
||||||
@ -1039,10 +1039,10 @@ public final class KeywordSearchIngestService implements IngestServiceAbstractFi
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the skip known files setting on the service
|
* Set the skip known files setting on the module
|
||||||
*
|
*
|
||||||
* @param skip true if skip, otherwise, will process known files as well, as
|
* @param skip true if skip, otherwise, will process known files as well, as
|
||||||
* reported by HashDB service
|
* reported by HashDB module
|
||||||
*/
|
*/
|
||||||
void setSkipKnown(boolean skip) {
|
void setSkipKnown(boolean skip) {
|
||||||
this.skipKnown = skip;
|
this.skipKnown = skip;
|
@ -163,7 +163,7 @@ public class KeywordSearchIngestSimplePanel extends javax.swing.JPanel {
|
|||||||
|
|
||||||
private void reloadLangs() {
|
private void reloadLangs() {
|
||||||
//TODO multiple
|
//TODO multiple
|
||||||
List<SCRIPT> scripts = KeywordSearchIngestService.getDefault().getStringExtractScripts();
|
List<SCRIPT> scripts = KeywordSearchIngestModule.getDefault().getStringExtractScripts();
|
||||||
StringBuilder langs = new StringBuilder();
|
StringBuilder langs = new StringBuilder();
|
||||||
langs.append("<html>");
|
langs.append("<html>");
|
||||||
for (SCRIPT s : scripts) {
|
for (SCRIPT s : scripts) {
|
||||||
|
@ -159,7 +159,7 @@ class KeywordSearchListsViewerPanel extends AbstractKeywordSearchPerformer {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
if(IngestManager.getDefault().isServiceRunning(KeywordSearchIngestService.getDefault())) {
|
if(IngestManager.getDefault().isModuleRunning(KeywordSearchIngestModule.getDefault())) {
|
||||||
initIngest(true);
|
initIngest(true);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -173,15 +173,15 @@ class KeywordSearchListsViewerPanel extends AbstractKeywordSearchPerformer {
|
|||||||
String changed = evt.getPropertyName();
|
String changed = evt.getPropertyName();
|
||||||
Object oldValue = evt.getOldValue();
|
Object oldValue = evt.getOldValue();
|
||||||
if(changed.equals(IngestModuleEvent.COMPLETED.toString() ) &&
|
if(changed.equals(IngestModuleEvent.COMPLETED.toString() ) &&
|
||||||
((String) oldValue).equals(KeywordSearchIngestService.MODULE_NAME)) {
|
((String) oldValue).equals(KeywordSearchIngestModule.MODULE_NAME)) {
|
||||||
initIngest(false);
|
initIngest(false);
|
||||||
}
|
}
|
||||||
else if(changed.equals(IngestModuleEvent.STARTED.toString() ) &&
|
else if(changed.equals(IngestModuleEvent.STARTED.toString() ) &&
|
||||||
((String) oldValue).equals(KeywordSearchIngestService.MODULE_NAME)) {
|
((String) oldValue).equals(KeywordSearchIngestModule.MODULE_NAME)) {
|
||||||
initIngest(true);
|
initIngest(true);
|
||||||
}
|
}
|
||||||
else if(changed.equals(IngestModuleEvent.STOPPED.toString() ) &&
|
else if(changed.equals(IngestModuleEvent.STOPPED.toString() ) &&
|
||||||
((String) oldValue).equals(KeywordSearchIngestService.MODULE_NAME)) {
|
((String) oldValue).equals(KeywordSearchIngestModule.MODULE_NAME)) {
|
||||||
initIngest(false);
|
initIngest(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -410,7 +410,7 @@ class KeywordSearchListsViewerPanel extends AbstractKeywordSearchPerformer {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isCellEditable(int rowIndex, int columnIndex) {
|
public boolean isCellEditable(int rowIndex, int columnIndex) {
|
||||||
List<String> locked = KeywordSearchIngestService.getDefault().getKeywordLists();
|
List<String> locked = KeywordSearchIngestModule.getDefault().getKeywordLists();
|
||||||
return (columnIndex == 0 && (!ingestRunning || !locked.contains((String)getValueAt(rowIndex, 1))));
|
return (columnIndex == 0 && (!ingestRunning || !locked.contains((String)getValueAt(rowIndex, 1))));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -618,7 +618,7 @@ class KeywordSearchListsViewerPanel extends AbstractKeywordSearchPerformer {
|
|||||||
this.setVerticalAlignment(JCheckBox.CENTER);
|
this.setVerticalAlignment(JCheckBox.CENTER);
|
||||||
|
|
||||||
String name = (String) table.getModel().getValueAt(row, 1);
|
String name = (String) table.getModel().getValueAt(row, 1);
|
||||||
List<String> locked = KeywordSearchIngestService.getDefault().getKeywordLists();
|
List<String> locked = KeywordSearchIngestModule.getDefault().getKeywordLists();
|
||||||
setEnabled(!locked.contains(name) || !ingestRunning);
|
setEnabled(!locked.contains(name) || !ingestRunning);
|
||||||
Boolean selected = (Boolean) table.getModel().getValueAt(row, 0);
|
Boolean selected = (Boolean) table.getModel().getValueAt(row, 0);
|
||||||
setSelected(selected);
|
setSelected(selected);
|
||||||
|
@ -43,7 +43,7 @@ import org.sleuthkit.autopsy.datamodel.AbstractFsContentNode;
|
|||||||
import org.sleuthkit.autopsy.datamodel.AbstractFsContentNode.FsContentPropertyType;
|
import org.sleuthkit.autopsy.datamodel.AbstractFsContentNode.FsContentPropertyType;
|
||||||
import org.sleuthkit.autopsy.datamodel.KeyValueNode;
|
import org.sleuthkit.autopsy.datamodel.KeyValueNode;
|
||||||
import org.sleuthkit.autopsy.ingest.IngestManagerProxy;
|
import org.sleuthkit.autopsy.ingest.IngestManagerProxy;
|
||||||
import org.sleuthkit.autopsy.ingest.ServiceDataEvent;
|
import org.sleuthkit.autopsy.ingest.ModuleDataEvent;
|
||||||
import org.sleuthkit.autopsy.keywordsearch.KeywordSearchQueryManager.Presentation;
|
import org.sleuthkit.autopsy.keywordsearch.KeywordSearchQueryManager.Presentation;
|
||||||
import org.sleuthkit.datamodel.AbstractFile;
|
import org.sleuthkit.datamodel.AbstractFile;
|
||||||
import org.sleuthkit.datamodel.BlackboardArtifact;
|
import org.sleuthkit.datamodel.BlackboardArtifact;
|
||||||
@ -536,7 +536,7 @@ public class KeywordSearchResultFactory extends ChildFactory<KeyValueQuery> {
|
|||||||
|
|
||||||
|
|
||||||
if (!this.isCancelled() && !na.isEmpty()) {
|
if (!this.isCancelled() && !na.isEmpty()) {
|
||||||
IngestManagerProxy.fireServiceDataEvent(new ServiceDataEvent(KeywordSearchIngestService.MODULE_NAME, ARTIFACT_TYPE.TSK_KEYWORD_HIT, na));
|
IngestManagerProxy.fireModuleDataEvent(new ModuleDataEvent(KeywordSearchIngestModule.MODULE_NAME, ARTIFACT_TYPE.TSK_KEYWORD_HIT, na));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -126,7 +126,7 @@ public class LuceneQuery implements KeywordSearchQuery {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public KeywordWriteResult writeToBlackBoard(String termHit, AbstractFile newFsHit, String snippet, String listName) {
|
public KeywordWriteResult writeToBlackBoard(String termHit, AbstractFile newFsHit, String snippet, String listName) {
|
||||||
final String MODULE_NAME = KeywordSearchIngestService.MODULE_NAME;
|
final String MODULE_NAME = KeywordSearchIngestModule.MODULE_NAME;
|
||||||
|
|
||||||
KeywordWriteResult writeResult = null;
|
KeywordWriteResult writeResult = null;
|
||||||
Collection<BlackboardAttribute> attributes = new ArrayList<BlackboardAttribute>();
|
Collection<BlackboardAttribute> attributes = new ArrayList<BlackboardAttribute>();
|
||||||
|
@ -160,7 +160,7 @@ public class TermComponentQuery implements KeywordSearchQuery {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public KeywordWriteResult writeToBlackBoard(String termHit, AbstractFile newFsHit, String snippet, String listName) {
|
public KeywordWriteResult writeToBlackBoard(String termHit, AbstractFile newFsHit, String snippet, String listName) {
|
||||||
final String MODULE_NAME = KeywordSearchIngestService.MODULE_NAME;
|
final String MODULE_NAME = KeywordSearchIngestModule.MODULE_NAME;
|
||||||
|
|
||||||
//there is match actually in this file, create artifact only then
|
//there is match actually in this file, create artifact only then
|
||||||
BlackboardArtifact bba = null;
|
BlackboardArtifact bba = null;
|
||||||
|
@ -28,9 +28,9 @@
|
|||||||
<attr name="instanceCreate" methodvalue="org.sleuthkit.autopsy.keywordsearch.HighlightedMatchesSource.getDefault"/>
|
<attr name="instanceCreate" methodvalue="org.sleuthkit.autopsy.keywordsearch.HighlightedMatchesSource.getDefault"/>
|
||||||
<attr name="position" intvalue="250"/>
|
<attr name="position" intvalue="250"/>
|
||||||
</file>
|
</file>
|
||||||
<file name="org-sleuthkit-autopsy-keywordsearch-KeywordSearchIngestService.instance">
|
<file name="org-sleuthkit-autopsy-keywordsearch-KeywordSearchIngestModule.instance">
|
||||||
<attr name="instanceOf" stringvalue="org.sleuthkit.autopsy.ingest.IngestServiceAbstractFile"/>
|
<attr name="instanceOf" stringvalue="org.sleuthkit.autopsy.ingest.IngestModuleAbstractFile"/>
|
||||||
<attr name="instanceCreate" methodvalue="org.sleuthkit.autopsy.keywordsearch.KeywordSearchIngestService.getDefault"/>
|
<attr name="instanceCreate" methodvalue="org.sleuthkit.autopsy.keywordsearch.KeywordSearchIngestModule.getDefault"/>
|
||||||
<attr name="position" intvalue="300"/>
|
<attr name="position" intvalue="300"/>
|
||||||
</file>
|
</file>
|
||||||
<!--<file name="org-sleuthkit-autopsy-keywordsearch-KeywordSearchDataExplorer.instance">
|
<!--<file name="org-sleuthkit-autopsy-keywordsearch-KeywordSearchDataExplorer.instance">
|
||||||
|
@ -36,8 +36,8 @@ import java.io.FileReader;
|
|||||||
import org.sleuthkit.autopsy.coreutils.DecodeUtil;
|
import org.sleuthkit.autopsy.coreutils.DecodeUtil;
|
||||||
import org.sleuthkit.autopsy.ingest.IngestImageWorkerController;
|
import org.sleuthkit.autopsy.ingest.IngestImageWorkerController;
|
||||||
import org.sleuthkit.autopsy.ingest.IngestManager;
|
import org.sleuthkit.autopsy.ingest.IngestManager;
|
||||||
import org.sleuthkit.autopsy.ingest.IngestServiceImage;
|
import org.sleuthkit.autopsy.ingest.IngestModuleImage;
|
||||||
import org.sleuthkit.autopsy.ingest.ServiceDataEvent;
|
import org.sleuthkit.autopsy.ingest.ModuleDataEvent;
|
||||||
import org.sleuthkit.datamodel.BlackboardArtifact;
|
import org.sleuthkit.datamodel.BlackboardArtifact;
|
||||||
import org.sleuthkit.datamodel.BlackboardArtifact.ARTIFACT_TYPE;
|
import org.sleuthkit.datamodel.BlackboardArtifact.ARTIFACT_TYPE;
|
||||||
import org.sleuthkit.datamodel.BlackboardAttribute;
|
import org.sleuthkit.datamodel.BlackboardAttribute;
|
||||||
@ -48,7 +48,7 @@ import org.sleuthkit.datamodel.Image;
|
|||||||
*
|
*
|
||||||
* @author Alex
|
* @author Alex
|
||||||
*/
|
*/
|
||||||
public class Chrome extends Extract implements IngestServiceImage {
|
public class Chrome extends Extract implements IngestModuleImage {
|
||||||
|
|
||||||
private static final String chquery = "SELECT urls.url, urls.title, urls.visit_count, urls.typed_count, "
|
private static final String chquery = "SELECT urls.url, urls.title, urls.visit_count, urls.typed_count, "
|
||||||
+ "last_visit_time, urls.hidden, visits.visit_time, (SELECT urls.url FROM urls WHERE urls.id=visits.url) as from_visit, visits.transition FROM urls, visits WHERE urls.id = visits.url";
|
+ "last_visit_time, urls.hidden, visits.visit_time, (SELECT urls.url FROM urls WHERE urls.id=visits.url) as from_visit, visits.transition FROM urls, visits WHERE urls.id = visits.url";
|
||||||
@ -114,7 +114,7 @@ public class Chrome extends Extract implements IngestServiceImage {
|
|||||||
j++;
|
j++;
|
||||||
dbFile.delete();
|
dbFile.delete();
|
||||||
}
|
}
|
||||||
IngestManagerProxy.fireServiceDataEvent(new ServiceDataEvent("Recent Activity", BlackboardArtifact.ARTIFACT_TYPE.TSK_WEB_HISTORY));
|
IngestManagerProxy.fireModuleDataEvent(new ModuleDataEvent("Recent Activity", BlackboardArtifact.ARTIFACT_TYPE.TSK_WEB_HISTORY));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -174,7 +174,7 @@ public class Chrome extends Extract implements IngestServiceImage {
|
|||||||
j++;
|
j++;
|
||||||
dbFile.delete();
|
dbFile.delete();
|
||||||
}
|
}
|
||||||
IngestManagerProxy.fireServiceDataEvent(new ServiceDataEvent("Recent Activity", BlackboardArtifact.ARTIFACT_TYPE.TSK_WEB_BOOKMARK));
|
IngestManagerProxy.fireModuleDataEvent(new ModuleDataEvent("Recent Activity", BlackboardArtifact.ARTIFACT_TYPE.TSK_WEB_BOOKMARK));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -223,7 +223,7 @@ public class Chrome extends Extract implements IngestServiceImage {
|
|||||||
j++;
|
j++;
|
||||||
dbFile.delete();
|
dbFile.delete();
|
||||||
}
|
}
|
||||||
IngestManagerProxy.fireServiceDataEvent(new ServiceDataEvent("Recent Activity", BlackboardArtifact.ARTIFACT_TYPE.TSK_WEB_COOKIE));
|
IngestManagerProxy.fireModuleDataEvent(new ModuleDataEvent("Recent Activity", BlackboardArtifact.ARTIFACT_TYPE.TSK_WEB_COOKIE));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -274,7 +274,7 @@ public class Chrome extends Extract implements IngestServiceImage {
|
|||||||
j++;
|
j++;
|
||||||
dbFile.delete();
|
dbFile.delete();
|
||||||
}
|
}
|
||||||
IngestManagerProxy.fireServiceDataEvent(new ServiceDataEvent("Recent Activity", BlackboardArtifact.ARTIFACT_TYPE.TSK_WEB_DOWNLOAD));
|
IngestManagerProxy.fireModuleDataEvent(new ModuleDataEvent("Recent Activity", BlackboardArtifact.ARTIFACT_TYPE.TSK_WEB_DOWNLOAD));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -321,7 +321,7 @@ public class Chrome extends Extract implements IngestServiceImage {
|
|||||||
j++;
|
j++;
|
||||||
dbFile.delete();
|
dbFile.delete();
|
||||||
}
|
}
|
||||||
IngestManagerProxy.fireServiceDataEvent(new ServiceDataEvent("Recent Activity", BlackboardArtifact.ARTIFACT_TYPE.TSK_WEB_HISTORY));
|
IngestManagerProxy.fireModuleDataEvent(new ModuleDataEvent("Recent Activity", BlackboardArtifact.ARTIFACT_TYPE.TSK_WEB_HISTORY));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -346,8 +346,8 @@ public class Chrome extends Extract implements IngestServiceImage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ServiceType getType() {
|
public ModuleType getType() {
|
||||||
return ServiceType.Image;
|
return ModuleType.Image;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -28,10 +28,10 @@ import java.util.*;
|
|||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
import org.sleuthkit.autopsy.casemodule.Case;
|
import org.sleuthkit.autopsy.casemodule.Case;
|
||||||
import org.sleuthkit.autopsy.ingest.IngestServiceImage;
|
import org.sleuthkit.autopsy.ingest.IngestModuleImage;
|
||||||
import org.sleuthkit.datamodel.*;
|
import org.sleuthkit.datamodel.*;
|
||||||
|
|
||||||
abstract public class Extract implements IngestServiceImage{
|
abstract public class Extract implements IngestModuleImage{
|
||||||
|
|
||||||
protected Case currentCase = Case.getCurrentCase(); // get the most updated case
|
protected Case currentCase = Case.getCurrentCase(); // get the most updated case
|
||||||
protected SleuthkitCase tskCase = currentCase.getSleuthkitCase();
|
protected SleuthkitCase tskCase = currentCase.getSleuthkitCase();
|
||||||
|
@ -55,7 +55,7 @@ import org.sleuthkit.autopsy.datamodel.KeyValue;
|
|||||||
import org.sleuthkit.autopsy.ingest.IngestImageWorkerController;
|
import org.sleuthkit.autopsy.ingest.IngestImageWorkerController;
|
||||||
import org.sleuthkit.autopsy.ingest.IngestManager;
|
import org.sleuthkit.autopsy.ingest.IngestManager;
|
||||||
import org.sleuthkit.autopsy.ingest.IngestManagerProxy;
|
import org.sleuthkit.autopsy.ingest.IngestManagerProxy;
|
||||||
import org.sleuthkit.autopsy.ingest.ServiceDataEvent;
|
import org.sleuthkit.autopsy.ingest.ModuleDataEvent;
|
||||||
import org.sleuthkit.datamodel.BlackboardArtifact;
|
import org.sleuthkit.datamodel.BlackboardArtifact;
|
||||||
import org.sleuthkit.datamodel.BlackboardArtifact.ARTIFACT_TYPE;
|
import org.sleuthkit.datamodel.BlackboardArtifact.ARTIFACT_TYPE;
|
||||||
import org.sleuthkit.datamodel.BlackboardAttribute;
|
import org.sleuthkit.datamodel.BlackboardAttribute;
|
||||||
@ -64,10 +64,10 @@ import org.sleuthkit.datamodel.Content;
|
|||||||
import org.sleuthkit.datamodel.FsContent;
|
import org.sleuthkit.datamodel.FsContent;
|
||||||
import org.sleuthkit.datamodel.SleuthkitCase;
|
import org.sleuthkit.datamodel.SleuthkitCase;
|
||||||
import org.sleuthkit.autopsy.coreutils.PlatformUtil;
|
import org.sleuthkit.autopsy.coreutils.PlatformUtil;
|
||||||
import org.sleuthkit.autopsy.ingest.IngestServiceImage;
|
import org.sleuthkit.autopsy.ingest.IngestModuleImage;
|
||||||
import org.sleuthkit.datamodel.*;
|
import org.sleuthkit.datamodel.*;
|
||||||
|
|
||||||
public class ExtractIE extends Extract implements IngestServiceImage {
|
public class ExtractIE extends Extract implements IngestModuleImage {
|
||||||
|
|
||||||
private static final Logger logger = Logger.getLogger(ExtractIE.class.getName());
|
private static final Logger logger = Logger.getLogger(ExtractIE.class.getName());
|
||||||
private String indexDatQueryStr = "select * from tsk_files where name LIKE '%index.dat%'";
|
private String indexDatQueryStr = "select * from tsk_files where name LIKE '%index.dat%'";
|
||||||
@ -142,7 +142,7 @@ public class ExtractIE extends Extract implements IngestServiceImage {
|
|||||||
bbattributes.add(new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_PROG_NAME.getTypeID(), "RecentActivity", "Internet Explorer"));
|
bbattributes.add(new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_PROG_NAME.getTypeID(), "RecentActivity", "Internet Explorer"));
|
||||||
bbattributes.add(new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_DOMAIN.getTypeID(), "RecentActivity", domain));
|
bbattributes.add(new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_DOMAIN.getTypeID(), "RecentActivity", domain));
|
||||||
this.addArtifact(ARTIFACT_TYPE.TSK_WEB_BOOKMARK, Favorite, bbattributes);
|
this.addArtifact(ARTIFACT_TYPE.TSK_WEB_BOOKMARK, Favorite, bbattributes);
|
||||||
IngestManagerProxy.fireServiceDataEvent(new ServiceDataEvent("Recent Activity", BlackboardArtifact.ARTIFACT_TYPE.TSK_WEB_BOOKMARK));
|
IngestManagerProxy.fireModuleDataEvent(new ModuleDataEvent("Recent Activity", BlackboardArtifact.ARTIFACT_TYPE.TSK_WEB_BOOKMARK));
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
logger.log(Level.WARNING, "Error while trying to read into a sqlite db.{0}", ex);
|
logger.log(Level.WARNING, "Error while trying to read into a sqlite db.{0}", ex);
|
||||||
this.addErrorMessage(this.getName() + ": Error while trying to analyze file:" + Favorite.getName());
|
this.addErrorMessage(this.getName() + ": Error while trying to analyze file:" + Favorite.getName());
|
||||||
@ -195,7 +195,7 @@ public class ExtractIE extends Extract implements IngestServiceImage {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
IngestManagerProxy.fireServiceDataEvent(new ServiceDataEvent("Recent Activity", BlackboardArtifact.ARTIFACT_TYPE.TSK_WEB_COOKIE));
|
IngestManagerProxy.fireModuleDataEvent(new ModuleDataEvent("Recent Activity", BlackboardArtifact.ARTIFACT_TYPE.TSK_WEB_COOKIE));
|
||||||
}
|
}
|
||||||
|
|
||||||
//Recent Documents section
|
//Recent Documents section
|
||||||
@ -225,7 +225,7 @@ public class ExtractIE extends Extract implements IngestServiceImage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
IngestManagerProxy.fireServiceDataEvent(new ServiceDataEvent("Recent Activity", BlackboardArtifact.ARTIFACT_TYPE.TSK_RECENT_OBJECT));
|
IngestManagerProxy.fireModuleDataEvent(new ModuleDataEvent("Recent Activity", BlackboardArtifact.ARTIFACT_TYPE.TSK_RECENT_OBJECT));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -488,7 +488,7 @@ public class ExtractIE extends Extract implements IngestServiceImage {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
IngestManagerProxy.fireServiceDataEvent(new ServiceDataEvent("Recent Activity", BlackboardArtifact.ARTIFACT_TYPE.TSK_WEB_HISTORY));
|
IngestManagerProxy.fireModuleDataEvent(new ModuleDataEvent("Recent Activity", BlackboardArtifact.ARTIFACT_TYPE.TSK_WEB_HISTORY));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -515,8 +515,8 @@ public class ExtractIE extends Extract implements IngestServiceImage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ServiceType getType() {
|
public ModuleType getType() {
|
||||||
return ServiceType.Image;
|
return ModuleType.Image;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -37,7 +37,7 @@ import org.sleuthkit.autopsy.casemodule.Case;
|
|||||||
import org.sleuthkit.autopsy.datamodel.ContentUtils;
|
import org.sleuthkit.autopsy.datamodel.ContentUtils;
|
||||||
import org.sleuthkit.autopsy.ingest.IngestImageWorkerController;
|
import org.sleuthkit.autopsy.ingest.IngestImageWorkerController;
|
||||||
import org.sleuthkit.autopsy.ingest.IngestManagerProxy;
|
import org.sleuthkit.autopsy.ingest.IngestManagerProxy;
|
||||||
import org.sleuthkit.autopsy.ingest.IngestServiceImage;
|
import org.sleuthkit.autopsy.ingest.IngestModuleImage;
|
||||||
import org.sleuthkit.datamodel.BlackboardArtifact.ARTIFACT_TYPE;
|
import org.sleuthkit.datamodel.BlackboardArtifact.ARTIFACT_TYPE;
|
||||||
import org.sleuthkit.datamodel.BlackboardAttribute.ATTRIBUTE_TYPE;
|
import org.sleuthkit.datamodel.BlackboardAttribute.ATTRIBUTE_TYPE;
|
||||||
import org.sleuthkit.datamodel.*;
|
import org.sleuthkit.datamodel.*;
|
||||||
@ -45,7 +45,7 @@ import org.sleuthkit.datamodel.*;
|
|||||||
/**
|
/**
|
||||||
* Extracting windows registry data using regripper
|
* Extracting windows registry data using regripper
|
||||||
*/
|
*/
|
||||||
public class ExtractRegistry extends Extract implements IngestServiceImage {
|
public class ExtractRegistry extends Extract implements IngestModuleImage {
|
||||||
|
|
||||||
public Logger logger = Logger.getLogger(this.getClass().getName());
|
public Logger logger = Logger.getLogger(this.getClass().getName());
|
||||||
private String RR_PATH;
|
private String RR_PATH;
|
||||||
@ -355,8 +355,8 @@ public class ExtractRegistry extends Extract implements IngestServiceImage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ServiceType getType() {
|
public ModuleType getType() {
|
||||||
return ServiceType.Image;
|
return ModuleType.Image;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -33,8 +33,8 @@ import org.sleuthkit.autopsy.datamodel.ContentUtils;
|
|||||||
import org.sleuthkit.autopsy.ingest.IngestImageWorkerController;
|
import org.sleuthkit.autopsy.ingest.IngestImageWorkerController;
|
||||||
import org.sleuthkit.autopsy.ingest.IngestManager;
|
import org.sleuthkit.autopsy.ingest.IngestManager;
|
||||||
import org.sleuthkit.autopsy.ingest.IngestManagerProxy;
|
import org.sleuthkit.autopsy.ingest.IngestManagerProxy;
|
||||||
import org.sleuthkit.autopsy.ingest.IngestServiceImage;
|
import org.sleuthkit.autopsy.ingest.IngestModuleImage;
|
||||||
import org.sleuthkit.autopsy.ingest.ServiceDataEvent;
|
import org.sleuthkit.autopsy.ingest.ModuleDataEvent;
|
||||||
import org.sleuthkit.datamodel.BlackboardArtifact;
|
import org.sleuthkit.datamodel.BlackboardArtifact;
|
||||||
import org.sleuthkit.datamodel.BlackboardArtifact.ARTIFACT_TYPE;
|
import org.sleuthkit.datamodel.BlackboardArtifact.ARTIFACT_TYPE;
|
||||||
import org.sleuthkit.datamodel.BlackboardAttribute;
|
import org.sleuthkit.datamodel.BlackboardAttribute;
|
||||||
@ -46,7 +46,7 @@ import org.sleuthkit.datamodel.Image;
|
|||||||
*
|
*
|
||||||
* @author Alex
|
* @author Alex
|
||||||
*/
|
*/
|
||||||
public class Firefox extends Extract implements IngestServiceImage {
|
public class Firefox extends Extract implements IngestModuleImage {
|
||||||
|
|
||||||
private static final String ffquery = "SELECT moz_historyvisits.id,url,title,visit_count,(visit_date/1000000) as visit_date,from_visit,(SELECT url FROM moz_places WHERE id=moz_historyvisits.from_visit) as ref FROM moz_places, moz_historyvisits WHERE moz_places.id = moz_historyvisits.place_id AND hidden = 0";
|
private static final String ffquery = "SELECT moz_historyvisits.id,url,title,visit_count,(visit_date/1000000) as visit_date,from_visit,(SELECT url FROM moz_places WHERE id=moz_historyvisits.from_visit) as ref FROM moz_places, moz_historyvisits WHERE moz_places.id = moz_historyvisits.place_id AND hidden = 0";
|
||||||
private static final String ffcookiequery = "SELECT name,value,host,expiry,(lastAccessed/1000000) as lastAccessed,(creationTime/1000000) as creationTime FROM moz_cookies";
|
private static final String ffcookiequery = "SELECT name,value,host,expiry,(lastAccessed/1000000) as lastAccessed,(creationTime/1000000) as creationTime FROM moz_cookies";
|
||||||
@ -108,7 +108,7 @@ public class Firefox extends Extract implements IngestServiceImage {
|
|||||||
j++;
|
j++;
|
||||||
dbFile.delete();
|
dbFile.delete();
|
||||||
}
|
}
|
||||||
IngestManagerProxy.fireServiceDataEvent(new ServiceDataEvent("Recent Activity", BlackboardArtifact.ARTIFACT_TYPE.TSK_WEB_HISTORY));
|
IngestManagerProxy.fireModuleDataEvent(new ModuleDataEvent("Recent Activity", BlackboardArtifact.ARTIFACT_TYPE.TSK_WEB_HISTORY));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -151,7 +151,7 @@ public class Firefox extends Extract implements IngestServiceImage {
|
|||||||
j++;
|
j++;
|
||||||
dbFile.delete();
|
dbFile.delete();
|
||||||
}
|
}
|
||||||
IngestManagerProxy.fireServiceDataEvent(new ServiceDataEvent("Recent Activity", BlackboardArtifact.ARTIFACT_TYPE.TSK_WEB_BOOKMARK));
|
IngestManagerProxy.fireModuleDataEvent(new ModuleDataEvent("Recent Activity", BlackboardArtifact.ARTIFACT_TYPE.TSK_WEB_BOOKMARK));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -211,7 +211,7 @@ public class Firefox extends Extract implements IngestServiceImage {
|
|||||||
j++;
|
j++;
|
||||||
dbFile.delete();
|
dbFile.delete();
|
||||||
}
|
}
|
||||||
IngestManagerProxy.fireServiceDataEvent(new ServiceDataEvent("Recent Activity", BlackboardArtifact.ARTIFACT_TYPE.TSK_WEB_COOKIE));
|
IngestManagerProxy.fireModuleDataEvent(new ModuleDataEvent("Recent Activity", BlackboardArtifact.ARTIFACT_TYPE.TSK_WEB_COOKIE));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -259,7 +259,7 @@ public class Firefox extends Extract implements IngestServiceImage {
|
|||||||
j++;
|
j++;
|
||||||
dbFile.delete();
|
dbFile.delete();
|
||||||
}
|
}
|
||||||
IngestManagerProxy.fireServiceDataEvent(new ServiceDataEvent("Recent Activity", BlackboardArtifact.ARTIFACT_TYPE.TSK_WEB_DOWNLOAD));
|
IngestManagerProxy.fireModuleDataEvent(new ModuleDataEvent("Recent Activity", BlackboardArtifact.ARTIFACT_TYPE.TSK_WEB_DOWNLOAD));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -284,8 +284,8 @@ public class Firefox extends Extract implements IngestServiceImage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ServiceType getType() {
|
public ModuleType getType() {
|
||||||
return ServiceType.Image;
|
return ModuleType.Image;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -28,17 +28,17 @@ import org.sleuthkit.autopsy.ingest.IngestImageWorkerController;
|
|||||||
import org.sleuthkit.autopsy.ingest.IngestManagerProxy;
|
import org.sleuthkit.autopsy.ingest.IngestManagerProxy;
|
||||||
import org.sleuthkit.autopsy.ingest.IngestMessage;
|
import org.sleuthkit.autopsy.ingest.IngestMessage;
|
||||||
import org.sleuthkit.autopsy.ingest.IngestMessage.MessageType;
|
import org.sleuthkit.autopsy.ingest.IngestMessage.MessageType;
|
||||||
import org.sleuthkit.autopsy.ingest.IngestServiceImage;
|
import org.sleuthkit.autopsy.ingest.IngestModuleImage;
|
||||||
import org.sleuthkit.datamodel.Image;
|
import org.sleuthkit.datamodel.Image;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Recent activity image ingest service
|
* Recent activity image ingest module
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public final class RAImageIngestService implements IngestServiceImage {
|
public final class RAImageIngestModule implements IngestModuleImage {
|
||||||
|
|
||||||
private static final Logger logger = Logger.getLogger(RAImageIngestService.class.getName());
|
private static final Logger logger = Logger.getLogger(RAImageIngestModule.class.getName());
|
||||||
private static RAImageIngestService defaultInstance = null;
|
private static RAImageIngestModule defaultInstance = null;
|
||||||
private IngestManagerProxy managerProxy;
|
private IngestManagerProxy managerProxy;
|
||||||
private static int messageId = 0;
|
private static int messageId = 0;
|
||||||
private ArrayList<String> errors = new ArrayList<String>();
|
private ArrayList<String> errors = new ArrayList<String>();
|
||||||
@ -51,13 +51,13 @@ public final class RAImageIngestService implements IngestServiceImage {
|
|||||||
|
|
||||||
//public constructor is required
|
//public constructor is required
|
||||||
//as multiple instances are created for processing multiple images simultenously
|
//as multiple instances are created for processing multiple images simultenously
|
||||||
public RAImageIngestService() {
|
public RAImageIngestModule() {
|
||||||
}
|
}
|
||||||
|
|
||||||
//default instance used for service registration
|
//default instance used for module registration
|
||||||
public static synchronized RAImageIngestService getDefault() {
|
public static synchronized RAImageIngestModule getDefault() {
|
||||||
if (defaultInstance == null) {
|
if (defaultInstance == null) {
|
||||||
defaultInstance = new RAImageIngestService();
|
defaultInstance = new RAImageIngestModule();
|
||||||
}
|
}
|
||||||
return defaultInstance;
|
return defaultInstance;
|
||||||
}
|
}
|
||||||
@ -112,7 +112,7 @@ public final class RAImageIngestService implements IngestServiceImage {
|
|||||||
final IngestMessage msg = IngestMessage.createMessage(++messageId, MessageType.INFO, this, "Completed - " + errorsFound, errorMessage.toString());
|
final IngestMessage msg = IngestMessage.createMessage(++messageId, MessageType.INFO, this, "Completed - " + errorsFound, errorMessage.toString());
|
||||||
managerProxy.postMessage(msg);
|
managerProxy.postMessage(msg);
|
||||||
|
|
||||||
//service specific cleanup due to completion here
|
//module specific cleanup due to completion here
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -139,7 +139,7 @@ public final class RAImageIngestService implements IngestServiceImage {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void stop() {
|
public void stop() {
|
||||||
logger.log(Level.INFO, "RAImageIngetService::stop()");
|
logger.log(Level.INFO, "RAImageIngetModule::stop()");
|
||||||
//Order Matters
|
//Order Matters
|
||||||
//ExtractRegistry stop
|
//ExtractRegistry stop
|
||||||
this.eree.stop();
|
this.eree.stop();
|
||||||
@ -149,8 +149,8 @@ public final class RAImageIngestService implements IngestServiceImage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ServiceType getType() {
|
public ModuleType getType() {
|
||||||
return ServiceType.Image;
|
return ModuleType.Image;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
@ -28,8 +28,8 @@ import java.util.logging.Logger;
|
|||||||
import javax.swing.JPanel;
|
import javax.swing.JPanel;
|
||||||
import org.sleuthkit.autopsy.ingest.IngestImageWorkerController;
|
import org.sleuthkit.autopsy.ingest.IngestImageWorkerController;
|
||||||
import org.sleuthkit.autopsy.ingest.IngestManagerProxy;
|
import org.sleuthkit.autopsy.ingest.IngestManagerProxy;
|
||||||
import org.sleuthkit.autopsy.ingest.IngestServiceImage;
|
import org.sleuthkit.autopsy.ingest.IngestModuleImage;
|
||||||
import org.sleuthkit.autopsy.ingest.ServiceDataEvent;
|
import org.sleuthkit.autopsy.ingest.ModuleDataEvent;
|
||||||
import org.sleuthkit.datamodel.BlackboardArtifact;
|
import org.sleuthkit.datamodel.BlackboardArtifact;
|
||||||
import org.sleuthkit.datamodel.BlackboardArtifact.ARTIFACT_TYPE;
|
import org.sleuthkit.datamodel.BlackboardArtifact.ARTIFACT_TYPE;
|
||||||
import org.sleuthkit.datamodel.BlackboardAttribute;
|
import org.sleuthkit.datamodel.BlackboardAttribute;
|
||||||
@ -47,7 +47,7 @@ import org.sleuthkit.datamodel.Image;
|
|||||||
* enum, getSearchEngine(), extractSearchEngineQuery()
|
* enum, getSearchEngine(), extractSearchEngineQuery()
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class SearchEngineURLQueryAnalyzer extends Extract implements IngestServiceImage {
|
public class SearchEngineURLQueryAnalyzer extends Extract implements IngestModuleImage {
|
||||||
|
|
||||||
static final String MODULE_NAME = "Search Engine Query Analyzer";
|
static final String MODULE_NAME = "Search Engine Query Analyzer";
|
||||||
|
|
||||||
@ -336,7 +336,7 @@ public class SearchEngineURLQueryAnalyzer extends Extract implements IngestServi
|
|||||||
logger.log(Level.SEVERE, "Error while add artifact.", e + " from " + fs.toString());
|
logger.log(Level.SEVERE, "Error while add artifact.", e + " from " + fs.toString());
|
||||||
this.addErrorMessage(this.getName() + ": Error while adding artifact");
|
this.addErrorMessage(this.getName() + ": Error while adding artifact");
|
||||||
}
|
}
|
||||||
IngestManagerProxy.fireServiceDataEvent(new ServiceDataEvent("RecentActivity", BlackboardArtifact.ARTIFACT_TYPE.TSK_WEB_SEARCH_QUERY));
|
IngestManagerProxy.fireModuleDataEvent(new ModuleDataEvent("RecentActivity", BlackboardArtifact.ARTIFACT_TYPE.TSK_WEB_SEARCH_QUERY));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -404,8 +404,8 @@ public class SearchEngineURLQueryAnalyzer extends Extract implements IngestServi
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ServiceType getType() {
|
public ModuleType getType() {
|
||||||
return ServiceType.Image;
|
return ModuleType.Image;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -2,9 +2,9 @@
|
|||||||
<!DOCTYPE filesystem PUBLIC "-//NetBeans//DTD Filesystem 1.2//EN" "http://www.netbeans.org/dtds/filesystem-1_2.dtd">
|
<!DOCTYPE filesystem PUBLIC "-//NetBeans//DTD Filesystem 1.2//EN" "http://www.netbeans.org/dtds/filesystem-1_2.dtd">
|
||||||
<filesystem>
|
<filesystem>
|
||||||
<folder name="Services">
|
<folder name="Services">
|
||||||
<file name="org-sleuthkit-autopsy-recentactivity-RAImageIngestService.instance">
|
<file name="org-sleuthkit-autopsy-recentactivity-RAImageIngestModule.instance">
|
||||||
<attr name="instanceOf" stringvalue="org.sleuthkit.autopsy.ingest.IngestServiceImage"/>
|
<attr name="instanceOf" stringvalue="org.sleuthkit.autopsy.ingest.IngestModuleImage"/>
|
||||||
<attr name="instanceCreate" methodvalue="org.sleuthkit.autopsy.recentactivity.RAImageIngestService.getDefault"/>
|
<attr name="instanceCreate" methodvalue="org.sleuthkit.autopsy.recentactivity.RAImageIngestModule.getDefault"/>
|
||||||
<attr name="position" intvalue="110"/>
|
<attr name="position" intvalue="110"/>
|
||||||
</file>
|
</file>
|
||||||
</folder>
|
</folder>
|
||||||
|
@ -200,7 +200,7 @@ public class ReportHTML implements ReportModule {
|
|||||||
if (IngestManager.getDefault().isIngestRunning()) {
|
if (IngestManager.getDefault().isIngestRunning()) {
|
||||||
formatted_Report.append(ingestwarning);
|
formatted_Report.append(ingestwarning);
|
||||||
}
|
}
|
||||||
else if (IngestManager.getDefault().areServicesRunning()) {
|
else if (IngestManager.getDefault().areModulesRunning()) {
|
||||||
formatted_Report.append(ingestwarning);
|
formatted_Report.append(ingestwarning);
|
||||||
}
|
}
|
||||||
formatted_Report.append("<h2>Case Summary</h2><p>HTML Report Generated by <strong>Autopsy 3</strong> on ").append(datetime).append("<ul>");
|
formatted_Report.append("<h2>Case Summary</h2><p>HTML Report Generated by <strong>Autopsy 3</strong> on ").append(datetime).append("<ul>");
|
||||||
|
@ -225,7 +225,7 @@ public class RegressionTest extends TestCase{
|
|||||||
}
|
}
|
||||||
new Timeout("pausing", 15000).sleep(); // give it a second (or fifteen) to process
|
new Timeout("pausing", 15000).sleep(); // give it a second (or fifteen) to process
|
||||||
boolean sleep = true;
|
boolean sleep = true;
|
||||||
while (man.areServicesRunning()) {
|
while (man.areModulesRunning()) {
|
||||||
new Timeout("pausing", 5000).sleep(); // give it a second (or five) to process
|
new Timeout("pausing", 5000).sleep(); // give it a second (or five) to process
|
||||||
}
|
}
|
||||||
logger.info("Ingest (including enqueue) took " + (System.currentTimeMillis()-start) + "ms");
|
logger.info("Ingest (including enqueue) took " + (System.currentTimeMillis()-start) + "ms");
|
||||||
|
@ -124,7 +124,7 @@ public class ThunderbirdEmailParser {
|
|||||||
ftime = ftime / 1000;
|
ftime = ftime / 1000;
|
||||||
dates = ftime;
|
dates = ftime;
|
||||||
} catch (ParseException ex) {
|
} catch (ParseException ex) {
|
||||||
Logger.getLogger(ThunderbirdMboxFileIngestService.class.getName()).log(Level.WARNING, null, ex);
|
Logger.getLogger(ThunderbirdMboxFileIngestModule.class.getName()).log(Level.WARNING, null, ex);
|
||||||
}
|
}
|
||||||
|
|
||||||
return dates;
|
return dates;
|
||||||
|
@ -36,9 +36,9 @@ import org.apache.tika.metadata.Metadata;
|
|||||||
import org.sleuthkit.autopsy.ingest.IngestManagerProxy;
|
import org.sleuthkit.autopsy.ingest.IngestManagerProxy;
|
||||||
import org.sleuthkit.autopsy.ingest.IngestMessage;
|
import org.sleuthkit.autopsy.ingest.IngestMessage;
|
||||||
import org.sleuthkit.autopsy.ingest.IngestMessage.MessageType;
|
import org.sleuthkit.autopsy.ingest.IngestMessage.MessageType;
|
||||||
import org.sleuthkit.autopsy.ingest.IngestServiceAbstract.*;
|
import org.sleuthkit.autopsy.ingest.IngestModuleAbstract.*;
|
||||||
import org.sleuthkit.autopsy.ingest.IngestServiceAbstractFile;
|
import org.sleuthkit.autopsy.ingest.IngestModuleAbstractFile;
|
||||||
import org.sleuthkit.autopsy.ingest.ServiceDataEvent;
|
import org.sleuthkit.autopsy.ingest.ModuleDataEvent;
|
||||||
import org.sleuthkit.datamodel.AbstractFile;
|
import org.sleuthkit.datamodel.AbstractFile;
|
||||||
import org.sleuthkit.datamodel.BlackboardArtifact;
|
import org.sleuthkit.datamodel.BlackboardArtifact;
|
||||||
import org.sleuthkit.datamodel.BlackboardAttribute;
|
import org.sleuthkit.datamodel.BlackboardAttribute;
|
||||||
@ -56,19 +56,19 @@ import org.sleuthkit.datamodel.SleuthkitCase;
|
|||||||
import org.sleuthkit.datamodel.TskData;
|
import org.sleuthkit.datamodel.TskData;
|
||||||
|
|
||||||
|
|
||||||
public class ThunderbirdMboxFileIngestService implements IngestServiceAbstractFile {
|
public class ThunderbirdMboxFileIngestModule implements IngestModuleAbstractFile {
|
||||||
|
|
||||||
private static final Logger logger = Logger.getLogger(ThunderbirdMboxFileIngestService.class.getName());
|
private static final Logger logger = Logger.getLogger(ThunderbirdMboxFileIngestModule.class.getName());
|
||||||
private static ThunderbirdMboxFileIngestService instance = null;
|
private static ThunderbirdMboxFileIngestModule instance = null;
|
||||||
private IngestManagerProxy managerProxy;
|
private IngestManagerProxy managerProxy;
|
||||||
private static int messageId = 0;
|
private static int messageId = 0;
|
||||||
private static final String classname = "Thunderbird Parser";
|
private static final String classname = "Thunderbird Parser";
|
||||||
private final String hashDBServiceName = "Hash Lookup";
|
private final String hashDBModuleName = "Hash Lookup";
|
||||||
private final GetIsFileKnownVisitor getIsFileKnown = new GetIsFileKnownVisitor();
|
private final GetIsFileKnownVisitor getIsFileKnown = new GetIsFileKnownVisitor();
|
||||||
|
|
||||||
public static synchronized ThunderbirdMboxFileIngestService getDefault() {
|
public static synchronized ThunderbirdMboxFileIngestModule getDefault() {
|
||||||
if (instance == null) {
|
if (instance == null) {
|
||||||
instance = new ThunderbirdMboxFileIngestService();
|
instance = new ThunderbirdMboxFileIngestModule();
|
||||||
}
|
}
|
||||||
return instance;
|
return instance;
|
||||||
}
|
}
|
||||||
@ -78,12 +78,12 @@ public class ThunderbirdMboxFileIngestService implements IngestServiceAbstractFi
|
|||||||
ThunderbirdEmailParser mbox = new ThunderbirdEmailParser();
|
ThunderbirdEmailParser mbox = new ThunderbirdEmailParser();
|
||||||
boolean isMbox = false;
|
boolean isMbox = false;
|
||||||
|
|
||||||
IngestServiceAbstractFile.ProcessResult hashDBResult =
|
IngestModuleAbstractFile.ProcessResult hashDBResult =
|
||||||
managerProxy.getAbstractFileServiceResult(hashDBServiceName);
|
managerProxy.getAbstractFileModuleResult(hashDBModuleName);
|
||||||
|
|
||||||
if (abstractFile.accept(getIsFileKnown) == true) {
|
if (abstractFile.accept(getIsFileKnown) == true) {
|
||||||
return ProcessResult.OK; //file is known, stop processing it
|
return ProcessResult.OK; //file is known, stop processing it
|
||||||
} else if (hashDBResult == IngestServiceAbstractFile.ProcessResult.ERROR) {
|
} else if (hashDBResult == IngestModuleAbstractFile.ProcessResult.ERROR) {
|
||||||
return ProcessResult.ERROR; //file has read error, stop processing it
|
return ProcessResult.ERROR; //file has read error, stop processing it
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -94,7 +94,7 @@ public class ThunderbirdMboxFileIngestService implements IngestServiceAbstractFi
|
|||||||
isMbox = mbox.isValidMimeTypeMbox(t);
|
isMbox = mbox.isValidMimeTypeMbox(t);
|
||||||
}
|
}
|
||||||
} catch (TskException ex) {
|
} catch (TskException ex) {
|
||||||
Logger.getLogger(ThunderbirdMboxFileIngestService.class.getName()).log(Level.WARNING, null, ex);
|
Logger.getLogger(ThunderbirdMboxFileIngestModule.class.getName()).log(Level.WARNING, null, ex);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -136,7 +136,7 @@ public class ThunderbirdMboxFileIngestService implements IngestServiceAbstractFi
|
|||||||
Content msfContent = tskCase.getContentById(msfId);
|
Content msfContent = tskCase.getContentById(msfId);
|
||||||
ContentUtils.writeToFile(msfContent, new File(currentCase.getTempDirectory() + File.separator + msfName));
|
ContentUtils.writeToFile(msfContent, new File(currentCase.getTempDirectory() + File.separator + msfName));
|
||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
Logger.getLogger(ThunderbirdMboxFileIngestService.class.getName()).log(Level.WARNING, null, ex);
|
Logger.getLogger(ThunderbirdMboxFileIngestModule.class.getName()).log(Level.WARNING, null, ex);
|
||||||
} catch (TskCoreException ex) {
|
} catch (TskCoreException ex) {
|
||||||
logger.log(Level.WARNING, "Unable to obtain msf file for mbox parsing:" + this.getClass().getName(), ex);
|
logger.log(Level.WARNING, "Unable to obtain msf file for mbox parsing:" + this.getClass().getName(), ex);
|
||||||
}
|
}
|
||||||
@ -162,7 +162,7 @@ public class ThunderbirdMboxFileIngestService implements IngestServiceAbstractFi
|
|||||||
// try {
|
// try {
|
||||||
// reader = new FileReader(currentCase.getTempDirectory() + File.separator + msfName);
|
// reader = new FileReader(currentCase.getTempDirectory() + File.separator + msfName);
|
||||||
// } catch (FileNotFoundException ex) {
|
// } catch (FileNotFoundException ex) {
|
||||||
// Logger.getLogger(ThunderbirdMboxFileIngestService.class.getName()).log(Level.WARNING, null, ex);
|
// Logger.getLogger(ThunderbirdMboxFileIngestModule.class.getName()).log(Level.WARNING, null, ex);
|
||||||
// }
|
// }
|
||||||
// MorkDocument morkDocument = new MorkDocument(reader);
|
// MorkDocument morkDocument = new MorkDocument(reader);
|
||||||
// List<Dict> dicts = morkDocument.getDicts();
|
// List<Dict> dicts = morkDocument.getDicts();
|
||||||
@ -217,18 +217,18 @@ public class ThunderbirdMboxFileIngestService implements IngestServiceAbstractFi
|
|||||||
bbart = abstractFile.newArtifact(BlackboardArtifact.ARTIFACT_TYPE.TSK_EMAIL_MSG);
|
bbart = abstractFile.newArtifact(BlackboardArtifact.ARTIFACT_TYPE.TSK_EMAIL_MSG);
|
||||||
bbart.addAttributes(bbattributes);
|
bbart.addAttributes(bbattributes);
|
||||||
} catch (TskCoreException ex) {
|
} catch (TskCoreException ex) {
|
||||||
Logger.getLogger(ThunderbirdMboxFileIngestService.class.getName()).log(Level.WARNING, null, ex);
|
Logger.getLogger(ThunderbirdMboxFileIngestModule.class.getName()).log(Level.WARNING, null, ex);
|
||||||
}
|
}
|
||||||
IngestManagerProxy.fireServiceDataEvent(new ServiceDataEvent(classname, BlackboardArtifact.ARTIFACT_TYPE.TSK_EMAIL_MSG));
|
IngestManagerProxy.fireModuleDataEvent(new ModuleDataEvent(classname, BlackboardArtifact.ARTIFACT_TYPE.TSK_EMAIL_MSG));
|
||||||
}
|
}
|
||||||
} catch (FileNotFoundException ex) {
|
} catch (FileNotFoundException ex) {
|
||||||
Logger.getLogger(ThunderbirdMboxFileIngestService.class.getName()).log(Level.WARNING, null, ex);
|
Logger.getLogger(ThunderbirdMboxFileIngestModule.class.getName()).log(Level.WARNING, null, ex);
|
||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
Logger.getLogger(ThunderbirdMboxFileIngestService.class.getName()).log(Level.WARNING, null, ex);
|
Logger.getLogger(ThunderbirdMboxFileIngestModule.class.getName()).log(Level.WARNING, null, ex);
|
||||||
} catch (SAXException ex) {
|
} catch (SAXException ex) {
|
||||||
Logger.getLogger(ThunderbirdMboxFileIngestService.class.getName()).log(Level.WARNING, null, ex);
|
Logger.getLogger(ThunderbirdMboxFileIngestModule.class.getName()).log(Level.WARNING, null, ex);
|
||||||
} catch (TikaException ex) {
|
} catch (TikaException ex) {
|
||||||
Logger.getLogger(ThunderbirdMboxFileIngestService.class.getName()).log(Level.WARNING, null, ex);
|
Logger.getLogger(ThunderbirdMboxFileIngestModule.class.getName()).log(Level.WARNING, null, ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -240,7 +240,7 @@ public class ThunderbirdMboxFileIngestService implements IngestServiceAbstractFi
|
|||||||
logger.log(Level.INFO, "complete()");
|
logger.log(Level.INFO, "complete()");
|
||||||
managerProxy.postMessage(IngestMessage.createMessage(++messageId, MessageType.INFO, this, "COMPLETE"));
|
managerProxy.postMessage(IngestMessage.createMessage(++messageId, MessageType.INFO, this, "COMPLETE"));
|
||||||
|
|
||||||
//service specific cleanup due completion here
|
//module specific cleanup due completion here
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -258,19 +258,19 @@ public class ThunderbirdMboxFileIngestService implements IngestServiceAbstractFi
|
|||||||
logger.log(Level.INFO, "init()");
|
logger.log(Level.INFO, "init()");
|
||||||
this.managerProxy = managerProxy;
|
this.managerProxy = managerProxy;
|
||||||
|
|
||||||
//service specific initialization here
|
//module specific initialization here
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void stop() {
|
public void stop() {
|
||||||
logger.log(Level.INFO, "stop()");
|
logger.log(Level.INFO, "stop()");
|
||||||
|
|
||||||
//service specific cleanup due interruption here
|
//module specific cleanup due interruption here
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ServiceType getType() {
|
public ModuleType getType() {
|
||||||
return ServiceType.AbstractFile;
|
return ModuleType.AbstractFile;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
@ -2,9 +2,9 @@
|
|||||||
<!DOCTYPE filesystem PUBLIC "-//NetBeans//DTD Filesystem 1.2//EN" "http://www.netbeans.org/dtds/filesystem-1_2.dtd">
|
<!DOCTYPE filesystem PUBLIC "-//NetBeans//DTD Filesystem 1.2//EN" "http://www.netbeans.org/dtds/filesystem-1_2.dtd">
|
||||||
<filesystem>
|
<filesystem>
|
||||||
<folder name="Services">
|
<folder name="Services">
|
||||||
<file name="org-sleuthkit-autopsy-thunderbirdparser-ThunderbirdMboxFilervice.instance">
|
<file name="org-sleuthkit-autopsy-thunderbirdparser-ThunderbirdMboxFileModule.instance">
|
||||||
<attr name="instanceOf" stringvalue="org.sleuthkit.autopsy.ingest.IngestServiceAbstractFile"/>
|
<attr name="instanceOf" stringvalue="org.sleuthkit.autopsy.ingest.IngestModuleAbstractFile"/>
|
||||||
<attr name="instanceCreate" methodvalue="org.sleuthkit.autopsy.thunderbirdparser.ThunderbirdMboxFileIngestService.getDefault"/>
|
<attr name="instanceCreate" methodvalue="org.sleuthkit.autopsy.thunderbirdparser.ThunderbirdMboxFileIngestModule.getDefault"/>
|
||||||
<attr name="position" intvalue="1050"/>
|
<attr name="position" intvalue="1050"/>
|
||||||
</file>
|
</file>
|
||||||
</folder>
|
</folder>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user