01: package org.pentaho.plugin.versionchecker;
02:
03: import java.util.List;
04:
05: import org.apache.commons.logging.Log;
06: import org.apache.commons.logging.LogFactory;
07: import org.quartz.Job;
08: import org.quartz.JobDataMap;
09: import org.quartz.JobExecutionContext;
10: import org.quartz.JobExecutionException;
11:
12: public class VersionCheckerJob implements Job {
13:
14: public static final String VERSION_REQUEST_FLAGS = "versionRequestFlags"; //$NON-NLS-1$
15:
16: public Log getLogger() {
17: return LogFactory.getLog(VersionCheckerJob.class);
18: }
19:
20: public void execute(JobExecutionContext context)
21: throws JobExecutionException {
22: JobDataMap dataMap = context.getJobDetail().getJobDataMap();
23: int versionRequestFlags = -1;
24: try {
25: versionRequestFlags = dataMap.getInt(VERSION_REQUEST_FLAGS);
26: } catch (Exception e) {
27: // ignore
28: }
29: List results = PentahoVersionCheckReflectHelper
30: .performVersionCheck(false, versionRequestFlags);
31: if (results != null) {
32: PentahoVersionCheckReflectHelper.logVersionCheck(results,
33: getLogger());
34: }
35: }
36: }
|