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 Details

    • appendResultRows

      io.reactivex.rxjava3.core.Single<Boolean> appendResultRows(ReportResult reportResult, Collection<ReportResultRow> rows)
      Saves new result rows against a ReportResult. 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 individual ReportResultRow
      Parameters:
      reportResult - The report run being processed
      rows - 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 the ReportResult. 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 processed
      status - 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

      io.reactivex.rxjava3.core.Completable releaseDatabaseConnection(Connection connection)
      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.