org.opennms.reporting.core.svclayer
Interface ReportWrapperService

All Known Implementing Classes:
DefaultReportWrapperService

public interface ReportWrapperService

Interface that finds and executes individual reportServices. Always run a report service via this wrapper as the implementation will find the correct service for the reportId and wrap it as necessary.

Version:
$Id: $
Author:
Jonathan Sartin

Method Summary
 DeliveryOptions getDeliveryOptions(String userId, String reportId)
          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
 boolean validate(ReportParameters parameters, String reportId)
          This method validates that the map of report parameters matches the report parameters accepted by the report.
 

Method Detail

validate

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.

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.

run

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

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

getDeliveryOptions

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

Parameters:
userId - a String object.
reportId - a String object.
Returns:
a delivery options object containing information that describes how the report might be delivered.

getFormats

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

Parameters:
reportId - reportId as defined in database-reports.xml
Returns:
a list of supported formats

runAndRender

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

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

render

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

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

hasParameters

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

Parameters:
ReportId - a String object.
Returns:
true if the report takes parameters, false if not.

getParameters

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

Parameters:
ReportId - a String object.
Returns:
a ReportParameters object containing the parameters taken by the report


Copyright © 2011. All Rights Reserved.