1 |
29397
|
claudio.at
|
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.openaireplus.workflows.nodes.index.EntityGrouperConfigurationLoader;
|
6 |
|
|
import eu.dnetlib.msro.rmi.MSROException;
|
7 |
|
|
import eu.dnetlib.msro.workflows.nodes.SimpleJobNode;
|
8 |
48139
|
alessia.ba
|
import org.apache.commons.lang.StringUtils;
|
9 |
|
|
import org.apache.commons.logging.Log;
|
10 |
|
|
import org.apache.commons.logging.LogFactory;
|
11 |
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
12 |
29397
|
claudio.at
|
|
13 |
|
|
public class LoadEntityLinksJobNode extends SimpleJobNode {
|
14 |
|
|
|
15 |
|
|
private static final String INDEX_ENTITY_LINKS = "index.entity.links";
|
16 |
|
|
|
17 |
|
|
/**
|
18 |
|
|
* logger.
|
19 |
|
|
*/
|
20 |
|
|
private static final Log log = LogFactory.getLog(LoadEntityLinksJobNode.class); // NOPMD by marko on 11/24/08 5:02 PM
|
21 |
|
|
|
22 |
|
|
@Autowired
|
23 |
|
|
private EntityGrouperConfigurationLoader grouperConfLoader;
|
24 |
|
|
|
25 |
|
|
@Override
|
26 |
|
|
protected String execute(final NodeToken token) throws Exception {
|
27 |
|
|
|
28 |
|
|
log.info("loading entity link table");
|
29 |
|
|
|
30 |
|
|
String links = grouperConfLoader.load();
|
31 |
|
|
|
32 |
|
|
if (StringUtils.isBlank(links)) throw new MSROException("empty links table");
|
33 |
|
|
|
34 |
|
|
token.getEnv().setAttribute(INDEX_ENTITY_LINKS, links);
|
35 |
|
|
|
36 |
|
|
return Arc.DEFAULT_ARC;
|
37 |
|
|
}
|
38 |
|
|
|
39 |
|
|
}
|