dk.netarkivet.harvester.scheduler
Class JobDispatcher

java.lang.Object
  extended by dk.netarkivet.harvester.scheduler.JobDispatcher

public class JobDispatcher
extends java.lang.Object

This class handles dispatching of Harvest jobs to the Harvesters.


Constructor Summary
JobDispatcher(JMSConnection jmsConnection)
           
 
Method Summary
 void doOneCrawl(Job job, java.lang.String origHarvestName, java.lang.String origHarvestDesc, java.lang.String origHarvestSchedule, java.util.List<MetadataEntry> metadata)
          Submit an doOneCrawl request to a HarvestControllerServer.
protected  void submitNextNewJob(JobPriority priority)
          Submit the next new job (the one with the lowest ID) with the given priority, and updates the internal counter as needed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JobDispatcher

public JobDispatcher(JMSConnection jmsConnection)
Parameters:
jmsConnection - The JMS connection to use.
Method Detail

submitNextNewJob

protected void submitNextNewJob(JobPriority priority)
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:
priority - the job priority

doOneCrawl

public void doOneCrawl(Job job,
                       java.lang.String origHarvestName,
                       java.lang.String origHarvestDesc,
                       java.lang.String origHarvestSchedule,
                       java.util.List<MetadataEntry> metadata)
                throws ArgumentNotValid,
                       IOFailure
Submit an doOneCrawl request to a HarvestControllerServer.

Parameters:
job - the specific job to send
origHarvestName - the harvest definition's name
origHarvestDesc - the harvest definition's description
origHarvestSchedule - the harvest definition schedule name
metadata - pre-harvest metadata to store in arcfile.
Throws:
ArgumentNotValid - one of the parameters are null
IOFailure - if unable to send the doOneCrawl request to a harvestControllerServer