Package org.dlese.dpc.index.writer
Class HarvestLogWriter
java.lang.Object
org.dlese.dpc.index.writer.HarvestLogWriter
- All Implemented Interfaces:
DocWriter
Writes a Lucene Document that holds information about a harvest.
The Lucene
The Lucene
Document fields that are created by this class are: requestdate - The date of the client request. Stored. requesturl - The URL and query the client requested. Stored.remotehost - The requesting client's host name or IP address. Stored.notes - Free text notes related to this log entry. Stored.doctype - The document format type, which is 'weblog,' with '0' appended to support
wildcard searching.readerclass - The class which is used to read Documents created by this writer, which is 'WebLogReader'.admindefaultfield - The default field that holds all content for searching.
'WebLogReader'.- Author:
- John Weatherley
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic intNOT YET DOCUMENTEDstatic intNOT YET DOCUMENTEDstatic intNOT YET DOCUMENTEDstatic intNOT YET DOCUMENTED -
Constructor Summary
ConstructorsConstructorDescriptionHarvestLogWriter(String repositoryName, String baseURL, String set, String shUid) Constructor for the HarvestLogWriter object -
Method Summary
Modifier and TypeMethodDescriptionprotected final voidaddToAdminDefaultField(String value, StringBuffer adminDefaultBuffer) Adds the given String to a text field referenced in the index by the field name 'default'.Gets doctype, which is "harvestlog".Gets the name of the concreteDocReaderclass that is used to read this type ofDocument, which is "HarvestLogReader".final org.apache.lucene.document.DocumentlogEntry(long harvestUid, long startTime, long endTime, int recordCount, int resumptionCount, int messageType, String harvestedRecordsDir, String zipFilePathName, String supportedGranularity, String deletedRecordSupport, String oaiErrCode, String message) Logs an entry in the index.final voidsetHarvestAttributes(Date from, Date until) Sets the harvest attributes for this harvest.
-
Field Details
-
HARVEST_IN_PROGRESS
public static int HARVEST_IN_PROGRESSNOT YET DOCUMENTED -
COMPLETED_SUCCESSFUL
public static int COMPLETED_SUCCESSFULNOT YET DOCUMENTED -
COMPLETED_OAI_ERROR
public static int COMPLETED_OAI_ERRORNOT YET DOCUMENTED -
COMPLETED_SERIOUS_ERROR
public static int COMPLETED_SERIOUS_ERRORNOT YET DOCUMENTED
-
-
Constructor Details
-
HarvestLogWriter
Constructor for the HarvestLogWriter object- Parameters:
repositoryName- Repos namebaseURL- baseUrlset- set, or null if noneshUid- The harvest Uid
-
-
Method Details
-
getDocType
Gets doctype, which is "harvestlog".- Specified by:
getDocTypein interfaceDocWriter- Returns:
- The String "harvestlog".
-
getReaderClass
Gets the name of the concreteDocReaderclass that is used to read this type ofDocument, which is "HarvestLogReader".- Specified by:
getReaderClassin interfaceDocWriter- Returns:
- The String "HarvestLogReader".
-
setHarvestAttributes
Sets the harvest attributes for this harvest.- Parameters:
from- The from date or null if none useduntil- The until date or null if none used
-
logEntry
public final org.apache.lucene.document.Document logEntry(long harvestUid, long startTime, long endTime, int recordCount, int resumptionCount, int messageType, String harvestedRecordsDir, String zipFilePathName, String supportedGranularity, String deletedRecordSupport, String oaiErrCode, String message) Logs an entry in the index.- Parameters:
harvestUid- Harvest UidstartTime- Start timeendTime- End timerecordCount- Num recordsresumptionCount- Num resumption tokens issuedmessageType- The message typeharvestedRecordsDir- Dir where harvested records are savedzipFilePathName- Zip filesupportedGranularity- GranularitydeletedRecordSupport- Deleted record supportoaiErrCode- OAI error code, or nullmessage- Message to be logged- Returns:
- Document to be inserted into the index
-
addToAdminDefaultField
Adds the given String to a text field referenced in the index by the field name 'default'. The default field may be used in queries to quickly search for text across fields. This method should be called from the addCustomFields of implementing classes.- Parameters:
value- A text string to be added to the indexed field named 'default.'adminDefaultBuffer- The feature to be added to the ToDefaultField attribute
-