}
if (null == doiRow)
{
log.error("Cannot update metadata for DOI {}: unable to find it in "
+ "our db.", doi);
throw new DOIIdentifierException("Unable to find DOI.",
DOIIdentifierException.DOI_DOES_NOT_EXIST);
}
if (doiRow.getIntColumn("resource_id") != dso.getID() ||
doiRow.getIntColumn("resource_type_id") != dso.getType())
{
log.error("Refuse to update metadata of DOI {} with the metadata of "
+ " an object ({}/{}) the DOI is not dedicated to.",
new String[] {doi, dso.getTypeText(), Integer.toString(dso.getID())});
throw new DOIIdentifierException("Cannot update DOI metadata: "
+ "DOI and DSpaceObject does not match!",
DOIIdentifierException.MISMATCH);
}
if (DELETED == doiRow.getIntColumn("status") ||
TO_BE_DELETED == doiRow.getIntColumn("status"))
{
throw new DOIIdentifierException("You tried to update the metadata"
+ "of a DOI that is marked as DELETED.",
DOIIdentifierException.DOI_IS_DELETED);
}
connector.updateMetadata(context, dso, doi);