Class PrintJob

java.lang.Object
org.mapfish.print.servlet.job.PrintJob
All Implemented Interfaces:
Callable<PrintJobResult>
Direct Known Subclasses:
FilePrintJob, HibernatePrintJob

public abstract class PrintJob extends Object implements Callable<PrintJobResult>
The information for printing a report.
  • Constructor Details

    • PrintJob

      public PrintJob()
  • Method Details

    • getEntry

      public final PrintJobEntry getEntry()
    • setEntry

      public final void setEntry(PrintJobEntry entry)
    • getReportFile

      protected File getReportFile()
    • withOpenOutputStream

      protected PrintJob.PrintResult withOpenOutputStream(PrintJob.PrintAction function) throws Exception
      Open an OutputStream and execute the function using the OutputStream.
      Parameters:
      function - the function to execute
      Returns:
      the URI and the file size
      Throws:
      Exception
    • createResult

      protected abstract PrintJobResult createResult(String fileName, String fileExtension, String mimeType) throws URISyntaxException, IOException
      Create Print Job Result.
      Parameters:
      fileName - the file name
      fileExtension - the file extension
      mimeType - the mime type
      Returns:
      the job result
      Throws:
      URISyntaxException
      IOException
    • call

      public PrintJobResult call() throws Exception
      Specified by:
      call in interface Callable<PrintJobResult>
      Throws:
      Exception
    • deleteReport

      protected void deleteReport()
      Delete the report (used if the report is sent by email).
    • setSecurityContext

      public final void setSecurityContext(org.springframework.security.core.context.SecurityContext securityContext)
      The security context that contains the information about the user that made the request. This must be set on SecurityContextHolder when the thread starts executing.
      Parameters:
      securityContext - the context object