Interface HarvestedCollectionService

All Known Implementing Classes:
HarvestedCollectionServiceImpl

public interface HarvestedCollectionService
Service interface class for the HarvestedCollection object. The implementation of this class is responsible for all business logic calls for the HarvestedCollection object and is autowired by spring
Author:
kevinvandevelde at atmire.com
  • Method Details

    • find

      HarvestedCollection find(Context context, Collection collection) throws SQLException
      Find the harvest settings corresponding to this collection
      Parameters:
      context - The relevant DSpace Context.
      collection - target collection
      Returns:
      a HarvestInstance object corresponding to this collection's settings, null if not found.
      Throws:
      SQLException - if database error
    • create

      HarvestedCollection create(Context context, Collection collection) throws SQLException
      Create a new harvest instance row for a specified collection.
      Parameters:
      context - The relevant DSpace Context.
      collection - target collection
      Returns:
      a new HarvestInstance object
      Throws:
      SQLException - if database error
    • isHarvestable

      boolean isHarvestable(Context context, Collection collection) throws SQLException
      Returns whether the specified collection is harvestable, i.e. whether its harvesting options are set up correctly. This is distinct from "ready", since this collection may be in process of being harvested.
      Parameters:
      context - The relevant DSpace Context.
      collection - target collection
      Returns:
      is collection harvestable?
      Throws:
      SQLException - if database error
    • isHarvestable

      boolean isHarvestable(HarvestedCollection harvestedCollection) throws SQLException
      Returns whether this harvest instance is actually harvestable, i.e. whether its settings options are set up correctly. This is distinct from "ready", since this collection may be in process of being harvested.
      Parameters:
      harvestedCollection - collection to be harvested
      Returns:
      is collection harvestable?
      Throws:
      SQLException - if database error
    • isReady

      boolean isReady(Context context, Collection collection) throws SQLException
      Returns whether the specified collection is ready for immediate harvest.
      Parameters:
      context - The relevant DSpace Context.
      collection - collection to be harvested
      Returns:
      is collection ready for immediate harvest?
      Throws:
      SQLException - if database error
    • isReady

      boolean isReady(HarvestedCollection harvestedCollection) throws SQLException
      Returns whether the specified collection is ready for immediate harvest.
      Parameters:
      harvestedCollection - collection to be harvested
      Returns:
      is collection ready for immediate harvest?
      Throws:
      SQLException - if database error
    • findAll

      List<HarvestedCollection> findAll(Context context) throws SQLException
      Find all collections that are set up for harvesting
      Parameters:
      context - The relevant DSpace Context.
      Returns:
      list of collection id's
      Throws:
      SQLException - if database error
    • findReady

      List<HarvestedCollection> findReady(Context context) throws SQLException
      Find all collections that are ready for harvesting
      Parameters:
      context - The relevant DSpace Context.
      Returns:
      list of collection id's
      Throws:
      SQLException - if database error
    • findByStatus

      List<HarvestedCollection> findByStatus(Context context, int status) throws SQLException
      Find all collections with the specified status flag.
      Parameters:
      context - The relevant DSpace Context.
      status - see HarvestInstance.STATUS_...
      Returns:
      all collections with the specified status flag
      Throws:
      SQLException - if database error
    • findOldestHarvest

      HarvestedCollection findOldestHarvest(Context context) throws SQLException
      Find the collection that was harvested the longest time ago.
      Parameters:
      context - The relevant DSpace Context.
      Returns:
      collection that was harvested the longest time ago
      Throws:
      SQLException - if database error
    • findNewestHarvest

      HarvestedCollection findNewestHarvest(Context context) throws SQLException
      Find the collection that was harvested most recently.
      Parameters:
      context - The relevant DSpace Context.
      Returns:
      collection that was harvested most recently
      Throws:
      SQLException - if database error
    • delete

      void delete(Context context, HarvestedCollection harvestedCollection) throws SQLException
      Throws:
      SQLException
    • update

      void update(Context context, HarvestedCollection harvestedCollection) throws SQLException
      Throws:
      SQLException
    • exists

      boolean exists(Context context) throws SQLException
      Throws:
      SQLException
    • verifyOAIharvester

      List<String> verifyOAIharvester(String oaiSource, String oaiSetId, String metaPrefix, boolean testORE)
      Test the given harvest settings
      Parameters:
      oaiSource - the address of the OAI-PMH provider
      oaiSetId - OAI set identifier
      metaPrefix - OAI metadataPrefix
      testORE - whether the method should also check the PMH provider for ORE support
      Returns:
      list of errors encountered during verification. An empty list indicates a "success" condition.