Java Code Examples for org.quartz.JobExecutionContext#getScheduledFireTime()

The following examples show how to use org.quartz.JobExecutionContext#getScheduledFireTime() . These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
/**
 * @return composite data
 */
public static CompositeData toCompositeData(JobExecutionContext jec)
        throws SchedulerException {
    try {
        return new CompositeDataSupport(COMPOSITE_TYPE, ITEM_NAMES,
                new Object[] {
                        jec.getScheduler().getSchedulerName(),
                        jec.getTrigger().getKey().getName(),
                        jec.getTrigger().getKey().getGroup(),
                        jec.getJobDetail().getKey().getName(),
                        jec.getJobDetail().getKey().getGroup(),
                        JobDataMapSupport.toTabularData(jec
                                .getMergedJobDataMap()),
                        jec.getTrigger().getCalendarName(),
                        jec.isRecovering(),
                        jec.getRefireCount(),
                        jec.getFireTime(), jec.getScheduledFireTime(),
                        jec.getPreviousFireTime(), jec.getNextFireTime(),
                        jec.getJobRunTime(),
                        jec.getFireInstanceId() });
    } catch (OpenDataException e) {
        throw new RuntimeException(e);
    }
}
 
Example 2
/**
 * @return composite data
 */
public static CompositeData toCompositeData(JobExecutionContext jec)
		throws SchedulerException {
	try {
		return new CompositeDataSupport(COMPOSITE_TYPE, ITEM_NAMES,
				new Object[] {
						jec.getScheduler().getSchedulerName(),
						jec.getTrigger().getFullName(),
						jec.getJobDetail().getFullName(),
						JobDataMapSupport.toTabularData(jec
								.getMergedJobDataMap()),
						determineCalendarName(jec),
						Boolean.valueOf(jec.isRecovering()),
						Integer.valueOf(jec.getRefireCount()),
						jec.getFireTime(), jec.getScheduledFireTime(),
						jec.getPreviousFireTime(), jec.getNextFireTime(),
						Long.valueOf(jec.getJobRunTime()) });
	} catch (OpenDataException e) {
		throw new RuntimeException(e);
	}
}
 
Example 3
public void execute(JobExecutionContext jobInfo) throws JobExecutionException {
	loginToSakai("admin");

	String jobName = jobInfo.getJobDetail().getKey().getName();
	String triggerName = jobInfo.getTrigger().getKey().getName();
		Date requestedFire = jobInfo.getScheduledFireTime();
	Date actualfire = jobInfo.getFireTime();

	StringBuffer whoAmI = new StringBuffer("AutoSubmitAssessmentsJob $");
	whoAmI.append(" Job: ");
	whoAmI.append(jobName);
	whoAmI.append(" Trigger: ");
	whoAmI.append(triggerName);
	
	if (requestedFire != null) {
		whoAmI.append(" Fire scheduled: ");
		whoAmI.append(requestedFire.toString());
	}
	
	if (actualfire != null) {
		whoAmI.append(" Fire actual: ");
		whoAmI.append(actualfire.toString());
	}
	
	eventTrackingService.post(eventTrackingService.newEvent(SamigoConstants.EVENT_AUTO_SUBMIT_JOB, safeEventLength(whoAmI.toString()), true));

	log.info("Start Job: {}", whoAmI);
	
	GradingService gradingService = new GradingService();
	int failures = gradingService.autoSubmitAssessments();
	
	if (failures > 0)
	{
		samigoETSProvider.notifyAutoSubmitFailures(failures);
	}
	
	log.info("End Job: {} ({} failures)", whoAmI, failures);
	
	logoutFromSakai();
}
 
Example 4
public void execute(JobExecutionContext jobInfo) throws JobExecutionException {
	loginToSakai("admin");

	String jobName = jobInfo.getJobDetail().getKey().getName();
	String triggerName = jobInfo.getTrigger().getKey().getName();
		Date requestedFire = jobInfo.getScheduledFireTime();
	Date actualfire = jobInfo.getFireTime();

	StringBuffer whoAmI = new StringBuffer("AutoSubmitAssessmentsJob $");
	whoAmI.append(" Job: ");
	whoAmI.append(jobName);
	whoAmI.append(" Trigger: ");
	whoAmI.append(triggerName);
	
	if (requestedFire != null) {
		whoAmI.append(" Fire scheduled: ");
		whoAmI.append(requestedFire.toString());
	}
	
	if (actualfire != null) {
		whoAmI.append(" Fire actual: ");
		whoAmI.append(actualfire.toString());
	}
	
	eventTrackingService.post(eventTrackingService.newEvent(SamigoConstants.EVENT_AUTO_SUBMIT_JOB, safeEventLength(whoAmI.toString()), true));

	log.info("Start Job: {}", whoAmI);
	
	GradingService gradingService = new GradingService();
	int failures = gradingService.autoSubmitAssessments();
	
	if (failures > 0)
	{
		samigoETSProvider.notifyAutoSubmitFailures(failures);
	}
	
	log.info("End Job: {} ({} failures)", whoAmI, failures);
	
	logoutFromSakai();
}