Package org.mapfish.print.servlet.job
Interface JobQueue
- All Known Implementing Classes:
HibernateJobQueue
,RegistryJobQueue
public interface JobQueue
Manages the Statuses of the Print Jobs. Should not be used directly unless by Job Manager.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
add
(PrintJobEntry jobEntry) Add new job entry to the queue.void
Mark job as canceling (if running) or canceled (if waiting / finished).void
Cancel old WAITING tasks.void
Delete the job.void
done
(String referenceId, PrintJobResult result) Mark job as done.void
Mark job as failed.Return the completed job object if the job has completed or absent otherwise.long
Get the average time print jobs take to complete.long
Get the number of prints that finished (either by error or success).long
Get the total number of print requests made.long
Return the amount of time the queue will keep an entry before purging the record.long
Get the total number of waiting/running jobs.List<? extends PrintJobStatus>
start
(int number) Start the next [N] number of jobs at once.void
Mark job as running.long
timeSinceLastStatusCheck
(String referenceId) Get the time since a client has last requested the print job.List<? extends PrintJobStatus>
toCancel()
Get the jobs that are marked as "CANCELING" and must be canceled.
-
Method Details
-
getTimeToKeepAfterAccessInMillis
long getTimeToKeepAfterAccessInMillis()Return the amount of time the queue will keep an entry before purging the record.- Returns:
- the number of milliseconds between the last access of a record and the time when a record can be purged from the registry. -1 if there it is unlimited.
-
getLastPrintCount
long getLastPrintCount()Get the number of prints that finished (either by error or success). -
getAverageTimeSpentPrinting
long getAverageTimeSpentPrinting()Get the average time print jobs take to complete. -
getNumberOfRequestsMade
long getNumberOfRequestsMade()Get the total number of print requests made. -
timeSinceLastStatusCheck
Get the time since a client has last requested the print job.- Parameters:
referenceId
- the id of the print job
-
getWaitingJobsCount
long getWaitingJobsCount()Get the total number of waiting/running jobs. -
get
Return the completed job object if the job has completed or absent otherwise.- Parameters:
referenceId
- the referenceId of the report to lookupexternal
- true if external status request- Throws:
NoSuchReferenceException
-
add
Add new job entry to the queue.- Parameters:
jobEntry
- the job to run.
-
cancel
Mark job as canceling (if running) or canceled (if waiting / finished).- Parameters:
referenceId
- reference id to the job that has failed.message
- the error messageforceFinal
- finalize, even if status is running- Throws:
NoSuchReferenceException
-
fail
Mark job as failed.- Parameters:
referenceId
- reference id to the job that has failed.message
- the error message- Throws:
NoSuchReferenceException
-
start
Mark job as running.- Parameters:
referenceId
- reference id to the job to start.- Throws:
NoSuchReferenceException
-
done
Mark job as done.- Parameters:
referenceId
- reference id to the job that is done.result
- the result of the print job- Throws:
NoSuchReferenceException
-
cancelOld
Cancel old WAITING tasks.- Parameters:
startTimeOut
- time-out value from when job startedabandonTimeout
- time-out value form last status requestmessage
- error message
-
start
Start the next [N] number of jobs at once.- Parameters:
number
- the number of jobs to start- Returns:
- the jobs that were just started
-
toCancel
List<? extends PrintJobStatus> toCancel()Get the jobs that are marked as "CANCELING" and must be canceled. -
delete
Delete the job.- Parameters:
referenceId
- reference id to the job.
-