1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 package org.miloss.fgsms.auxsrv;
23
24 import java.util.logging.Level;
25 import java.util.logging.Logger;
26 import org.miloss.fgsms.services.interfaces.common.PolicyType;
27 import org.miloss.fgsms.sla.AuxHelper;
28 import org.miloss.fgsms.sla.SLACommon;
29 import org.miloss.fgsms.bueller.Bueller;
30 import org.quartz.*;
31 import org.quartz.JobExecutionContext;
32 import org.quartz.JobExecutionException;
33
34
35
36
37
38
39 public class BuellerScheduler implements StatefulJob {
40
41 public void execute(JobExecutionContext jec) throws JobExecutionException {
42 try {
43 org.miloss.fgsms.bueller.Bueller m = new Bueller();
44 m.Fire(true);
45 AuxHelper.TryUpdateStatus(true, "urn:fgsms:Bueller:" + SLACommon.GetHostName(), "OK", true, PolicyType.STATUS, AuxHelper.UNSPECIFIED, SLACommon.GetHostName());
46 } catch (Exception ex) {
47 Logger.getLogger(BuellerScheduler.class.getName()).log(Level.SEVERE, null, ex);
48 AuxHelper.TryUpdateStatus(false, "urn:fgsms:Bueller:" + SLACommon.GetHostName(), ex.getMessage(), true, PolicyType.STATUS, AuxHelper.UNSPECIFIED, SLACommon.GetHostName());
49 }
50
51 }
52 }