Class DefaultReportWrapperService
- java.lang.Object
-
- org.opennms.reporting.core.svclayer.support.DefaultReportWrapperService
-
- All Implemented Interfaces:
ReportWrapperService
public class DefaultReportWrapperService extends Object implements ReportWrapperService
-
-
Constructor Summary
Constructors Constructor Description DefaultReportWrapperService()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description 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 reportReportParameters
getParameters(String reportId)
This method retrieves the runtime parameters taken by the reportBoolean
hasParameters(String reportId)
This method is used to determine whether the report takes any parametersvoid
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 reportvoid
runAndRender(ReportParameters parameters, ReportMode mode, OutputStream outputStream)
This method runs the report and renders in into the given output stream with no intermediate stepsvoid
setReportServiceLocator(ReportServiceLocator reportServiceLocator)
setReportServiceLocatorvoid
setReportStoreService(ReportStoreService reportStoreService)
setReportStoreServiceprotected static String
substituteUrl(String url, Map<String,Object> parameters)
protected static String
substituteUrl(String url, DeliveryOptions deliveryOptions, Map<String,Object> reportParameters)
-
-
-
Method Detail
-
getFormats
public List<ReportFormat> getFormats(String reportId)
This method provides a list of formats supported by the report- Specified by:
getFormats
in interfaceReportWrapperService
- Parameters:
reportId
- reportId as defined in database-reports.xml- Returns:
- a list of supported formats
-
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 interfaceReportWrapperService
- Parameters:
reportId
- aString
object.userId
- aString
object.- Returns:
- a delivery options object containing information that describes how the report might be delivered.
-
getParameters
public ReportParameters getParameters(String reportId)
This method retrieves the runtime parameters taken by the report- Specified by:
getParameters
in interfaceReportWrapperService
- Parameters:
reportId
- aString
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 interfaceReportWrapperService
- Parameters:
reportId
- aString
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 interfaceReportWrapperService
- Parameters:
reportId
- reportId as defined in database-reports.xmllocation
- location of the report on diskformat
- format to render the reportoutputStream
- 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 interfaceReportWrapperService
- Parameters:
parameters
- runtime report parametersmode
- in which to run the report (ONLINE, BATCH or IMMEDIATE)deliveryOptions
- delivery options for the reportreportId
- reportId as defined in database-reports.xml
-
substituteUrl
protected static String substituteUrl(String url, DeliveryOptions deliveryOptions, Map<String,Object> reportParameters)
-
setReportServiceLocator
public void setReportServiceLocator(ReportServiceLocator reportServiceLocator)
setReportServiceLocator
- Parameters:
reportServiceLocator
- aReportServiceLocator
object.
-
setReportStoreService
public void setReportStoreService(ReportStoreService reportStoreService)
setReportStoreService
- Parameters:
reportStoreService
- aReportStoreService
object.
-
runAndRender
public void runAndRender(ReportParameters parameters, ReportMode mode, OutputStream outputStream) throws ReportException
This method runs the report and renders in into the given output stream with no intermediate steps- Specified by:
runAndRender
in interfaceReportWrapperService
- Parameters:
parameters
- runtime report parametersmode
- in which to run the report (ONLINE, BATCH or IMMEDIATE)outputStream
- stream to render the resulting report- Throws:
ReportException
-
-