dk.netarkivet.harvester.scheduler.jobgen
Interface JobGenerator

All Known Implementing Classes:
AbstractJobGenerator, DefaultJobGenerator, FixedDomainConfigurationCountJobGenerator

public interface JobGenerator

This interface defines the core methods that should be provided by a job generator. It is designed to allow alternate implementations of job generation, depending on curators and/or production engineers specific needs.


Method Summary
 boolean canAccept(Job job, DomainConfiguration cfg)
          Tests if a configuration fits into this Job.
 int generateJobs(HarvestDefinition harvest)
          Generates a series of jobs for the given harvest definition.
 

Method Detail

generateJobs

int generateJobs(HarvestDefinition harvest)
Generates a series of jobs for the given harvest definition. Note that a job generator is expected to follow the singleton pattern, so implementations of this method should be thread-safe.

Parameters:
harvest - the harvest definition to process.
Returns:
the number of jobs that were generated.

canAccept

boolean canAccept(Job job,
                  DomainConfiguration cfg)
Tests if a configuration fits into this Job. First tests if it's the right type of order-template and bytelimit, and whether the bytelimit is right for the job. The Job limits are compared against the configuration estimates and if no limits are exceeded true is returned otherwise false is returned.

Parameters:
job - the job being built.
cfg - the configuration to check
Returns:
true if adding the configuration to this Job does not exceed any of the Job limits.
Throws:
ArgumentNotValid - if cfg is null