Class ReportStatusManager
- java.lang.Object
- 
- com.inductiveautomation.reporting.gateway.ReportStatusManager
 
- 
 public class ReportStatusManager extends java.lang.ObjectFilename: ReportStatusManager.java Created on Apr 02, 2015 Author: Kathy Applebaum Copyright Inductive Automation 2015 Project: ReportingKeeps track of what reports are currently executing and the last execution time for any report executed since the Gateway last started. 
- 
- 
Constructor SummaryConstructors Constructor Description ReportStatusManager(GatewayContext context)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcancel(java.util.UUID uuid)voidfinish(ReportExecutionContext reportExecutionContext)Call this when report execution is finished to save last execution time and remove the report from the current execution map.longgetActiveScheduledReportCount(java.lang.String projectName)Used by ReportOverviewContributor.java.util.List<ReportExecutionContext>getCurrentReportContexts()java.util.List<ReportExecutionContext>getCurrentReportContextsForProject(java.lang.String projectName)java.util.DategetLastExecution(java.lang.String projectName, java.lang.String reportPath)Returns the start time of the last finished execution for this report.longgetLastExecutionDuration(java.lang.String projectName, java.lang.String reportPath)java.util.DategetLastScheduledExecution(java.lang.String projectName, java.lang.String reportPath)Returns the start time of the last finished scheduled execution for this report.java.util.List<ReportStatusWatcher>getLastScheduledRuns()ReportSchedulegetNextScheduledRun(java.lang.String projectName, java.lang.String reportPath)Returns the ReportSchedule that should execute next.java.util.List<java.lang.String>getPathsWithSchedules(java.lang.String projectName)Gets a list of the report paths for a particular project that have reportSchedules in our map.java.util.Collection<java.lang.String>getProjectsWithSchedules()Gets a list of project ids with scheduled reports.ReportExecutionContextgetReportExecutionContext(java.lang.String projectName, java.lang.String reportPath, boolean isSampleData)intgetScheduledReportCount()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.booleanisScheduledReportsEmpty()voidremoveScheduledRuns(ProjectResourceId id)voidremoveScheduledRuns(java.lang.String projectName)Removes all scheduled run entries from scheduledExecutionsByProject and resourceIdToReportPath for this project.voidsetScheduledRuns(ProjectResource projectResource)Called to add new schedules
 
- 
- 
- 
Constructor Detail- 
ReportStatusManagerpublic ReportStatusManager(GatewayContext context) 
 
- 
 - 
Method Detail- 
getReportExecutionContextpublic ReportExecutionContext getReportExecutionContext(java.lang.String projectName, java.lang.String reportPath, boolean isSampleData) 
 - 
getCurrentReportContextspublic java.util.List<ReportExecutionContext> getCurrentReportContexts() 
 - 
getCurrentReportContextsForProjectpublic java.util.List<ReportExecutionContext> getCurrentReportContextsForProject(java.lang.String projectName) 
 - 
getLastExecutionpublic java.util.Date getLastExecution(java.lang.String projectName, java.lang.String reportPath)Returns the start time of the last finished execution for this report.
 - 
getLastScheduledExecutionpublic java.util.Date getLastScheduledExecution(java.lang.String projectName, java.lang.String reportPath)Returns the start time of the last finished scheduled execution for this report.
 - 
getLastExecutionDurationpublic long getLastExecutionDuration(java.lang.String projectName, java.lang.String reportPath)- Returns:
- Difference between start and end time in millis. Returns 0 if no last run date since gateway restart.
 
 - 
finishpublic void finish(@Nonnull ReportExecutionContext reportExecutionContext)Call this when report execution is finished to save last execution time and remove the report from the current execution map.
 - 
getStatusList@Nonnull public java.util.List<ReportStatusWatcher> getStatusList() Used by ReportStatusView to populate the status page.- Returns:
- List of ReportStatusWatcher objects for reports currently executing reports
 
 - 
cancelpublic void cancel(java.util.UUID uuid) 
 - 
getLastScheduledRunspublic java.util.List<ReportStatusWatcher> getLastScheduledRuns() 
 - 
getNextScheduledRun@Nullable public ReportSchedule getNextScheduledRun(java.lang.String projectName, @Nonnull java.lang.String reportPath) Returns the ReportSchedule that should execute next.- Returns:
- Next ReportSchedule to execute for this path/project, or null if no reports scheduled.
 
 - 
getScheduledReportCountpublic int getScheduledReportCount() Used by the status page to determine if blank state page is shown.- Returns:
- count of number of projects with scheduled reports
 
 - 
isScheduledReportsEmptypublic boolean isScheduledReportsEmpty() 
 - 
getProjectsWithSchedules@Nonnull public java.util.Collection<java.lang.String> getProjectsWithSchedules() Gets a list of project ids with scheduled reports.- Returns:
- List of project ids, or empty list if none exist in our map.
 
 - 
getPathsWithSchedules@Nonnull public java.util.List<java.lang.String> getPathsWithSchedules(@Nullable java.lang.String projectName)Gets a list of the report paths for a particular project that have reportSchedules in our map. Includes paths with schedules that are inactive.- Returns:
- List of report paths, or empty list if none exist.
 
 - 
getActiveScheduledReportCountpublic long getActiveScheduledReportCount(java.lang.String projectName) Used by ReportOverviewContributor. We want to know how many reports have at least one schedule that could be executed. This means we need to eliminate reports that are in a disabled project or that have no enabled schedules.- Parameters:
- projectName- Nullable
- Returns:
- Count of how many reports in this project have at least one enabled schedule.
 
 - 
setScheduledRunspublic void setScheduledRuns(@Nonnull ProjectResource projectResource)Called to add new schedules- Parameters:
- projectResource- Not null.
 
 - 
removeScheduledRunspublic void removeScheduledRuns(java.lang.String projectName) Removes all scheduled run entries from scheduledExecutionsByProject and resourceIdToReportPath for this project. Called when a project is deleted.
 - 
removeScheduledRunspublic void removeScheduledRuns(@Nonnull ProjectResourceId id)
 
- 
 
-