Project

General

Profile

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

    
3
import org.apache.commons.logging.Log;
4
import org.apache.commons.logging.LogFactory;
5
import org.springframework.beans.factory.annotation.Autowired;
6
import org.springframework.context.annotation.Scope;
7
import org.springframework.stereotype.Component;
8

    
9
import eu.dnetlib.data.mdstore.MDStoreService;
10
import eu.dnetlib.msro.annotations.ProcessNode;
11
import eu.dnetlib.msro.workflows.Arc;
12
import eu.dnetlib.msro.workflows.nodes.SimpleParallelProcessNode;
13

    
14
@Component
15
@Scope("prototype")
16
@ProcessNode("CreateMDStore")
17
public class CreateMDStoreJobNode extends SimpleParallelProcessNode {
18

    
19
	private static final Log log = LogFactory.getLog(CreateMDStoreJobNode.class);
20

    
21
	@Autowired
22
	private MDStoreService mdstoreService;
23

    
24
	private String format;
25

    
26
	private String layout;
27

    
28
	private String interpretation;
29

    
30
	private String resultMdId;
31

    
32
	@Override
33
	protected String execute() throws Exception {
34
		resultMdId = mdstoreService.create(format, layout, interpretation);
35
		log.info("New mdstore " + resultMdId);
36
		return Arc.DEFAULT_ARC;
37
	}
38

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

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

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

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

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

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

    
63
	public String getResultMdId() {
64
		return resultMdId;
65
	}
66

    
67
	public void setResultMdId(final String resultMdId) {
68
		this.resultMdId = resultMdId;
69
	}
70

    
71
}
(1-1/4)