|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object dk.netarkivet.harvester.datamodel.JobDAO dk.netarkivet.harvester.datamodel.JobDBDAO
public class JobDBDAO
A database-based implementation of the JobDAO class. The statements to create the tables are now in scripts/sql/createfullhddb.sql
Constructor Summary | |
---|---|
protected |
JobDBDAO()
Create a new JobDAO implemented using database. |
Method Summary | |
---|---|
void |
create(Job job)
Creates an instance in persistent storage of the given job. |
boolean |
exists(java.lang.Long jobID)
Check whether a particular job exists. |
java.util.Iterator<Job> |
getAll()
Return a list of all jobs. |
java.util.Iterator<Job> |
getAll(JobStatus status)
Return a list of all jobs with the given status, ordered by id. |
java.util.Iterator<java.lang.Long> |
getAllJobIds()
Return a list of all job_ids . |
java.util.Iterator<java.lang.Long> |
getAllJobIds(JobStatus status)
Return a list of all job_id's representing jobs with the given status. |
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. |
int |
getCountJobs()
Returns the number of existing jobs. |
java.util.List<java.lang.Long> |
getJobIDsForDuplicateReduction(long jobID)
Calculate all jobIDs to use for duplication reduction. |
JobStatus |
getJobStatus(java.lang.Long jobID)
Get Jobstatus for the job with the given id. |
HarvestStatus |
getStatusInfo(HarvestStatusQuery query)
Get a list of small and immediately usable status information for given job status and in given job id order. |
java.util.List<JobStatusInfo> |
getStatusInfo(JobStatus status)
Get a list of small and immediately usable status information for given job status. |
Job |
read(java.lang.Long jobID)
Read a single job from the job database. |
long |
rescheduleJob(long oldJobID)
Reschedule a job by creating a new job (in status NEW) and setting the old job to status RESUBMITTED. |
void |
update(Job job)
Update a Job in persistent storage. |
Methods inherited from class dk.netarkivet.harvester.datamodel.JobDAO |
---|
getInstance, iterator, reset |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected JobDBDAO()
Method Detail |
---|
public void create(Job job)
create
in class JobDAO
job
- a given job to add to persistent storage
PermissionDenied
- If a job already exists in persistent storage
with the same id as the given job
IOFailure
- If some IOException occurs while
writing the job to persistent storagepublic boolean exists(java.lang.Long jobID)
exists
in class JobDAO
jobID
- Id of the job.
public void update(Job job)
update
in class JobDAO
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 Job read(java.lang.Long jobID)
read
in class JobDAO
jobID
- ID of the job.
UnknownID
- if the job id does not exist.
IOFailure
- if there was some problem talking to the database.public java.util.Iterator<Job> getAll(JobStatus status)
getAll
in class JobDAO
status
- A given status.
public java.util.Iterator<java.lang.Long> getAllJobIds(JobStatus status)
getAllJobIds
in class JobDAO
status
- A given status.
ArgumentNotValid
- If the given status is not one of the
five valid statuses specified in Job.public java.util.Iterator<java.lang.Long> getAllJobIds(JobStatus status, JobPriority priority)
JobDAO
getAllJobIds
in class JobDAO
status
- A given statuspriority
- A given priority
public java.util.Iterator<Job> getAll()
getAll
in class JobDAO
public java.util.Iterator<java.lang.Long> getAllJobIds()
getAllJobIds
in class JobDAO
public java.util.List<JobStatusInfo> getStatusInfo(JobStatus status)
getStatusInfo
in class JobDAO
status
- The status asked for.
ArgumentNotValid
- for invalid jobStatus
IOFailure
- on trouble getting data from databasepublic HarvestStatus getStatusInfo(HarvestStatusQuery query)
getStatusInfo
in class JobDAO
query
- the user query
IOFailure
- on trouble getting data from databasepublic java.util.List<java.lang.Long> getJobIDsForDuplicateReduction(long jobID) throws UnknownID
getJobIDsForDuplicateReduction
in class JobDAO
jobID
- The job ID to find duplicate reduction data for.
UnknownID
- if job ID is unknown
IOFailure
- on trouble querying databasepublic int getCountJobs()
getCountJobs
in class JobDAO
public long rescheduleJob(long oldJobID)
JobDAO
rescheduleJob
in class JobDAO
oldJobID
- ID of a job to reschedule
JobDAO.rescheduleJob(long)
public JobStatus getJobStatus(java.lang.Long jobID)
getJobStatus
in class JobDAO
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 |