|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object dk.netarkivet.harvester.datamodel.HarvestDefinition dk.netarkivet.harvester.datamodel.PartialHarvest
public class PartialHarvest
This class contains the specific properties and operations of harvest definitions which are not snapshot harvest definitions. I.e. this class models definitions of event and selective harvests.
Field Summary |
---|
Fields inherited from class dk.netarkivet.harvester.datamodel.HarvestDefinition |
---|
comments, edition, harvestDefName, isActive, numEvents, oid, submissionDate |
Constructor Summary | |
---|---|
PartialHarvest(java.util.List<DomainConfiguration> domainConfigurations,
Schedule schedule,
java.lang.String harvestDefName,
java.lang.String comments)
Create new instance of a PartialHavest configured according to the properties of the supplied DomainConfiguration. |
Method Summary | |
---|---|
void |
addSeeds(java.lang.String seeds,
java.lang.String templateName,
long maxBytes,
int maxObjects)
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. |
int |
createJobs()
Generates jobs in files from this harvest definition, and updates the schedule for when the harvest definition should happen next time. |
java.util.Iterator<DomainConfiguration> |
getDomainConfigurations()
Returns a List of domain configurations for this harvest definition. |
protected long |
getMaxBytes()
Always returns no limit. |
protected long |
getMaxCountObjects()
Always returns no limit. |
protected Job |
getNewJob(DomainConfiguration cfg)
Get a new Job suited for this type of HarvestDefinition. |
java.util.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 |
reset()
Reset the harvest definition to no harvests and next date being the first possible for the schedule. |
boolean |
runNow(java.util.Date now)
Check if this harvest definition should be run, given the time now. |
void |
setDomainConfigurations(java.util.List<DomainConfiguration> configs)
Set the list of configurations that this hd uses. |
void |
setNextDate(java.util.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. |
Methods inherited from class dk.netarkivet.harvester.datamodel.HarvestDefinition |
---|
createFullHarvest, createPartialHarvest, equals, getActive, getComments, getEdition, getName, getNumEvents, getOid, getSubmissionDate, hashCode, hasID, makeJobs, setActive, setComments, setEdition, setNumEvents, setOid, setSubmissionDate, toString |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public PartialHarvest(java.util.List<DomainConfiguration> domainConfigurations, Schedule schedule, java.lang.String harvestDefName, java.lang.String comments)
domainConfigurations
- a list of domain configurationsschedule
- the harvest definition scheduleharvestDefName
- the name of the harvest definitioncomments
- commentsMethod Detail |
---|
public int createJobs()
HarvesterSettings.JOBS_MAX_RELATIVE_SIZE_DIFFERENCE
:
The maximum relative difference between the smallest and largest
number of objects expected in a job
HarvesterSettings.JOBS_MIN_ABSOLUTE_SIZE_DIFFERENCE
:
Size differences below this threshold are ignored even if
the relative difference exceeds HarvesterSettings.JOBS_MAX_RELATIVE_SIZE_DIFFERENCE
HarvesterSettings.JOBS_MAX_TOTAL_JOBSIZE
:
The upper limit on the total number of objects that a job may
retrieve
Also updates the harvest definition to schedule the next event using
the defined schedule. Will skip events if the next event would be in the
past when using the schedule definition.
createJobs
in class HarvestDefinition
protected Job getNewJob(DomainConfiguration cfg)
getNewJob
in class HarvestDefinition
cfg
- The configuration to use when creating the job
public Schedule getSchedule()
public void setSchedule(Schedule schedule)
schedule
- A schedule for when to try harvesting.public java.util.Date getNextDate()
public void setNextDate(java.util.Date nextDate)
nextDate
- The next date the harvest definition should be run.
May be null, meaning never again.public java.util.Iterator<DomainConfiguration> getDomainConfigurations()
getDomainConfigurations
in class HarvestDefinition
public void setDomainConfigurations(java.util.List<DomainConfiguration> configs)
configs
- Listpublic void reset()
public boolean runNow(java.util.Date now)
runNow
in class HarvestDefinition
now
- The current time
public boolean isSnapShot()
isSnapShot
in class HarvestDefinition
protected long getMaxCountObjects()
getMaxCountObjects
in class HarvestDefinition
protected long getMaxBytes()
getMaxBytes
in class HarvestDefinition
public void addSeeds(java.lang.String seeds, java.lang.String templateName, long maxBytes, int maxObjects)
seeds
- a newline-separated 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 domainfor details
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |