// notify listeners
metadata = record.getContent();
listener.onHarvestMetadata(unit.getRepository(), sourceUri, metadata);
// publication request
HarvesterRequest publicationRequest =
new HarvesterRequest(context, unit.getPublisher(), unit.getRepository().getUuid(), sourceUri.asString(), metadata);
publicationRequest.getPublicationRecord().setAutoApprove(ProtocolInvoker.getAutoApprove(unit.getRepository().getProtocol()));
// if this is a repository descriptor, update repository record
if (record instanceof Native && isRepositorySourceUri(sourceUri, unit.getRepository())) {
String sMethod = MmdEnums.PublicationMethod.registration.toString();
publicationRequest.getPublicationRecord().setUuid(unit.getRepository().getUuid());
publicationRequest.getPublicationRecord().setPublicationMethod(sMethod);
publicationRequest.getPublicationRecord().setAlternativeTitle(unit.getRepository().getName());
publicationRequest.getPublicationRecord().setLockTitle(ProtocolInvoker.getLockTitle(unit.getRepository().getProtocol()));
}
publicationRequest.publish();
boolean bReplaced =
publicationRequest.getPublicationRecord().getWasDocumentReplaced();
LOGGER.finer("[SYNCHRONIZER] SUCCEEDED processing metadata #" + (rp.getHarvestedCount() + 1) + " through: " + unit + ", source URI: " + sourceUri);
// notify listeners
listener.onPublishMetadata(unit.getRepository(), sourceUri, publicationRequest.getPublicationRecord().getUuid(), metadata);
// create harvest report entry for the current record
rp.createEntry(sourceUri.asString(), !bReplaced);
} catch (NullReferenceException ex) {
if (LOGGER.isLoggable(Level.FINEST)) {