DLESE Tools
v1.6.0

org.dlese.dpc.index.writer
Class HarvestLogWriter

java.lang.Object
  extended by org.dlese.dpc.index.writer.HarvestLogWriter
All Implemented Interfaces:
DocWriter

public class HarvestLogWriter
extends Object
implements DocWriter

Writes a Lucene Document that holds information about a harvest.
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:
HarvestLogReader

Field Summary
static int COMPLETED_OAI_ERROR
          NOT YET DOCUMENTED
static int COMPLETED_SERIOUS_ERROR
          NOT YET DOCUMENTED
static int COMPLETED_SUCCESSFUL
          NOT YET DOCUMENTED
static int HARVEST_IN_PROGRESS
          NOT YET DOCUMENTED
 
Constructor Summary
HarvestLogWriter(String repositoryName, String baseURL, String set, String shUid)
          Constructor for the HarvestLogWriter object
 
Method Summary
protected  void addToAdminDefaultField(String value, StringBuffer adminDefaultBuffer)
          Adds the given String to a text field referenced in the index by the field name 'default'.
 String getDocType()
          Gets doctype, which is "harvestlog".
 String getReaderClass()
          Gets the name of the concrete DocReader class that is used to read this type of Document, which is "HarvestLogReader".
 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.
 void setHarvestAttributes(Date from, Date until)
          Sets the harvest attributes for this harvest.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

HARVEST_IN_PROGRESS

public static int HARVEST_IN_PROGRESS
NOT YET DOCUMENTED


COMPLETED_SUCCESSFUL

public static int COMPLETED_SUCCESSFUL
NOT YET DOCUMENTED


COMPLETED_OAI_ERROR

public static int COMPLETED_OAI_ERROR
NOT YET DOCUMENTED


COMPLETED_SERIOUS_ERROR

public static int COMPLETED_SERIOUS_ERROR
NOT YET DOCUMENTED

Constructor Detail

HarvestLogWriter

public HarvestLogWriter(String repositoryName,
                        String baseURL,
                        String set,
                        String shUid)
Constructor for the HarvestLogWriter object

Parameters:
repositoryName - Repos name
baseURL - baseUrl
set - set, or null if none
shUid - The harvest Uid
Method Detail

getDocType

public String getDocType()
Gets doctype, which is "harvestlog".

Specified by:
getDocType in interface DocWriter
Returns:
The String "harvestlog".

getReaderClass

public String getReaderClass()
Gets the name of the concrete DocReader class that is used to read this type of Document, which is "HarvestLogReader".

Specified by:
getReaderClass in interface DocWriter
Returns:
The String "HarvestLogReader".

setHarvestAttributes

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

Parameters:
from - The from date or null if none used
until - 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 Uid
startTime - Start time
endTime - End time
recordCount - Num records
resumptionCount - Num resumption tokens issued
messageType - The message type
harvestedRecordsDir - Dir where harvested records are saved
zipFilePathName - Zip file
supportedGranularity - Granularity
deletedRecordSupport - Deleted record support
oaiErrCode - OAI error code, or null
message - Message to be logged
Returns:
Document to be inserted into the index

addToAdminDefaultField

protected final void addToAdminDefaultField(String value,
                                            StringBuffer adminDefaultBuffer)
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

DLESE Tools
v1.6.0