Class TaskProcessorCommand
java.lang.Object
eu.svjatoslav.alyverkko_cli.commands.task_processor.TaskProcessorCommand
- All Implemented Interfaces:
Command
TODO: What happens when directory gets renamed ? Will event listener reindex all files inside it for processing ?
The TaskProcessorCommand continuously monitors a specified tasks
directory for new or modified text files, checks if they have a
"TOCOMPUTE:" marker, and if so, adds them to a priority queue to be
processed in priority order. Once processed, results are appended to
the same file.
Usage:
alyverkko-cli mail
-
Field Summary
FieldsModifier and TypeFieldDescriptioneu.svjatoslav.commons.cli_helper.parameter_parser.parameter.FileOptionOptional CLI argument for specifying a configuration file path. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidexecuteCommand(String[] cliArguments) Executes the "mail" command, loading configuration, starting a WatchService on the mail directory, adding existing files to the task queue, and processing tasks in priority order.
-
Field Details
-
configFileOption
public eu.svjatoslav.commons.cli_helper.parameter_parser.parameter.FileOption configFileOptionOptional CLI argument for specifying a configuration file path.
-
-
Constructor Details
-
TaskProcessorCommand
public TaskProcessorCommand()
-
-
Method Details
-
getCommandName
- Specified by:
getCommandNamein interfaceCommand- Returns:
- the name of this command, i.e., "mail".
-
executeCommand
Executes the "mail" command, loading configuration, starting a WatchService on the mail directory, adding existing files to the task queue, and processing tasks in priority order.- Specified by:
executeCommandin interfaceCommand- Parameters:
cliArguments- the command-line arguments following the "mail" subcommand.- Throws:
IOException- if reading/writing tasks fails.InterruptedException- if the WatchService is interrupted.
-