DLESE Tools
v1.6.0

org.dlese.dpc.index.reader
Class HarvestLogReader

java.lang.Object
  extended by org.dlese.dpc.index.reader.DocReader
      extended by org.dlese.dpc.index.reader.HarvestLogReader

public class HarvestLogReader
extends DocReader

A bean for accessing the data stored in a Lucene Document that logs a single OAI harvest. The index writer that is responsible for creating this type of Lucene Document is a HarvestLogWriter.

Author:
John Weatherley
See Also:
ResultDoc, HarvestLogWriter

Field Summary
 
Fields inherited from class org.dlese.dpc.index.reader.DocReader
conf, doc, resultDoc, score
 
Constructor Summary
HarvestLogReader()
          Constructor for the HarvestLogReader object
HarvestLogReader(org.apache.lucene.document.Document doc)
          Constructor that may be used programatically to wrap a reader around a Lucene Document created by a DocWriter.
 
Method Summary
 String getBaseUrl()
          Gets the baseUrl attribute of the HarvestLogReader object
protected static String getDateStamp()
          Return a string for the current time and date, sutiable for display in log files and output to standout:
 String getDeletedRecordSupport()
          Gets the level of support for deleted records of the data provider, or null if not available.
 Date getEndDate()
          Gets the end time as a Date, or null.
 String getEndTime()
          Gets the endTime attribute of the HarvestLogReader object
 long getEndTimeLong()
          Gets the end time as a long, or -1 if not available.
 String getEntryType()
          Gets the entryType attribute of the HarvestLogReader object
 Date getFromDate()
          Gets the from Date used for this harvest, or null if none was used.
 String getFromDatestamp()
          Gets the from datestamp of the form yyyy-MM-ddTHH:mm:ssZ used for this harvest, or null if none was used.
 String getHarvestDir()
          Gets the harvestDir attribute of the HarvestLogReader object
 String getHarvestDuration()
          Gets the harvest duration for display, or null if not available.
 long getHarvestDurationLong()
          Gets the harvest duration as a long, or -1 if not avialble.
 String getHarvestUid()
          The UID of an individual harvest that was performed.
 long getHarvestUidLong()
          Gets the harvestUidLong attribute of the HarvestLogReader object
 String getLogDate()
          Gets the logDate attribute of the HarvestLogReader object
 String getLogMessage()
          Gets the logMessage attribute of the HarvestLogReader object
 String getNumHarvestedRecords()
          Gets the numHarvestedRecords attribute of the HarvestLogReader object
 int getNumHarvestedRecordsInt()
          Gets the numHarvestedRecordsInt attribute of the HarvestLogReader object
 String getNumResumptionTokens()
          Gets the numResumptionTokens attribute of the HarvestLogReader object
 int getNumResumptionTokensInt()
          Gets the numResumptionTokensInt attribute of the HarvestLogReader object
 String getOaiErrorCode()
          Gets the OAI error code that was returned by the data provider, for example 'noRecordsMatch', or null if not applicable.
 String getReaderType()
          Gets a String describing the reader type.
 String getRepositoryName()
          Gets the repositoryName attribute of the HarvestLogReader object
 String getSet()
          Gets the set if one was specified, or empty String.
 Date getStartDate()
          Gets the start time as a Date, or null.
 String getStartTime()
          Gets the startTime attribute of the HarvestLogReader object
 long getStartTimeLong()
          Gets the start time as a long, or -1 if not available.
 String getSupportedGranularity()
          Gets the date granularity supported by the data provider, or null if not available.
 String getUid()
          The UID of the scheduled harvest.
 long getUidLong()
          Gets the uidLong attribute of the HarvestLogReader object
 Date getUntilDate()
          Gets the until Date used for this harvest, or null if none was used.
 String getUntilDatestamp()
          Gets the until datestamp of the form yyyy-MM-ddTHH:mm:ssZ used for this harvest, or null if none was used.
 String getZipFilePath()
          Gets the path to the zip file for this harvest, or null if none was saved.
 void init()
          Init method does nothing.
 
Methods inherited from class org.dlese.dpc.index.reader.DocReader
doInit, getAttribute, getDocMap, getDocument, getIndex, getLazyDocMap, getQuery, getRepositoryManager, getScore, setDoc
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HarvestLogReader

public HarvestLogReader()
Constructor for the HarvestLogReader object


HarvestLogReader

public HarvestLogReader(org.apache.lucene.document.Document doc)
Constructor that may be used programatically to wrap a reader around a Lucene Document created by a DocWriter. Sets the score to 0.

Parameters:
doc - A Lucene Document created by a DocWriter.
Method Detail

init

public void init()
Init method does nothing.

Specified by:
init in class DocReader

getLogDate

public String getLogDate()
Gets the logDate attribute of the HarvestLogReader object

Returns:
The logDate value

getStartDate

public Date getStartDate()
Gets the start time as a Date, or null.

Returns:
The startTime value

getStartTime

public String getStartTime()
Gets the startTime attribute of the HarvestLogReader object

Returns:
The startTime value

getStartTimeLong

public long getStartTimeLong()
Gets the start time as a long, or -1 if not available.

Returns:
The start time as a long

getEndDate

public Date getEndDate()
Gets the end time as a Date, or null.

Returns:
The startTime value

getEndTime

public String getEndTime()
Gets the endTime attribute of the HarvestLogReader object

Returns:
The endTime value

getEndTimeLong

public long getEndTimeLong()
Gets the end time as a long, or -1 if not available.

Returns:
The end time or -1

getHarvestDurationLong

public long getHarvestDurationLong()
Gets the harvest duration as a long, or -1 if not avialble.

Returns:
The harvest duration

getHarvestDuration

public String getHarvestDuration()
Gets the harvest duration for display, or null if not available.

Returns:
The harvest duration

getRepositoryName

public String getRepositoryName()
Gets the repositoryName attribute of the HarvestLogReader object

Returns:
The repositoryName value

getBaseUrl

public String getBaseUrl()
Gets the baseUrl attribute of the HarvestLogReader object

Returns:
The baseUrl value

getSet

public String getSet()
Gets the set if one was specified, or empty String. Note that the index stores 'noset' for the set if none was specified.

Returns:
The setSpec or empty String

getFromDatestamp

public String getFromDatestamp()
Gets the from datestamp of the form yyyy-MM-ddTHH:mm:ssZ used for this harvest, or null if none was used.

Returns:
The from datestamp or null

getFromDate

public Date getFromDate()
Gets the from Date used for this harvest, or null if none was used.

Returns:
The from Date or null

getUntilDatestamp

public String getUntilDatestamp()
Gets the until datestamp of the form yyyy-MM-ddTHH:mm:ssZ used for this harvest, or null if none was used.

Returns:
The until datestamp or null

getUntilDate

public Date getUntilDate()
Gets the until Date used for this harvest, or null if none was used.

Returns:
The until Date or null

getUid

public String getUid()
The UID of the scheduled harvest.

Returns:
The uid value

getUidLong

public long getUidLong()
Gets the uidLong attribute of the HarvestLogReader object

Returns:
The uidLong value

getHarvestUid

public String getHarvestUid()
The UID of an individual harvest that was performed.

Returns:
The harvestUid value

getHarvestUidLong

public long getHarvestUidLong()
Gets the harvestUidLong attribute of the HarvestLogReader object

Returns:
The harvestUidLong value

getNumHarvestedRecords

public String getNumHarvestedRecords()
Gets the numHarvestedRecords attribute of the HarvestLogReader object

Returns:
The numHarvestedRecords value

getNumHarvestedRecordsInt

public int getNumHarvestedRecordsInt()
Gets the numHarvestedRecordsInt attribute of the HarvestLogReader object

Returns:
The numHarvestedRecordsInt value

getNumResumptionTokens

public String getNumResumptionTokens()
Gets the numResumptionTokens attribute of the HarvestLogReader object

Returns:
The numResumptionTokens value

getNumResumptionTokensInt

public int getNumResumptionTokensInt()
Gets the numResumptionTokensInt attribute of the HarvestLogReader object

Returns:
The numResumptionTokensInt value

getLogMessage

public String getLogMessage()
Gets the logMessage attribute of the HarvestLogReader object

Returns:
The logMessage value

getHarvestDir

public String getHarvestDir()
Gets the harvestDir attribute of the HarvestLogReader object

Returns:
The harvestDir value

getZipFilePath

public String getZipFilePath()
Gets the path to the zip file for this harvest, or null if none was saved.

Returns:
The zip file path or null

getDeletedRecordSupport

public String getDeletedRecordSupport()
Gets the level of support for deleted records of the data provider, or null if not available.

Returns:
One of 'no', 'persistent', 'transient' or null

getSupportedGranularity

public String getSupportedGranularity()
Gets the date granularity supported by the data provider, or null if not available.

Returns:
One of 'days', 'seconds'or null

getOaiErrorCode

public String getOaiErrorCode()
Gets the OAI error code that was returned by the data provider, for example 'noRecordsMatch', or null if not applicable. See OAI-PMH error codes .

Returns:
The OAI error code or null

getEntryType

public String getEntryType()
Gets the entryType attribute of the HarvestLogReader object

Returns:
The entryType value

getReaderType

public String getReaderType()
Gets a String describing the reader type. This may be used in (Struts) beans to determine which type of reader is available for a given search result and thus what data is available for display in the UI. The reader type implies which getter methods are available.

Specified by:
getReaderType in class DocReader
Returns:
The readerType value.

getDateStamp

protected static final String getDateStamp()
Return a string for the current time and date, sutiable for display in log files and output to standout:

Returns:
The dateStamp value

DLESE Tools
v1.6.0