Subversion Repositories SmartDukaan

Rev

Rev 23759 | Rev 23761 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
23756 amit.gupta 1
package com.smartdukaan.cron.scheduled;
2
 
3
import org.apache.logging.log4j.LogManager;
4
import org.apache.logging.log4j.Logger;
5
import org.springframework.beans.factory.annotation.Autowired;
6
import org.springframework.scheduling.annotation.Scheduled;
7
import org.springframework.stereotype.Component;
8
 
9
import com.smartdukaan.cron.migrations.RunOnceTasks;
10
import com.smartdukaan.cron.monitored.NagiosMonitorTasks;
11
 
12
@Component
13
public class ScheduledSkeleton {
14
 
15
	private static final Logger log = LogManager.getLogger(ScheduledSkeleton.class);
16
 
17
	@Autowired
18
	ScheduledTasks scheduledTasks;
19
 
20
	@Autowired
21
	NagiosMonitorTasks nagiosMonitorTasks;
22
 
23
	@Autowired
24
	RunOnceTasks runOnceTasks;
25
 
26
	@Scheduled(cron = "1 00 * * * *")
27
	public void generateDailyRecharge() {
28
		scheduledTasks.generateDailyRecharge();
29
	}
30
 
31
	/*@Scheduled(cron = "0 45 0 * * *")
32
	public void processScheme() throws Exception {
33
		scheduledTasks.processScheme();
34
	}*/
35
 
36
	@Scheduled(cron = "0 45 * * * *")
37
	public void reconcileRecharge() throws Exception {
38
		scheduledTasks.reconcileRecharge();
39
	}
40
 
23759 amit.gupta 41
	@Scheduled(cron = "0 05 0 1,16 * ?")
23756 amit.gupta 42
	public void processRechargeCashback() throws Throwable {
43
		scheduledTasks.processRechargeCashback();
44
	}
45
 
46
	/*Value so big so that it got to run only once.
47
	 * 
48
	 */
23759 amit.gupta 49
	/*@Scheduled(fixedRate=Integer.MAX_VALUE)
23756 amit.gupta 50
	public void runOnce() throws Throwable
51
	{
52
		log.info("Started run Once");
53
		runOnceTasks.migarateLineItemsToNewTable();
54
	}
55
	@Scheduled(fixedRate=Integer.MAX_VALUE)
56
	public void runTwice() throws Throwable
57
	{
58
		log.info("Started run Twice");
59
		scheduledTasks.reconcileRecharge();
23759 amit.gupta 60
	}*/
23756 amit.gupta 61
	@Scheduled(fixedRate=Integer.MAX_VALUE)
62
	public void runThird() throws Throwable
63
	{
64
		log.info("Started run Third");
23760 amit.gupta 65
		scheduledTasks.processRechargeCashback();
23756 amit.gupta 66
	}
67
 
68
}