Package org.mapfish.print.servlet.job
Class PrintJob
java.lang.Object
org.mapfish.print.servlet.job.PrintJob
- All Implemented Interfaces:
Callable<PrintJobResult>
- Direct Known Subclasses:
FilePrintJob,HibernatePrintJob
The information for printing a report.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static interfaceInterface encapsulating the code to run with the open output stream.static final recordHolds the info that goes with the result of a print. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncall()protected abstract PrintJobResultcreateResult(String fileName, String fileExtension, String mimeType) Create Print Job Result.protected voidDelete the report (used if the report is sent by email).final PrintJobEntrygetEntry()protected Filefinal voidsetEntry(PrintJobEntry entry) final voidsetSecurityContext(org.springframework.security.core.context.SecurityContext securityContext) The security context that contains the information about the user that made the request.protected PrintJob.PrintResultwithOpenOutputStream(PrintJob.PrintAction function) Open an OutputStream and execute the function using the OutputStream.
-
Constructor Details
-
PrintJob
public PrintJob()
-
-
Method Details
-
getEntry
-
setEntry
-
getReportFile
-
withOpenOutputStream
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 namefileExtension- the file extensionmimeType- the mime type- Returns:
- the job result
- Throws:
URISyntaxExceptionIOException
-
call
- Specified by:
callin interfaceCallable<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 onSecurityContextHolderwhen the thread starts executing.- Parameters:
securityContext- the context object
-