| Line 1... |
Line 1... |
| 1 |
package com.smartdukaan.cron.scheduled;
|
1 |
package com.smartdukaan.cron.scheduled;
|
| 2 |
|
2 |
|
| 3 |
import java.io.IOException;
|
3 |
import java.io.IOException;
|
| 4 |
import java.time.LocalDate;
|
4 |
import java.time.LocalDate;
|
| 5 |
import java.time.LocalDateTime;
|
5 |
import java.time.LocalDateTime;
|
| - |
|
6 |
import java.util.Date;
|
| 6 |
import java.util.LinkedHashMap;
|
7 |
import java.util.LinkedHashMap;
|
| 7 |
|
8 |
|
| 8 |
import org.apache.logging.log4j.LogManager;
|
9 |
import org.apache.logging.log4j.LogManager;
|
| 9 |
import org.apache.logging.log4j.Logger;
|
10 |
import org.apache.logging.log4j.Logger;
|
| 10 |
import org.springframework.beans.factory.annotation.Autowired;
|
11 |
import org.springframework.beans.factory.annotation.Autowired;
|
| Line 46... |
Line 47... |
| 46 |
|
47 |
|
| 47 |
@Autowired
|
48 |
@Autowired
|
| 48 |
private WriteToPropertiesFile writeToPropertiesFile;
|
49 |
private WriteToPropertiesFile writeToPropertiesFile;
|
| 49 |
|
50 |
|
| 50 |
String nagiosCronPropertiesFile = "/var/log/services/nagios-Cron-Monitoring.properties";
|
51 |
String nagiosCronPropertiesFile = "/var/log/services/nagios-Cron-Monitoring.properties";
|
| 51 |
|
52 |
|
| 52 |
// @Scheduled(cron = "0 0 2 * * *")
|
53 |
// @Scheduled(cron = "0 0 2 * * *")
|
| 53 |
public void processDailySchemes() throws Exception {
|
54 |
public void processDailySchemes() throws Exception {
|
| 54 |
|
55 |
|
| 55 |
LinkedHashMap<String, String> propertiesDetails = new LinkedHashMap<>();
|
56 |
LinkedHashMap<String, String> propertiesDetails = new LinkedHashMap<>();
|
| 56 |
propertiesDetails.put("processDailySchemes", "0");
|
57 |
propertiesDetails.put("processDailySchemes", "0");
|
| Line 487... |
Line 488... |
| 487 |
LinkedHashMap<String, String> propertiesDetails = new LinkedHashMap<>();
|
488 |
LinkedHashMap<String, String> propertiesDetails = new LinkedHashMap<>();
|
| 488 |
propertiesDetails.put("checkItelImeiActivation", "0");
|
489 |
propertiesDetails.put("checkItelImeiActivation", "0");
|
| 489 |
writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
|
490 |
writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
|
| 490 |
|
491 |
|
| 491 |
scheduledTasks.checkItelImeiActivation(LocalDate.now(), 15);
|
492 |
scheduledTasks.checkItelImeiActivation(LocalDate.now(), 15);
|
| 492 |
|
- |
|
| - |
|
493 |
long secs = (new Date().getTime())/1000;
|
| 493 |
propertiesDetails.put("checkItelImeiActivation", "1");
|
494 |
propertiesDetails.put("checkItelImeiActivation", "1");
|
| - |
|
495 |
propertiesDetails.put("itelDate", Long.toString(secs));
|
| 494 |
writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
|
496 |
writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
|
| - |
|
497 |
|
| - |
|
498 |
}
|
| 495 |
|
499 |
|
| 496 |
|
500 |
|
| 497 |
scheduledTasks.checkItelImeiActivation(LocalDate.now(), 15);
|
- |
|
| 498 |
|
- |
|
| 499 |
}
|
- |
|
| 500 |
|
- |
|
| 501 |
@Scheduled(cron = "0 0 23 * * *")
|
501 |
@Scheduled(cron = "0 0 23 * * *")
|
| 502 |
public void checkTecnoImeiActivation() throws Throwable {
|
502 |
public void checkTecnoImeiActivation() throws Throwable {
|
| 503 |
|
503 |
|
| 504 |
LinkedHashMap<String, String> propertiesDetails = new LinkedHashMap<>();
|
504 |
LinkedHashMap<String, String> propertiesDetails = new LinkedHashMap<>();
|
| 505 |
propertiesDetails.put("checkTecnoImeiActivation", "0");
|
505 |
propertiesDetails.put("checkTecnoImeiActivation", "0");
|
| Line 507... |
Line 507... |
| 507 |
|
507 |
|
| 508 |
log.info("startTime" + LocalDate.now());
|
508 |
log.info("startTime" + LocalDate.now());
|
| 509 |
|
509 |
|
| 510 |
scheduledTasks.checkTecnoImeiActivation(LocalDate.now(), 15);
|
510 |
scheduledTasks.checkTecnoImeiActivation(LocalDate.now(), 15);
|
| 511 |
|
511 |
|
| - |
|
512 |
long secs = (new Date().getTime())/1000;
|
| 512 |
propertiesDetails.put("checkTecnoImeiActivation", "1");
|
513 |
propertiesDetails.put("checkTecnoImeiActivation", "1");
|
| - |
|
514 |
propertiesDetails.put("technoDate", Long.toString(secs));
|
| 513 |
writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
|
515 |
writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
|
| 514 |
scheduledTasks.checkTecnoImeiActivation(LocalDate.now(), 15);
|
- |
|
| 515 |
|
516 |
|
| 516 |
}
|
517 |
}
|
| 517 |
|
518 |
|
| 518 |
@Scheduled(cron = "0 0 23 * * *")
|
519 |
@Scheduled(cron = "0 0 23 * * *")
|
| 519 |
public void vivoImeiActivation() throws Throwable {
|
520 |
public void vivoImeiActivation() throws Throwable {
|
| 520 |
log.info("startTime" + LocalDateTime.now());
|
521 |
log.info("startTime" + LocalDateTime.now());
|
| Line 522... |
Line 523... |
| 522 |
LinkedHashMap<String, String> propertiesDetails = new LinkedHashMap<>();
|
523 |
LinkedHashMap<String, String> propertiesDetails = new LinkedHashMap<>();
|
| 523 |
propertiesDetails.put("vivoImeiActivation", "0");
|
524 |
propertiesDetails.put("vivoImeiActivation", "0");
|
| 524 |
writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
|
525 |
writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
|
| 525 |
|
526 |
|
| 526 |
scheduledTasks.checkImeiActivation();
|
527 |
scheduledTasks.checkImeiActivation();
|
| - |
|
528 |
long secs = (new Date().getTime())/1000;
|
| 527 |
log.info("endTime" + LocalDateTime.now());
|
529 |
log.info("endTime" + LocalDateTime.now());
|
| 528 |
propertiesDetails.put("vivoImeiActivation", "1");
|
530 |
propertiesDetails.put("vivoImeiActivation", "1");
|
| - |
|
531 |
|
| - |
|
532 |
propertiesDetails.put("vivoDate", Long.toString(secs));
|
| 529 |
writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
|
533 |
writeToPropertiesFile.saveParamChanges(propertiesDetails, nagiosCronPropertiesFile);
|
| 530 |
|
534 |
|
| 531 |
}
|
535 |
}
|
| 532 |
|
536 |
|
| 533 |
@Scheduled(cron = "0 0 * * * *")
|
537 |
@Scheduled(cron = "0 0 * * * *")
|