init
This commit is contained in:
@@ -0,0 +1,57 @@
|
||||
package com.eactive.eai.rms.common.meta;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.eactive.eai.rms.common.base.SqlMapClientForMetaTemplateDao;
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* 1. 기능 : 대시보드에서 사용하기 위한 DB Query 서비스
|
||||
* 거래로그건수, 타임아웃건수, 에러로그 건수를 조회하여 리턴한다.
|
||||
* 2. 처리 개요 :
|
||||
* -
|
||||
* 3. 주의사항 :
|
||||
* </pre>
|
||||
*
|
||||
* @author : 윤영주
|
||||
* @version : $Revision: 1.12.2.3 $
|
||||
* @since : rts 1.0
|
||||
* @spring.bean id="DashboardTargetDao"
|
||||
* @spring.property name="dataSource" ref="dataSource"
|
||||
*/
|
||||
@Repository("metaSelectDao")
|
||||
public class MetaSelectDao extends SqlMapClientForMetaTemplateDao {
|
||||
|
||||
|
||||
/**
|
||||
* Logger for this class
|
||||
*/
|
||||
final Logger logger = Logger.getLogger(MetaSelectDao.class);
|
||||
|
||||
public List<HashMap<String, String>> selectSyncItem( HashMap<String,Object> paramMap) throws Exception {
|
||||
return null;
|
||||
// return this.template.queryForList("MetaSelect.selectSyncItem", paramMap);
|
||||
}
|
||||
public List<HashMap<String, String>> selectSyncTelegram( HashMap<String,Object> paramMap) throws Exception {
|
||||
return null;
|
||||
// return this.template.queryForList("MetaSelect.selectSyncTelegram", paramMap);
|
||||
}
|
||||
public List<HashMap<String, String>> selectSyncStdErrMsg( HashMap<String,Object> paramMap) throws Exception {
|
||||
return null;
|
||||
// return this.template.queryForList("MetaSelect.selectSyncStdErrMsg", paramMap);
|
||||
}
|
||||
public List<HashMap<String, String>> selectSyncCode( HashMap<String,Object> paramMap) throws Exception {
|
||||
return null;
|
||||
// return this.template.queryForList("MetaSelect.selectSyncCode", paramMap);
|
||||
}
|
||||
public List<HashMap<String, String>> selectSyncActnMsg( HashMap<String,Object> paramMap) throws Exception {
|
||||
return null;
|
||||
// return this.template.queryForList("MetaSelect.selectSyncActnMsg", paramMap);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
package com.eactive.eai.rms.common.meta;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.eactive.eai.rms.common.base.SqlMapClientTemplateDao;
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* 1. 기능 : 대시보드에서 사용하기 위한 DB Query 서비스
|
||||
* 거래로그건수, 타임아웃건수, 에러로그 건수를 조회하여 리턴한다.
|
||||
* 2. 처리 개요 :
|
||||
* -
|
||||
* 3. 주의사항 :
|
||||
* </pre>
|
||||
*
|
||||
* @author : 윤영주
|
||||
* @version : $Revision: 1.12.2.3 $
|
||||
* @since : rts 1.0
|
||||
* @spring.bean id="DashboardTargetDao"
|
||||
* @spring.property name="dataSource" ref="dataSource"
|
||||
*/
|
||||
@Repository("metaSyncDao")
|
||||
public class MetaSyncDao extends SqlMapClientTemplateDao{
|
||||
|
||||
/**
|
||||
* Logger for this class
|
||||
*/
|
||||
final Logger logger = Logger.getLogger(MetaSyncDao.class);
|
||||
|
||||
public String getLastUpdateTimeItem(HashMap<String,Object> paramMap)throws Exception {
|
||||
return null;
|
||||
// return (String)this.template.queryForObject("MetaSync.getLastUpdateTimeItem",paramMap);
|
||||
}
|
||||
|
||||
public String getLastUpdateTimeTelegram(HashMap<String,Object> paramMap) throws Exception {
|
||||
return null;
|
||||
// return (String)this.template.queryForObject("MetaSync.getLastUpdateTimeTelegram",paramMap);
|
||||
}
|
||||
|
||||
public String getLastUpdateTimeStdErrMsg(HashMap<String,Object> paramMap) throws Exception {
|
||||
return null;
|
||||
// return (String)this.template.queryForObject("MetaSync.getLastUpdateTimeStdErrMsg",paramMap);
|
||||
}
|
||||
public String getLastUpdateTimeCode(HashMap<String,Object> paramMap) throws Exception {
|
||||
return null;
|
||||
// return (String)this.template.queryForObject("MetaSync.getLastUpdateTimeCode",paramMap);
|
||||
}
|
||||
public String getLastUpdateTimeActnMsg(HashMap<String,Object> paramMap) throws Exception {
|
||||
return null;
|
||||
// return (String)this.template.queryForObject("MetaSync.getLastUpdateTimeActnMsg",paramMap);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public int updateSyncItem(HashMap<String,String> paramMap) throws Exception {
|
||||
return this.template.update("MetaSync.updataSyncItem",paramMap);
|
||||
}
|
||||
|
||||
public int updateSyncTelegram(HashMap<String,String> paramMap) throws Exception {
|
||||
return this.template.update("MetaSync.updataSyncTelegram",paramMap);
|
||||
}
|
||||
|
||||
public int updateSyncStdErrMsg(HashMap<String,String> paramMap) throws Exception {
|
||||
return this.template.update("MetaSync.updataSyncStdErrMsg",paramMap);
|
||||
}
|
||||
public int updateSyncCode(HashMap<String,String> paramMap) throws Exception {
|
||||
return this.template.update("MetaSync.updataSyncCode",paramMap);
|
||||
}
|
||||
public int updateSyncActnMsg(HashMap<String,String> paramMap) throws Exception {
|
||||
return this.template.update("MetaSync.updataSyncActnMsg",paramMap);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
package com.eactive.eai.rms.common.meta;
|
||||
|
||||
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;
|
||||
|
||||
public class MetaSyncJob implements Job {
|
||||
private static final Logger logger = Logger.getLogger(MetaSyncJob.class);
|
||||
|
||||
public void execute(JobExecutionContext context) throws JobExecutionException {
|
||||
|
||||
ApplicationContext appContext = null;
|
||||
try {
|
||||
appContext = (ApplicationContext)context.getScheduler().getContext().get("applicationContext");
|
||||
} catch (SchedulerException e) {
|
||||
// TODO Auto-generated catch block
|
||||
//e.printStackTrace();
|
||||
return ;
|
||||
}
|
||||
if (appContext == null){
|
||||
logger.info("[MetaSyncJob.metaSync ]appContext is null");
|
||||
}
|
||||
if (appContext.getBean("metaSyncService") == null){
|
||||
logger.info("[MetaSyncJob.metaSync ]metaSyncService is null");
|
||||
}
|
||||
|
||||
MetaSyncService service = (MetaSyncService)appContext.getBean("metaSyncService");
|
||||
|
||||
|
||||
|
||||
logger.info("[MetaSyncJob.metaSync START]----------");
|
||||
//1. Meta Á¤º¸ Á¶È¸
|
||||
//int iCnt = 0;
|
||||
//int tCnt = 0;
|
||||
try {
|
||||
for(DataSourceType dataSourceType : DataSourceTypeManager.getOnlineDataSourceTypes()){
|
||||
DataSourceContextHolder.setDataSourceType(dataSourceType);
|
||||
int cnt=0;
|
||||
cnt = service.syncItem();
|
||||
logger.info("[MetaSyncJob.metaSync] item="+cnt);
|
||||
cnt = service.syncTelegram();
|
||||
logger.info("[MetaSyncJob.metaSync] telegram="+cnt);
|
||||
cnt = service.syncStdErrMsg();
|
||||
logger.info("[MetaSyncJob.metaSync] std error message="+cnt);
|
||||
cnt = service.syncCode();
|
||||
logger.info("[MetaSyncJob.metaSync] code="+cnt);
|
||||
cnt = service.syncActnMsg();
|
||||
logger.info("[MetaSyncJob.metaSync] actn message="+cnt);
|
||||
}
|
||||
|
||||
} catch(Exception e) {
|
||||
logger.error(e.getMessage(), e);
|
||||
} finally {
|
||||
logger.info("[MetaSyncJob.metaSync END]----------");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,144 @@
|
||||
package com.eactive.eai.rms.common.meta;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.eactive.eai.rms.common.base.BaseService;
|
||||
|
||||
/**
|
||||
* 대시보드에서 사용하기 위한 DB Query 서비스
|
||||
* 거래로그건수, 타임아웃건수, 에러로그 건수를 조회하여 리턴한다.
|
||||
*/
|
||||
|
||||
@Service("metaSyncService")
|
||||
public class MetaSyncService extends BaseService {
|
||||
|
||||
@Autowired
|
||||
@Qualifier("metaSyncDao")
|
||||
private MetaSyncDao metaSyncDao;
|
||||
|
||||
@Autowired
|
||||
@Qualifier("metaSelectDao")
|
||||
private MetaSelectDao metaSelectDao;
|
||||
|
||||
/**
|
||||
* Logger for this class
|
||||
*/
|
||||
private static final Logger logger = Logger.getLogger(MetaSyncService.class);
|
||||
|
||||
public int syncItem() {
|
||||
|
||||
try{
|
||||
HashMap<String,Object> param = new HashMap<String,Object>();
|
||||
|
||||
String time = metaSyncDao.getLastUpdateTimeItem(param);
|
||||
param.put("time", time);
|
||||
List<HashMap<String,String>> data =metaSelectDao.selectSyncItem( param);
|
||||
int cnt =0;
|
||||
if(data != null){ //취약점소스 수정 2020.08.24
|
||||
for(HashMap <String,String> m : data){
|
||||
cnt +=metaSyncDao.updateSyncItem(m);
|
||||
}
|
||||
}
|
||||
|
||||
return cnt;
|
||||
}catch(Exception e){
|
||||
//e.printStackTrace();
|
||||
logger.error("syncItem error", e);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
public int syncTelegram() {
|
||||
try{
|
||||
HashMap<String,Object> param = new HashMap<String,Object>();
|
||||
String time = metaSyncDao.getLastUpdateTimeTelegram(param);
|
||||
param.put("time", time);
|
||||
List<HashMap<String,String>> data =metaSelectDao.selectSyncTelegram( param);
|
||||
int cnt =0;
|
||||
if(data != null) { //취약점소스 수정 2020.08.24
|
||||
for(HashMap <String,String> m : data){
|
||||
cnt +=metaSyncDao.updateSyncTelegram(m);
|
||||
}
|
||||
}
|
||||
return cnt;
|
||||
}catch(Exception e){
|
||||
//e.printStackTrace();
|
||||
logger.error("syncTelegram error", e);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
public int syncStdErrMsg() {
|
||||
try{
|
||||
HashMap<String,Object> param = new HashMap<String,Object>();
|
||||
String time = metaSyncDao.getLastUpdateTimeStdErrMsg(param);
|
||||
param.put("time", time);
|
||||
List<HashMap<String,String>> data =metaSelectDao.selectSyncStdErrMsg( param);
|
||||
int cnt =0;
|
||||
if(data != null){ //취약점소스 수정 2020.08.24
|
||||
for(HashMap <String,String> m : data){
|
||||
cnt += metaSyncDao.updateSyncStdErrMsg(m);
|
||||
}
|
||||
}
|
||||
|
||||
return cnt;
|
||||
|
||||
}catch(Exception e){
|
||||
logger.error("Sync StdErrMsg Error", e);
|
||||
//e.printStackTrace();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
public int syncCode() {
|
||||
try{
|
||||
HashMap<String,Object> param = new HashMap<String,Object>();
|
||||
String time = metaSyncDao.getLastUpdateTimeCode(param);
|
||||
param.put("time", time);
|
||||
List<HashMap<String,String>> data =metaSelectDao.selectSyncCode( param);
|
||||
int cnt =0;
|
||||
|
||||
if(data != null) { //취약점소스 수정 2020.08.24
|
||||
for(HashMap <String,String> m : data){
|
||||
cnt += metaSyncDao.updateSyncCode(m);
|
||||
}
|
||||
}
|
||||
|
||||
return cnt;
|
||||
|
||||
}catch(Exception e){
|
||||
//e.printStackTrace();
|
||||
logger.error("syncCode error", e);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
public int syncActnMsg() {
|
||||
try{
|
||||
HashMap<String,Object> param = new HashMap<String,Object>();
|
||||
String time = metaSyncDao.getLastUpdateTimeActnMsg(param);
|
||||
param.put("time", time);
|
||||
List<HashMap<String,String>> data =metaSelectDao.selectSyncActnMsg( param);
|
||||
int cnt =0;
|
||||
if(data != null) { //취약점소스 수정 2020.08.24
|
||||
for(HashMap <String,String> m : data){
|
||||
cnt += metaSyncDao.updateSyncActnMsg(m);
|
||||
}
|
||||
}
|
||||
|
||||
return cnt;
|
||||
|
||||
}catch(Exception e){
|
||||
//e.printStackTrace();
|
||||
logger.error("syncActnMsg error", e);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user