Class ReportStatusManager
java.lang.Object
com.inductiveautomation.reporting.gateway.ReportStatusManager
Filename: ReportStatusManager.java Created on Apr 02, 2015 Author: Kathy Applebaum Copyright Inductive Automation
 2015 Project: Reporting
 
Keeps track of what reports are currently executing and the last execution time for any report executed since the Gateway last started.
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidvoidfinish(ReportExecutionContext reportExecutionContext) Call this when report execution is finished to save last execution time and remove the report from the current execution map.longgetActiveScheduledReportCount(String projectName) Used by ReportOverviewContributor.getCurrentReportContextsForProject(String projectName) getLastExecution(String projectName, String reportPath) Returns the start time of the last finished execution for this report.longgetLastExecutionDuration(String projectName, String reportPath) getLastScheduledExecution(String projectName, String reportPath) Returns the start time of the last finished scheduled execution for this report.getNextScheduledRun(String projectName, String reportPath) Returns the ReportSchedule that should execute next.getPathsWithSchedules(String projectName) Gets a list of the report paths for a particular project that have reportSchedules in our map.Gets a list of project ids with scheduled reports.getReportExecutionContext(String projectName, String reportPath, boolean isSampleData) intUsed by the status page to determine if blank state page is shown.Used by ReportStatusView to populate the status page.booleanvoidvoidremoveScheduledRuns(String projectName) Removes all scheduled run entries from scheduledExecutionsByProject and resourceIdToReportPath for this project.voidsetScheduledRuns(ProjectResource projectResource) Called to add new schedules
- 
Constructor Details- 
ReportStatusManager
 
- 
- 
Method Details- 
getReportExecutionContextpublic ReportExecutionContext getReportExecutionContext(String projectName, String reportPath, boolean isSampleData) 
- 
getCurrentReportContexts
- 
getCurrentReportContextsForProject
- 
getLastExecutionReturns the start time of the last finished execution for this report.
- 
getLastScheduledExecutionReturns the start time of the last finished scheduled execution for this report.
- 
getLastExecutionDuration- Returns:
- Difference between start and end time in millis. Returns 0 if no last run date since gateway restart.
 
- 
finishCall this when report execution is finished to save last execution time and remove the report from the current execution map.
- 
getStatusListUsed by ReportStatusView to populate the status page.- Returns:
- List of ReportStatusWatcher objects for reports currently executing reports
 
- 
cancel
- 
getLastScheduledRuns
- 
getNextScheduledRunReturns 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()
- 
getProjectsWithSchedulesGets a list of project ids with scheduled reports.- Returns:
- List of project ids, or empty list if none exist in our map.
 
- 
getPathsWithSchedulesGets 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.
 
- 
getActiveScheduledReportCountUsed 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.
 
- 
setScheduledRunsCalled to add new schedules- Parameters:
- projectResource- Not null.
 
- 
removeScheduledRunsRemoves all scheduled run entries from scheduledExecutionsByProject and resourceIdToReportPath for this project. Called when a project is deleted.
- 
removeScheduledRuns
 
-