Package org.dspace.identifier
Class IdentifierProvider
- java.lang.Object
-
- org.dspace.identifier.IdentifierProvider
-
- Direct Known Subclasses:
EZIDIdentifierProvider,FilteredIdentifierProvider,HandleIdentifierProvider,VersionedHandleIdentifierProvider,VersionedHandleIdentifierProviderWithCanonicalHandles
public abstract class IdentifierProvider extends Object
- 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 Modifier and Type Field Description protected ConfigurationServiceconfigurationServiceprotected IdentifierServiceparentService
-
Constructor Summary
Constructors Constructor Description IdentifierProvider()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract voiddelete(Context context, DSpaceObject dso)Unbind this type of identifier(s) from an object.abstract voiddelete(Context context, DSpaceObject dso, String identifier)Unbind the given identifier from an object.abstract Stringlookup(Context context, DSpaceObject object)Return the identifier for a DSpaceObject.abstract Stringmint(Context context, DSpaceObject dso)Create an identifier for a DSpaceObject.abstract Stringregister(Context context, DSpaceObject item)Create and apply an identifier to a DSpaceObject.abstract voidregister(Context context, DSpaceObject object, String identifier)Create a specific identifier and apply it to an object.abstract voidreserve(Context context, DSpaceObject dso, String identifier)Set an object's identifier.abstract DSpaceObjectresolve(Context context, String identifier, String... attributes)Find the object named by a given identifier.voidsetConfigurationService(ConfigurationService configurationService)voidsetParentService(IdentifierService parentService)abstract booleansupports(Class<? extends Identifier> identifier)Can this provider provide identifiers of a given type?abstract booleansupports(String identifier)Can this provider provide identifiers of a given type?
-
-
-
Field Detail
-
parentService
protected IdentifierService parentService
-
configurationService
protected ConfigurationService configurationService
-
-
Method Detail
-
setConfigurationService
@Autowired(required=true) public void setConfigurationService(ConfigurationService configurationService)
-
setParentService
public void setParentService(IdentifierService parentService)
-
supports
public abstract boolean supports(Class<? extends Identifier> identifier)
Can this provider provide identifiers of a given type?- Parameters:
identifier- requested type.- Returns:
- true if the given type is assignable from this provider's type.
-
supports
public abstract boolean supports(String identifier)
Can this provider provide identifiers of a given type?- Parameters:
identifier- requested type.- Returns:
- true if this provider can provide the named type of identifier.
-
register
public abstract String register(Context context, DSpaceObject item) throws IdentifierException
Create and apply an identifier to a DSpaceObject.- Parameters:
context- The relevant DSpace Context.item- object to be named.- Returns:
- existing identifier of
itemif it has one, else a new identifier. - Throws:
IdentifierException- if identifier error
-
mint
public abstract String mint(Context context, DSpaceObject dso) throws IdentifierException
Create an identifier for a DSpaceObject.- Parameters:
context- The relevant DSpace Context.dso- object to be named.- Returns:
- existing identifier of
dsoif it has one, else a new identifier. - Throws:
IdentifierException- if identifier error
-
resolve
public abstract DSpaceObject resolve(Context context, String identifier, String... attributes) throws IdentifierNotFoundException, IdentifierNotResolvableException
Find the object named by a given identifier.- Parameters:
context- The relevant DSpace Context.identifier- to be resolved.attributes- additional information for resolvingidentifier.- Returns:
- the named object.
- Throws:
IdentifierNotFoundException- if identifier not foundIdentifierNotResolvableException- if identifier not resolvable
-
lookup
public abstract String lookup(Context context, DSpaceObject object) throws IdentifierNotFoundException, IdentifierNotResolvableException
Return the identifier for a DSpaceObject.- Parameters:
context- The relevant DSpace Context.object- The object to be looked up.- Returns:
- identifier for
object. - Throws:
IdentifierNotFoundException- if identifier not foundIdentifierNotResolvableException- if identifier not resolvable
-
delete
public abstract void delete(Context context, DSpaceObject dso) throws IdentifierException
Unbind this type of identifier(s) from an object.- Parameters:
context- The relevant DSpace Context.dso- object to lose its identity.- Throws:
IdentifierException- if identifier error
-
delete
public abstract void delete(Context context, DSpaceObject dso, String identifier) throws IdentifierException
Unbind the given identifier from an object.- Parameters:
context- The relevant DSpace Context.dso- object to be de-identified.identifier- to be removed.- Throws:
IdentifierException- if identifier error
-
reserve
public abstract void reserve(Context context, DSpaceObject dso, String identifier) throws IdentifierException
Set an object's identifier.- Parameters:
context- The relevant DSpace Context.dso- object to be identified.identifier- to be set on the object.- Throws:
IdentifierException- if identifier error
-
register
public abstract void register(Context context, DSpaceObject object, String identifier) throws IdentifierException
Create a specific identifier and apply it to an object.- Parameters:
context- The relevant DSpace Context.object- to be identified.identifier- to be created.- Throws:
IdentifierException- if identifier error
-
-