Project

General

Profile

« Previous | Next » 

Revision 55470

Save interface descriptor data in the aggregation workflow logger entries #4470, also for incremental harvestings

View differences:

modules/dnet-msro-service/trunk/src/main/java/eu/dnetlib/msro/workflows/nodes/collect/DateRangeCollectRecordsJobNode.java
1 1
package eu.dnetlib.msro.workflows.nodes.collect;
2 2

  
3 3
import java.io.StringReader;
4
import java.util.Map;
4 5

  
5 6
import javax.annotation.Resource;
6 7
import javax.xml.ws.wsaddressing.W3CEndpointReference;
7 8

  
9
import eu.dnetlib.msro.rmi.MSROException;
10
import eu.dnetlib.msro.workflows.util.WorkflowsConstants;
8 11
import org.apache.commons.lang3.StringUtils;
9 12
import org.dom4j.Document;
10 13
import org.dom4j.Node;
......
42 45

  
43 46
		final InterfaceDescriptor interfaceDescriptor = InterfaceDescriptor.newInstance(ifcNode);
44 47

  
48
		if (interfaceDescriptor == null) {
49
			throw new MSROException("invalid interface descriptor: " + datasourceInterface);
50
		}
51

  
45 52
		final W3CEndpointReference epr = serviceLocator.getService(CollectorService.class).dateRangeCollect(interfaceDescriptor, fromDate, untilDate);
46 53

  
47 54
		token.getEnv().setAttribute(getEprParam(), epr.toString());
48 55

  
56
		token.getEnv().setAttribute(WorkflowsConstants.DATAPROVIDER_INTERFACE_BASEURL, interfaceDescriptor.getBaseUrl());
57
		token.getEnv().setAttribute(WorkflowsConstants.DATAPROVIDER_PREFIX + "protocol", interfaceDescriptor.getProtocol());
58
		final Map<String, String> params = interfaceDescriptor.getParams();
59
		if (params != null) {
60
			for(Map.Entry<String, String> e : params.entrySet()) {
61
				token.getEnv().setAttribute(WorkflowsConstants.DATAPROVIDER_PREFIX + e.getKey(), e.getValue());
62
			}
63
		}
64

  
65

  
49 66
		return Arc.DEFAULT_ARC;
50 67
	}
51 68

  

Also available in: Unified diff