public class PartialHarvest extends HarvestDefinition
audience, channelId, comments, edition, harvestDefName, isActive, numEvents, oid, submissionDate
extendedFieldValues
Constructor and Description |
---|
PartialHarvest(List<DomainConfiguration> domainConfigurations,
Schedule schedule,
String harvestDefName,
String comments,
String audience)
Create new instance of a PartialHavest configured according to the properties of the supplied
DomainConfiguration.
|
Modifier and Type | Method and Description |
---|---|
void |
addDomainConfiguration(DomainConfiguration newConfiguration)
Add a new domainconfiguration to this PartialHarvest.
|
Set<String> |
addSeeds(Set<String> seeds,
String templateName,
long maxBytes,
int maxObjects,
Map<String,String> attributeValues)
Takes a seed list and creates any necessary domains, configurations, and seedlists to enable them to be harvested
with the given template and other parameters.
|
Set<String> |
addSeedsFromFile(File seedsFile,
String templateName,
long maxBytes,
int maxObjects,
Map<String,String> attributeValues)
This method is a duplicate of the addSeeds method but for seedsFile parameter
|
Iterator<DomainConfiguration> |
getDomainConfigurations()
Returns a List of domain configurations for this harvest definition.
|
Collection<DomainConfiguration> |
getDomainConfigurationsAsList() |
long |
getMaxBytes()
Always returns no limit.
|
long |
getMaxCountObjects()
Always returns no limit.
|
Date |
getNextDate()
Get the next date this harvest definition should be run.
|
Schedule |
getSchedule()
Returns the schedule defined for this harvest definition.
|
boolean |
isSnapShot()
Returns whether this HarvestDefinition represents a snapshot harvest.
|
void |
removeDomainConfiguration(SparseDomainConfiguration dcKey)
Remove domainconfiguration from this partialHarvest.
|
void |
reset()
Reset the harvest definition to no harvests and next date being the first possible for the schedule.
|
boolean |
runNow(Date now)
Check if this harvest definition should be run, given the time now.
|
void |
setDomainConfigurations(List<DomainConfiguration> configs)
Set the list of configurations that this PartialHarvest uses.
|
void |
setNextDate(Date nextDate)
Set the next date this harvest definition should be run.
|
void |
setSchedule(Schedule schedule)
Set the schedule to be used for this harvestdefinition.
|
createFullHarvest, createPartialHarvest, equals, getActive, getAudience, getChannelId, getComments, getEdition, getExtendedFieldType, getName, getNumEvents, getOid, getSubmissionDate, hashCode, setActive, setAudience, setChannelId, setComments, setEdition, setName, setNumEvents, setOid, setSubmissionDate, toString
addExtendedFieldValue, addExtendedFieldValues, getExtendedFieldValue, getExtendedFieldValues, setExtendedFieldValues, updateExtendedFieldValue
public PartialHarvest(List<DomainConfiguration> domainConfigurations, Schedule schedule, String harvestDefName, String comments, String audience)
domainConfigurations
- a list of domain configurationsschedule
- the harvest definition scheduleharvestDefName
- the name of the harvest definitioncomments
- commentsaudience
- The intended audience for this harvest (could be null)public Schedule getSchedule()
public void setSchedule(Schedule schedule)
schedule
- A schedule for when to try harvesting.public Date getNextDate()
public void setNextDate(Date nextDate)
nextDate
- The next date the harvest definition should be run. May be null, meaning never again.public void removeDomainConfiguration(SparseDomainConfiguration dcKey)
dcKey
- domainConfiguration keypublic void addDomainConfiguration(DomainConfiguration newConfiguration)
newConfiguration
- A new DomainConfigurationpublic Iterator<DomainConfiguration> getDomainConfigurations()
getDomainConfigurations
in class HarvestDefinition
public Collection<DomainConfiguration> getDomainConfigurationsAsList()
public void setDomainConfigurations(List<DomainConfiguration> configs)
configs
- Listpublic void reset()
public boolean runNow(Date now)
runNow
in class HarvestDefinition
now
- The current timepublic boolean isSnapShot()
isSnapShot
in class HarvestDefinition
public long getMaxCountObjects()
getMaxCountObjects
in class HarvestDefinition
public long getMaxBytes()
getMaxBytes
in class HarvestDefinition
public Set<String> addSeeds(Set<String> seeds, String templateName, long maxBytes, int maxObjects, Map<String,String> attributeValues)
seeds
- a list of the seeds to be addedtemplateName
- the name of the template to be usedmaxBytes
- Maximum number of bytes to harvest per domainmaxObjects
- Maximum number of objects to harvest per domainattributeValues
- Attributes read from webpagefor details
public Set<String> addSeedsFromFile(File seedsFile, String templateName, long maxBytes, int maxObjects, Map<String,String> attributeValues)
seedsFile
- a newline-separated File containing the seeds to be addedtemplateName
- the name of the template to be usedmaxBytes
- Maximum number of bytes to harvest per domainmaxObjects
- Maximum number of objects to harvest per domainCopyright © 2005–2018 The Royal Danish Library, the National Library of France and the Austrian National Library.. All rights reserved.