Revision 55469
Added by Claudio Atzori almost 5 years ago
CollectRecordsJobNode.java | ||
---|---|---|
1 | 1 |
package eu.dnetlib.msro.workflows.nodes.collect; |
2 | 2 |
|
3 | 3 |
import java.io.StringReader; |
4 |
import java.util.HashMap; |
|
5 |
import java.util.Map; |
|
4 | 6 |
|
5 | 7 |
import javax.annotation.Resource; |
6 | 8 |
import javax.xml.ws.wsaddressing.W3CEndpointReference; |
7 | 9 |
|
10 |
import eu.dnetlib.msro.rmi.MSROException; |
|
11 |
import eu.dnetlib.msro.workflows.util.WorkflowsConstants; |
|
8 | 12 |
import org.dom4j.Document; |
9 | 13 |
import org.dom4j.Node; |
10 | 14 |
import org.dom4j.io.SAXReader; |
... | ... | |
35 | 39 |
|
36 | 40 |
final InterfaceDescriptor interfaceDescriptor = InterfaceDescriptor.newInstance(ifcNode); |
37 | 41 |
|
42 |
if (interfaceDescriptor == null) { |
|
43 |
throw new MSROException("invalid interface descriptor: " + datasourceInterface); |
|
44 |
} |
|
45 |
|
|
38 | 46 |
final W3CEndpointReference epr = serviceLocator.getService(CollectorService.class).collect(interfaceDescriptor); |
39 | 47 |
|
40 | 48 |
token.getEnv().setAttribute(getEprParam(), epr.toString()); |
41 | 49 |
|
50 |
token.getEnv().setAttribute(WorkflowsConstants.DATAPROVIDER_INTERFACE_BASEURL, interfaceDescriptor.getBaseUrl()); |
|
51 |
token.getEnv().setAttribute(WorkflowsConstants.DATAPROVIDER_PREFIX + "protocol", interfaceDescriptor.getProtocol()); |
|
52 |
final Map<String, String> params = interfaceDescriptor.getParams(); |
|
53 |
if (params != null) { |
|
54 |
for(Map.Entry<String, String> e : params.entrySet()) { |
|
55 |
token.getEnv().setAttribute(WorkflowsConstants.DATAPROVIDER_PREFIX + e.getKey(), e.getValue()); |
|
56 |
} |
|
57 |
} |
|
58 |
|
|
42 | 59 |
return Arc.DEFAULT_ARC; |
43 | 60 |
} |
44 | 61 |
|
Also available in: Unified diff
Save interface descriptor data in the aggregation workflow logger entries #4470