public interface JobQueue
| Modifier and Type | Method and Description |
|---|---|
void |
add(PrintJobEntry jobEntry)
Add new job entry to the queue.
|
void |
cancel(java.lang.String referenceId,
java.lang.String message,
boolean forceFinal)
Mark job as canceling (if running) or cancelled (if waiting / finished).
|
void |
cancelOld(long startTimeOut,
long abandonTimeout,
java.lang.String message)
Cancel old WAITING tasks.
|
void |
done(java.lang.String referenceId,
PrintJobResult result)
Mark job as done.
|
void |
fail(java.lang.String referenceId,
java.lang.String message)
Mark job as failed.
|
PrintJobStatus |
get(java.lang.String referenceId,
boolean external)
Return the completed job object if the job has completed or absent otherwise.
|
long |
getAverageTimeSpentPrinting()
Get the average time print jobs take to complete.
|
int |
getLastPrintCount()
Get the number of prints that finished (either by error or success).
|
int |
getNumberOfRequestsMade()
Get the total number of print requests made.
|
long |
getTimeToKeepAfterAccessInMillis()
Return the amount of time the queue will keep an entry before purging the record.
|
int |
getWaitingJobsCount()
Get the total number of waiting/running jobs.
|
java.util.List<? extends PrintJobStatus> |
start(int number)
Start the next [N] number of jobs at once.
|
void |
start(java.lang.String referenceId)
Mark job as running.
|
long |
timeSinceLastStatusCheck(java.lang.String referenceId)
Get the time since a client has last requested the print job.
|
java.util.List<? extends PrintJobStatus> |
toCancel()
Get the jobs that are marked as "CANCELING" and must be cancelled.
|
long getTimeToKeepAfterAccessInMillis()
int getLastPrintCount()
long getAverageTimeSpentPrinting()
int getNumberOfRequestsMade()
long timeSinceLastStatusCheck(java.lang.String referenceId)
referenceId - the id of the print jobint getWaitingJobsCount()
PrintJobStatus get(java.lang.String referenceId, boolean external) throws NoSuchReferenceException
referenceId - the referenceId of the report to lookupexternal - true if external status requestNoSuchReferenceExceptionvoid add(PrintJobEntry jobEntry)
jobEntry - the job to run.void cancel(java.lang.String referenceId,
java.lang.String message,
boolean forceFinal)
throws NoSuchReferenceException
referenceId - reference id to the job that has failed.message - the error messageforceFinal - finalize, even if status is runningNoSuchReferenceExceptionvoid fail(java.lang.String referenceId,
java.lang.String message)
throws NoSuchReferenceException
referenceId - reference id to the job that has failed.message - the error messageNoSuchReferenceExceptionvoid start(java.lang.String referenceId)
throws NoSuchReferenceException
referenceId - reference id to the job to start.NoSuchReferenceExceptionvoid done(java.lang.String referenceId,
PrintJobResult result)
throws NoSuchReferenceException
referenceId - reference id to the job that is done.result - the result of the print jobNoSuchReferenceExceptionvoid cancelOld(long startTimeOut,
long abandonTimeout,
java.lang.String message)
startTimeOut - time-out value from when job startedabandonTimeout - time-out value form last status requestmessage - error messagejava.util.List<? extends PrintJobStatus> start(int number)
number - the number of jobs to startjava.util.List<? extends PrintJobStatus> toCancel()