Class AbstractReportProcessTask
- java.lang.Object
-
- org.pentaho.reporting.engine.classic.core.AbstractReportProcessTask
-
- All Implemented Interfaces:
Runnable
,ReportProcessTask
- Direct Known Subclasses:
AbstractMultiStreamReportProcessTask
,FlowExcelReportProcessTask
,FlowRTFReportProcessTask
,FlowXExcelReportProcessTask
,Graphics2DReportProcessTask
,PageableExcelReportProcessTask
,PageableXExcelReportProcessTask
,PageableXmlReportProcessTask
,PdfReportProcessTask
,PlainTextReportProcessTask
,StreamCSVReportProcessTask
,StreamExcelReportProcessTask
,StreamRTFReportProcessTask
,StreamXExcelReportProcessTask
,TableXmlReportProcessTask
,ZipHtmlReportProcessTask
public abstract class AbstractReportProcessTask extends Object implements ReportProcessTask
A base class for common report process task implementations.- Author:
- Thomas Morgner
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractReportProcessTask()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addReportProgressListener(ReportProgressListener listener)
Adds a report progress listener that is able to monitor the export progress.org.pentaho.reporting.libraries.repository.ContentLocation
getBodyContentLocation()
Returns the content location for the generated document.org.pentaho.reporting.libraries.repository.NameGenerator
getBodyNameGenerator()
Returns the name generator for the report document.Throwable
getError()
Returns any error that has caused the report export to fail.MasterReport
getReport()
Returns the report that will be executed in this task.protected ReportProgressListener[]
getReportProgressListeners()
Returns all progress listeners that are registered on this ProcessTask implementation.boolean
isTaskAborted()
Checks whether the task was aborted.boolean
isTaskSuccessful()
Checks whether the export was successful.boolean
isValid()
Returns if the task is configured in a way that the export can be safely started.void
removeReportProgressListener(ReportProgressListener listener)
Removes the given report progress listener from the list of listeners.void
setBodyContentLocation(org.pentaho.reporting.libraries.repository.ContentLocation bodyContentLocation)
Defines the content location (and implicitly the repository) for the generated report document.void
setBodyNameGenerator(org.pentaho.reporting.libraries.repository.NameGenerator bodyNameGenerator)
Defines the body name generator, that generates name sequences in case the target name is already taken.protected void
setError(Throwable error)
Updates the error cause.void
setReport(MasterReport report)
Defines the report that will be executed in this task.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.pentaho.reporting.engine.classic.core.ReportProcessTask
getReportMimeType
-
-
-
-
Method Detail
-
getBodyContentLocation
public org.pentaho.reporting.libraries.repository.ContentLocation getBodyContentLocation()
Returns the content location for the generated document.- Specified by:
getBodyContentLocation
in interfaceReportProcessTask
- Returns:
- the content location where the generated document of the report will be stored.
-
setBodyContentLocation
public void setBodyContentLocation(org.pentaho.reporting.libraries.repository.ContentLocation bodyContentLocation)
Defines the content location (and implicitly the repository) for the generated report document.- Specified by:
setBodyContentLocation
in interfaceReportProcessTask
- Parameters:
bodyContentLocation
- the content location for the report document.
-
getBodyNameGenerator
public org.pentaho.reporting.libraries.repository.NameGenerator getBodyNameGenerator()
Returns the name generator for the report document.- Specified by:
getBodyNameGenerator
in interfaceReportProcessTask
- Returns:
- the name generator.
-
setBodyNameGenerator
public void setBodyNameGenerator(org.pentaho.reporting.libraries.repository.NameGenerator bodyNameGenerator)
Defines the body name generator, that generates name sequences in case the target name is already taken. The given namegenerator should return the first-choice document name as first generated name.- Specified by:
setBodyNameGenerator
in interfaceReportProcessTask
- Parameters:
bodyNameGenerator
- the name generator.
-
getReport
public MasterReport getReport()
Returns the report that will be executed in this task.- Specified by:
getReport
in interfaceReportProcessTask
- Returns:
- the report.
-
setReport
public void setReport(MasterReport report)
Defines the report that will be executed in this task. It is assumed that the report is fully parametrized. Report processing will fail if the report requires parameters that are not given.- Specified by:
setReport
in interfaceReportProcessTask
- Parameters:
report
- the report.
-
addReportProgressListener
public void addReportProgressListener(ReportProgressListener listener)
Adds a report progress listener that is able to monitor the export progress.- Specified by:
addReportProgressListener
in interfaceReportProcessTask
- Parameters:
listener
- the listener.
-
removeReportProgressListener
public void removeReportProgressListener(ReportProgressListener listener)
Removes the given report progress listener from the list of listeners.- Specified by:
removeReportProgressListener
in interfaceReportProcessTask
- Parameters:
listener
- the listener.
-
getReportProgressListeners
protected ReportProgressListener[] getReportProgressListeners()
Returns all progress listeners that are registered on this ProcessTask implementation.- Returns:
- all registered listeners.
-
getError
public Throwable getError()
Returns any error that has caused the report export to fail.- Specified by:
getError
in interfaceReportProcessTask
- Returns:
- the error that caused a failure, or
null
if there was no error.
-
setError
protected void setError(Throwable error)
Updates the error cause.- Parameters:
error
- the error.
-
isTaskAborted
public boolean isTaskAborted()
Checks whether the task was aborted. Tasks can be aborted by signaling "interrupt()" to the executing thread.- Specified by:
isTaskAborted
in interfaceReportProcessTask
- Returns:
- true, if the task was aborted, false otherwise.
-
isTaskSuccessful
public boolean isTaskSuccessful()
Checks whether the export was successful. An aborted task cannot be successfull.- Specified by:
isTaskSuccessful
in interfaceReportProcessTask
- Returns:
- true, if the report was exported successfully, false otherwise.
-
isValid
public boolean isValid()
Returns if the task is configured in a way that the export can be safely started.- Specified by:
isValid
in interfaceReportProcessTask
- Returns:
- true, if the task is valid and can be started, false otherwise.
-
-