Package org.dspace.harvest
Class HarvestedCollectionServiceImpl
- java.lang.Object
-
- org.dspace.harvest.HarvestedCollectionServiceImpl
-
- All Implemented Interfaces:
HarvestedCollectionService
public class HarvestedCollectionServiceImpl extends Object implements 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 Modifier and Type Field Description protected HarvestedCollectionDAOharvestedCollectionDAO
-
Constructor Summary
Constructors Modifier Constructor Description protectedHarvestedCollectionServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description HarvestedCollectioncreate(Context context, Collection collection)Create a new harvest instance row for a specified collection.voiddelete(Context context, HarvestedCollection harvestedCollection)booleanexists(Context context)HarvestedCollectionfind(Context context, Collection collection)Find the harvest settings corresponding to this collectionList<HarvestedCollection>findAll(Context context)Find all collections that are set up for harvestingList<HarvestedCollection>findByStatus(Context context, int status)Find all collections with the specified status flag.HarvestedCollectionfindNewestHarvest(Context context)Find the collection that was harvested most recently.HarvestedCollectionfindOldestHarvest(Context context)Find the collection that was harvested the longest time ago.List<HarvestedCollection>findReady(Context context)Find all collections that are ready for harvestingbooleanisHarvestable(Context context, Collection collection)Returns whether the specified collection is harvestable, i.e.booleanisHarvestable(HarvestedCollection harvestedCollection)Returns whether this harvest instance is actually harvestable, i.e.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)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.
-
-
-
Field Detail
-
harvestedCollectionDAO
@Autowired(required=true) protected HarvestedCollectionDAO harvestedCollectionDAO
-
-
Method Detail
-
find
public HarvestedCollection find(Context context, Collection collection) throws SQLException
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
public HarvestedCollection create(Context context, Collection collection) throws SQLException
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
public boolean isHarvestable(Context context, Collection collection) throws SQLException
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
public boolean isHarvestable(HarvestedCollection harvestedCollection) throws SQLException
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
public boolean isReady(Context context, Collection collection) throws SQLException
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
public boolean isReady(HarvestedCollection harvestedCollection) throws SQLException
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
public List<HarvestedCollection> findAll(Context context) throws SQLException
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
public List<HarvestedCollection> findReady(Context context) throws SQLException
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
public List<HarvestedCollection> findByStatus(Context context, int status) throws SQLException
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
public HarvestedCollection findOldestHarvest(Context context) throws SQLException
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
public HarvestedCollection findNewestHarvest(Context context) throws SQLException
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
public void delete(Context context, HarvestedCollection harvestedCollection) throws SQLException
- Specified by:
deletein interfaceHarvestedCollectionService- Throws:
SQLException
-
update
public void update(Context context, HarvestedCollection harvestedCollection) throws SQLException
- Specified by:
updatein interfaceHarvestedCollectionService- Throws:
SQLException
-
exists
public boolean exists(Context context) throws SQLException
- 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.
-
-