Revision 42170
Added by Sandro La Bruzzo about 8 years ago
CreateObjectStoreJobNode.java | ||
---|---|---|
2 | 2 |
|
3 | 3 |
import java.util.Map; |
4 | 4 |
|
5 |
import org.apache.commons.lang3.StringUtils; |
|
6 |
import org.apache.commons.logging.Log; |
|
7 |
import org.apache.commons.logging.LogFactory; |
|
8 |
|
|
9 | 5 |
import eu.dnetlib.enabling.tools.blackboard.BlackboardJob; |
10 | 6 |
import eu.dnetlib.msro.workflows.nodes.BlackboardJobNode; |
11 | 7 |
import eu.dnetlib.msro.workflows.nodes.blackboard.BlackboardWorkflowJobListener; |
12 | 8 |
import eu.dnetlib.msro.workflows.procs.Env; |
13 | 9 |
import eu.dnetlib.msro.workflows.procs.Token; |
14 | 10 |
import eu.dnetlib.rmi.data.ObjectStoreService; |
11 |
import org.apache.commons.lang3.StringUtils; |
|
12 |
import org.apache.commons.logging.Log; |
|
13 |
import org.apache.commons.logging.LogFactory; |
|
15 | 14 |
|
16 | 15 |
public class CreateObjectStoreJobNode extends BlackboardJobNode { |
17 | 16 |
|
... | ... | |
19 | 18 |
|
20 | 19 |
private String interpretation; |
21 | 20 |
private String outputPrefix = "objectStore_"; |
21 |
private boolean createOnlyIfMissing = false; |
|
22 | 22 |
|
23 | 23 |
@Override |
24 | 24 |
protected String obtainServiceId(final Env env) { |
... | ... | |
31 | 31 |
final String basePath = token.getEnv().getAttribute("objectStoreBasePath", String.class); |
32 | 32 |
job.setAction("CREATE"); |
33 | 33 |
job.getParameters().put("interpretation", this.interpretation); |
34 |
job.getParameters().put("createOnlyIfMissing", "" + createOnlyIfMissing); |
|
34 | 35 |
if (StringUtils.isNotBlank(basePath)) { |
35 | 36 |
job.getParameters().put("basePath", basePath); |
37 |
|
|
36 | 38 |
} |
37 | 39 |
} |
38 | 40 |
|
... | ... | |
52 | 54 |
this.outputPrefix = outputPrefix; |
53 | 55 |
} |
54 | 56 |
|
57 |
public boolean isCreateOnlyIfMissing() { |
|
58 |
return createOnlyIfMissing; |
|
59 |
} |
|
60 |
|
|
61 |
public void setCreateOnlyIfMissing(final boolean createOnlyIfMissing) { |
|
62 |
this.createOnlyIfMissing = createOnlyIfMissing; |
|
63 |
} |
|
64 |
|
|
55 | 65 |
@Override |
56 | 66 |
protected BlackboardWorkflowJobListener generateBlackboardListener(final Token token) { |
57 | 67 |
return new BlackboardWorkflowJobListener(token) { |
Also available in: Unified diff
fixed download into gridfs