Package com.morpheusdata.core
Interface MorpheusReportService
public interface MorpheusReportService
The Report Context Provides callbacks for Morpheus Custom Report Type Generation. This should ideally only be used in
ReportProvider
based plugins. Be mindful that things like grabbing a database connection will NOT work in other plugin
types when being run externally in a distributed worker scenario. Reports have a simply object model. Firstly a plugin defines
a ReportType
which contains information about the report and available filter options.
Finally, a user runs said report which creates a ReportResult
entry. These are tracked against when appending rows to the result
Rows have sections like 'data', or 'header'. This can affect the display in how you render things from the HTML output side.- Since:
- 0.8.0
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionio.reactivex.rxjava3.core.Single<Boolean>
appendResultRows
(ReportResult reportResult, Collection<ReportResultRow> rows) Saves new result rows against aReportResult
.io.reactivex.rxjava3.core.Single<Connection>
Grabs a Read-Only Database connection for querying the Morpheus Database.io.reactivex.rxjava3.core.Completable
releaseDatabaseConnection
(Connection connection) Releases a Database Connection back into the Pool Manager.io.reactivex.rxjava3.core.Completable
updateReportResultStatus
(ReportResult reportResult, ReportResult.Status status) Updates the status of theReportResult
.
-
Method Details
-
appendResultRows
io.reactivex.rxjava3.core.Single<Boolean> appendResultRows(ReportResult reportResult, Collection<ReportResultRow> rows) Saves new result rows against aReportResult
. These can be chunked or done in batches to improve report efficiency. It is important to leverage displayOrder when processing for proper order on each individualReportResultRow
- Parameters:
reportResult
- The report run being processedrows
- the list of rows to be added to the system- Returns:
- success
-
updateReportResultStatus
io.reactivex.rxjava3.core.Completable updateReportResultStatus(ReportResult reportResult, ReportResult.Status status) Updates the status of theReportResult
. This should be updated upon either success or failure or even when initializing processing of large reports.- Parameters:
reportResult
- the report result row that is being processedstatus
- the new status TODO: Maybe statusMessage for failure in the future?- Returns:
- the completable state of the updated status if needed
-
getReadOnlyDatabaseConnection
io.reactivex.rxjava3.core.Single<Connection> getReadOnlyDatabaseConnection()Grabs a Read-Only Database connection for querying the Morpheus Database. This does NOT decrypt any encrypted data in the database. Therefore some data may not be accessable. If it is possible to use a standard context method instead of a direct database call, to run a report, this is more advised.NOTE: Be sure to release a connection you grab when you are done so as not to over-utilize a pool.
- Returns:
- a JDBC SQL Connection object that can be wrapped in tools like groovy.Sql.
-
releaseDatabaseConnection
Releases a Database Connection back into the Pool Manager. This MUST be called when completing database operations. For LONG operations try to minimize length of time this connection is used.- Parameters:
connection
- the JDBC Sql connection to be released- Returns:
- Completion status of the release event.
-