package com.eactive.eai.rms.bat.common.service;//package com.eactive.eai.rms.bat.common.service;
//
//import org.apache.log4j.Logger;
//import org.quartz.Job;
//import org.quartz.JobExecutionContext;
//import org.quartz.JobExecutionException;
//import org.quartz.SchedulerException;
//import org.springframework.context.ApplicationContext;
//
//import com.eactive.eai.rms.common.datasource.DataSourceContextHolder;
//import com.eactive.eai.rms.common.datasource.DataSourceType;
//import com.eactive.eai.rms.common.datasource.DataSourceTypeManager;
//import com.eactive.eai.rms.common.util.CommonUtil;
//
//
//public class BatNdmLogTableDeleteJob implements Job {
//  /**
//   * Logger for this class
//   */
//   private static final Logger logger = Logger.getLogger(BatNdmLogTableDeleteJob.class);
//
//   private transient BatNdmLogTableDeleteService batNdmLogTableDeleteService;
//   
//   
//	@Override
//	public void execute(JobExecutionContext context) throws JobExecutionException {
//		
//		ApplicationContext appContext = null;
//		try {
//			appContext = (ApplicationContext)context.getScheduler().getContext().get("applicationContext");
//		} catch (SchedulerException e) {
//			logger.error("applicationContext get module error",e);
//			return ;
//		}  
//		batNdmLogTableDeleteService = (BatNdmLogTableDeleteService)appContext.getBean("batNdmLogTableDeleteService");	
//		
//		logger.info(">>> START EMPTY_NDM_LOG_TABLE_SCHEDULER...");
//
//		String today = CommonUtil.getToday("yyyyMMdd");
//		String targetDay = CommonUtil.getDiffHourDate(today, +24, "yyyyMMdd");
//		String targetTableName = "TSEAIEG"+targetDay.substring(6,8); 
//		
//		logger.info(">>> Target Table Name : " + targetTableName + ", Target Day : " + targetDay);
//
//		DataSourceType dataType = DataSourceTypeManager.getDataSourceType(DataSourceTypeManager.ISG);
//		DataSourceContextHolder.setDataSourceType(dataType);
//		 if(dataType != null) {
//			 batNdmLogTableDeleteService.truncNdmLogTable(dataType, targetTableName);
//		 }else{
//			logger.error(">>> dataType is null");
//		 }
//	  	
//	  	logger.info(">>> EMPTY_NDM_LOG_TABLE_SCHEDULER END");
//	  	
//	}
//}