Revision 41466
Added by Sandro La Bruzzo about 8 years ago
FeedCompleteObjectAction.java | ||
---|---|---|
1 | 1 |
package eu.dnetlib.data.objectstore.modular; |
2 | 2 |
|
3 |
import eu.dnetlib.data.objectstore.rmi.ObjectStoreServiceException; |
|
3 | 4 |
import eu.dnetlib.enabling.tools.blackboard.BlackboardJob; |
4 |
import eu.dnetlib.enabling.tools.blackboard.BlackboardServerAction; |
|
5 | 5 |
import eu.dnetlib.enabling.tools.blackboard.BlackboardServerHandler; |
6 | 6 |
import org.springframework.beans.factory.annotation.Required; |
7 | 7 |
|
... | ... | |
9 | 9 |
/** |
10 | 10 |
* The Class FeedCompleteObjectAction is responsible to execute the blacboard action of type FEED OBJECT which is Metadata created for WOS case of openaire. |
11 | 11 |
*/ |
12 |
public class FeedCompleteObjectAction extends AbstractObjectStoreAction implements BlackboardServerAction<ObjectStoreActions> {
|
|
12 |
public class FeedCompleteObjectAction extends AbstractObjectStoreAction { |
|
13 | 13 |
|
14 | 14 |
/** The store feeder. */ |
15 | 15 |
private ModularObjectStoreFeeder storeFeeder; |
16 | 16 |
|
17 |
/* (non-Javadoc) |
|
18 |
* @see eu.dnetlib.enabling.tools.blackboard.BlackboardServerAction#execute(eu.dnetlib.enabling.tools.blackboard.BlackboardServerHandler, eu.dnetlib.enabling.tools.blackboard.BlackboardJob) |
|
19 |
*/ |
|
20 | 17 |
@Override |
21 |
public void execute(final BlackboardServerHandler handler, final BlackboardJob job) throws Exception { |
|
22 |
final String objStoreID = job.getParameters().get("obsID"); |
|
23 |
final String eprRs = job.getParameters().get("epr"); |
|
24 |
final String mime = job.getParameters().get("mime"); |
|
25 |
int count = storeFeeder.feedMetadataObjectRecord(objStoreID, eprRs, mime); |
|
26 |
job.getParameters().put("total", "" + count); |
|
27 |
handler.done(job); |
|
18 |
protected void executeAsync(final BlackboardServerHandler handler, final BlackboardJob job) throws ObjectStoreServiceException { |
|
19 |
try { |
|
20 |
final String objStoreID = job.getParameters().get("obsID"); |
|
21 |
final String eprRs = job.getParameters().get("epr"); |
|
22 |
final String mime = job.getParameters().get("mime"); |
|
23 |
int count = storeFeeder.feedMetadataObjectRecord(objStoreID, eprRs, mime); |
|
24 |
job.getParameters().put("total", "" + count); |
|
25 |
completeWithSuccess(handler, job); |
|
26 |
} catch (Exception e) { |
|
27 |
completeWithFail(handler, job, e); |
|
28 |
} |
|
28 | 29 |
} |
29 | 30 |
|
30 | 31 |
/** |
Also available in: Unified diff
implemented Drop content action