Class PrintJobDao
java.lang.Object
org.mapfish.print.servlet.job.impl.hibernate.PrintJobDao
JobEntryDao.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal void
Cancel old waiting jobs.final long
count
(PrintJobStatus.Status... statuses) void
Delete a record.final int
deleteOld
(long checkTimeThreshold) Delete old jobs.final PrintJobStatusExtImpl
Get Job Record.final PrintJobStatusExtImpl
Get Job Record.final List<PrintJobStatusExtImpl>
get
(PrintJobStatus.Status... statuses) final PrintJobResultExtImpl
Get result report.final long
final Object
get specific property value of job.final void
init()
Initialize db manager.final List<PrintJobStatusExtImpl>
poll
(int size) Poll for the next N waiting jobs in line.final void
save
(PrintJobStatusExtImpl entry) Save Job Record.final void
updateLastCheckTime
(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.
-