Subversion Repositories SmartDukaan

Rev

Rev 23768 | Rev 23841 | 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 {
23794 govind 14
 
23756 amit.gupta 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
 
23794 govind 26
	/*
27
	 * @Scheduled(cron = "0 5 0 * * * ") public void generateDailyRecharge() {
28
	 * scheduledTasks.generateDailyRecharge(); }
29
	 */
23756 amit.gupta 30
 
23794 govind 31
	/*
32
	 * @Scheduled(cron = "0 45 0 * * *") public void processScheme() throws
33
	 * Exception { scheduledTasks.processScheme(); }
34
	 */
23756 amit.gupta 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
	}
23794 govind 45
 
46
	/*
47
	 * Value so big so that it got to run only once.
23756 amit.gupta 48
	 * 
49
	 */
23794 govind 50
	@Scheduled(fixedDelay = 1000 * 60 * 10)
51
	public void migrateLineItems() throws Throwable {
23756 amit.gupta 52
		log.info("Started run Once");
53
		runOnceTasks.migarateLineItemsToNewTable();
54
	}
23767 amit.gupta 55
	/*
23794 govind 56
	 * @Scheduled(fixedRate=Integer.MAX_VALUE) public void runTwice() throws
57
	 * Throwable { log.info("Started run Twice");
58
	 * scheduledTasks.reconcileRecharge(); }
59
	 */
60
	/*
61
	 * @Scheduled(fixedRate=Integer.MAX_VALUE) public void runThird() throws
62
	 * Throwable { log.info("Started run Third");
63
	 * scheduledTasks.processRechargeCashback(); }
64
	 */
23756 amit.gupta 65
 
23794 govind 66
 
23756 amit.gupta 67
}