Class JobDispatcher
- java.lang.Object
-
- dk.netarkivet.harvester.scheduler.JobDispatcher
-
public class JobDispatcher extends Object
This class handles dispatching of Harvest jobs to the Harvesters.
-
-
Constructor Summary
Constructors Constructor Description JobDispatcher(JMSConnection jmsConnection, HarvestDefinitionDAO hDao, JobDAO jobDao)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
doOneCrawl(Job job, String origHarvestName, String origHarvestDesc, String origHarvestSchedule, HarvestChannel channel, String origHarvestAudience, List<MetadataEntry> metadata)
Submit an doOneCrawl request to a HarvestControllerServer.protected void
submitNextNewJob(HarvestChannel channel)
Submit the next new job (the one with the lowest ID) with the given priority, and updates the internal counter as needed.
-
-
-
Constructor Detail
-
JobDispatcher
public JobDispatcher(JMSConnection jmsConnection, HarvestDefinitionDAO hDao, JobDAO jobDao)
- Parameters:
jmsConnection
- The JMS connection to use.hDao
- The HarvestDefinitionDAO to use.jobDao
- The JobDAO to use.
-
-
Method Detail
-
submitNextNewJob
protected void submitNextNewJob(HarvestChannel channel)
Submit the next new job (the one with the lowest ID) with the given priority, and updates the internal counter as needed. If no jobs are ready for the given priority, nothing is done- Parameters:
channel
- the Channel to use for the job.
-
doOneCrawl
public void doOneCrawl(Job job, String origHarvestName, String origHarvestDesc, String origHarvestSchedule, HarvestChannel channel, String origHarvestAudience, List<MetadataEntry> metadata) throws ArgumentNotValid, IOFailure
Submit an doOneCrawl request to a HarvestControllerServer.- Parameters:
job
- the specific job to sendorigHarvestName
- the harvest definition's nameorigHarvestDesc
- the harvest definition's descriptionorigHarvestSchedule
- the harvest definition schedule namechannel
- the channel to which the job should be sentmetadata
- pre-harvest metadata to store in (w)arcfile.origHarvestAudience
- the audience for the data generated by harvest definitions.- Throws:
ArgumentNotValid
- one of the parameters are nullIOFailure
- if unable to send the doOneCrawl request to a harvestControllerServer
-
-