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