| Constructor and Description |
|---|
HibernateJobQueue() |
| 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.
|
void |
init()
Called by spring on initialization.
|
void |
setTimeToKeepAfterAccessInMinutes(int timeToKeepAfterAccessInMinutes) |
void |
shutdown()
Called by spring when application context is being destroyed.
|
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.
|
public final void setTimeToKeepAfterAccessInMinutes(int timeToKeepAfterAccessInMinutes)
public final long getTimeToKeepAfterAccessInMillis()
JobQueuegetTimeToKeepAfterAccessInMillis in interface JobQueuepublic final int getLastPrintCount()
JobQueuegetLastPrintCount in interface JobQueuepublic final int getWaitingJobsCount()
JobQueuegetWaitingJobsCount in interface JobQueuepublic final int getNumberOfRequestsMade()
JobQueuegetNumberOfRequestsMade in interface JobQueuepublic final long getAverageTimeSpentPrinting()
JobQueuegetAverageTimeSpentPrinting in interface JobQueue@Transactional(readOnly=true) public final long timeSinceLastStatusCheck(java.lang.String referenceId)
JobQueuetimeSinceLastStatusCheck in interface JobQueuereferenceId - the id of the print jobpublic final PrintJobStatus get(java.lang.String referenceId, boolean external) throws NoSuchReferenceException
JobQueueget in interface JobQueuereferenceId - the referenceId of the report to lookupexternal - true if external status requestNoSuchReferenceExceptionpublic final void add(PrintJobEntry jobEntry)
JobQueuepublic final void cancel(java.lang.String referenceId,
java.lang.String message,
boolean forceFinal)
throws NoSuchReferenceException
JobQueuecancel in interface JobQueuereferenceId - reference id to the job that has failed.message - the error messageforceFinal - finalize, even if status is runningNoSuchReferenceExceptionpublic final void fail(java.lang.String referenceId,
java.lang.String message)
throws NoSuchReferenceException
JobQueuefail in interface JobQueuereferenceId - reference id to the job that has failed.message - the error messageNoSuchReferenceExceptionpublic final void start(java.lang.String referenceId)
throws NoSuchReferenceException
JobQueuestart in interface JobQueuereferenceId - reference id to the job to start.NoSuchReferenceExceptionpublic final void done(java.lang.String referenceId,
PrintJobResult result)
throws NoSuchReferenceException
JobQueuedone in interface JobQueuereferenceId - reference id to the job that is done.result - the result of the print jobNoSuchReferenceExceptionpublic final void cancelOld(long startTimeOut,
long abandonTimeout,
java.lang.String message)
JobQueuepublic final java.util.List<? extends PrintJobStatus> start(int number)
JobQueuepublic final java.util.List<? extends PrintJobStatus> toCancel()
JobQueue@PostConstruct public final void init()
@PreDestroy public final void shutdown()