Package org.dspace.harvest
Class HarvestedCollectionServiceImpl
java.lang.Object
org.dspace.harvest.HarvestedCollectionServiceImpl
- All Implemented Interfaces:
HarvestedCollectionService
Service implementation for the HarvestedCollection object.
This class is responsible for all business logic calls for the HarvestedCollection object and is autowired by spring.
This class should never be accessed directly.
- Author:
- kevinvandevelde at atmire.com
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreate(Context context, Collection collection) Create a new harvest instance row for a specified collection.voiddelete(Context context, HarvestedCollection harvestedCollection) booleanfind(Context context, Collection collection) Find the harvest settings corresponding to this collectionFind all collections that are set up for harvestingfindByStatus(Context context, int status) Find all collections with the specified status flag.findNewestHarvest(Context context) Find the collection that was harvested most recently.findOldestHarvest(Context context) Find the collection that was harvested the longest time ago.Find all collections that are ready for harvestingbooleanisHarvestable(Context context, Collection collection) Returns whether the specified collection is harvestable, i.e. whether its harvesting options are set up correctly.booleanisHarvestable(HarvestedCollection harvestedCollection) Returns whether this harvest instance is actually harvestable, i.e. whether its settings options are set up correctly.booleanisReady(Context context, Collection collection) Returns whether the specified collection is ready for immediate harvest.booleanisReady(HarvestedCollection harvestedCollection) Returns whether the specified collection is ready for immediate harvest.voidupdate(Context context, HarvestedCollection harvestedCollection) verifyOAIharvester(String oaiSource, String oaiSetId, String metaPrefix, boolean testORE) Verify the existence of an OAI server with the specified set and supporting the provided metadata formats.
-
Field Details
-
harvestedCollectionDAO
-
-
Constructor Details
-
HarvestedCollectionServiceImpl
protected HarvestedCollectionServiceImpl()
-
-
Method Details
-
find
Description copied from interface:HarvestedCollectionServiceFind the harvest settings corresponding to this collection- Specified by:
findin interfaceHarvestedCollectionService- 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
Description copied from interface:HarvestedCollectionServiceCreate a new harvest instance row for a specified collection.- Specified by:
createin interfaceHarvestedCollectionService- Parameters:
context- The relevant DSpace Context.collection- target collection- Returns:
- a new HarvestInstance object
- Throws:
SQLException- if database error
-
isHarvestable
Description copied from interface:HarvestedCollectionServiceReturns 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.- Specified by:
isHarvestablein interfaceHarvestedCollectionService- Parameters:
context- The relevant DSpace Context.collection- target collection- Returns:
- is collection harvestable?
- Throws:
SQLException- if database error
-
isHarvestable
Description copied from interface:HarvestedCollectionServiceReturns 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.- Specified by:
isHarvestablein interfaceHarvestedCollectionService- Parameters:
harvestedCollection- collection to be harvested- Returns:
- is collection harvestable?
- Throws:
SQLException- if database error
-
isReady
Description copied from interface:HarvestedCollectionServiceReturns whether the specified collection is ready for immediate harvest.- Specified by:
isReadyin interfaceHarvestedCollectionService- Parameters:
context- The relevant DSpace Context.collection- collection to be harvested- Returns:
- is collection ready for immediate harvest?
- Throws:
SQLException- if database error
-
isReady
Description copied from interface:HarvestedCollectionServiceReturns whether the specified collection is ready for immediate harvest.- Specified by:
isReadyin interfaceHarvestedCollectionService- Parameters:
harvestedCollection- collection to be harvested- Returns:
- is collection ready for immediate harvest?
- Throws:
SQLException- if database error
-
findAll
Description copied from interface:HarvestedCollectionServiceFind all collections that are set up for harvesting- Specified by:
findAllin interfaceHarvestedCollectionService- Parameters:
context- The relevant DSpace Context.- Returns:
- list of collection id's
- Throws:
SQLException- if database error
-
findReady
Description copied from interface:HarvestedCollectionServiceFind all collections that are ready for harvesting- Specified by:
findReadyin interfaceHarvestedCollectionService- Parameters:
context- The relevant DSpace Context.- Returns:
- list of collection id's
- Throws:
SQLException- if database error
-
findByStatus
Description copied from interface:HarvestedCollectionServiceFind all collections with the specified status flag.- Specified by:
findByStatusin interfaceHarvestedCollectionService- Parameters:
context- The relevant DSpace Context.status- see HarvestInstance.STATUS_...- Returns:
- all collections with the specified status flag
- Throws:
SQLException- if database error
-
findOldestHarvest
Description copied from interface:HarvestedCollectionServiceFind the collection that was harvested the longest time ago.- Specified by:
findOldestHarvestin interfaceHarvestedCollectionService- Parameters:
context- The relevant DSpace Context.- Returns:
- collection that was harvested the longest time ago
- Throws:
SQLException- if database error
-
findNewestHarvest
Description copied from interface:HarvestedCollectionServiceFind the collection that was harvested most recently.- Specified by:
findNewestHarvestin interfaceHarvestedCollectionService- Parameters:
context- The relevant DSpace Context.- Returns:
- collection that was harvested most recently
- Throws:
SQLException- if database error
-
delete
- Specified by:
deletein interfaceHarvestedCollectionService- Throws:
SQLException
-
update
- Specified by:
updatein interfaceHarvestedCollectionService- Throws:
SQLException
-
exists
- Specified by:
existsin interfaceHarvestedCollectionService- Throws:
SQLException
-
verifyOAIharvester
public List<String> verifyOAIharvester(String oaiSource, String oaiSetId, String metaPrefix, boolean testORE) Verify the existence of an OAI server with the specified set and supporting the provided metadata formats.- Specified by:
verifyOAIharvesterin interfaceHarvestedCollectionService- Parameters:
oaiSource- the address of the OAI-PMH provideroaiSetId- OAI set identifiermetaPrefix- OAI metadataPrefixtestORE- whether the method should also check the PMH provider for ORE support- Returns:
- list of errors encountered during verification. Empty list indicates a "success" condition.
-