scheduler.createJob( EmbeddedVersionCheckSystemListener.VERSION_CHECK_JOBNAME, VersionCheckerAction.class, parms,
trigger );
}
protected void deleteJobIfNecessary() throws SchedulerException {
IScheduler scheduler = PentahoSystem.get( IScheduler.class, "IScheduler2", null ); //$NON-NLS-1$
IJobFilter filter = new IJobFilter() {
public boolean accept( Job job ) {
return job.getJobName().contains( EmbeddedVersionCheckSystemListener.VERSION_CHECK_JOBNAME );
}
};
// Like old code - remove the existing job and replace it
List<Job> matchingJobs = scheduler.getJobs( filter );
if ( ( matchingJobs != null ) && ( matchingJobs.size() > 0 ) ) {
for ( Job verCkJob : matchingJobs ) {
scheduler.removeJob( verCkJob.getJobId() );
}
}
}