Package org.dspace.identifier
Class IdentifierServiceImpl
java.lang.Object
org.dspace.identifier.IdentifierServiceImpl
- All Implemented Interfaces:
IdentifierService
The main service class used to reserve, register and resolve identifiers
- Author:
- Fabio Bolognesi (fabio at atmire dot com), Mark Diggory (markd at atmire dot com), Ben Bosman (ben at atmire dot com)
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddelete(Context context, DSpaceObject dso) Delete (Unbind) all identifiers registered for a specific DSpace item.voiddelete(Context context, DSpaceObject dso, String identifier) Used to Delete a Specific Identifier (for example a Handle, hdl:1234.5/6) The provider is responsible for Detecting and Processing the appropriate identifier, all Providers are interrogated, multiple providers can process the same identifier.Get List of currently enabled IdentifierProviderslookup(Context context, DSpaceObject dso) Gets the identifiers all registered IdentifierProvider returns if asked to lookup the provided DSpaceObject.lookup(Context context, DSpaceObject dso, Class<? extends Identifier> identifier) Get an identifier for a given object which is assignment-compatible with a given Identifier type.voidregister(Context context, DSpaceObject dso) Used to register newly-minted identifiers.voidregister(Context context, DSpaceObject dso, Class<? extends Identifier> type) Register identifier(s) for the given DSO just with providers that support that Identifier class, and apply the given filter if that provider extends FilteredIdentifierProvidervoidregister(Context context, DSpaceObject dso, Class<? extends Identifier> type, Filter filter) Register identifier(s) for the given DSO just with providers that support that Identifier class, and apply the given filter if that provider extends FilteredIdentifierProvidervoidregister(Context context, DSpaceObject object, String identifier) Used to Register a specific Identifier (for example a Handle, hdl:1234.5/6).voidregister(Context context, DSpaceObject dso, Map<Class<? extends Identifier>, Filter> typeFilters) Register identifiers for a DSO, with a map of logical filters for each Identifier class to apply at the time of local registration.voidreserve(Context context, DSpaceObject dso) Reserves identifiers for the itemvoidreserve(Context context, DSpaceObject dso, String identifier) Used to Reserve a Specific Identifier (for example a Handle, hdl:1234.5/6) The provider is responsible for Detecting and Processing the appropriate identifier, all Providers are interrogated, multiple providers can process the same identifier.This will resolve a DSpaceObject based on a provided Identifier.voidsetProviders(List<IdentifierProvider> providers)
-
Field Details
-
contentServiceFactory
-
handleService
-
-
Constructor Details
-
IdentifierServiceImpl
protected IdentifierServiceImpl()
-
-
Method Details
-
setProviders
-
getProviders
Description copied from interface:IdentifierServiceGet List of currently enabled IdentifierProviders- Specified by:
getProvidersin interfaceIdentifierService- Returns:
- List of enabled IdentifierProvider objects.
-
reserve
public void reserve(Context context, DSpaceObject dso) throws AuthorizeException, SQLException, IdentifierException Reserves identifiers for the item- Specified by:
reservein interfaceIdentifierService- Parameters:
context- dspace contextdso- dspace object- Throws:
AuthorizeException- if authorization errorSQLException- if database errorIdentifierException- if identifier error
-
reserve
public void reserve(Context context, DSpaceObject dso, String identifier) throws AuthorizeException, SQLException, IdentifierException Description copied from interface:IdentifierServiceUsed to Reserve a Specific Identifier (for example a Handle, hdl:1234.5/6) The provider is responsible for Detecting and Processing the appropriate identifier, all Providers are interrogated, multiple providers can process the same identifier.- Specified by:
reservein interfaceIdentifierService- Parameters:
context- The relevant DSpace Context.dso- DSpace object to be reservedidentifier- instance of an Identifier of the required type.- Throws:
AuthorizeException- if authorization errorSQLException- if database errorIdentifierException- if identifier error
-
register
public void register(Context context, DSpaceObject dso) throws AuthorizeException, SQLException, IdentifierException Description copied from interface:IdentifierServiceUsed to register newly-minted identifiers. Each provider is responsible for creating the appropriate identifier. All providers are interrogated.- Specified by:
registerin interfaceIdentifierService- Parameters:
context- The relevant DSpace Context.dso- DSpace object to be registered- Throws:
AuthorizeException- if authorization errorSQLException- if database errorIdentifierException- if identifier error
-
register
public void register(Context context, DSpaceObject dso, Class<? extends Identifier> type, Filter filter) throws AuthorizeException, SQLException, IdentifierException Description copied from interface:IdentifierServiceRegister identifier(s) for the given DSO just with providers that support that Identifier class, and apply the given filter if that provider extends FilteredIdentifierProvider- Specified by:
registerin interfaceIdentifierService- Parameters:
context- The relevant DSpace Context.dso- DSpace object to be registeredtype- Type of identifier to registerfilter- If a service supports a given Identifier implementation, apply this specific filter- Throws:
AuthorizeException- if authorization errorSQLException- if database errorIdentifierException- if identifier error
-
register
public void register(Context context, DSpaceObject dso, Class<? extends Identifier> type) throws AuthorizeException, SQLException, IdentifierException Description copied from interface:IdentifierServiceRegister identifier(s) for the given DSO just with providers that support that Identifier class, and apply the given filter if that provider extends FilteredIdentifierProvider- Specified by:
registerin interfaceIdentifierService- Parameters:
context- The relevant DSpace Context.dso- DSpace object to be registeredtype- Type of identifier to register- Throws:
AuthorizeException- if authorization errorSQLException- if database errorIdentifierException- if identifier error
-
register
public void register(Context context, DSpaceObject dso, Map<Class<? extends Identifier>, Filter> typeFilters) throws AuthorizeException, SQLException, IdentifierExceptionDescription copied from interface:IdentifierServiceRegister identifiers for a DSO, with a map of logical filters for each Identifier class to apply at the time of local registration.- Specified by:
registerin interfaceIdentifierService- Parameters:
context- The relevant DSpace Context.dso- DSpace object to be registeredtypeFilters- If a service supports a given Identifier implementation, apply the associated filter- Throws:
AuthorizeException- if authorization errorSQLException- if database errorIdentifierException- if identifier error
-
register
public void register(Context context, DSpaceObject object, String identifier) throws AuthorizeException, SQLException, IdentifierException Description copied from interface:IdentifierServiceUsed to Register a specific Identifier (for example a Handle, hdl:1234.5/6). The provider is responsible for detecting and processing the appropriate identifier. All Providers are interrogated. Multiple providers can process the same identifier.- Specified by:
registerin interfaceIdentifierService- Parameters:
context- The relevant DSpace Context.object- DSpace object to be registeredidentifier- instance of an Identifier of the required type.- Throws:
AuthorizeException- if authorization errorSQLException- if database errorIdentifierException- if identifier error
-
lookup
Description copied from interface:IdentifierServiceGet an identifier for a given object which is assignment-compatible with a given Identifier type.- Specified by:
lookupin interfaceIdentifierService- Parameters:
context- The relevant DSpace Context.dso- the object to be identified.identifier- instance of an Identifier of the required type.- Returns:
- the matching identifier, or the site identifier if the object is a Site, or null if no matching identifier is found.
-
lookup
Description copied from interface:IdentifierServiceGets the identifiers all registered IdentifierProvider returns if asked to lookup the provided DSpaceObject.- Specified by:
lookupin interfaceIdentifierService- Parameters:
context- The relevant DSpace Context.dso- the object to be identified.- Returns:
- the matching identifiers, or the site identifier if the object is a Site, or an empty array if no matching identifier is found.
-
resolve
public DSpaceObject resolve(Context context, String identifier) throws IdentifierNotFoundException, IdentifierNotResolvableException Description copied from interface:IdentifierServiceThis will resolve a DSpaceObject based on a provided Identifier. The Service will interrogate the providers in no particular order and return the first successful result discovered. If no resolution is successful, the method will return null if no object is found. TODO: Verify null is returned.- Specified by:
resolvein interfaceIdentifierService- Parameters:
context- The relevant DSpace Context.identifier- instance of an Identifier of the required type.- Returns:
- the DSpace object associated with the identifier
- Throws:
IdentifierNotFoundException- if identifier not foundIdentifierNotResolvableException- if identifier not resolvable
-
delete
public void delete(Context context, DSpaceObject dso) throws AuthorizeException, SQLException, IdentifierException Description copied from interface:IdentifierServiceDelete (Unbind) all identifiers registered for a specific DSpace item. Identifiers are "unbound" across all providers in no particular order.- Specified by:
deletein interfaceIdentifierService- Parameters:
context- The relevant DSpace Context.dso- DSpace object to be deleted- Throws:
AuthorizeException- if authorization errorSQLException- if database errorIdentifierException- if identifier error
-
delete
public void delete(Context context, DSpaceObject dso, String identifier) throws AuthorizeException, SQLException, IdentifierException Description copied from interface:IdentifierServiceUsed to Delete a Specific Identifier (for example a Handle, hdl:1234.5/6) The provider is responsible for Detecting and Processing the appropriate identifier, all Providers are interrogated, multiple providers can process the same identifier.- Specified by:
deletein interfaceIdentifierService- Parameters:
context- The relevant DSpace Context.dso- DSpace object to be deletedidentifier- instance of an Identifier of the required type.- Throws:
AuthorizeException- if authorization errorSQLException- if database errorIdentifierException- if identifier error
-