AbstractTask Class
Package:iped.engine.taskSource:
iped-engine/src/main/java/iped/engine/task/AbstractTask.java
The AbstractTask class is the base class for all processing tasks in IPED. Each worker thread maintains its own instances of tasks.
Creating a Custom Task
ExtendAbstractTask and implement the required abstract methods:
Abstract Methods
getConfigurables()
List<Configurable<?>>
Returns a list of
Configurable objects containing task-specific configuration options. These are loaded at startup and passed to init(). Can be used by UIs to query task options.init()
void
Performs task initialization. Called once per worker thread at startup. Use this to:
- Load task configurations
- Initialize models or resources
- Validate dependencies
- Set up per-thread state
process()
void
Processes a single evidence item. This is the main task logic. Called for each item in the case.
finish()
void
Performs cleanup when task processing completes. Called once per worker thread. Use this to:
- Release resources
- Close files or connections
- Save final statistics
Protected Fields
Tasks have access to several protected fields:Worker
The worker thread executing this task
Statistics
Statistics object that can be updated by the task
File
Processing output directory where tasks can create subdirectories for results
CaseData
Represents the current case. Use
caseData.objectMap to share objects between task instances.Example: Accessing Protected Fields
Task Configuration
Optional Methods
boolean
Returns whether the task is enabled. Default is
true. Override to implement enable/disable logic.boolean
Returns whether the task should process ignored items (items with
hashDb:status=known). Default is false.boolean
Returns whether the task should process special queue-end marker items. Default is
false.Creating Subitems
Tasks can create subitems when extracting embedded content:Checking Dependencies
Ensure required tasks are enabled:Sharing Data Between Task Instances
Use the case object map to share data:Complete Example: Hash Lookup Task
Complete Example: File Classifier Task
Registering Tasks
To use your custom task, register it in IPED’s configuration:- Compile your task and package it as a JAR
- Place the JAR in IPED’s
liborpluginsdirectory - Add the task to
conf/TaskInstaller.xml:
Task Lifecycle
Best Practices
Task Execution Order
Tasks execute in the order defined inTaskInstaller.xml. Consider dependencies when ordering:
- SignatureTask - Detect file types
- HashTask - Compute hashes
- ParsingTask - Extract text content
- Your custom tasks - Use results from previous tasks
Debugging Tasks
Enable detailed logging:See Also
- Item API - Access and modify item properties
- Search API - Query items in tasks
- Configuration Guide - Configure task behavior