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 interface
Interface encapsulating the code to run with the open output stream.static class
Holds the info that goes with the result of a print. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncall()
protected abstract PrintJobResult
createResult
(String fileName, String fileExtension, String mimeType) Create Print Job Result.protected void
Delete the report (used if the report is sent by email).final PrintJobEntry
getEntry()
protected File
final void
setEntry
(PrintJobEntry entry) final 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.
-
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:
URISyntaxException
IOException
-
call
- Specified by:
call
in 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 onSecurityContextHolder
when the thread starts executing.- Parameters:
securityContext
- the context object
-