Project

General

Profile

1 27368 claudio.at
package eu.dnetlib.msro.openaireplus.workflows.nodes;
2
3 32863 claudio.at
import java.util.List;
4
import java.util.Map;
5
6
import com.google.gson.Gson;
7 27368 claudio.at
import com.googlecode.sarasvati.Arc;
8
import com.googlecode.sarasvati.NodeToken;
9 43601 claudio.at
import org.springframework.beans.factory.annotation.Required;
10 27368 claudio.at
11 43601 claudio.at
public class PrepareIISMainParamsV2JobNode extends PrepareIISParamsV2 {
12 27368 claudio.at
13
	private String xqueryObjectStores;
14
15
	private String objectStoreParam = "import_content_objectstores_csv";
16
17 48139 alessia.ba
	private String importHbaseDumpLocation;
18
19
	private String importHbaseDumpLocationParam = "import_hbase_dump_location";
20
21 27368 claudio.at
	// Enable/Disable inference modules
22
23
	@Override
24
	protected String execute(final NodeToken token) throws Exception {
25
26 27525 claudio.at
		super.prepare(token);
27
28 31423 claudio.at
		token.getEnv().setAttribute(getObjectStoreParam(), getFilteredObjectStoreCSV(getXqueryObjectStores()));
29 48139 alessia.ba
		token.getEnv().setAttribute(getImportHbaseDumpLocationParam(), getImportHbaseDumpLocation());
30 27368 claudio.at
31 48139 alessia.ba
		@SuppressWarnings("unchecked")		final List<Map<String, String>> sets = new Gson().fromJson(token.getEnv().getAttribute("sets"), List.class);
32 32863 claudio.at
		for (Map<String, String> set : sets) {
33
			token.getEnv().setAttribute(set.get("enablingProperty"), set.get("enabled"));
34
		}
35 27368 claudio.at
36
		return Arc.DEFAULT_ARC;
37
	}
38
39
	public String getXqueryObjectStores() {
40
		return xqueryObjectStores;
41
	}
42
43
	@Required
44 28824 claudio.at
	public void setXqueryObjectStores(final String xqueryObjectStores) {
45 27368 claudio.at
		this.xqueryObjectStores = xqueryObjectStores;
46
	}
47
48
	public String getObjectStoreParam() {
49
		return objectStoreParam;
50
	}
51
52 28824 claudio.at
	public void setObjectStoreParam(final String objectStoreParam) {
53 27368 claudio.at
		this.objectStoreParam = objectStoreParam;
54
	}
55
56 48139 alessia.ba
	public String getImportHbaseDumpLocation() {
57
		return importHbaseDumpLocation;
58
	}
59
60
	public void setImportHbaseDumpLocation(final String importHbaseDumpLocation) {
61
		this.importHbaseDumpLocation = importHbaseDumpLocation;
62
	}
63
64
	public String getImportHbaseDumpLocationParam() {
65
		return importHbaseDumpLocationParam;
66
	}
67
68
	public void setImportHbaseDumpLocationParam(final String importHbaseDumpLocationParam) {
69
		this.importHbaseDumpLocationParam = importHbaseDumpLocationParam;
70
	}
71 27368 claudio.at
}