Package org.mapfish.print.servlet.job
Class PrintJob
- java.lang.Object
-
- org.mapfish.print.servlet.job.PrintJob
-
- All Implemented Interfaces:
java.util.concurrent.Callable<PrintJobResult>
- Direct Known Subclasses:
FilePrintJob
,HibernatePrintJob
public abstract class PrintJob extends java.lang.Object implements java.util.concurrent.Callable<PrintJobResult>
The information for printing a report.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static interface
PrintJob.PrintAction
Interface encapsulating the code to run with the open output stream.static class
PrintJob.PrintResult
Holds the info that goes with the result of a print.
-
Constructor Summary
Constructors Constructor Description PrintJob()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description PrintJobResult
call()
protected abstract PrintJobResult
createResult(java.lang.String fileName, java.lang.String fileExtension, java.lang.String mimeType)
Create Print Job Result.protected void
deleteReport()
Delete the report (used if the report is sent by email).PrintJobEntry
getEntry()
protected java.io.File
getReportFile()
void
setEntry(PrintJobEntry entry)
void
setSecurityContext(org.springframework.security.core.context.SecurityContext securityContext)
The security context that contains the information about the user that made the request.protected PrintJob.PrintResult
withOpenOutputStream(PrintJob.PrintAction function)
Open an OutputStream and execute the function using the OutputStream.
-
-
-
Method Detail
-
getEntry
public final PrintJobEntry getEntry()
-
setEntry
public final void setEntry(PrintJobEntry entry)
-
getReportFile
protected java.io.File getReportFile()
-
withOpenOutputStream
protected PrintJob.PrintResult withOpenOutputStream(PrintJob.PrintAction function) throws java.lang.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:
java.lang.Exception
-
createResult
protected abstract PrintJobResult createResult(java.lang.String fileName, java.lang.String fileExtension, java.lang.String mimeType) throws java.net.URISyntaxException, java.io.IOException
Create Print Job Result.- Parameters:
fileName
- the file namefileExtension
- the file extensionmimeType
- the mime type- Returns:
- the job result
- Throws:
java.net.URISyntaxException
java.io.IOException
-
call
public final PrintJobResult call() throws java.lang.Exception
- Specified by:
call
in interfacejava.util.concurrent.Callable<PrintJobResult>
- Throws:
java.lang.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 onSecurityContextHolder
when the thread starts executing.- Parameters:
securityContext
- the context object
-
-