org.dspace.harvest
Class OAIHarvester

java.lang.Object
  extended by org.dspace.harvest.OAIHarvester

public class OAIHarvester
extends Object

This class handles OAI harvesting of externaly located records into this repository.

Author:
Alexey Maslov

Nested Class Summary
 class OAIHarvester.HarvestingException
          Exception class specifically assigned to recoverable errors that occur during harvesting.
static class OAIHarvester.HarvestScheduler
          The class responsible for scheduling harvesting cycles are regular intervals.
 
Field Summary
static String OAI_ADDRESS_ERROR
           
static String OAI_DMD_ERROR
           
static String OAI_ORE_ERROR
           
static String OAI_SET_ERROR
           
 
Constructor Summary
OAIHarvester(Context c, DSpaceObject dso, HarvestedCollection hc)
           
 
Method Summary
static String OAIResolveNamespaceToPrefix(String oaiSource, String MDNamespace)
          Query the OAI-PMH server for its mapping of the supplied namespace and metadata prefix.
static void pauseScheduler()
          Pause an active harvest scheduler.
static void resetScheduler()
           
static void resumeScheduler()
          Resume a paused harvest scheduler.
 void runHarvest()
          Performs a harvest cycle on this collection.
static void startNewScheduler()
          Start harvest scheduler.
static void stopScheduler()
          Stop an active harvest scheduler.
 List<String> verifyOAIharvester()
          Verify OAI settings for the current collection
static List<String> verifyOAIharvester(String oaiSource, String oaiSetId, String metaPrefix, boolean testORE)
          Verify the existance of an OAI server with the specified set and supporting the provided metadata formats.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

OAI_ADDRESS_ERROR

public static final String OAI_ADDRESS_ERROR
See Also:
Constant Field Values

OAI_SET_ERROR

public static final String OAI_SET_ERROR
See Also:
Constant Field Values

OAI_DMD_ERROR

public static final String OAI_DMD_ERROR
See Also:
Constant Field Values

OAI_ORE_ERROR

public static final String OAI_ORE_ERROR
See Also:
Constant Field Values
Constructor Detail

OAIHarvester

public OAIHarvester(Context c,
                    DSpaceObject dso,
                    HarvestedCollection hc)
             throws OAIHarvester.HarvestingException,
                    SQLException
Throws:
OAIHarvester.HarvestingException
SQLException
Method Detail

runHarvest

public void runHarvest()
                throws SQLException,
                       IOException,
                       AuthorizeException
Performs a harvest cycle on this collection. This will query the remote OAI-PMH provider, check for updates since last harvest, and ingest the returned items.

Throws:
SQLException
IOException
AuthorizeException

OAIResolveNamespaceToPrefix

public static String OAIResolveNamespaceToPrefix(String oaiSource,
                                                 String MDNamespace)
                                          throws IOException,
                                                 ParserConfigurationException,
                                                 SAXException,
                                                 TransformerException,
                                                 ConnectException
Query the OAI-PMH server for its mapping of the supplied namespace and metadata prefix. For example for a typical OAI-PMH server a query "http://www.openarchives.org/OAI/2.0/oai_dc/" would return "oai_dc".

Parameters:
oaiSource - the address of the OAI-PMH provider
MDNamespace - the namespace that we are trying to resove to the metadataPrefix
Returns:
metadataPrefix the OAI-PMH provider has assigned to the supplied namespace
Throws:
IOException
ParserConfigurationException
SAXException
TransformerException
ConnectException

verifyOAIharvester

public List<String> verifyOAIharvester()
Verify OAI settings for the current collection

Returns:
list of errors encountered during verification. Empty list indicates a "success" condition.

verifyOAIharvester

public static List<String> verifyOAIharvester(String oaiSource,
                                              String oaiSetId,
                                              String metaPrefix,
                                              boolean testORE)
Verify the existance of an OAI server with the specified set and supporting the provided metadata formats.

Parameters:
oaiSource - the address of the OAI-PMH provider
oaiSetId -
metaPrefix -
testORE - 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.

startNewScheduler

public static void startNewScheduler()
                              throws SQLException,
                                     AuthorizeException
Start harvest scheduler.

Throws:
SQLException
AuthorizeException

stopScheduler

public static void stopScheduler()
                          throws SQLException,
                                 AuthorizeException
Stop an active harvest scheduler.

Throws:
SQLException
AuthorizeException

pauseScheduler

public static void pauseScheduler()
                           throws SQLException,
                                  AuthorizeException
Pause an active harvest scheduler.

Throws:
SQLException
AuthorizeException

resumeScheduler

public static void resumeScheduler()
                            throws SQLException,
                                   AuthorizeException
Resume a paused harvest scheduler.

Throws:
SQLException
AuthorizeException

resetScheduler

public static void resetScheduler()
                           throws SQLException,
                                  AuthorizeException,
                                  IOException
Throws:
SQLException
AuthorizeException
IOException


Copyright © 2010 DuraSpace. All Rights Reserved.