org.opennms.reporting.core.svclayer.support
Class DefaultReportWrapperService

java.lang.Object
  extended by org.opennms.reporting.core.svclayer.support.DefaultReportWrapperService
All Implemented Interfaces:
ReportWrapperService

public class DefaultReportWrapperService
extends Object
implements ReportWrapperService

DefaultReportWrapperService class.

Version:
$Id: $
Author:
ranger

Constructor Summary
DefaultReportWrapperService()
          Constructor for DefaultReportWrapperService.
 
Method Summary
 DeliveryOptions getDeliveryOptions(String reportId, String userId)
          This method returns the delivery options for the report.
 List<ReportFormat> getFormats(String reportId)
          This method provides a list of formats supported by the report
 ReportParameters getParameters(String reportId)
          This method retrieves the runtime parameters taken by the report
 Boolean hasParameters(String reportId)
          This method is used to determine whether the report takes any parameters
 void render(String reportId, String location, ReportFormat format, OutputStream outputStream)
          This method renders the report into a given output stream.
 void run(ReportParameters parameters, ReportMode mode, DeliveryOptions deliveryOptions, String reportId)
          This method runs the report
 void runAndRender(ReportParameters parameters, ReportMode mode, OutputStream outputStream)
          This method runs the report and renders in into the given output stream with no intermediate steps
 void setReportServiceLocator(ReportServiceLocator reportServiceLocator)
          setReportServiceLocator
 void setReportStoreService(ReportStoreService reportStoreService)
          setReportStoreService
 boolean validate(ReportParameters parameters, String reportId)
          This method validates that the map of report parameters matches the report parameters accepted by the report.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultReportWrapperService

public DefaultReportWrapperService()

Constructor for DefaultReportWrapperService.

Method Detail

getDeliveryOptions

public DeliveryOptions getDeliveryOptions(String reportId,
                                          String userId)
This method returns the delivery options for the report. Providing a userID will allow the report service to pre-populate the destination address

Specified by:
getDeliveryOptions in interface ReportWrapperService
Parameters:
reportId - a String object.
userId - a String object.
Returns:
a delivery options object containing information that describes how the report might be delivered.

getFormats

public List<ReportFormat> getFormats(String reportId)
This method provides a list of formats supported by the report

Specified by:
getFormats in interface ReportWrapperService
Parameters:
reportId - reportId as defined in database-reports.xml
Returns:
a list of supported formats

getParameters

public ReportParameters getParameters(String reportId)
This method retrieves the runtime parameters taken by the report

Specified by:
getParameters in interface ReportWrapperService
Parameters:
reportId - a String object.
Returns:
a ReportParameters object containing the parameters taken by the report

hasParameters

public Boolean hasParameters(String reportId)
This method is used to determine whether the report takes any parameters

Specified by:
hasParameters in interface ReportWrapperService
Parameters:
reportId - a String object.
Returns:
true if the report takes parameters, false if not.

render

public void render(String reportId,
                   String location,
                   ReportFormat format,
                   OutputStream outputStream)
This method renders the report into a given output stream.

Specified by:
render in interface ReportWrapperService
Parameters:
reportId - reportId as defined in database-reports.xml
location - location of the report on disk
format - format to render the report
outputStream - stream to render the resulting report

run

public void run(ReportParameters parameters,
                ReportMode mode,
                DeliveryOptions deliveryOptions,
                String reportId)
This method runs the report

Specified by:
run in interface ReportWrapperService
Parameters:
parameters - runtime report parameters
mode - in which to run the report (ONLINE, BATCH or IMMEDIATE)
deliveryOptions - delivery options for the report
reportId - reportId as defined in database-reports.xml

validate

public boolean validate(ReportParameters parameters,
                        String reportId)
This method validates that the map of report parameters matches the report parameters accepted by the report. Used by the web interface.

Specified by:
validate in interface ReportWrapperService
Parameters:
parameters - runtime report parameters
reportId - reportId as defined in database-reports.xml
Returns:
true if the reportParms supplied match those in the report definition.

setReportServiceLocator

public void setReportServiceLocator(ReportServiceLocator reportServiceLocator)

setReportServiceLocator

Parameters:
reportServiceLocator - a ReportServiceLocator object.

setReportStoreService

public void setReportStoreService(ReportStoreService reportStoreService)

setReportStoreService

Parameters:
reportStoreService - a ReportStoreService object.

runAndRender

public void runAndRender(ReportParameters parameters,
                         ReportMode mode,
                         OutputStream outputStream)
This method runs the report and renders in into the given output stream with no intermediate steps

Specified by:
runAndRender in interface ReportWrapperService
Parameters:
parameters - runtime report parameters
mode - in which to run the report (ONLINE, BATCH or IMMEDIATE)
outputStream - stream to render the resulting report


Copyright © 2011. All Rights Reserved.