Subversion Repositories SmartDukaan

Rev

Rev 23767 | Rev 23794 | 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
 
23767 amit.gupta 26
	/*@Scheduled(cron = "0 5 0 * * * ")
23756 amit.gupta 27
	public void generateDailyRecharge() {
28
		scheduledTasks.generateDailyRecharge();
23767 amit.gupta 29
	}*/
23756 amit.gupta 30
 
31
	/*@Scheduled(cron = "0 45 0 * * *")
32
	public void processScheme() throws Exception {
33
		scheduledTasks.processScheme();
34
	}*/
35
 
23761 amit.gupta 36
	@Scheduled(cron = "0 15 0 * * *")
23756 amit.gupta 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
	 */
23768 amit.gupta 49
	@Scheduled(fixedDelay=1000*60*10)
23767 amit.gupta 50
	public void migrateLineItems() throws Throwable
23756 amit.gupta 51
	{
52
		log.info("Started run Once");
53
		runOnceTasks.migarateLineItemsToNewTable();
54
	}
23767 amit.gupta 55
	/*
23756 amit.gupta 56
	@Scheduled(fixedRate=Integer.MAX_VALUE)
57
	public void runTwice() throws Throwable
58
	{
59
		log.info("Started run Twice");
60
		scheduledTasks.reconcileRecharge();
23759 amit.gupta 61
	}*/
23762 amit.gupta 62
	/*@Scheduled(fixedRate=Integer.MAX_VALUE)
23756 amit.gupta 63
	public void runThird() throws Throwable
64
	{
65
		log.info("Started run Third");
23760 amit.gupta 66
		scheduledTasks.processRechargeCashback();
23762 amit.gupta 67
	}*/
23756 amit.gupta 68
 
69
}