DLESE Tools
v1.6.0

org.dlese.dpc.oai.harvester
Interface HarvestMessageHandler

All Known Implementing Classes:
IndexingHarvestMsgHandler, SimpleHarvestMessageHandler

public interface HarvestMessageHandler

Interface that recieves status messages about the progress of an OAI harvest as it occurs.

Version:
$Id: HarvestMessageHandler.java,v 1.9 2009/03/20 23:33:53 jweather Exp $
Author:
John Weatherley
See Also:
Harvester

Method Summary
 void completedHarvestMessage(int recordCount, int resumptionCount, String baseURL, String set, long startTime, long endTime, String zipFilePathName, String supportedGranularity, String deletedRecordSupport)
          A final report detailing the result of a successful harvest.
 void errorMessage(String msg)
          A serios error that occured during the harvest, preventing it from completing.
 int getNumRecordsForStatusNotification()
          Gets the number of records the Harveser should harvest between sending statusMessage notifications to this HarvestMessageHandler.
 void oaiErrorMessage(String oaiError, String errorMessage, String supportedGranularity, String deletedRecordSupport)
          A message generated by the harvester when an OAI protocol error has occured.
 void setHarvestAttributes(Date from, Date until)
          Sets harvest attributes for this harvest.
 void statusMessage(int recordCount, int resumptionCount)
          A status message indicating the number of records currenlty harvested and the number of resumption tokens issued.
 void statusMessage(String msg)
          A status message indicating an event that took place during the harvest, such as a request made to the data provider.
 

Method Detail

statusMessage

void statusMessage(int recordCount,
                   int resumptionCount)
A status message indicating the number of records currenlty harvested and the number of resumption tokens issued.

Parameters:
recordCount - Number of recrods currently harvested.
resumptionCount - Number of resumption tokens currently issued.
See Also:
getNumRecordsForStatusNotification()

statusMessage

void statusMessage(String msg)
A status message indicating an event that took place during the harvest, such as a request made to the data provider.

Parameters:
msg - A harvest status message generated by the harvester.

getNumRecordsForStatusNotification

int getNumRecordsForStatusNotification()
Gets the number of records the Harveser should harvest between sending statusMessage notifications to this HarvestMessageHandler.

Returns:
The numRecordsForStatusNotification value.
See Also:
statusMessage(String msg)

setHarvestAttributes

void setHarvestAttributes(Date from,
                          Date until)
Sets harvest attributes for this harvest.

Parameters:
from - The from date or null if none used
until - The until date or null if none used

oaiErrorMessage

void oaiErrorMessage(String oaiError,
                     String errorMessage,
                     String supportedGranularity,
                     String deletedRecordSupport)
A message generated by the harvester when an OAI protocol error has occured.

Parameters:
oaiError - The OAI error code, for example "noRecordsMatch".
errorMessage - The accompanying message returned by the data provider, if any.
supportedGranularity - Supported granularity [days, seconds] or null
deletedRecordSupport - Deleted record support [no, transient, persistent] or null

errorMessage

void errorMessage(String msg)
A serios error that occured during the harvest, preventing it from completing. For example an http 500 error or a parsing error.

Parameters:
msg - Description of the error.

completedHarvestMessage

void completedHarvestMessage(int recordCount,
                             int resumptionCount,
                             String baseURL,
                             String set,
                             long startTime,
                             long endTime,
                             String zipFilePathName,
                             String supportedGranularity,
                             String deletedRecordSupport)
A final report detailing the result of a successful harvest. This method is only called if the harvest completes successfully with no errors.

Parameters:
recordCount - The total number of records harvested.
resumptionCount - Number of resumption tokens issued.
baseURL - The baseURL that was harvested.
set - The set that was harvested, or an empty string if none.
startTime - The time the harvest began.
endTime - The time the harvest was completed.
zipFilePathName - The full path to the harvest zip file, or null if none.
supportedGranularity - Supported granularity [days, seconds]
deletedRecordSupport - Deleted record support [no, transient, persistent]

DLESE Tools
v1.6.0