public void registerDOI(Context context, DSpaceObject dso, String doi)
throws DOIIdentifierException
{
if (!reserved.containsKey(doi))
{
throw new DOIIdentifierException("Trying to register an unreserverd "
+ "DOI.", DOIIdentifierException.RESERVE_FIRST);
}
if (reserved.get(doi).intValue() != dso.getID())
{
throw new DOIIdentifierException("Trying to register a DOI that is"
+ " reserved for another item.", DOIIdentifierException.MISMATCH);
}
if (registered.containsKey(doi))
{
if (registered.get(doi).intValue() == dso.getID())
{
return;
}
else
{
throw new DOIIdentifierException("Trying to register a DOI that "
+ "is registered for another item.",
DOIIdentifierException.MISMATCH);
}
}