Revision 6234
Added by Chris Jones over 13 years ago
src/edu/ucsb/nceas/metacat/dataone/MNodeService.java | ||
---|---|---|
63 | 63 |
import org.dataone.service.types.SystemMetadata; |
64 | 64 |
import org.dataone.service.types.util.ServiceTypeUtil; |
65 | 65 |
|
66 |
import edu.ucsb.nceas.metacat.EventLog; |
|
66 | 67 |
import edu.ucsb.nceas.metacat.IdentifierManager; |
68 |
import edu.ucsb.nceas.metacat.McdbDocNotFoundException; |
|
67 | 69 |
|
68 | 70 |
/** |
69 | 71 |
* Represents Metacat's implementation of the DataONE Member Node |
... | ... | |
469 | 471 |
throws NotImplemented, ServiceFailure, NotAuthorized, InvalidRequest, |
470 | 472 |
InsufficientResources, UnsupportedType { |
471 | 473 |
|
472 |
return false;
|
|
474 |
return true;
|
|
473 | 475 |
} |
474 | 476 |
|
475 | 477 |
/** |
476 | 478 |
* A callback method used by a CN to indicate to a MN that it cannot |
477 |
* complete synchronization of the science metadata identified by pid |
|
479 |
* complete synchronization of the science metadata identified by pid. Log |
|
480 |
* the event in the metacat event log. |
|
478 | 481 |
* |
479 | 482 |
* @param session |
480 | 483 |
* @param syncFailed |
... | ... | |
488 | 491 |
public void synchronizationFailed(Session session, SynchronizationFailed syncFailed) |
489 | 492 |
throws NotImplemented, ServiceFailure, NotAuthorized, InvalidRequest { |
490 | 493 |
|
494 |
String localId; |
|
491 | 495 |
|
496 |
try { |
|
497 |
localId = IdentifierManager.getInstance().getLocalId(syncFailed.getPid().getValue()); |
|
498 |
} catch (McdbDocNotFoundException e) { |
|
499 |
throw new ServiceFailure("2161", "The identifier specified by " + |
|
500 |
syncFailed.getPid().getValue() + |
|
501 |
" was not found on this node."); |
|
502 |
|
|
503 |
} |
|
504 |
// TODO: update the CN URL below when the CNRead.SynchronizationFailed |
|
505 |
// method is changed to include the URL as a parameter |
|
506 |
logMetacat.debug("Synchronization for the object identified by " + |
|
507 |
syncFailed.getPid().getValue() + |
|
508 |
" failed from " + |
|
509 |
"CN URL WILL GO HERE." + |
|
510 |
" Logging the event to the Metacat EventLog as a 'syncFailed' event."); |
|
511 |
EventLog.getInstance().log("CN URL WILL GO HERE", |
|
512 |
session.getSubject().getValue(), localId, "syncFailed"); |
|
513 |
|
|
492 | 514 |
} |
493 | 515 |
|
494 | 516 |
} |
Also available in: Unified diff
Implement CNRead.synchronizationFailed() in MNodeService. Note: The CN URL is not yet available in the SynchronizationFailed exception, but will be once the d1_common_java exception is updated. See https://redmine.dataone.org/issues/1656. Once updated, change this method to explicitly state the CN URL making the call.