mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-07 01:54:22 +00:00
Check if an IdentifierProvider supports a specified identifier.
This commit is contained in:
@@ -88,9 +88,19 @@ public class IdentifierServiceImpl implements IdentifierService {
|
||||
|
||||
//We need to commit our context because one of the providers might require the handle created above
|
||||
// Next resolve all other services
|
||||
boolean registered = false;
|
||||
for (IdentifierProvider service : providers)
|
||||
{
|
||||
service.register(context, object, identifier);
|
||||
if (service.supports(identifier))
|
||||
{
|
||||
service.register(context, object, identifier);
|
||||
registered = true;
|
||||
}
|
||||
}
|
||||
if (!registered)
|
||||
{
|
||||
throw new IdentifierException("Cannot register identifier: Didn't "
|
||||
+ "find a provider that supports this identifier.");
|
||||
}
|
||||
//Update our item
|
||||
object.update();
|
||||
|
Reference in New Issue
Block a user