java.lang.Object
org.mapfish.print.servlet.job.impl.hibernate.PrintJobDao

public class PrintJobDao extends Object
JobEntryDao.
  • Constructor Details

    • PrintJobDao

      public PrintJobDao()
  • Method Details

    • init

      @PostConstruct public final void init()
      Initialize db manager.
    • save

      public final void save(PrintJobStatusExtImpl entry)
      Save Job Record.
      Parameters:
      entry - the entry
    • get

      @Nullable public final PrintJobStatusExtImpl get(String id)
      Get Job Record.
      Parameters:
      id - the id
      Returns:
      the job
    • get

      @Nullable public final PrintJobStatusExtImpl get(String id, boolean lock)
      Get Job Record.
      Parameters:
      id - the id
      lock - whether record should be locked for transaction
      Returns:
      the job status or null.
    • getValue

      public final Object getValue(String id, String property)
      get specific property value of job.
      Parameters:
      id - the id
      property - the property name/path
      Returns:
      the property value
    • count

      public final long count(PrintJobStatus.Status... statuses)
      Parameters:
      statuses - the statuses to include (or none if all)
      Returns:
      the total amount of jobs
    • get

      public final List<PrintJobStatusExtImpl> get(PrintJobStatus.Status... statuses)
      Parameters:
      statuses - the statuses to include (or none if all)
      Returns:
      the jobs
    • getTotalTimeSpentPrinting

      public final long getTotalTimeSpentPrinting()
      Returns:
      total time spent printing
    • cancelOld

      public final void cancelOld(long starttimeThreshold, long checkTimeThreshold, String message)
      Cancel old waiting jobs.
      Parameters:
      starttimeThreshold - threshold for start time
      checkTimeThreshold - threshold for last check time
      message - the error message
    • updateLastCheckTime

      public final void updateLastCheckTime(String id, long lastCheckTime)
      Update the lastCheckTime of the given record.
      Parameters:
      id - the id
      lastCheckTime - 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

      public final List<PrintJobStatusExtImpl> poll(int size)
      Poll for the next N waiting jobs in line.
      Parameters:
      size - maximum amount of jobs to poll for
      Returns:
      up to "size" jobs
    • getResult

      public final PrintJobResultExtImpl getResult(URI reportURI)
      Get result report.
      Parameters:
      reportURI - the URI of the report
      Returns:
      the result report.
    • delete

      public void delete(String referenceId)
      Delete a record.
      Parameters:
      referenceId - the reference ID.