Check if an IdentifierProvider supports a specified identifier.

This commit is contained in:
Pascal-Nicolas Becker
2013-09-27 17:48:11 +02:00
parent 159590c570
commit 7d831f9190

View File

@@ -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)
{
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();