public class ReportStatusManager
extends java.lang.Object
Keeps track of what reports are currently executing and the last execution time for any report executed since the Gateway last started.
Constructor and Description |
---|
ReportStatusManager(GatewayContext context) |
Modifier and Type | Method and Description |
---|---|
void |
addResourceId(long projectId,
long resourceId,
java.lang.String reportPath)
Adds a project/reportpath to our resourceID accounting
|
void |
cancel(java.util.UUID uuid) |
void |
finish(ReportExecutionContext reportExecutionContext)
Call this when report execution is finished to save last execution time and remove the report from the current
execution map.
|
java.util.List<ReportExecutionContext> |
getCurrentReportContexts() |
java.util.List<ReportExecutionContext> |
getCurrentReportContextsForProject(long projectId) |
java.util.Date |
getLastExecution(long projectId,
java.lang.String reportPath)
Returns the start time of the last finished execution for this report.
|
long |
getLastExecutionDuration(long projectId,
java.lang.String reportPath) |
java.util.Date |
getLastScheduledExecution(long projectId,
java.lang.String reportPath)
Returns the start time of the last finished scheduled execution for this report.
|
java.util.List<ReportStatusWatcher> |
getLastScheduledRuns() |
java.lang.String |
getNameForProject(long id)
Convenience function for ReportReactComponent to get a project name without having a context
|
ReportSchedule |
getNextScheduledRun(long projectId,
java.lang.String reportPath)
Returns the ReportSchedule that should execute next.
|
java.util.List<java.lang.String> |
getPathsWithSchedules(long projectId)
Gets a list of the report paths for a particular project that have reportSchedules in our map.
|
java.util.Collection<java.lang.Long> |
getProjectsWithSchedules()
Gets a list of project ids with scheduled reports.
|
ReportExecutionContext |
getReportExecutionContext(long projectId,
java.lang.String reportPath,
boolean isSampleData) |
int |
getScheduledReportCount()
Used by the status page to determine if blank state page is shown.
|
java.util.List<ReportStatusWatcher> |
getStatusList()
Used by ReportStatusView to populate the status page.
|
void |
removeResourceId(long projectId,
long resourceId)
When something gets deleted, we have much accounting to account
|
void |
removeScheduledRuns(long projectId)
Removes all scheduled run entries from scheduledExecutionsByProject and resourceIdToReportPath for this project.
|
void |
removeScheduledRuns(long projectId,
java.lang.String reportPath)
Removes this report/path's entry from scheduled runs.
|
void |
setScheduledRuns(long projectId,
java.lang.String reportPath,
java.util.List<ReportSchedule> reportSchedules)
Used to add or update scheduled runs to our bookkeeping.
|
public ReportStatusManager(GatewayContext context)
public ReportExecutionContext getReportExecutionContext(long projectId, java.lang.String reportPath, boolean isSampleData)
public java.util.List<ReportExecutionContext> getCurrentReportContexts()
public java.util.List<ReportExecutionContext> getCurrentReportContextsForProject(long projectId)
public java.util.Date getLastExecution(long projectId, java.lang.String reportPath)
public java.util.Date getLastScheduledExecution(long projectId, java.lang.String reportPath)
public long getLastExecutionDuration(long projectId, java.lang.String reportPath)
public void finish(@Nonnull ReportExecutionContext reportExecutionContext)
@Nonnull public java.util.List<ReportStatusWatcher> getStatusList()
public void cancel(java.util.UUID uuid)
public java.util.List<ReportStatusWatcher> getLastScheduledRuns()
@Nullable public ReportSchedule getNextScheduledRun(long projectId, @Nonnull java.lang.String reportPath)
public int getScheduledReportCount()
@Nonnull public java.util.Collection<java.lang.Long> getProjectsWithSchedules()
@Nonnull public java.lang.String getNameForProject(long id)
@Nonnull public java.util.List<java.lang.String> getPathsWithSchedules(long projectId)
public void setScheduledRuns(long projectId, @Nonnull java.lang.String reportPath, @Nonnull java.util.List<ReportSchedule> reportSchedules)
public void removeScheduledRuns(long projectId, @Nonnull java.lang.String reportPath)
public void removeScheduledRuns(long projectId)
public void addResourceId(long projectId, long resourceId, java.lang.String reportPath)
public void removeResourceId(long projectId, long resourceId)