Class PrintJobDao
java.lang.Object
org.mapfish.print.servlet.job.impl.hibernate.PrintJobDao
JobEntryDao.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal voidCancel old waiting jobs.final longcount(PrintJobStatus.Status... statuses) voidDelete a record.final intdeleteOld(long checkTimeThreshold) Delete old jobs.final PrintJobStatusExtImplGet Job Record.final PrintJobStatusExtImplGet Job Record.final List<PrintJobStatusExtImpl> get(PrintJobStatus.Status... statuses) final PrintJobResultExtImplGet result report.final longfinal Objectget specific property value of job.final voidinit()Initialize db manager.final List<PrintJobStatusExtImpl> poll(int size) Poll for the next N waiting jobs in line.final voidsave(PrintJobStatusExtImpl entry) Save Job Record.final voidupdateLastCheckTime(String id, long lastCheckTime) Update the lastCheckTime of the given record.
-
Constructor Details
-
PrintJobDao
public PrintJobDao()
-
-
Method Details
-
init
@PostConstruct public final void init()Initialize db manager. -
save
Save Job Record.- Parameters:
entry- the entry
-
get
Get Job Record.- Parameters:
id- the id- Returns:
- the job
-
get
Get Job Record.- Parameters:
id- the idlock- whether record should be locked for transaction- Returns:
- the job status or null.
-
getValue
get specific property value of job.- Parameters:
id- the idproperty- the property name/path- Returns:
- the property value
-
count
- Parameters:
statuses- the statuses to include (or none if all)- Returns:
- the total amount of jobs
-
get
- Parameters:
statuses- the statuses to include (or none if all)- Returns:
- the jobs
-
getTotalTimeSpentPrinting
public final long getTotalTimeSpentPrinting()- Returns:
- total time spent printing
-
cancelOld
Cancel old waiting jobs.- Parameters:
starttimeThreshold- threshold for start timecheckTimeThreshold- threshold for last check timemessage- the error message
-
updateLastCheckTime
Update the lastCheckTime of the given record.- Parameters:
id- the idlastCheckTime- the new value
-
deleteOld
public final int deleteOld(long checkTimeThreshold) Delete old jobs.- Parameters:
checkTimeThreshold- threshold for last check time- Returns:
- the number of jobs deleted
-
poll
Poll for the next N waiting jobs in line.- Parameters:
size- maximum amount of jobs to poll for- Returns:
- up to "size" jobs
-
getResult
Get result report.- Parameters:
reportURI- the URI of the report- Returns:
- the result report.
-
delete
Delete a record.- Parameters:
referenceId- the reference ID.
-