Project

General

Profile

1
package eu.dnetlib.dhp.common.java;
2

    
3
import java.util.Map;
4

    
5
import org.apache.hadoop.conf.Configuration;
6

    
7
import eu.dnetlib.dhp.common.java.porttype.PortType;
8

    
9
/** Workflow node written in Java.
10
 * 
11
 * The implementing class has to define a constructor with no parameters 
12
 * (possibly the default one) or a constructor with String[] as a single
13
 * parameter.
14
 * @author Mateusz Kobos
15
 */
16
public interface Process {
17
	/**
18
	 * Run the process.
19
	 * 
20
	 * The process ends with a success status if no exception is thrown, 
21
	 * otherwise it ends with an error status.
22
	 *
23
	 * @param parameters parameters of the process. Each parameter
24
	 * corresponds to a single entry in the map, its name is the key, its
25
	 * value is the value.
26
	 * @throws Exception if thrown, it means that the process finished
27
	 * with an error status
28
	 */
29
	void run(PortBindings portBindings, Configuration conf, 
30
			Map<String, String> parameters) throws Exception;
31
	
32
	/**
33
	 * @return map containing as the key: name of the port, as the value: type
34
	 * of the port 
35
	 */
36
	Map<String, PortType> getInputPorts();
37
	
38
	/**
39
	 * @return map containing as the key: name of the port, as the value: type
40
	 * of the port 
41
	 */
42
	Map<String, PortType> getOutputPorts();
43
}
(7-7/11)