org.pentaho.reporting.engine.classic.core
Class AbstractReportProcessTask

java.lang.Object
  extended by 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, ZipHtmpReportProcessTask

public abstract class AbstractReportProcessTask
extends Object
implements ReportProcessTask

A base class for common report process task implementations.

Author:
Thomas Morgner

Method Summary
 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.
 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.
 void setReport(MasterReport report)
          Defines the report that will be executed in this task.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.pentaho.reporting.engine.classic.core.ReportProcessTask
getReportMimeType
 
Methods inherited from interface java.lang.Runnable
run
 

Method Detail

getBodyContentLocation

public org.pentaho.reporting.libraries.repository.ContentLocation getBodyContentLocation()
Returns the content location for the generated document.

Specified by:
getBodyContentLocation in interface ReportProcessTask
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 interface ReportProcessTask
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 interface ReportProcessTask
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 interface ReportProcessTask
Parameters:
bodyNameGenerator - the name generator.

getReport

public MasterReport getReport()
Returns the report that will be executed in this task.

Specified by:
getReport in interface ReportProcessTask
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 interface ReportProcessTask
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 interface ReportProcessTask
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 interface ReportProcessTask
Parameters:
listener - the listener.

getError

public Throwable getError()
Returns any error that has caused the report export to fail.

Specified by:
getError in interface ReportProcessTask
Returns:
the error that caused a failure, or null if there was no 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 interface ReportProcessTask
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 interface ReportProcessTask
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 interface ReportProcessTask
Returns:
true, if the task is valid and can be started, false otherwise.