Class DOIOrganiser

java.lang.Object
org.dspace.identifier.doi.DOIOrganiser

public class DOIOrganiser extends Object
Author:
Marsa Haoua, Pascal-Nicolas Becker
  • Field Details

  • Constructor Details

    • DOIOrganiser

      public DOIOrganiser(Context context, DOIIdentifierProvider provider)
      Constructor to be called within the main() method
      Parameters:
      context - - DSpace context
      provider - - DOI identifier provider to use
  • Method Details

    • main

      public static void main(String[] args)
      Main command-line runner method as with other DSpace launcher commands
      Parameters:
      args - - the command line arguments to parse as parameters
    • runCLI

      public static void runCLI(Context context, DOIOrganiser organiser, String[] args)
    • list

      public void list(String processName, PrintStream out, PrintStream err, Integer... status)
      list DOIs queued for reservation or registration
      Parameters:
      processName - - process name for display
      out - - output stream (eg. STDOUT)
      err - - error output stream (eg. STDERR)
      status - - status codes
    • register

      public void register(DOI doiRow, Filter filter) throws IllegalArgumentException, IllegalStateException, RuntimeException
      Register DOI with the provider
      Parameters:
      doiRow - DOI to register
      filter - logical item filter to override
      Throws:
      IllegalArgumentException - if doiRow does not name an Item.
      IllegalStateException - on invalid DOI.
      RuntimeException - on database error.
    • register

      public void register(DOI doiRow) throws IllegalStateException, IllegalArgumentException, RuntimeException
      Register DOI with the provider.
      Parameters:
      doiRow - DOI to register
      Throws:
      IllegalArgumentException - passed through.
      IllegalStateException - passed through.
      RuntimeException - passed through.
    • reserve

      public void reserve(DOI doiRow)
      Reserve DOI with the provider,
      Parameters:
      doiRow - - doi to reserve
    • reserve

      public void reserve(DOI doiRow, Filter filter)
      Reserve DOI with the provider.
      Parameters:
      doiRow - - doi to reserve
      filter - - Logical item filter to determine whether this identifier should be reserved online.
      Throws:
      IllegalStateException - on invalid DOI.
      RuntimeException - on database error.
    • update

      public void update(DOI doiRow)
      Update metadata for a DOI
      Parameters:
      doiRow - - DOI to update
    • delete

      public void delete(String identifier) throws SQLException
      Delete a DOI
      Parameters:
      identifier - - DOI to delete
      Throws:
      SQLException
    • resolveToDOI

      Finds the TableRow in the Doi table that belongs to the specified DspaceObject.
      Parameters:
      identifier - Either an ItemID, a DOI or a handle. If the identifier contains digits only we treat it as ItemID, if not we try to find a matching doi or a handle (in this order).
      Returns:
      The TableRow or null if the Object does not have a DOI.
      Throws:
      SQLException - if database error
      IllegalArgumentException - If the identifier is null, an empty String or specifies an DSpaceObject that is not an item. We currently support DOIs for items only, but this may change once...
      IllegalStateException - If the identifier was a valid DOI that is not stored in our database or if it is a handle that is not bound to an DSpaceObject.
      IdentifierException - if identifier error