org.cert.cc.jira
Class ReportScheduler

java.lang.Object
  extended by org.cert.cc.jira.ReportScheduler

public final class ReportScheduler
extends Object

© 2010 Carnegie Mellon University

Author:
Brad Rubbo

Constructor Summary
ReportScheduler()
          Base Constructor that sets up the Scheduler to use.
 
Method Summary
 void deleteScheduledReport(String reportName, String groupName)
          Method to remove Trigger from the Scheduler.
 String[] getAllScheduledReportsByGroupName(String groupName)
          Method to retrieve a string array of all the names of the Triggers with in a specified Group.
 Trigger getScheduledReportTrigger(String reportName, String groupName)
          Method for retrieving a Trigger by name and group name.
 Trigger scheduleReport(String reportName, String groupName, Class jobClass, String cronExpression, Map map)
          Method to schedule a report Trigger with the Scheduler.
 void unscheduleAllReportsByGroupName(String groupName)
          Method for removing all Triggers and all related Jobs specified by a String representing the group.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReportScheduler

public ReportScheduler()
Base Constructor that sets up the Scheduler to use.

Method Detail

getScheduledReportTrigger

public Trigger getScheduledReportTrigger(String reportName,
                                         String groupName)
Method for retrieving a Trigger by name and group name.

Parameters:
reportName - - String Name to use for Trigger.
groupName - - String Name to use for the group.
Returns:
- Trigger

scheduleReport

public Trigger scheduleReport(String reportName,
                              String groupName,
                              Class jobClass,
                              String cronExpression,
                              Map map)
Method to schedule a report Trigger with the Scheduler. This will also register the associated Job with the Scheduler and Trigger.

Parameters:
reportName - String Name to use for the trigger. Must be distinct in the Group.
groupName - String Name to use for the Group to put the Trigger in.
jobClass - Job to register for the Trigger to fire.
cronExpression - String cron expression to use to schedule when to fire.
Returns:
Trigger after it has been created and scheduled.

unscheduleAllReportsByGroupName

public void unscheduleAllReportsByGroupName(String groupName)
                                     throws Exception
Method for removing all Triggers and all related Jobs specified by a String representing the group.

Parameters:
groupName - - String Name of the group.
Throws:
Exception - - Exception thrown on failure to remove all Triggers and associated Jobs.

deleteScheduledReport

public void deleteScheduledReport(String reportName,
                                  String groupName)
                           throws SchedulerException
Method to remove Trigger from the Scheduler. Note: This still leaves the Job registered with the Scheduler. I left this in case multiple triggers use the same job.

Parameters:
reportName - - String Name of the Trigger.
groupName - - String Name of the group the Trigger belongs too.
Throws:
SchedulerException - - SchedulerException thrown if there is a failure removing the Trigger.

getAllScheduledReportsByGroupName

public String[] getAllScheduledReportsByGroupName(String groupName)
Method to retrieve a string array of all the names of the Triggers with in a specified Group.

Parameters:
groupName - String Name of the Group.
Returns:
- String Array representing all the trigger names in the group.


Copyright © 2012 Carnegie Mellon University