"...wie_202021_csbillero11.git" did not exist on "1a881bfd4e487d3629eb79bc5a63d8cf0de9f0f0"
Newer
Older
The *Task* entities defined in a *Processor* definition can be implemented as dedicated native java plugins or as scripts written in *Perl*, *Python* or *Shell* scripting languages.
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
## Java plugins
Dedicated native java plugins can be developed by implementing the GenericTaskInterface process method defined in the DES library
**GenericTaskInterface Interface**
```java
public interface GenericTaskInterface {
/**
*
* @param basepath Basepath as configured in DistributionServer.ini
* @param aoi_name AOI name contained in the $processor.processor_config.xml
* @param processor_name Processor name related to the $processor.processor_config.xml
* @param entity_name Name of executing entity (Task, Consumer, etc.)
* @param parameters Parameters as defined by <Parameter>
* @param args List of arguments of the Task (String or Hashtables, to be checked by the plugin)
* @param files List of files of the Task iff <FileType>regexp</FileType> is defined, else null
* @return ExitCodes
*/
public int process(String basepath, String aoi_name,
String processor_name, String entity_name, Hashtable parameters, Object[] args, String[] files);
}
```
The implemented plugin should be packaged as a jar file and placed in the DES ./plugins directory where it is automatically loaded at Runtime.
The plugin can be executed in a given *Processor* *Task* with the following definition:
Example:
```xml
<Task name="renameFiles" type="class" active="yes" priority="NORM">
<Command>class</Command>
<FileType>SAMPLE.*.AA.txt</FileType>
<Parameter>edu.eurac.distributionserver.tasks.generic.FileRename</Parameter>
<FilePrefix>RENAME</FilePrefix>
</Task>
```
The parameters can be passed to the *Task* plugin with one of the following options:
1) By using a custom keyword tag eg. *FilePrefix* in the *Task* definition and then accessing the parameter with the Hashtable parameters in the Interface
```java
2) By using the *Parameter* tag in the *Task* definition and than referencing the parameter with the Object[] args type in the Interface