Project

General

Profile

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

    
3
import com.googlecode.sarasvati.Arc;
4
import com.googlecode.sarasvati.NodeToken;
5
import eu.dnetlib.msro.workflows.nodes.SimpleJobNode;
6
import org.apache.commons.logging.Log;
7
import org.apache.commons.logging.LogFactory;
8

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

    
11
public class SetFormatInfoJobNode extends SimpleJobNode {
12

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

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

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

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

    
27
	/**
28
	 * {@inheritDoc}
29
	 *
30
	 * @see com.googlecode.sarasvati.mem.MemNode#execute(com.googlecode.sarasvati.Engine, com.googlecode.sarasvati.NodeToken)
31
	 */
32
	@Override
33
	public String execute(final NodeToken token) {
34

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

    
37
		token.getEnv().setAttribute(getFormatParam(), getFormat());
38
		token.getEnv().setAttribute(getLayoutParam(), getLayout());
39
		token.getEnv().setAttribute(getInterpretationParam(), getInterpretation());
40

    
41
		return Arc.DEFAULT_ARC;
42
	}
43

    
44
	public String getFormat() {
45
		return format;
46
	}
47

    
48
	public void setFormat(final String format) {
49
		this.format = format;
50
	}
51

    
52
	public String getLayout() {
53
		return layout;
54
	}
55

    
56
	public void setLayout(final String layout) {
57
		this.layout = layout;
58
	}
59

    
60
	public String getInterpretation() {
61
		return interpretation;
62
	}
63

    
64
	public void setInterpretation(final String interpretation) {
65
		this.interpretation = interpretation;
66
	}
67

    
68
	public String getFormatParam() {
69
		return formatParam;
70
	}
71

    
72
	public void setFormatParam(final String formatParam) {
73
		this.formatParam = formatParam;
74
	}
75

    
76
	public String getLayoutParam() {
77
		return layoutParam;
78
	}
79

    
80
	public void setLayoutParam(final String layoutParam) {
81
		this.layoutParam = layoutParam;
82
	}
83

    
84
	public String getInterpretationParam() {
85
		return interpretationParam;
86
	}
87

    
88
	public void setInterpretationParam(final String interpretationParam) {
89
		this.interpretationParam = interpretationParam;
90
	}
91

    
92
}
(21-21/24)