public class IndexingHarvestMsgHandler extends java.lang.Object implements HarvestMessageHandler
Constructor and Description |
---|
IndexingHarvestMsgHandler(SimpleLuceneIndex harvestLogIndex,
java.lang.String repositoryName,
java.lang.String baseURL,
java.lang.String set,
java.lang.String shUid,
int numRecordsForNotification,
java.io.File hd)
Constructor for the HarvestMsgHandler object
|
Modifier and Type | Method and Description |
---|---|
void |
completedHarvestMessage(int recordCount,
int resumptionCount,
java.lang.String baseURL,
java.lang.String set,
long startTime,
long endTime,
java.lang.String zipFilePathName,
java.lang.String supportedGranularity,
java.lang.String deletedRecordSupport)
A final report detailing the result of a successful harvest, which only occurs if no
errors have occured.
|
void |
errorMessage(java.lang.String msg)
A serios error that occured during the harvest, preventing it from completing.
|
protected static java.lang.String |
getDateStamp()
Return a string for the current time and date, sutiable for display in log files and
output to standout:
|
int |
getNumRecordsForStatusNotification()
Gets the number of records the Harveser should harvest between sending statusMessage
notifications to this HarvestMessageHandler.
|
void |
oaiErrorMessage(java.lang.String oaiError,
java.lang.String errorMessage,
java.lang.String supportedGranularity,
java.lang.String deletedRecordSupport)
A message generated by the harvester when a standard OAI error has occured.
|
static void |
setDebug(boolean db)
Sets the debug attribute of the object
|
void |
setHarvestAttributes(java.util.Date from,
java.util.Date until)
Sets the harvest attributes for this harvest.
|
void |
setHarvester(Harvester harvester)
Sets the harvester attribute of the IndexingHarvestMsgHandler object
|
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(java.lang.String msg)
A status message indicating an event that took place during the harvest, such as a
request made to the data provider.
|
public IndexingHarvestMsgHandler(SimpleLuceneIndex harvestLogIndex, java.lang.String repositoryName, java.lang.String baseURL, java.lang.String set, java.lang.String shUid, int numRecordsForNotification, java.io.File hd)
harvestLogIndex
- The index.repositoryName
- The name of the repository, for indexing.baseURL
- Base URL to the harvested provider.set
- Set being harvested.shUid
- UID of the scheduled Harvest.numRecordsForNotification
- Number of records the harvester should recieve
between logging progress entries.hd
- Description of the Parameterpublic void setHarvester(Harvester harvester)
harvester
- The new harvester valuepublic void setHarvestAttributes(java.util.Date from, java.util.Date until)
setHarvestAttributes
in interface HarvestMessageHandler
from
- The from date or null if none useduntil
- The until date or null if none usedpublic void statusMessage(java.lang.String msg)
statusMessage
in interface HarvestMessageHandler
msg
- A harvest status message generated by the harvester.public void statusMessage(int recordCount, int resumptionCount)
statusMessage
in interface HarvestMessageHandler
recordCount
- Number of recrods currently harvested.resumptionCount
- Number of resumption tokens currently issued.getNumRecordsForStatusNotification()
public void oaiErrorMessage(java.lang.String oaiError, java.lang.String errorMessage, java.lang.String supportedGranularity, java.lang.String deletedRecordSupport)
oaiErrorMessage
in interface HarvestMessageHandler
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 nulldeletedRecordSupport
- Deleted record support [no, transient, persistent] or nullpublic void errorMessage(java.lang.String msg)
errorMessage
in interface HarvestMessageHandler
msg
- Description of the error.public void completedHarvestMessage(int recordCount, int resumptionCount, java.lang.String baseURL, java.lang.String set, long startTime, long endTime, java.lang.String zipFilePathName, java.lang.String supportedGranularity, java.lang.String deletedRecordSupport)
completedHarvestMessage
in interface HarvestMessageHandler
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]public int getNumRecordsForStatusNotification()
getNumRecordsForStatusNotification
in interface HarvestMessageHandler
statusMessage(String msg)
protected static final java.lang.String getDateStamp()
public static void setDebug(boolean db)
db
- The new debug value