1 |
42244
|
claudio.at
|
package eu.dnetlib.msro.openaireplus.workflows.nodes;
|
2 |
|
|
|
3 |
|
|
import com.googlecode.sarasvati.NodeToken;
|
4 |
|
|
import eu.dnetlib.data.mdstore.MDStoreService;
|
5 |
|
|
import eu.dnetlib.enabling.locators.UniqueServiceLocator;
|
6 |
|
|
import eu.dnetlib.enabling.tools.blackboard.BlackboardJob;
|
7 |
|
|
import eu.dnetlib.msro.workflows.nodes.BlackboardJobNode;
|
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 NodeToken nodeToken) {
|
28 |
|
|
return serviceLocator.getServiceId(MDStoreService.class);
|
29 |
|
|
}
|
30 |
|
|
|
31 |
|
|
@Override
|
32 |
|
|
protected void prepareJob(final BlackboardJob job, final NodeToken nodeToken) 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 mdId;
|
42 |
|
|
}
|
43 |
|
|
|
44 |
|
|
public void setMdId(final String mdId) {
|
45 |
|
|
this.mdId = mdId;
|
46 |
|
|
}
|
47 |
|
|
|
48 |
|
|
public String getPluginName() {
|
49 |
|
|
return pluginName;
|
50 |
|
|
}
|
51 |
|
|
|
52 |
|
|
public void setPluginName(final String pluginName) {
|
53 |
|
|
this.pluginName = pluginName;
|
54 |
|
|
}
|
55 |
|
|
}
|