package com.prime.sony.ecommerce.jobs;

import java.sql.Connection;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.batch.core.Job;
import org.springframework.batch.core.launch.JobLauncher;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import com.prime.sony.ecommerce.exceptions.TaskStatusServiceException;
import com.prime.sony.ecommerce.service.PipeStatusService;

//@Component
@Component
public class PipeStatusServiceJob {

	private static final Logger log = LoggerFactory.getLogger(PipeStatusServiceJob.class);

	// @Override
	// public void execute(JobExecutionContext context) throws JobExecutionException
	// {
	// // TODO Auto-generated method stub
	// System.out.println("Test Job");
	// }

//	@Autowired
//	JobLauncher jobLauncher;
	
//	@Autowired
//	private Connection connection;
	
	@Autowired
	private PipeStatusService pipeStatusService;

//	@Autowired
//	Job job;
	
	/*
	 * @Scheduled(cron="#{@getCronValueForPipe}") public void productPipeScheduler()
	 * throws Exception {
	 * 
	 * log.info("==>PipeStatusServiceJob.productPipeScheduler()"); try {
	 * 
	 * pipeStatusService.loadProductPipeHistory();
	 * 
	 * } catch (Exception e) {
	 * log.error("==> Exception at PipeStatusServiceJob.productPipeScheduler()",e);
	 * 
	 * throw new TaskStatusServiceException(e.getMessage(), e.getCause(), null); }
	 * log.info("<==PipeStatusServiceJob.productPipeScheduler()"); }
	 * 
	 * @Scheduled(cron = "#{@getCronValueForPipe}") public void
	 * customerPipeScheduler() throws Exception {
	 * 
	 * log.info("==>PipeStatusServiceJob.customerPipeScheduler()"); try {
	 * pipeStatusService.loadCustomerPipeHistory(); } catch (Exception e) {
	 * log.error("==> Exception at PipeStatusServiceJob.customerPipeScheduler()",e);
	 * 
	 * throw new TaskStatusServiceException(e.getMessage(), e.getCause(), null); }
	 * log.info("<==PipeStatusServiceJob.customerPipeScheduler()"); }
	 * 
	 * @Scheduled(cron="#{@getCronValueForPipe}") public void orderPipeScheduler()
	 * throws Exception {
	 * 
	 * log.info("==>PipeStatusServiceJob.orderPipeScheduler()"); try {
	 * 
	 * pipeStatusService.loadOrderPipeHistory(); } catch (Exception e) {
	 * log.error("==> Exception at PipeStatusServiceJob.orderPipeScheduler()",e);
	 * 
	 * throw new TaskStatusServiceException(e.getMessage(), e.getCause(), null); }
	 * log.info("<==PipeStatusServiceJob.orderPipeScheduler()"); }
	 */
	
	

}
