Modifier | Constructor and Description |
---|---|
protected |
JobDAO()
constructor used when creating singleton.
|
Modifier and Type | Method and Description |
---|---|
abstract void |
create(Job job)
Creates an instance in persistent storage of the given job.
|
abstract boolean |
exists(Long jobID)
Check whether a particular job exists.
|
abstract Iterator<Job> |
getAll()
Return a list of all jobs .
|
abstract Iterator<Job> |
getAll(JobStatus status)
Return a list of all jobs with the given status.
|
abstract Iterator<Long> |
getAllJobIds()
Return a list of all job_ids .
|
abstract Iterator<Long> |
getAllJobIds(JobStatus status)
Return a list of all job_id's representing jobs with the given status.
|
abstract Iterator<Long> |
getAllJobIds(JobStatus status,
HarvestChannel channel)
Return a list of all job_id's representing jobs with the given status and channel.
|
abstract int |
getCountJobs()
Returns the number of jobs existing.
|
static JobDAO |
getInstance()
Gets the JobDAO singleton.
|
abstract List<AliasInfo> |
getJobAliasInfo(Job job)
Get a list of AliasInfo objects for all the domains included in the job.
|
abstract List<Long> |
getJobIDsForDuplicateReduction(long jobID)
Calculate all jobIDs to use for duplication reduction.
|
abstract JobStatus |
getJobStatus(Long jobID)
Get Jobstatus for the job with the given id.
|
abstract HarvestStatus |
getStatusInfo(HarvestStatusQuery query)
Return status information for all jobs defined by the supplied query.
|
abstract List<JobStatusInfo> |
getStatusInfo(JobStatus status)
Return status information for all jobs with given job status.
|
Iterator<Job> |
iterator()
Gets an iterator of all jobs.
|
abstract Job |
read(long jobID)
Reads a job from persistent storage.
|
abstract long |
rescheduleJob(long oldJobID)
Reschedule a job by creating a new job (in status NEW) and setting the old job to status RESUBMITTED.
|
static void |
reset()
Reset the DAO instance.
|
abstract void |
update(Job job)
Update a Job in persistent storage.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEach, spliterator
protected JobDAO()
public static JobDAO getInstance()
public abstract void create(Job job)
job
- a job to create in persistent storage.PermissionDenied
- If a job already exists in persistent storage with id of the given jobIOFailure
- If some IOException occurs while writing the jobpublic abstract boolean exists(Long jobID)
jobID
- Id of the job.public abstract int getCountJobs()
public abstract Job read(long jobID) throws ArgumentNotValid, UnknownID, IOFailure
jobID
- The ID of the job to readArgumentNotValid
- If failed to create job instance in case the configuration or priority is null, or the
harvestID is invalid.UnknownID
- If the job with the given jobID does not exist in persistent storage.IOFailure
- If the loaded ID of job does not match the expected.public abstract void update(Job job) throws IOFailure
job
- The Job to updateArgumentNotValid
- If the Job is nullUnknownID
- If the Job doesn't exist in the DAOIOFailure
- If writing the job to persistent storage failsPermissionDenied
- If the job has been updated behind our backspublic static void reset()
public abstract Iterator<Job> getAll(JobStatus status)
status
- A given status.ArgumentNotValid
- If the given status is not one of the six valid states specified in JobStatus.public abstract Iterator<Long> getAllJobIds(JobStatus status)
status
- A given status.ArgumentNotValid
- If the given status is not one of the six valid states specified in JobStatus.public abstract Iterator<Long> getAllJobIds(JobStatus status, HarvestChannel channel)
status
- A given statuschannel
- A given HarvestChannel
public abstract Iterator<Job> getAll()
public Iterator<Job> iterator()
public abstract Iterator<Long> getAllJobIds()
public abstract HarvestStatus getStatusInfo(HarvestStatusQuery query)
query
- the user queryIOFailure
- on trouble in database accesspublic abstract List<JobStatusInfo> getStatusInfo(JobStatus status)
status
- The status asked for.IOFailure
- on trouble in database accesspublic abstract List<Long> getJobIDsForDuplicateReduction(long jobID) throws UnknownID
More precisely, this method calculates the following: If the job ID corresponds to a partial harvest, all jobIDs from the previous scheduled harvest are returned, or the empty list if this harvest hasn't been scheduled before.
If the job ID corresponds to a full harvest, the entire chain of harvests this is based on is returned, and all jobIDs from the previous chain of full harvests is returned.
jobID
- The job ID to find duplicate reduction data for.UnknownID
- if job ID is unknownIOFailure
- on trouble getting jobIDs for deduplication from the metadata archive file.public abstract long rescheduleJob(long oldJobID)
Notice the slightly confusing naming: The only job is marked RESUBMITTED, but the new job is not really submitted, that happens in a separate stage, the new job is in status NEW.
oldJobID
- ID of a job to rescheduleUnknownID
- if no job exists with id jobIDIllegalState
- if the job with id jobID is not SUBMITTED or FAILED.public abstract JobStatus getJobStatus(Long jobID)
jobID
- A given JobidUnknownID
- if no job exists with id jobIDpublic abstract List<AliasInfo> getJobAliasInfo(Job job)
Copyright © 2005–2015 The Royal Danish Library, the Danish State and University Library, the National Library of France and the Austrian National Library.. All rights reserved.