Project

General

Profile

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

    
3
import eu.dnetlib.enabling.locators.UniqueServiceLocator;
4
import eu.dnetlib.enabling.tools.blackboard.BlackboardJob;
5
import eu.dnetlib.msro.workflows.procs.Env;
6
import eu.dnetlib.msro.workflows.procs.Token;
7
import eu.dnetlib.rmi.data.MDStoreService;
8
import org.apache.commons.logging.Log;
9
import org.apache.commons.logging.LogFactory;
10
import org.springframework.beans.factory.annotation.Autowired;
11

    
12
/**
13
 * Created by claudio on 21/03/16.
14
 */
15
public class RunMDStorePluginJobNode extends BlackboardJobNode {
16

    
17
	private static final Log log = LogFactory.getLog(RunMDStorePluginJobNode.class);
18

    
19
	@Autowired
20
	private UniqueServiceLocator serviceLocator;
21

    
22
	private String mdId;
23

    
24
	private String pluginName;
25

    
26
	@Override
27
	protected String obtainServiceId(final Env env) {
28
		return this.serviceLocator.getServiceId(MDStoreService.class);
29
	}
30

    
31
	@Override
32
	protected void prepareJob(final BlackboardJob job, final Token token) throws Exception {
33
		job.setAction("RUN_PLUGIN");
34
		job.getParameters().put("plugin.name", getPluginName());
35
		job.getParameters().put("mdId", getMdId());
36

    
37
		log.debug(job.getParameters());
38
	}
39

    
40
	public String getMdId() {
41
		return this.mdId;
42
	}
43

    
44
	public void setMdId(final String mdId) {
45
		this.mdId = mdId;
46
	}
47

    
48
	public String getPluginName() {
49
		return this.pluginName;
50
	}
51

    
52
	public void setPluginName(final String pluginName) {
53
		this.pluginName = pluginName;
54
	}
55
}
(11-11/12)