1
|
package eu.dnetlib.msro.workflows.nodes.index;
|
2
|
|
3
|
import org.apache.commons.logging.Log;
|
4
|
import org.apache.commons.logging.LogFactory;
|
5
|
|
6
|
import com.googlecode.sarasvati.NodeToken;
|
7
|
|
8
|
import eu.dnetlib.data.provision.index.rmi.IndexService;
|
9
|
import eu.dnetlib.enabling.tools.blackboard.BlackboardJob;
|
10
|
import eu.dnetlib.msro.workflows.nodes.BlackboardJobNode;
|
11
|
|
12
|
public class DeleteIndexJobNode extends BlackboardJobNode {
|
13
|
|
14
|
private static final Log log = LogFactory.getLog(DeleteIndexJobNode.class);
|
15
|
|
16
|
private String indexId;
|
17
|
private String defaultIndexId;
|
18
|
|
19
|
@Override
|
20
|
protected String obtainServiceId(final NodeToken token) {
|
21
|
return getServiceLocator().getServiceId(IndexService.class);
|
22
|
}
|
23
|
|
24
|
@Override
|
25
|
protected void prepareJob(final BlackboardJob job, final NodeToken token) throws Exception {
|
26
|
log.info("deleting index id = " + getIndexId());
|
27
|
|
28
|
job.setAction("DELETE");
|
29
|
job.getParameters().put("id", getIndexId());
|
30
|
job.getParameters().put("backend_Id", defaultIndexId);
|
31
|
|
32
|
}
|
33
|
|
34
|
public String getIndexId() {
|
35
|
return indexId;
|
36
|
}
|
37
|
|
38
|
public void setIndexId(final String indexId) {
|
39
|
this.indexId = indexId;
|
40
|
}
|
41
|
|
42
|
public String getDefaultIndexId() {
|
43
|
return defaultIndexId;
|
44
|
}
|
45
|
|
46
|
public void setDefaultIndexId(final String defaultIndexId) {
|
47
|
this.defaultIndexId = defaultIndexId;
|
48
|
}
|
49
|
}
|