Project

General

Profile

1
package eu.dnetlib.msro.workflows.nodes;
2

    
3
import eu.dnetlib.msro.workflows.graph.Arc;
4
import eu.dnetlib.msro.workflows.graph.Env;
5
import org.apache.commons.logging.Log;
6
import org.apache.commons.logging.LogFactory;
7

    
8
import static java.lang.String.format;
9

    
10
public class SetFormatInfoJobNode extends SimpleJobNode {
11

    
12
	/**
13
	 * logger.
14
	 */
15
	private static final Log log = LogFactory.getLog(SetFormatInfoJobNode.class); // NOPMD by marko on 11/24/08 5:02 PM
16

    
17
	private String format;
18
	private String formatParam = "format";
19

    
20
	private String layout;
21
	private String layoutParam = "layout";
22

    
23
	private String interpretation;
24
	private String interpretationParam = "interpretation";
25

    
26
	@Override
27
	public String execute(final Env env) {
28

    
29
		log.info(format("setting mdFromat: %s, layout: %s, interpretation: %s", getFormat(), getLayout(), getInterpretation()));
30

    
31
		env.setAttribute(getFormatParam(), getFormat());
32
		env.setAttribute(getLayoutParam(), getLayout());
33
		env.setAttribute(getInterpretationParam(), getInterpretation());
34

    
35
		return Arc.DEFAULT_ARC;
36
	}
37

    
38
	public String getFormat() {
39
		return format;
40
	}
41

    
42
	public void setFormat(final String format) {
43
		this.format = format;
44
	}
45

    
46
	public String getLayout() {
47
		return layout;
48
	}
49

    
50
	public void setLayout(final String layout) {
51
		this.layout = layout;
52
	}
53

    
54
	public String getInterpretation() {
55
		return interpretation;
56
	}
57

    
58
	public void setInterpretation(final String interpretation) {
59
		this.interpretation = interpretation;
60
	}
61

    
62
	public String getFormatParam() {
63
		return formatParam;
64
	}
65

    
66
	public void setFormatParam(final String formatParam) {
67
		this.formatParam = formatParam;
68
	}
69

    
70
	public String getLayoutParam() {
71
		return layoutParam;
72
	}
73

    
74
	public void setLayoutParam(final String layoutParam) {
75
		this.layoutParam = layoutParam;
76
	}
77

    
78
	public String getInterpretationParam() {
79
		return interpretationParam;
80
	}
81

    
82
	public void setInterpretationParam(final String interpretationParam) {
83
		this.interpretationParam = interpretationParam;
84
	}
85

    
86
}
(7-7/9)