Interface IdentifierService

All Known Implementing Classes:
IdentifierServiceImpl

public interface IdentifierService
Author:
Fabio Bolognesi (fabio at atmire dot com), Mark Diggory (markd at atmire dot com), Ben Bosman (ben at atmire dot com)
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    delete(Context context, DSpaceObject dso)
    Delete (Unbind) all identifiers registered for a specific DSpace item.
    void
    delete(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 IdentifierProviders
    lookup(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.
    void
    register(Context context, DSpaceObject dso)
    Used to register newly-minted identifiers.
    void
    register(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 FilteredIdentifierProvider
    void
    register(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 FilteredIdentifierProvider
    void
    register(Context context, DSpaceObject dso, String identifier)
    Used to Register a specific Identifier (for example a Handle, hdl:1234.5/6).
    void
    register(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.
    void
    reserve(Context context, DSpaceObject dso)
    Reserves any identifiers necessary based on the capabilities of all providers in the service.
    void
    reserve(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.
    resolve(Context context, String identifier)
    This will resolve a DSpaceObject based on a provided Identifier.
  • Method Details

    • lookup

      String 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.
      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

      List<String> lookup(Context context, DSpaceObject dso)
      Gets the identifiers all registered IdentifierProvider returns if asked to lookup the provided DSpaceObject.
      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

      This 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.
      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 found
      IdentifierNotResolvableException - if identifier not resolvable
    • reserve

      Reserves any identifiers necessary based on the capabilities of all providers in the service.
      Parameters:
      context - The relevant DSpace Context.
      dso - DSpace object to be reserved
      Throws:
      AuthorizeException - if authorization error
      SQLException - if database error
      IdentifierException - if identifier error
    • reserve

      void reserve(Context context, DSpaceObject dso, String identifier) throws AuthorizeException, SQLException, IdentifierException
      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.
      Parameters:
      context - The relevant DSpace Context.
      dso - DSpace object to be reserved
      identifier - instance of an Identifier of the required type.
      Throws:
      AuthorizeException - if authorization error
      SQLException - if database error
      IdentifierException - if identifier error
    • register

      Used to register newly-minted identifiers. Each provider is responsible for creating the appropriate identifier. All providers are interrogated.
      Parameters:
      context - The relevant DSpace Context.
      dso - DSpace object to be registered
      Throws:
      AuthorizeException - if authorization error
      SQLException - if database error
      IdentifierException - if identifier error
    • register

      void register(Context context, DSpaceObject dso, Map<Class<? extends Identifier>,Filter> typeFilters) throws AuthorizeException, SQLException, IdentifierException
      Register identifiers for a DSO, with a map of logical filters for each Identifier class to apply at the time of local registration.
      Parameters:
      context - The relevant DSpace Context.
      dso - DSpace object to be registered
      typeFilters - If a service supports a given Identifier implementation, apply the associated filter
      Throws:
      AuthorizeException - if authorization error
      SQLException - if database error
      IdentifierException - if identifier error
    • register

      void register(Context context, DSpaceObject dso, Class<? extends Identifier> type, Filter filter) throws AuthorizeException, SQLException, IdentifierException
      Register identifier(s) for the given DSO just with providers that support that Identifier class, and apply the given filter if that provider extends FilteredIdentifierProvider
      Parameters:
      context - The relevant DSpace Context.
      dso - DSpace object to be registered
      type - Type of identifier to register
      filter - If a service supports a given Identifier implementation, apply this specific filter
      Throws:
      AuthorizeException - if authorization error
      SQLException - if database error
      IdentifierException - if identifier error
    • register

      void register(Context context, DSpaceObject dso, Class<? extends Identifier> type) throws AuthorizeException, SQLException, IdentifierException
      Register identifier(s) for the given DSO just with providers that support that Identifier class, and apply the given filter if that provider extends FilteredIdentifierProvider
      Parameters:
      context - The relevant DSpace Context.
      dso - DSpace object to be registered
      type - Type of identifier to register
      Throws:
      AuthorizeException - if authorization error
      SQLException - if database error
      IdentifierException - if identifier error
    • register

      void register(Context context, DSpaceObject dso, String identifier) throws AuthorizeException, SQLException, IdentifierException
      Used 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.
      Parameters:
      context - The relevant DSpace Context.
      dso - DSpace object to be registered
      identifier - instance of an Identifier of the required type.
      Throws:
      AuthorizeException - if authorization error
      SQLException - if database error
      IdentifierException - if identifier error
    • delete

      Delete (Unbind) all identifiers registered for a specific DSpace item. Identifiers are "unbound" across all providers in no particular order.
      Parameters:
      context - The relevant DSpace Context.
      dso - DSpace object to be deleted
      Throws:
      AuthorizeException - if authorization error
      SQLException - if database error
      IdentifierException - if identifier error
    • delete

      void delete(Context context, DSpaceObject dso, String identifier) throws AuthorizeException, SQLException, IdentifierException
      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.
      Parameters:
      context - The relevant DSpace Context.
      dso - DSpace object to be deleted
      identifier - instance of an Identifier of the required type.
      Throws:
      AuthorizeException - if authorization error
      SQLException - if database error
      IdentifierException - if identifier error
    • getProviders

      List<IdentifierProvider> getProviders()
      Get List of currently enabled IdentifierProviders
      Returns:
      List of enabled IdentifierProvider objects.