|
DLESE Tools v1.6.0 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.dlese.dpc.oai.harvester.ScheduledHarvestManager
public final class ScheduledHarvestManager
Runs, logs and manages ScheduledHarvests.
Constructor Summary | |
---|---|
ScheduledHarvestManager(SimpleDataStore dataStore,
File initialHarvestDir,
SimpleLuceneIndex harvestLogIndex,
int timeOutMilliseconds)
Constructor for the ScheduledHarvestManager |
Method Summary | |
---|---|
void |
addScheduledHarvest(ScheduledHarvest sh)
Adds a ScheduledHarvest to this manager or replaces an existing one with the same ID. |
boolean |
containsScheduledHarvest(Long shUid)
Determines whether the given ScheduledHarvest ID is in this manager. |
boolean |
containsValue(ScheduledHarvest sh)
Determine whether the given ScheduledHarvest value is in this manager. |
static String |
getDateStamp()
Return a string for the current time and date, sutiable for display in log files and output to standout: |
File |
getHarvestDir()
Gets the harvestDir attribute of the ScheduledHarvestManager object |
static Date |
getHarvestStartDate(String startTimeString)
Gets the date and time to begin the harvest by parsing a String in 24 hour time format such as 12:24 or 23:15. |
ScheduledHarvest |
getScheduledHarvest(Long shUid)
Gets the scheduledHarvest, or null if none exists. |
Hashtable |
getScheduledHarvests()
Gets all scheduledHarvests in this this manager. |
void |
harvestNow(Long shUid,
boolean harvestAll,
boolean harvestAllIfNoDeletedRecord)
Harvests the given ScheduledHarvest immediately, if not already running. |
boolean |
isRunning(Long shUid)
Determines wheter the given ScheduledHarvest is currently running. |
boolean |
isRunningOneTimeHarvest(ScheduledHarvest sh)
Determines whether a given ScheduledHarvest is already running. |
void |
oneTimeHarvest(ScheduledHarvest sh,
Date from,
Date until,
File harvestDir,
boolean harvestAllIfNoDeletedRecord)
Performs a one-time only harvest in the background. |
void |
removeInProgresstLogEntries()
Removes log entries showing entrytype status inprogress and replaces them with an error message indicateing that the given harvest was terminated by a server shut-down or crash. |
void |
removeScheduledHarvest(Long shUid,
boolean deletefiles)
Removes the given ScheduledHarvest. |
static void |
setDebug(boolean db)
Sets the debug attribute object |
void |
setHarvestDir(File harvestDir)
Sets the harvestDir attribute of the ScheduledHarvestManager object |
void |
stopAllHarvests()
Stops all running harvests gracefully. |
void |
stopTimerThread(Long shUid)
Stops the timer |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ScheduledHarvestManager(SimpleDataStore dataStore, File initialHarvestDir, SimpleLuceneIndex harvestLogIndex, int timeOutMilliseconds)
dataStore
- The data store that will hold persistent data for this manager.initialHarvestDir
- The initial directory where harvested files will be saved.harvestLogIndex
- The harvest log index used to log harvests.timeOutMilliseconds
- Number of milliseconds the harvester will wait for a response from the data
provider before timing outMethod Detail |
---|
public void removeInProgresstLogEntries()
public void setHarvestDir(File harvestDir)
harvestDir
- The new harvestDir valuepublic File getHarvestDir()
public boolean isRunning(Long shUid)
shUid
- ScheduledHarvest ID.
public Hashtable getScheduledHarvests()
public ScheduledHarvest getScheduledHarvest(Long shUid)
shUid
- The ID of the item to retrieve.
public void addScheduledHarvest(ScheduledHarvest sh)
sh
- The ScheduledHarvest to add.public void removeScheduledHarvest(Long shUid, boolean deletefiles)
shUid
- ScheduledHarvest ID to removedeletefiles
- Description of the Parameterpublic boolean containsScheduledHarvest(Long shUid)
shUid
- ScheduledHarvest ID
public boolean containsValue(ScheduledHarvest sh)
sh
- ScheduledHarvest
public void harvestNow(Long shUid, boolean harvestAll, boolean harvestAllIfNoDeletedRecord)
shUid
- Uid of the ScheduledHarvest.harvestAll
- True to havest all records, false to havest only records changed
since the previous harvest.harvestAllIfNoDeletedRecord
- True to harvest all records from scratch if deleted records are not
supportedpublic boolean isRunningOneTimeHarvest(ScheduledHarvest sh)
sh
- The ScheduledHarvest
public void oneTimeHarvest(ScheduledHarvest sh, Date from, Date until, File harvestDir, boolean harvestAllIfNoDeletedRecord)
sh
- A ScheduledHarvest with appropriate settings.from
- From Dateuntil
- Until DateharvestDir
- Directory where harvested records will be saved.harvestAllIfNoDeletedRecord
- True to harvest all records from scratch if deleted records are not
supportedpublic void stopAllHarvests()
public void stopTimerThread(Long shUid)
shUid
- The uid of the ScheduledHarvest.public static Date getHarvestStartDate(String startTimeString) throws ParseException
startTimeString
- The hour and minute in 24 hour time, for example 23:15
ParseException
- If unable to parsepublic static String getDateStamp()
public static void setDebug(boolean db)
db
- The new debug value
|
DLESE Tools v1.6.0 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |