1
|
package eu.dnetlib.msro.workflows.nodes;
|
2
|
|
3
|
import eu.dnetlib.msro.workflows.graph.Arc;
|
4
|
import eu.dnetlib.msro.workflows.nodes.index.EntityGrouperConfigurationLoader;
|
5
|
import eu.dnetlib.msro.workflows.procs.Env;
|
6
|
import eu.dnetlib.rmi.manager.MSROException;
|
7
|
import org.apache.commons.lang3.StringUtils;
|
8
|
import org.apache.commons.logging.Log;
|
9
|
import org.apache.commons.logging.LogFactory;
|
10
|
import org.springframework.beans.factory.annotation.Autowired;
|
11
|
|
12
|
public class LoadEntityLinksJobNode extends SimpleJobNode {
|
13
|
|
14
|
/**
|
15
|
* logger.
|
16
|
*/
|
17
|
private static final Log log = LogFactory.getLog(LoadEntityLinksJobNode.class); // NOPMD by marko on 11/24/08 5:02 PM
|
18
|
|
19
|
private String entityLinksParam;
|
20
|
|
21
|
@Autowired
|
22
|
private EntityGrouperConfigurationLoader grouperConfLoader;
|
23
|
|
24
|
@Override
|
25
|
protected String execute(final Env env) throws Exception {
|
26
|
|
27
|
log.info("loading entity link table");
|
28
|
|
29
|
final String links = this.grouperConfLoader.load();
|
30
|
|
31
|
if (StringUtils.isBlank(links)) { throw new MSROException("empty links table"); }
|
32
|
|
33
|
env.setAttribute(getEntityLinksParam(), links);
|
34
|
|
35
|
return Arc.DEFAULT_ARC;
|
36
|
}
|
37
|
|
38
|
public String getEntityLinksParam() {
|
39
|
return entityLinksParam;
|
40
|
}
|
41
|
|
42
|
public void setEntityLinksParam(final String entityLinksParam) {
|
43
|
this.entityLinksParam = entityLinksParam;
|
44
|
}
|
45
|
}
|