|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object dk.netarkivet.harvester.datamodel.JobDAO
public abstract class JobDAO
Interface for creating and accessing jobs in persistent storage.
Constructor Summary | |
---|---|
protected |
JobDAO()
constructor used when creating singleton. |
Method Summary | |
---|---|
abstract void |
create(Job job)
Creates an instance in persistent storage of the given job. |
abstract boolean |
exists(java.lang.Long jobID)
Check whether a particular job exists. |
abstract java.util.Iterator<Job> |
getAll()
Return a list of all jobs . |
abstract java.util.Iterator<Job> |
getAll(JobStatus status)
Return a list of all jobs with the given status. |
abstract java.util.Iterator<java.lang.Long> |
getAllJobIds()
Return a list of all job_ids . |
abstract java.util.Iterator<java.lang.Long> |
getAllJobIds(JobStatus status)
Return a list of all job_id's representing jobs with the given status. |
abstract java.util.Iterator<java.lang.Long> |
getAllJobIds(JobStatus status,
JobPriority priority)
Return a list of all job_id's representing jobs with the given status and priority. |
abstract int |
getCountJobs()
Returns the number of jobs existing. |
static JobDAO |
getInstance()
Gets the JobDAO singleton. |
abstract java.util.List<java.lang.Long> |
getJobIDsForDuplicateReduction(long jobID)
Calculate all jobIDs to use for duplication reduction. |
abstract JobStatus |
getJobStatus(java.lang.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 java.util.List<JobStatusInfo> |
getStatusInfo(JobStatus status)
Return status information for all jobs with given job status. |
java.util.Iterator<Job> |
iterator()
Gets an iterator of all jobs. |
abstract Job |
read(java.lang.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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected JobDAO()
Method Detail |
---|
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 job
IOFailure
- If some IOException occurs while
writing the jobpublic abstract boolean exists(java.lang.Long jobID)
jobID
- Id of the job.
public abstract int getCountJobs()
public abstract Job read(java.lang.Long jobID) throws ArgumentNotValid, UnknownID, IOFailure
jobID
- The ID of the job to read
ArgumentNotValid
- 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 update
ArgumentNotValid
- If the Job is null
UnknownID
- If the Job doesn't exist in the DAO
IOFailure
- If writing the job to persistent storage fails
PermissionDenied
- If the job has been updated behind our backspublic static void reset()
public abstract java.util.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 java.util.Iterator<java.lang.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 java.util.Iterator<java.lang.Long> getAllJobIds(JobStatus status, JobPriority priority)
status
- A given statuspriority
- A given priority
public abstract java.util.Iterator<Job> getAll()
public java.util.Iterator<Job> iterator()
iterator
in interface java.lang.Iterable<Job>
public abstract java.util.Iterator<java.lang.Long> getAllJobIds()
public abstract HarvestStatus getStatusInfo(HarvestStatusQuery query)
query
- the user query
IOFailure
- on trouble in database accesspublic abstract java.util.List<JobStatusInfo> getStatusInfo(JobStatus status)
status
- The status asked for.
IOFailure
- on trouble in database accesspublic abstract java.util.List<java.lang.Long> getJobIDsForDuplicateReduction(long jobID) throws UnknownID
jobID
- The job ID to find duplicate reduction data for.
UnknownID
- if job ID is unknown
IOFailure
- on trouble getting ids from metadata storagepublic abstract long rescheduleJob(long oldJobID)
oldJobID
- ID of a job to reschedule
UnknownID
- if no job exists with id jobID
IllegalState
- if the job with id jobID is not SUBMITTED or FAILED.public abstract JobStatus getJobStatus(java.lang.Long jobID)
jobID
- A given Jobid
UnknownID
- if no job exists with id jobID
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |