Class RegistryJobQueue
java.lang.Object
org.mapfish.print.servlet.job.impl.RegistryJobQueue
- All Implemented Interfaces:
JobQueue
Job Queue that uses Registry.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal void
add
(PrintJobEntry jobEntry) Add new job entry to the queue.final void
Mark job as canceling (if running) or canceled (if waiting / finished).final void
Cancel old WAITING tasks.void
Delete the job.final void
done
(String referenceId, PrintJobResult result) Mark job as done.final void
Mark job as failed.final PrintJobStatusImpl
Return the completed job object if the job has completed or absent otherwise.final long
Get the average time print jobs take to complete.final long
Get the number of prints that finished (either by error or success).final long
Get the total number of print requests made.final long
Return the amount of time the queue will keep an entry before purging the record.final long
Get the total number of waiting/running jobs.final List<? extends PrintJobStatus>
start
(int number) Start the next [N] number of jobs at once.final void
Mark job as running.final long
timeSinceLastStatusCheck
(String referenceId) Get the time since a client has last requested the print job.final List<? extends PrintJobStatus>
toCancel()
Get the jobs that are marked as "CANCELING" and must be canceled.
-
Constructor Details
-
RegistryJobQueue
public RegistryJobQueue()
-
-
Method Details
-
getTimeToKeepAfterAccessInMillis
public final long getTimeToKeepAfterAccessInMillis()Description copied from interface:JobQueue
Return the amount of time the queue will keep an entry before purging the record.- Specified by:
getTimeToKeepAfterAccessInMillis
in interfaceJobQueue
- 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.
-
add
Description copied from interface:JobQueue
Add new job entry to the queue. -
start
Description copied from interface:JobQueue
Mark job as running.- Specified by:
start
in interfaceJobQueue
- Parameters:
referenceId
- reference id to the job to start.- Throws:
NoSuchReferenceException
-
done
Description copied from interface:JobQueue
Mark job as done.- Specified by:
done
in interfaceJobQueue
- Parameters:
referenceId
- reference id to the job that is done.result
- the result of the print job- Throws:
NoSuchReferenceException
-
cancel
public final void cancel(String referenceId, String message, boolean forceFinal) throws NoSuchReferenceException Description copied from interface:JobQueue
Mark job as canceling (if running) or canceled (if waiting / finished).- Specified by:
cancel
in interfaceJobQueue
- Parameters:
referenceId
- reference id to the job that has failed.message
- the error messageforceFinal
- finalize, even if status is running- Throws:
NoSuchReferenceException
-
fail
Description copied from interface:JobQueue
Mark job as failed.- Specified by:
fail
in interfaceJobQueue
- Parameters:
referenceId
- reference id to the job that has failed.message
- the error message- Throws:
NoSuchReferenceException
-
getNumberOfRequestsMade
public final long getNumberOfRequestsMade()Description copied from interface:JobQueue
Get the total number of print requests made.- Specified by:
getNumberOfRequestsMade
in interfaceJobQueue
-
timeSinceLastStatusCheck
Description copied from interface:JobQueue
Get the time since a client has last requested the print job.- Specified by:
timeSinceLastStatusCheck
in interfaceJobQueue
- Parameters:
referenceId
- the id of the print job
-
getAverageTimeSpentPrinting
public final long getAverageTimeSpentPrinting()Description copied from interface:JobQueue
Get the average time print jobs take to complete.- Specified by:
getAverageTimeSpentPrinting
in interfaceJobQueue
-
getLastPrintCount
public final long getLastPrintCount()Description copied from interface:JobQueue
Get the number of prints that finished (either by error or success).- Specified by:
getLastPrintCount
in interfaceJobQueue
-
getWaitingJobsCount
public final long getWaitingJobsCount()Description copied from interface:JobQueue
Get the total number of waiting/running jobs.- Specified by:
getWaitingJobsCount
in interfaceJobQueue
-
get
public final PrintJobStatusImpl get(String referenceId, boolean external) throws NoSuchReferenceException Description copied from interface:JobQueue
Return the completed job object if the job has completed or absent otherwise.- Specified by:
get
in interfaceJobQueue
- Parameters:
referenceId
- the referenceId of the report to lookupexternal
- true if external status request- Throws:
NoSuchReferenceException
-
cancelOld
Description copied from interface:JobQueue
Cancel old WAITING tasks. -
start
Description copied from interface:JobQueue
Start the next [N] number of jobs at once. -
toCancel
Description copied from interface:JobQueue
Get the jobs that are marked as "CANCELING" and must be canceled. -
delete
Description copied from interface:JobQueue
Delete the job.
-