init
This commit is contained in:
+146
@@ -0,0 +1,146 @@
|
||||
package com.eactive.eai.rms.onl.dashboard.controller;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Vector;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.servlet.http.HttpSession;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.ModelMap;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
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;
|
||||
import com.eactive.eai.rms.onl.dashboard.service.DashboardErrorService;
|
||||
|
||||
@Controller
|
||||
public class DashboardErrorController {
|
||||
private static final Logger logger = Logger.getLogger(DashboardErrorController.class);
|
||||
|
||||
@Autowired
|
||||
@Qualifier("dashboardErrorService")
|
||||
private DashboardErrorService dashboardErrorService;
|
||||
|
||||
@RequestMapping("/dashboard2/popupError.do")
|
||||
public String mainProc(ModelMap modelMap, HttpServletRequest request,
|
||||
HttpServletResponse response, String cmd, String type) {
|
||||
try {
|
||||
response.setHeader("Pragma", "No-cache");
|
||||
response.setHeader("Cache-Control", "no-cache");
|
||||
response.setHeader("Expires", "0");
|
||||
request.setCharacterEncoding("utf-8");
|
||||
|
||||
HttpSession session = request.getSession();
|
||||
|
||||
String logTime = request.getParameter("logTime");
|
||||
String domainType = request.getParameter("domainType");
|
||||
String nodeIndex = request.getParameter("nodeIndex");
|
||||
String errorType = request.getParameter("errorType");
|
||||
String commDiv = request.getParameter("commDiv");
|
||||
String subPage = request.getParameter("subPage");
|
||||
|
||||
if( commDiv == null ) commDiv = "0";
|
||||
if( nodeIndex == null ) nodeIndex = "";
|
||||
if( errorType == null ) errorType = "";
|
||||
|
||||
boolean isFromMainPage = true;
|
||||
if( "yes".equals(subPage) ) {
|
||||
// 상세페이지에서 호출된 경우에는 TARGET DB 전체를 조회한다.
|
||||
isFromMainPage = false ;
|
||||
}
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
Vector logList = null;
|
||||
|
||||
if (logTime == null) {
|
||||
logTime = CommonUtil.getThisTime();
|
||||
}
|
||||
|
||||
if (domainType == null) {
|
||||
logger.error("domainType os null");
|
||||
// domainType = DataSourceTypeManager.NSG;
|
||||
}
|
||||
|
||||
// 테스트
|
||||
logger.debug( "********************************" );
|
||||
logger.debug("isFromMainPage = " + isFromMainPage);
|
||||
logger.debug("logTime = " + logTime);
|
||||
logger.debug("domainType = " + domainType);
|
||||
logger.debug("nodeIndex = " + nodeIndex);
|
||||
logger.debug("errorType = " + errorType);
|
||||
logger.debug("commDiv = " + commDiv);
|
||||
|
||||
|
||||
//취약점코드 수정 2019.08.22 SW
|
||||
String owner = "";
|
||||
DataSourceType dt;
|
||||
if(domainType != null) {
|
||||
dt = DataSourceTypeManager.getDataSourceType(domainType);
|
||||
if(dt != null){
|
||||
DataSourceContextHolder.setDataSourceType(dt);
|
||||
owner = dt.getSchema();
|
||||
}
|
||||
}
|
||||
|
||||
if( isFromMainPage == false ) {
|
||||
// 상세페이지 에서의 조회는 서버구분코드를 고려하지 않는다.
|
||||
logList = dashboardErrorService.getLogList(owner, logTime, nodeIndex, errorType, "");
|
||||
} else if (DataSourceTypeManager.MCI.equals(domainType)
|
||||
|| DataSourceTypeManager.MCU.equals(domainType)
|
||||
|| DataSourceTypeManager.EAI.equals(domainType)
|
||||
|| DataSourceTypeManager.FEP.equals(domainType)) {
|
||||
logList = dashboardErrorService.getLogListBranchTest(owner, logTime, nodeIndex, errorType, commDiv);
|
||||
} else {
|
||||
logList = dashboardErrorService.getLogList(owner, logTime, nodeIndex, errorType, "");
|
||||
}
|
||||
|
||||
session.setAttribute("logTime", logTime);
|
||||
session.setAttribute("domainType", domainType);
|
||||
session.setAttribute("errorType", errorType);
|
||||
session.setAttribute("commDiv", commDiv);
|
||||
session.setAttribute("nodeIndex", nodeIndex);
|
||||
session.setAttribute("logList", logList);
|
||||
} catch ( Exception e ) {
|
||||
//e.printStackTrace();
|
||||
//취약점코드 수정 2019.08.22 SW
|
||||
logger.error(e.getMessage());
|
||||
}
|
||||
|
||||
if("new".equals(request.getParameter("cmd"))){
|
||||
return "redirect:/dashboard2/dashpopup2.jsp";
|
||||
}else{
|
||||
return "redirect:/dashboard2/dashpopup.jsp";
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping(value= "/dashboard2/timeoutError.json")
|
||||
public ModelAndView timeoutError(HttpServletRequest request, HttpServletResponse response, String adt, String domainType) throws Exception {
|
||||
|
||||
HashMap<String,Object> map = new HashMap<String,Object>();
|
||||
|
||||
if (adt != null && domainType != null) {
|
||||
DataSourceType dt = DataSourceTypeManager.getDataSourceType(domainType);
|
||||
DataSourceContextHolder.setDataSourceType(dt);
|
||||
|
||||
//취약점코드 수정 2019.08.22 SW
|
||||
String owner = "";
|
||||
if(dt != null){
|
||||
owner = dt.getSchema();
|
||||
}
|
||||
|
||||
map = dashboardErrorService.getDSGTelno(owner, adt);
|
||||
}
|
||||
|
||||
ModelAndView modelAndView = new ModelAndView("jsonView",map);
|
||||
return modelAndView;
|
||||
}
|
||||
|
||||
}
|
||||
+69
@@ -0,0 +1,69 @@
|
||||
package com.eactive.eai.rms.onl.dashboard.controller;
|
||||
|
||||
public class MobileMonitorController {
|
||||
|
||||
public String transValue() {
|
||||
MobileMonitorShareMemory ms = MobileMonitorShareMemory.getInstance();
|
||||
|
||||
return ms.getTranCount();
|
||||
}
|
||||
|
||||
public String comma_add(String num){
|
||||
String original = num;
|
||||
String convert = "";
|
||||
int count = 1;
|
||||
for (int i=original.length()-1; i>-1; i--){
|
||||
if((count%3)==0 && i<original.length()-1 && i>0){
|
||||
convert = ","+original.charAt(i) + convert;
|
||||
}else{
|
||||
convert = original.charAt(i) + convert;
|
||||
}
|
||||
count++;
|
||||
}
|
||||
return convert;
|
||||
}
|
||||
|
||||
public String returnFilterString(String str){
|
||||
if (str == null || "".equals(str))
|
||||
return "";
|
||||
String rstr = str;
|
||||
// int iStr = rstr.length();
|
||||
rstr = rstr.replace("<", "<");
|
||||
rstr = rstr.replace(">", ">");
|
||||
rstr = rstr.replace("#", "&ns;");
|
||||
rstr = rstr.replace("(", "&lp;");
|
||||
rstr = rstr.replace(")", "&rp;");
|
||||
rstr = rstr.replace("{", "&lcb;");
|
||||
rstr = rstr.replace("}", "&rcb;");
|
||||
rstr = rstr.replace("%", "&ps;");
|
||||
|
||||
return rstr;
|
||||
}
|
||||
|
||||
|
||||
// private int getDayOfWeekNum() {
|
||||
// Calendar c = Calendar.getInstance();
|
||||
// return c.get(Calendar.DAY_OF_WEEK);
|
||||
// }
|
||||
|
||||
|
||||
|
||||
|
||||
// public static void main(String[] args){ //취약점소스 수정 2020.08.24
|
||||
// System.out.println("dd");
|
||||
// String msg = "1234567890abcdefghijklmn";
|
||||
// String returnMsg = "";
|
||||
// if(msg.length() < 10){
|
||||
// System.out.println(msg);
|
||||
// }else if(msg.length() < 15){
|
||||
// returnMsg = msg.substring(0,14) + "\n" + msg.substring(14,20);
|
||||
// System.out.println(returnMsg);
|
||||
// }else{
|
||||
// returnMsg = msg.substring(0,14) + "\n" + msg.substring(14,20) + "\n" + msg.substring(20, msg.length());
|
||||
// System.out.println(returnMsg);
|
||||
// }
|
||||
// //HelloController a = new HelloController();
|
||||
// //a.checkTransValue();
|
||||
// //itsmCheckListInfo.selectCheckListInfo();
|
||||
// }
|
||||
}
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
package com.eactive.eai.rms.onl.dashboard.controller;
|
||||
|
||||
public class MobileMonitorShareMemory {
|
||||
|
||||
private static MobileMonitorShareMemory SINGLETON_INSTANCE = new MobileMonitorShareMemory();
|
||||
private String TranCount="내부,ieaapon,0,0,0,0,;대외,ieaapod,0,0,0,0,;공동,ieaapog,0,0,0,0,;DMZ,ieaapoz,0,0,0,0";
|
||||
private MobileMonitorShareMemory(){
|
||||
|
||||
}
|
||||
public static MobileMonitorShareMemory getInstance(){
|
||||
if(SINGLETON_INSTANCE == null){
|
||||
SINGLETON_INSTANCE = new MobileMonitorShareMemory();
|
||||
}
|
||||
return SINGLETON_INSTANCE;
|
||||
}
|
||||
|
||||
public String getTranCount() {
|
||||
return this.TranCount;
|
||||
}
|
||||
|
||||
public void setTranCount(String tranCount) {
|
||||
this.TranCount = tranCount;
|
||||
}
|
||||
}
|
||||
+976
@@ -0,0 +1,976 @@
|
||||
package com.eactive.eai.rms.onl.dashboard.controller;
|
||||
|
||||
import java.io.PrintWriter;
|
||||
import java.net.InetAddress;
|
||||
import java.net.UnknownHostException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Vector;
|
||||
|
||||
import javax.servlet.ServletOutputStream;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.ModelMap;
|
||||
import org.springframework.web.bind.ServletRequestUtils;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.servlet.View;
|
||||
|
||||
import com.eactive.eai.rms.common.context.MonitoringContext;
|
||||
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;
|
||||
import com.eactive.eai.rms.onl.common.service.EaiServerInfoService;
|
||||
import com.eactive.eai.rms.onl.dashboard.dao.DashboardDAO;
|
||||
import com.eactive.eai.rms.onl.dashboard.service.Dashboard2RepositoryService;
|
||||
import com.eactive.eai.rms.onl.dashboard.service.DashboardService;
|
||||
import com.eactive.eai.rms.onl.tracking.vo.MemStaticsVo;
|
||||
import com.eactive.eai.rms.onl.vo.AdaptersVO;
|
||||
import com.eactive.eai.rms.onl.vo.EAIEngineStatusVo;
|
||||
import com.eactive.eai.rms.onl.vo.HostStatusVo;
|
||||
import com.eactive.eai.rms.onl.vo.RealTimeAdaptersVO;
|
||||
import com.eactive.eai.rms.onl.vo.SmsVO;
|
||||
|
||||
|
||||
@Controller
|
||||
//@RequestMapping("/dashboard2.do")
|
||||
public class NewDashboardMainController {
|
||||
private static final String FIELD_SEP = "," ;
|
||||
private static final String LINE_SEP = ";" ;
|
||||
|
||||
private static final Logger logger = Logger.getLogger(NewDashboardMainController.class);
|
||||
|
||||
|
||||
/** The monitoring context. */
|
||||
@Autowired
|
||||
@Qualifier("monitoringContext")
|
||||
private transient MonitoringContext monitoringContext;
|
||||
|
||||
/** The eai server info service. */
|
||||
@Autowired
|
||||
@Qualifier("eaiServerInfoService")
|
||||
private EaiServerInfoService eaiServerInfoService;
|
||||
|
||||
/** The dashboard service. */
|
||||
@Autowired
|
||||
@Qualifier("dashboardService")
|
||||
private DashboardService dashboardService;
|
||||
|
||||
@Autowired
|
||||
@Qualifier("dashboard2RepositoryService")
|
||||
private Dashboard2RepositoryService dashboard2Repository;
|
||||
|
||||
@Autowired
|
||||
@Qualifier("dashboardDao")
|
||||
private DashboardDAO dashboardDao;
|
||||
|
||||
@RequestMapping(path = "/dashmain3.do")
|
||||
public String dashmain3(HttpServletRequest request) {
|
||||
return "dashmain3";
|
||||
}
|
||||
|
||||
@RequestMapping(path = "/dashboard2.do", params = "cmd=main")
|
||||
public View mainProc(ModelMap modelMap, HttpServletRequest request, HttpServletResponse response, String cmd, String type) {
|
||||
try {
|
||||
// 한글처리 관련
|
||||
response.setContentType("text/xml;charset=utf-8");
|
||||
response.setHeader("Cache-Control", "no-cache");
|
||||
|
||||
PrintWriter pw = response.getWriter();
|
||||
|
||||
List<Map<String, String>> list = null ;
|
||||
StringBuffer sb = new StringBuffer();
|
||||
|
||||
String service = ServletRequestUtils.getStringParameter(request, "service", "");
|
||||
|
||||
String tradeTarget = (String)request.getSession().getAttribute(MonitoringContext.RMS_TRADE_COUNT_TARGET);
|
||||
if( tradeTarget == null || "".equals(tradeTarget) ) {
|
||||
tradeTarget = "ALL" ;
|
||||
}
|
||||
|
||||
logger.debug("mainProc[" + type + "]:" + service);
|
||||
|
||||
if( (service.length() > 0) &&
|
||||
DataSourceTypeManager.getDataSourceType(service) == null) {
|
||||
logger.warn("New dashboard Skip mainProc unregistered Service : service=" + service +", cmd="+ cmd +", type="+ type);
|
||||
return null;
|
||||
}
|
||||
DataSourceContextHolder.setDataSourceType(DataSourceTypeManager.getDataSourceType(service));
|
||||
|
||||
if( "baseinfo".equals(type) ) {
|
||||
sb.append( getTargetService()); // ALL
|
||||
} else if( "serverinfo".equals(type) ) {
|
||||
|
||||
// EAISVRINSTNM,EAISVRIP,EAISVRLSNPORT,HOSTNAME
|
||||
// BATCH는 서버리스는 없음 new 만 해서 리턴함
|
||||
|
||||
if (DataSourceTypeManager.BAT.equals(service)){
|
||||
list = eaiServerInfoService.getBatServerIpList();
|
||||
} else if (DataSourceTypeManager.BAP.equals(service)){
|
||||
list = eaiServerInfoService.getBapServerIpList();
|
||||
} else {
|
||||
list = eaiServerInfoService.getEaiServerIpListDB();
|
||||
}
|
||||
|
||||
logger.debug("[" + service + "]serverinfo:" + list);
|
||||
if( list != null ) {
|
||||
for( Map<String,String> map : list ) {
|
||||
String inst = map.get("EAISVRINSTNM");
|
||||
String ip = map.get("EAISVRIP");
|
||||
String port = map.get("EAISVRLSNPORT");
|
||||
String host = map.get("HOSTNAME");
|
||||
sb.append(inst).append(FIELD_SEP);
|
||||
sb.append(ip).append(FIELD_SEP);
|
||||
sb.append(port).append(FIELD_SEP);
|
||||
sb.append(host).append(LINE_SEP);
|
||||
}
|
||||
//out.print(sb.toString());
|
||||
}
|
||||
} else if( "hostinfo".equals(type) ) {
|
||||
// list : [{HOSTNAME=I12245, FAILOVERSVRNM=ALL, WEBSERVERPORT=null, EAISVRLSNPORT=30513, EAISVRINSTNM=EAIISG_i21, EAISVRIP=192.168.120.245},
|
||||
// {HOSTNAME=I12245, FAILOVERSVRNM=ALL, WEBSERVERPORT=null, EAISVRLSNPORT=30514, EAISVRINSTNM=EAIISG_i22, EAISVRIP=192.168.120.245}]
|
||||
// hostinfo : I12245, 1, 0,0,0,0,0,0,0, 00, 0,0,0, 0, 0,0,0,0,0,0,0
|
||||
// hostinfo : 호스트명,hostAlive,adapterAlive,sna,socket,mq,http,ejb,tuxedo,instanceAlive,cpu,mem,disk,procTotal,realTimeAlive,sna,socket,mq,http,ejb,tuxedo
|
||||
|
||||
if (DataSourceTypeManager.BAT.equals(service)){
|
||||
list = eaiServerInfoService.getBatServerIpList();
|
||||
} else if (DataSourceTypeManager.BAP.equals(service)){
|
||||
list = eaiServerInfoService.getBapServerIpList();
|
||||
} else {
|
||||
list = eaiServerInfoService.getEaiServerIpListDB();
|
||||
}
|
||||
logger.debug("[" + service + "]list:" + list);
|
||||
|
||||
if( list == null ) {
|
||||
// 에러처리
|
||||
logger.error("New dashboard host list is null ! : cmd=hostinfo, service=" + service);
|
||||
return null ;
|
||||
}
|
||||
|
||||
String backHost = "" ;
|
||||
for( Map<String,String> map : list ) {
|
||||
String inst = map.get("EAISVRINSTNM");
|
||||
String ip = map.get("EAISVRIP");
|
||||
//String port = map.get("EAISVRLSNPORT");
|
||||
String host = map.get("HOSTNAME");
|
||||
|
||||
if( logger.isDebugEnabled() ) {
|
||||
logger.debug("inst=" + inst + ", ip=" + ip + ", host=" + host );
|
||||
}
|
||||
|
||||
//boolean isAlive = false;
|
||||
// host 별로 작성하기 위해서 backHost 저장 후 이전 호스트와 다를 경우만 처리 함
|
||||
if( ! backHost.equals(host) ) {
|
||||
backHost = host;
|
||||
|
||||
// 0. 호스트명
|
||||
sb.append(host).append(FIELD_SEP);
|
||||
|
||||
// 1. host 에 해당하는 서버의 서버다운 여부
|
||||
String hostAlive = null ;
|
||||
if(ip != null){
|
||||
hostAlive = dashboard2Repository.getHostAlive(ip) ;
|
||||
}
|
||||
|
||||
sb.append(hostAlive).append(FIELD_SEP);
|
||||
|
||||
List<Map<String, String>> instList = null ;
|
||||
if (DataSourceTypeManager.BAT.equals(service)){
|
||||
if(host != null) { //취약점소스 수정 2020.08.25
|
||||
instList = eaiServerInfoService.getBatServerIpListByHostName( host);
|
||||
}
|
||||
}else if (DataSourceTypeManager.BAP.equals(service)){
|
||||
if(host != null) { //취약점소스 수정 2020.08.25
|
||||
instList = eaiServerInfoService.getBapServerIpListByHostName( host);
|
||||
}
|
||||
} else {
|
||||
if(host != null) { //취약점소스 수정 2020.08.25
|
||||
instList = eaiServerInfoService.getEaiServerIpListByHostName( host);
|
||||
}
|
||||
}
|
||||
logger.debug("[" + service + "]instList:" + instList);
|
||||
|
||||
// 2. 어댑터 상태 : 전체 어댑터중 장애 상태의 어댑터 또는, 경고 상태 어댑터가 있는가?
|
||||
AdaptersVO vo = null; //취약점소스 수정 2020.08.26
|
||||
if(instList != null){
|
||||
vo = dashboardService.findAdapterStatusTotalList(instList);
|
||||
}
|
||||
|
||||
|
||||
// 0:에러, 1:부분정상, 2:정상
|
||||
int sna = vo.getSna(3);
|
||||
int socket = vo.getSocket2(3);
|
||||
int http = vo.getHttp(3);
|
||||
int ejb = vo.getEjb(3);
|
||||
int mq = vo.getMq(3);
|
||||
int tuxedo = vo.getTuxedo(3);
|
||||
|
||||
if (DataSourceTypeManager.BAT.equals(service)){
|
||||
// TODO : 배치는 socket(소켓2) 만 사용한다.
|
||||
if( socket==0 ) {
|
||||
sb.append("0");
|
||||
} else if( socket==1 ) {
|
||||
sb.append("1");
|
||||
} else if( socket==2 ) {
|
||||
sb.append("2");
|
||||
} else {
|
||||
sb.append("3");
|
||||
}
|
||||
} else {
|
||||
sb.append(vo.getTotal(3));
|
||||
}
|
||||
sb.append(FIELD_SEP);
|
||||
sb.append(sna).append(FIELD_SEP);
|
||||
sb.append(socket).append(FIELD_SEP);
|
||||
sb.append(mq).append(FIELD_SEP);
|
||||
sb.append(http).append(FIELD_SEP);
|
||||
sb.append(ejb).append(FIELD_SEP);
|
||||
sb.append(tuxedo).append(FIELD_SEP);
|
||||
|
||||
//일괄전송 192.168.68.41 ieaapdi1_svc 참고
|
||||
// 3. 인스턴스 상태 : 인스턴스 상태가 RUNNING 인가?
|
||||
// 0: 중지, 2: 정상
|
||||
List<EAIEngineStatusVo> engineList = dashboardService.findEngineStatus(instList, true);
|
||||
String stat = "" ;
|
||||
for( EAIEngineStatusVo engineVo : engineList ) {
|
||||
engineVo.getInstanceName();
|
||||
engineVo.getHostName();
|
||||
engineVo.getServerState(); // RUNNING
|
||||
if( "2".equals( engineVo.getServerState() )) {
|
||||
stat += "1" ;
|
||||
} else {
|
||||
stat += "0" ;
|
||||
}
|
||||
}
|
||||
|
||||
// 4. cpu, memory, disk 점유율
|
||||
HostStatusVo hostVo = null;
|
||||
if(instList != null){//취약점소스 수정 2020.08.26
|
||||
hostVo = dashboardService.findHostStatus(instList);
|
||||
}
|
||||
|
||||
|
||||
// if (DataSourceTypeManager.BAT.equals(service) || DataSourceTypeManager.BAP.equals(service)){ //메모리 정보가 있을경우 상태값 정상
|
||||
// if(hostVo != null)
|
||||
// stat = "1";
|
||||
// }
|
||||
|
||||
sb.append(stat).append(FIELD_SEP);
|
||||
|
||||
|
||||
// cpu,mem,disk 값이 100 이상이면 자릿수가 깨지므로
|
||||
// 최대값을 99로 제한한다.
|
||||
int cpu = hostVo.getCpu() ;
|
||||
int mem = hostVo.getMemory() ;
|
||||
int disk = hostVo.getDisk() ;
|
||||
|
||||
if( cpu > 99 ) {
|
||||
cpu = 99 ;
|
||||
}
|
||||
if( mem > 99 ) {
|
||||
mem = 99 ;
|
||||
}
|
||||
if( disk > 99 ) {
|
||||
disk = 99 ;
|
||||
}
|
||||
|
||||
sb.append(cpu).append(FIELD_SEP);
|
||||
sb.append(mem).append(FIELD_SEP);
|
||||
sb.append(disk).append(FIELD_SEP);
|
||||
|
||||
// 4. Host별 거래처리건수
|
||||
if (DataSourceTypeManager.BAT.equals(service)){
|
||||
String tmp = dashboard2Repository.getProcEaiBatch();
|
||||
if( tmp == null ) tmp = "0,0,0,0" ;
|
||||
String tmpProc[] = tmp.split(",");
|
||||
int batchProcSum = 0 ;
|
||||
if( tmpProc.length > 1 ) {
|
||||
//총 거래 = 정상송신 + 에러송신 + 대기송신
|
||||
int sendN = CommonUtil.getInt(tmpProc[0]);
|
||||
int sendE = CommonUtil.getInt(tmpProc[2]);
|
||||
int sendQ = CommonUtil.getInt(tmpProc[4]);
|
||||
batchProcSum = sendN + sendE + sendQ ;
|
||||
}
|
||||
sb.append(batchProcSum).append(FIELD_SEP);
|
||||
} else {
|
||||
MemStaticsVo mvo = dashboard2Repository.getMemTradeVoByHost(host, list);
|
||||
sb.append(mvo.getProcTotal()).append(FIELD_SEP);
|
||||
}
|
||||
|
||||
// 5. 24시업무대상어댑터 상태 : 전체 어댑터중 장애 상태의 어댑터 또는, 경고 상태 어댑터가 있는가?
|
||||
RealTimeAdaptersVO rtVO = null; //취약점소스 수정 2020.08.26
|
||||
if(instList != null) {
|
||||
rtVO = dashboardService.findRTAdapterStatusTotalList(instList);
|
||||
}
|
||||
// 0:에러, 1:부분정상, 2:정상
|
||||
sna = rtVO.getSna(3);
|
||||
socket = rtVO.getSocket2(3);
|
||||
http = rtVO.getHttp(3);
|
||||
ejb = rtVO.getEjb(3);
|
||||
mq = rtVO.getMq(3);
|
||||
tuxedo = rtVO.getTuxedo(3);
|
||||
|
||||
if (DataSourceTypeManager.BAT.equals(service)){
|
||||
// TODO : 배치는 socket(소켓2) 만 사용한다.
|
||||
if( socket==0 ) {
|
||||
sb.append("0");
|
||||
} else if( socket==1 ) {
|
||||
sb.append("1");
|
||||
} else if( socket==2 ) {
|
||||
sb.append("2");
|
||||
} else {
|
||||
sb.append("3");
|
||||
}
|
||||
} else {
|
||||
sb.append(rtVO.getTotal(3));
|
||||
}
|
||||
sb.append(FIELD_SEP);
|
||||
sb.append(sna).append(FIELD_SEP);
|
||||
sb.append(socket).append(FIELD_SEP);
|
||||
sb.append(mq).append(FIELD_SEP);
|
||||
sb.append(http).append(FIELD_SEP);
|
||||
sb.append(ejb).append(FIELD_SEP);
|
||||
sb.append(tuxedo);
|
||||
|
||||
sb.append(LINE_SEP);
|
||||
} // backhost if
|
||||
} // end for
|
||||
// ("######" + sb.toString());
|
||||
logger.info("hostinfo:[" + sb.toString() + "]");
|
||||
|
||||
} else if( "traninfo".equals(type) ) {
|
||||
// DB 에서 주기적으로 조회하여 지정한 테이블에 업데이트 하고,
|
||||
// 업데이트된 결과를 조회하는 로직으로 처리하자. ( 테이블 설계 및 신청 필요 )
|
||||
// 내부,대외,공동,DMZ,합계,일괄전송
|
||||
// 서비스,거래처리,증가,timeout,증가,에러,증가
|
||||
|
||||
HashMap<String, MemStaticsVo> memStaticsVos = new HashMap<String, MemStaticsVo>();
|
||||
for(DataSourceType dataSourceType : DataSourceTypeManager.getOnlineDataSourceTypes()){
|
||||
DataSourceContextHolder.setDataSourceType(dataSourceType);
|
||||
String typeName = dataSourceType.getName();
|
||||
memStaticsVos.put(typeName, dashboard2Repository.getMemTradeVoByService(typeName));
|
||||
}
|
||||
|
||||
int procTotal = 0;
|
||||
int timeoutTotal = 0;
|
||||
int errorTotal = 0;
|
||||
int syserrorTotal = 0;
|
||||
|
||||
if( "ALL".equals(tradeTarget) ) {
|
||||
for (String key : memStaticsVos.keySet()) {
|
||||
MemStaticsVo memStaticsVo = memStaticsVos.get(key);
|
||||
|
||||
sb.append((String) key).append(FIELD_SEP);
|
||||
sb.append(memStaticsVo.getProcTotal()).append(FIELD_SEP);
|
||||
sb.append(memStaticsVo.getTimeoutTotal()).append(FIELD_SEP);
|
||||
sb.append(memStaticsVo.getErrorTotal()).append(FIELD_SEP);
|
||||
sb.append(memStaticsVo.getSysErrorTotal());
|
||||
sb.append(LINE_SEP);
|
||||
|
||||
procTotal += memStaticsVo.getProcTotal();
|
||||
timeoutTotal += memStaticsVo.getTimeoutTotal();
|
||||
errorTotal += memStaticsVo.getErrorTotal();
|
||||
syserrorTotal += memStaticsVo.getSysErrorTotal();
|
||||
}
|
||||
} else {
|
||||
MemStaticsVo memStaticsVo = memStaticsVos.get(tradeTarget);
|
||||
|
||||
sb.append(tradeTarget).append(FIELD_SEP);
|
||||
sb.append(memStaticsVo.getProcTotal()).append(FIELD_SEP);
|
||||
sb.append(memStaticsVo.getTimeoutTotal()).append(FIELD_SEP);
|
||||
sb.append(memStaticsVo.getErrorTotal()).append(FIELD_SEP);
|
||||
sb.append(memStaticsVo.getSysErrorTotal());
|
||||
sb.append(LINE_SEP);
|
||||
|
||||
procTotal = memStaticsVo.getProcTotal();
|
||||
timeoutTotal = memStaticsVo.getTimeoutTotal();
|
||||
errorTotal = memStaticsVo.getErrorTotal();
|
||||
syserrorTotal += memStaticsVo.getSysErrorTotal();
|
||||
}
|
||||
|
||||
sb.append("TOTAL").append(FIELD_SEP);
|
||||
sb.append(procTotal).append(FIELD_SEP);
|
||||
sb.append(timeoutTotal).append(FIELD_SEP);
|
||||
sb.append(errorTotal).append(FIELD_SEP);
|
||||
sb.append(syserrorTotal);
|
||||
sb.append(LINE_SEP);
|
||||
|
||||
//일괄전송
|
||||
String batchCount = DataSourceTypeManager.BAP + FIELD_SEP + dashboard2Repository.getProcBatch();
|
||||
sb.append( batchCount );
|
||||
sb.append(LINE_SEP);
|
||||
|
||||
//배치
|
||||
String batchCount2 = DataSourceTypeManager.BAT + FIELD_SEP + dashboard2Repository.getProcEaiBatch();
|
||||
sb.append( batchCount2 );
|
||||
if( logger.isDebugEnabled() ) {
|
||||
logger.debug( sb.toString() );
|
||||
}
|
||||
|
||||
// 상황실 근무자를 위해 매일 밤 23시58분 부터 거래건수 정보를 Export 한다.
|
||||
String now = CommonUtil.getToday("") ;
|
||||
int test = CommonUtil.getInt(now.substring(8,12)) ;
|
||||
if( test > 2357 ) {
|
||||
String strReport = sb.toString();
|
||||
|
||||
for(DataSourceType dataSourceType : DataSourceTypeManager.getOnlineDataSourceTypes()){
|
||||
strReport = strReport.replace(dataSourceType.getName(), dataSourceType.getText());
|
||||
}
|
||||
|
||||
strReport = strReport.replace(DataSourceTypeManager.BAP, "일괄전송");
|
||||
strReport = strReport.replace(DataSourceTypeManager.BAT, "배치");
|
||||
|
||||
logger.debug("거래건수누계 : " + strReport );
|
||||
}
|
||||
|
||||
} else if( "peakinfo".equals(type) ) {
|
||||
String peakStat = ServletRequestUtils.getStringParameter(request, "peakstat", "tps");
|
||||
|
||||
String tps ="";
|
||||
|
||||
if( "tps".equals(peakStat) ) { // tps
|
||||
for (DataSourceType d : DataSourceTypeManager.getOnlineDataSourceTypes()){
|
||||
tps += dashboard2Repository.getPeakTps(d.getName());
|
||||
tps += ";";
|
||||
}
|
||||
DataSourceType bap = DataSourceTypeManager.getDataSourceType(DataSourceTypeManager.BAP);
|
||||
if(bap == null) {
|
||||
tps += "0;";
|
||||
}
|
||||
else {
|
||||
tps += dashboard2Repository.getPeakTps(bap.getName());
|
||||
tps += ";";
|
||||
}
|
||||
|
||||
DataSourceType bat = DataSourceTypeManager.getDataSourceType(DataSourceTypeManager.BAT);
|
||||
if(bat == null) {
|
||||
tps += "0;";
|
||||
}
|
||||
else {
|
||||
tps += dashboard2Repository.getPeakTps(bat.getName());
|
||||
tps += ";";
|
||||
}
|
||||
|
||||
} else { // trade
|
||||
|
||||
for (DataSourceType d : DataSourceTypeManager.getOnlineDataSourceTypes()){
|
||||
tps += dashboard2Repository.getPeakTrade(d.getName());
|
||||
tps += ";";
|
||||
}
|
||||
DataSourceType bap = DataSourceTypeManager.getDataSourceType(DataSourceTypeManager.BAP);
|
||||
if(bap == null) {
|
||||
tps += "0;";
|
||||
}
|
||||
else {
|
||||
tps += dashboard2Repository.getPeakTrade(bap.getName());
|
||||
tps += ";";
|
||||
}
|
||||
|
||||
DataSourceType bat = DataSourceTypeManager.getDataSourceType(DataSourceTypeManager.BAT);
|
||||
if(bat == null) {
|
||||
tps += "0;";
|
||||
}
|
||||
else {
|
||||
tps += dashboard2Repository.getPeakTrade(bat.getName());
|
||||
tps += ";";
|
||||
}
|
||||
}
|
||||
|
||||
logger.warn("peakinfo(peakStat=" + peakStat + ") =>" + tps );
|
||||
|
||||
if( logger.isDebugEnabled() ) {
|
||||
logger.debug("peakinfo(peakStat=" + peakStat + ") =>" + tps );
|
||||
}
|
||||
|
||||
String [] lines = tps.split(";");
|
||||
for( int i = 0 ; i < lines.length ; i++ ) {
|
||||
String data[] = lines[i].split(",");
|
||||
if( data.length > 3 ) {
|
||||
sb.append(data[0]).append(FIELD_SEP);
|
||||
sb.append(data[1]).append(FIELD_SEP);
|
||||
sb.append(data[2]).append(FIELD_SEP);
|
||||
sb.append(data[3]).append(LINE_SEP);
|
||||
}
|
||||
}
|
||||
|
||||
} else if( "smsinfo".equals(type) ) {
|
||||
List<SmsVO> totalSmsList = new LinkedList<SmsVO>();
|
||||
for (DataSourceType d : DataSourceTypeManager.getOnlineDataSourceTypes()){
|
||||
DataSourceContextHolder.setDataSourceType(d);
|
||||
List ipList = eaiServerInfoService.getEaiServerIpListDB();
|
||||
List<SmsVO> smsList = dashboardService.findSmsList(ipList,d.getName());
|
||||
totalSmsList.addAll(smsList);
|
||||
}
|
||||
|
||||
HashMap mapBack = new HashMap();
|
||||
List<String> tmpList = new ArrayList<String>();
|
||||
for ( SmsVO vo : totalSmsList ) {
|
||||
//String svc = vo.getService();
|
||||
//String name = ServiceType.get(svc).getName();
|
||||
//String inst = vo.getInstanceName();
|
||||
List<String> msgList = vo.getMessage();
|
||||
|
||||
for( String msg : msgList ) {
|
||||
// 메시지 + @ + 서비스 + @ 인스턴스 ( 시간별로 sort 하기 위함 )
|
||||
tmpList.add(msg ) ; //+ "@$@" + svc + "@$@" + inst );
|
||||
mapBack.put(msg, vo);
|
||||
}
|
||||
}
|
||||
|
||||
Object sortList[] = tmpList.toArray();
|
||||
Arrays.sort(sortList);
|
||||
|
||||
String smsBreaker = dashboardService.getSmsBreaker();
|
||||
if( "".equals(smsBreaker) ) {
|
||||
smsBreaker = "0100 00:00:00" ;
|
||||
}
|
||||
|
||||
if( logger.isDebugEnabled() ) {
|
||||
logger.debug( "SMS_BREAKER=>[" + smsBreaker + "]" );
|
||||
}
|
||||
|
||||
//월일
|
||||
String mmdd = CommonUtil.getToday("MMdd");
|
||||
int count = 10 ;
|
||||
for( int i = sortList.length - 1 ; i >= 0 ; i-- ) {
|
||||
|
||||
if( count < 0 ) break;
|
||||
|
||||
String msg = (String)sortList[i];
|
||||
SmsVO voTmp = (SmsVO)mapBack.get(msg);
|
||||
|
||||
String svc = voTmp.getService();
|
||||
String name = "";
|
||||
|
||||
logger.info("SMS MSG : " + msg );
|
||||
|
||||
for(DataSourceType dataSourceType : DataSourceTypeManager.getOnlineDataSourceTypes()){
|
||||
if (dataSourceType.getName().equals(svc)){
|
||||
name = dataSourceType.getText();
|
||||
}
|
||||
}
|
||||
|
||||
String inst = voTmp.getInstanceName();
|
||||
|
||||
//
|
||||
if( msg == null || msg.length() < 17 ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// 당일 데이터가 아닌것은 제외한다.
|
||||
// if( mmdd.compareTo(msg.substring(5,10).replace("-","")) > 0 ) {
|
||||
if( mmdd.compareTo(msg.substring(0,4)) > 0 ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
logger.info("SMS smsBreaker : " + smsBreaker );
|
||||
|
||||
// Beaker time 보다 이전의 데이터는 제외한다.
|
||||
if( msg != null && msg.length() > 13 ) {
|
||||
if ( smsBreaker.compareTo(msg.substring(0,13)) > -1 ) {
|
||||
//기준시간보다 이전이므로 제외합니다.
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Date dd = new Date();
|
||||
// SimpleDateFormat dateF = new SimpleDateFormat("YYYY-MM-dd");
|
||||
// String todate = "";
|
||||
// Calendar cal = Calendar.getInstance();
|
||||
// cal.setTime(dd);
|
||||
// todate = dateF.format(cal.getTime());
|
||||
|
||||
|
||||
logger.info("dashboard SMS_INFO ====>" + msg);
|
||||
|
||||
sb.append(name).append(FIELD_SEP);
|
||||
sb.append(inst).append(FIELD_SEP);
|
||||
sb.append(msg.substring(5,17)).append(FIELD_SEP);
|
||||
sb.append(msg.substring(17)).append(LINE_SEP);
|
||||
// if ( todate.compareTo(msg.substring(0,10)) > -1 ) { //당일시간만 찍히게 수정
|
||||
// }
|
||||
// else{
|
||||
// sb.append("").append(FIELD_SEP);
|
||||
// sb.append(msg).append(LINE_SEP);
|
||||
// //sb.append(msg.substring(42)).append(LINE_SEP);
|
||||
// }
|
||||
|
||||
|
||||
count --;
|
||||
}
|
||||
|
||||
logger.debug( "SMS_INFO====> [ " + sb.toString() + " ]" );
|
||||
logger.info( "SMS_INFO====> [ " + sb.toString() + " ]" );
|
||||
} else if( "smsinit".equals(type) ) {
|
||||
// monitoring/dashboard2.do?cmd=main&type=smsinit&initTime=00:00:00.000
|
||||
String mmdd = CommonUtil.getToday("MMdd");
|
||||
String initTime = ServletRequestUtils.getStringParameter(request, "initTime", CommonUtil.getToday("HH:mm:ss.SSS"));
|
||||
|
||||
|
||||
if( initTime.length() == 12 || initTime.length() == 11 ) {
|
||||
// MMdd hh:mm:ss
|
||||
String lastTime = mmdd + " " + initTime.substring(0, 8);
|
||||
dashboardService.setSmsBreaker( lastTime );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
// 자바스크립트 에서 split 처리할때 마지막에 구분자가 있음 배열이 하나 더 생기므로 trim 처리해서 보낸다.
|
||||
String outData = CommonUtil.rightTrim( sb.toString(), LINE_SEP );
|
||||
pw.print( outData );
|
||||
|
||||
} catch ( Exception e ) {
|
||||
logger.error("mainProc error",e);
|
||||
}
|
||||
|
||||
return null ;
|
||||
}
|
||||
|
||||
|
||||
@RequestMapping(path = "/dashboard2.do", params = "cmd=sub")
|
||||
public View subProc(ModelMap modelMap, HttpServletRequest request,
|
||||
HttpServletResponse response, String cmd, String type) {
|
||||
try {
|
||||
|
||||
// 한글처리 관련
|
||||
response.setContentType("text/xml;charset=utf-8");
|
||||
response.setHeader("Cache-Control", "no-cache");
|
||||
|
||||
ServletOutputStream out = response.getOutputStream();
|
||||
|
||||
StringBuffer sb = new StringBuffer();
|
||||
|
||||
String service = ServletRequestUtils.getStringParameter(request, "service", "");
|
||||
String smstime = ServletRequestUtils.getStringParameter(request, "smstime", "");
|
||||
|
||||
if((service.length() > 0) &&
|
||||
DataSourceTypeManager.getDataSourceType(service) == null) {
|
||||
logger.warn("New dashboard Skip subProc unregistered Service : service=" + service);
|
||||
return null;
|
||||
}
|
||||
|
||||
String tradeTarget = (String)request.getSession().getAttribute(MonitoringContext.RMS_TRADE_COUNT_TARGET);
|
||||
if( tradeTarget == null || "".equals(tradeTarget) ) {
|
||||
tradeTarget = "ALL" ;
|
||||
}
|
||||
|
||||
if( "traninfo".equals(type) ) {
|
||||
// DB 에서 주기적으로 조회하여 지정한 테이블에 업데이트 하고,
|
||||
// 업데이트된 결과를 조회하는 로직으로 처리하자. ( 테이블 설계 및 신청 필요 )
|
||||
// 내부,대외,공동,DMZ,합계,일괄전송
|
||||
// 서비스,거래처리,증가,timeout,증가,에러,증가
|
||||
List<String> hostList = dashboard2Repository.getHostNames(service);
|
||||
MemStaticsVo sumVo = new MemStaticsVo();
|
||||
for( int i = 0 ; i < 4 ; i++ ) {
|
||||
if( hostList != null && hostList.size() > i ) {
|
||||
String host = hostList.get(i);
|
||||
MemStaticsVo vo = dashboard2Repository.getMemTradeVoByHost(host);
|
||||
if( vo == null ) {
|
||||
sb.append( getSubTranLineData(tradeTarget, "NULL", vo, sumVo)).append(LINE_SEP);
|
||||
} else {
|
||||
sb.append( getSubTranLineData(tradeTarget, service, vo, sumVo)).append(LINE_SEP);
|
||||
}
|
||||
} else {
|
||||
sb.append( getSubTranLineData(tradeTarget, "NULL", null, sumVo)).append(LINE_SEP);
|
||||
}
|
||||
}
|
||||
sb.append( getSubTranLineData(tradeTarget, "TOTAL", null, sumVo)).append(LINE_SEP);
|
||||
} else if( "smsinfo".equals(type) ) {
|
||||
// 해당 서비스의 에러메시지 정보를 보낸다.
|
||||
|
||||
List serverList = eaiServerInfoService.getEaiServerIpListDB();
|
||||
List<SmsVO> smsList = dashboardService.findSmsList(serverList, service);
|
||||
|
||||
HashMap mapBack = new HashMap();
|
||||
List<String> tmpList = new ArrayList<String>();
|
||||
for ( SmsVO vo : smsList ) {
|
||||
//String svc = vo.getService();
|
||||
//String name = ServiceType.get(svc).getName();
|
||||
//String inst = vo.getInstanceName();
|
||||
List<String> msgList = vo.getMessage();
|
||||
|
||||
for( String msg : msgList ) {
|
||||
// 메시지 + @ + 서비스 + @ 인스턴스 ( 시간별로 sort 하기 위함 )
|
||||
tmpList.add(msg ) ; //+ "@$@" + svc + "@$@" + inst );
|
||||
mapBack.put(msg, vo);
|
||||
}
|
||||
}
|
||||
|
||||
Object sortList[] = tmpList.toArray();
|
||||
Arrays.sort(sortList);
|
||||
|
||||
String smsBreaker = dashboardService.getSmsBreaker();
|
||||
if( "".equals(smsBreaker) ) {
|
||||
smsBreaker = "0100 00:00:00" ;
|
||||
}
|
||||
|
||||
if( logger.isDebugEnabled() ) {
|
||||
logger.debug( "SUB SMS_BREAKER=>[" + smsBreaker + "]" );
|
||||
}
|
||||
|
||||
//월일
|
||||
String mmdd = CommonUtil.getToday("MMdd");
|
||||
int count = 2 ;
|
||||
for( int i = sortList.length - 1 ; i >= 0 ; i-- ) {
|
||||
|
||||
if( count < 0 ) break;
|
||||
|
||||
String msg = (String)sortList[i];
|
||||
SmsVO voTmp = (SmsVO)mapBack.get(msg);
|
||||
|
||||
String svc = voTmp.getService();
|
||||
String name = "";
|
||||
|
||||
for(DataSourceType dataSourceType : DataSourceTypeManager.getOnlineDataSourceTypes()){
|
||||
if (dataSourceType.getName().equals(svc)){
|
||||
name = dataSourceType.getText();
|
||||
}
|
||||
}
|
||||
String inst = voTmp.getInstanceName();
|
||||
|
||||
// 당일 데이터가 아닌것은 제외한다.
|
||||
if( ! mmdd.equals( msg.substring(0,4) ) ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Beaker time 보다 이전의 데이터는 제외한다.
|
||||
if( msg != null && msg.length() > 13 ) {
|
||||
if ( smsBreaker.compareTo(msg.substring(0,13)) > -1 ) {
|
||||
//"기준시간보다 이전이므로 제외합니다.
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
sb.append(name).append(FIELD_SEP);
|
||||
sb.append(inst).append(FIELD_SEP);
|
||||
sb.append(msg.substring(5,17)).append(FIELD_SEP);
|
||||
sb.append(msg.substring(17)).append(LINE_SEP);
|
||||
|
||||
count --;
|
||||
}
|
||||
// instance,date,message ( 메시지 내부의 콤마,세미콜론 은 마침표,콜론으 로 replace 한다. )
|
||||
} else if( "smserr".equals(type) ) {
|
||||
String dsName = "" ;
|
||||
|
||||
if( logger.isDebugEnabled() ) {
|
||||
logger.debug( "type=smserr => dsName=" + dsName + ", schema=" + service + ", smstime=" + smstime );
|
||||
}
|
||||
|
||||
Vector ret = getErrorInfo(service, smstime );
|
||||
|
||||
for(int i=0; i< ret.size(); i++) {
|
||||
String[] row = (String[])ret.get(i);
|
||||
|
||||
if( logger.isDebugEnabled() ) {
|
||||
logger.debug( row );
|
||||
}
|
||||
|
||||
//노드와 인스턴스 번호 추출
|
||||
int nodeNo = 0;
|
||||
int instNo = 0;
|
||||
|
||||
List<Map<String, String>> list = eaiServerInfoService.getEaiServerIpListDB();
|
||||
logger.debug(list);
|
||||
for( int idx=0; idx < list.size(); idx++ ) {
|
||||
Map<String, String> map = list.get(idx);
|
||||
String host = map.get("HOSTNAME");
|
||||
logger.debug("nodeNo추출 :[" + host + "][" + row[10].trim() + "]");
|
||||
if( host != null && (host.equals(row[10].trim()))) { //취약점소스 수정 2020.08.25
|
||||
nodeNo = idx+1;
|
||||
}
|
||||
}
|
||||
|
||||
List<Map<String, String>> instList = eaiServerInfoService.getEaiServerIpListByHostName( row[10].trim());
|
||||
logger.debug(instList);
|
||||
for( int idx=0; idx < instList.size(); idx++ ) {
|
||||
Map<String, String> map = instList.get(idx);
|
||||
String inst = map.get("EAISVRINSTNM");
|
||||
logger.debug("instNo추출 :[" + inst + "][" + row[9].trim() + "]");
|
||||
if( inst != null && (inst.equals(row[9].trim()))) { //취약점소스 수정 2020.08.25
|
||||
instNo = idx+1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
for(int j=0; j<row.length; j++) {
|
||||
sb.append(row[j].replaceAll(FIELD_SEP, " ").replaceAll(LINE_SEP," "));
|
||||
if(j == (row.length-1) ) {
|
||||
sb.append(FIELD_SEP);
|
||||
sb.append(nodeNo);
|
||||
sb.append(FIELD_SEP);
|
||||
sb.append(instNo);
|
||||
sb.append(LINE_SEP);
|
||||
}
|
||||
else {
|
||||
sb.append(FIELD_SEP);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if( "smsinit".equals(type) ) {
|
||||
String mmdd = CommonUtil.getToday("MMdd");
|
||||
String initTime = ServletRequestUtils.getStringParameter(request, "initTime", "");
|
||||
|
||||
if( initTime.length() == 12 || initTime.length() == 11 ) {
|
||||
// MMdd hh:mm:ss
|
||||
String lastTime = mmdd + " " + initTime.substring(0, 8);
|
||||
dashboardService.setSmsBreaker( lastTime );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 자바스크립트 에서 split 처리할때 마지막에 구분자가 있음 배열이 하나 더 생기므로 trim 처리해서 보낸다.
|
||||
String outData = CommonUtil.rightTrim( sb.toString(), LINE_SEP );
|
||||
out.print( outData );
|
||||
} catch ( Exception e ) {
|
||||
// e.printStackTrace();
|
||||
logger.error("subProc",e);
|
||||
}
|
||||
|
||||
return null ;
|
||||
}
|
||||
|
||||
private String getSubTranLineData( String target, String svc, MemStaticsVo vo, MemStaticsVo total ) {
|
||||
StringBuffer sb = new StringBuffer();
|
||||
|
||||
sb.append(svc).append(FIELD_SEP);
|
||||
|
||||
if( "NULL".equals(svc) ) {
|
||||
sb.append(0).append(FIELD_SEP);
|
||||
sb.append(0).append(FIELD_SEP);
|
||||
sb.append(0).append(FIELD_SEP);
|
||||
} else if( "TOTAL".equals(svc) ) {
|
||||
sb.append(total.getProcTotal()).append(FIELD_SEP);
|
||||
sb.append(total.getTimeoutTotal()).append(FIELD_SEP);
|
||||
sb.append(total.getErrorTotal()).append(FIELD_SEP);
|
||||
} else if( "ALL".equals(target) ) {
|
||||
if(vo != null){
|
||||
sb.append(vo.getProcTotal()).append(FIELD_SEP);
|
||||
sb.append(vo.getTimeoutTotal()).append(FIELD_SEP);
|
||||
sb.append(vo.getErrorTotal()).append(FIELD_SEP);
|
||||
}else{
|
||||
sb.append(0).append(FIELD_SEP);
|
||||
sb.append(0).append(FIELD_SEP);
|
||||
sb.append(0).append(FIELD_SEP);
|
||||
}
|
||||
total.add( vo );
|
||||
} else {
|
||||
if(vo != null){
|
||||
sb.append(vo.getProcTotal()).append(FIELD_SEP);
|
||||
sb.append(vo.getTimeoutTotal()).append(FIELD_SEP);
|
||||
sb.append(vo.getErrorTotal()).append(FIELD_SEP);
|
||||
}else{
|
||||
sb.append(0).append(FIELD_SEP);
|
||||
sb.append(0).append(FIELD_SEP);
|
||||
sb.append(0).append(FIELD_SEP);
|
||||
}
|
||||
|
||||
total.add( vo );
|
||||
}
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
|
||||
// private String getTranLineData( String service, DbStaticsVo vo ) {
|
||||
//
|
||||
// // 서비스,거래처리,timeout,에러
|
||||
//
|
||||
// StringBuffer sb = new StringBuffer();
|
||||
//
|
||||
// sb.append(service).append(FIELD_SEP);
|
||||
// sb.append(vo.getEaiMoniPrcssNoitm()).append(FIELD_SEP);
|
||||
// sb.append(vo.getEaiMoniToutNoitm()).append(FIELD_SEP);
|
||||
// sb.append(vo.getEaiMoniErrNoitm()).append(FIELD_SEP);
|
||||
//
|
||||
// return sb.toString();
|
||||
// }
|
||||
|
||||
|
||||
|
||||
// private String getTranLineDataBatch( String service, int[] counts ) {
|
||||
// StringBuffer sb = new StringBuffer();
|
||||
// sb.append(service).append(FIELD_SEP);
|
||||
// if( counts == null ) {
|
||||
// for( int i = 0 ; i < 6 ; i++ ) {
|
||||
// sb.append(0).append(FIELD_SEP);
|
||||
// }
|
||||
// } else {
|
||||
// for( int i = 0 ; i < counts.length ; i++ ) {
|
||||
// sb.append(counts[i]).append(FIELD_SEP);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// return sb.toString();
|
||||
// }
|
||||
|
||||
// private Connection getConnection(String dataSourceName) throws Exception {
|
||||
// Connection con = null;
|
||||
// try {
|
||||
// InitialContext ic = new InitialContext();
|
||||
// DataSource dataSource = (DataSource) ic.lookup(dataSourceName);
|
||||
// con = dataSource.getConnection();
|
||||
// return con;
|
||||
// }
|
||||
// catch(Exception e) {
|
||||
// //e.printStackTrace();
|
||||
// logger.error("getConnection ",e);
|
||||
// throw e;
|
||||
// }
|
||||
// }
|
||||
|
||||
private Vector getErrorInfo(String owner, String logTime ) throws Exception {
|
||||
|
||||
String today = CommonUtil.getToday("yyyyMMdd");
|
||||
|
||||
logTime = today + logTime.replaceAll("\\.", "").replaceAll(":", "");
|
||||
|
||||
String beforeTime = CommonUtil.getDiffMinDate( logTime, -1, "");
|
||||
|
||||
String tableName = CommonUtil.getLogErrTable(CommonUtil.getToday(""));
|
||||
|
||||
return dashboardDao.getErrorInfo(owner, tableName, logTime, beforeTime);
|
||||
|
||||
}
|
||||
|
||||
private String getTargetService() {
|
||||
String local = "";
|
||||
try {
|
||||
InetAddress addr = InetAddress.getLocalHost();
|
||||
local = addr.getHostAddress();
|
||||
} catch ( UnknownHostException e ) {
|
||||
logger.error(e);
|
||||
//e.printStackTrace();
|
||||
}
|
||||
|
||||
// 타겟서비스에 해당하는 DB 의 거래현황 데이터를 읽어서 해당DB 의 RM11 테이블에 집계데이터를 추가한다.
|
||||
// ALL : 온라인용 ( 전체 서비스 )
|
||||
// OUTSIDE : 테스트용 ( ZAUA - 192.168.175.82 )
|
||||
// COMMON : 테스트용 ( ZAPA - 192.168.175.54 )
|
||||
// 현재 사용되고 있지 않은곳이 내부(ZADA) 이므로 일단 ALL 데이터는 ZADA 로 WRITE 한다.
|
||||
String targetSvc = "ALL" ;
|
||||
String target = monitoringContext.getStringProperty(MonitoringContext.RMS_TRADE_COUNT_TARGET, "");
|
||||
String arrTmp[] = target.split(",");
|
||||
if( arrTmp != null && arrTmp.length > 0 ) {
|
||||
for( int i = 0 ; i < arrTmp.length ; i++ ) {
|
||||
String arrTmp2[] = arrTmp[i].split("=");
|
||||
if( arrTmp2 != null && arrTmp2.length == 2 && local.equals(arrTmp2[0]) ) {
|
||||
targetSvc = arrTmp2[1];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return targetSvc ;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.eactive.eai.rms.onl.dashboard.dao;
|
||||
|
||||
import java.util.Vector;
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* 1. 기능 :
|
||||
* 2. 처리 개요 :
|
||||
* -
|
||||
* 3. 주의사항 :
|
||||
* </pre>
|
||||
* @author : 윤영주
|
||||
* @version : $Revision: 1.3 $
|
||||
* @since : rts 1.0
|
||||
*/
|
||||
public interface DashboardDAO {
|
||||
public Vector<String[]> getErrorInfo(String owner, String tableName, String logTime, String beforeTime);
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
package com.eactive.eai.rms.onl.dashboard.dao;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Vector;
|
||||
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.eactive.eai.rms.common.base.SqlMapClientTemplateDao;
|
||||
import com.ibatis.sqlmap.client.event.RowHandler;
|
||||
|
||||
@Repository("dashboardDao")
|
||||
public class DashboardDaoImpl extends SqlMapClientTemplateDao
|
||||
implements DashboardDAO {
|
||||
|
||||
public Vector<String[]> getErrorInfo(String owner, String tableName, String logTime, String beforeTime) {
|
||||
final HashMap<String, String> paramMap = new HashMap<String, String>();
|
||||
paramMap.put("schemaId", owner);
|
||||
paramMap.put("tableName", tableName);
|
||||
paramMap.put("logTime", logTime);
|
||||
paramMap.put("beforeTime", beforeTime);
|
||||
final Vector<String[]> v = new Vector<String[]>();
|
||||
template.queryWithRowHandler("Dashboard.getErrorInfo", paramMap,
|
||||
new RowHandler(){
|
||||
@SuppressWarnings("unchecked")
|
||||
public void handleRow(Object valueObject) {
|
||||
HashMap<String, String> rowMap = (HashMap<String, String>)valueObject;
|
||||
String[] row = new String[11];
|
||||
row[0] = rowMap.get("LogPrcssSerno");
|
||||
row[1] = rowMap.get("GstatSysAdptrBzwkGroupName");
|
||||
row[2] = rowMap.get("GstatSysAdptrEAIBzwkDstcd");
|
||||
row[3] = rowMap.get("GstatSysAdptrBzwkDsticName");
|
||||
row[4] = rowMap.get("PsvSysAdptrBzwkGroupName");
|
||||
row[5] = rowMap.get("PsvSysAdptrEAIBzwkDstcd");
|
||||
row[6] = rowMap.get("PsvSysAdptrBzwkDsticName");
|
||||
row[7] = rowMap.get("EAIErrCd");
|
||||
row[8] = rowMap.get("EAIErrCtnt");
|
||||
row[9] = rowMap.get("EAISevrInstncName");
|
||||
row[10]= rowMap.get("LgingSysID");
|
||||
v.add(row);
|
||||
}});
|
||||
|
||||
return v;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.eactive.eai.rms.onl.dashboard.dao;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Vector;
|
||||
|
||||
public interface DashboardErrorDAO {
|
||||
|
||||
public Vector<String[]> getLogList(String owner, String logTime, String nodeIndex,
|
||||
String errorType, String commDiv) throws Exception ;
|
||||
|
||||
public Vector<String[]> getLogListBranchTest(String owner, String logTime,
|
||||
String nodeIndex, String errorType, String commDiv)
|
||||
throws Exception;
|
||||
|
||||
public HashMap<String, Object> getDSGTelno(String owner, String adt) throws Exception;
|
||||
|
||||
|
||||
public int getMobileMonitorLogListCount(String owner, String logTime, String nowTime) throws Exception;
|
||||
|
||||
public Vector<String[]> getMobileMonitorLogList(String owner,String logDate,String errorType,String commDiv) throws Exception;
|
||||
|
||||
public Vector<String[]> getMobileMonitorBatchLogList(String owner, String logTime ,String errorType) throws Exception ;
|
||||
|
||||
public Vector getDetailInfomation(String owner,String eaiGuid,String startConvCal,String endConvCal, String apCd) throws Exception;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,422 @@
|
||||
package com.eactive.eai.rms.onl.dashboard.dao;
|
||||
|
||||
import java.util.Calendar;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Vector;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.eactive.eai.rms.common.base.SqlMapClientTemplateDao;
|
||||
import com.eactive.eai.rms.common.context.MonitoringContext;
|
||||
import com.eactive.eai.rms.common.datasource.DataSourceContextHolder;
|
||||
import com.eactive.eai.rms.common.datasource.DataSourceType;
|
||||
import com.eactive.eai.rms.common.datasource.SpecifiedDataSourceExecutor;
|
||||
import com.eactive.eai.rms.common.util.CommonUtil;
|
||||
import com.ibatis.sqlmap.client.event.RowHandler;
|
||||
|
||||
@Repository("dashboardError")
|
||||
@SuppressWarnings("unchecked")
|
||||
public class DashboardErrorDaoImpl extends SqlMapClientTemplateDao implements DashboardErrorDAO {
|
||||
|
||||
private int MAX_ROWS = 20;
|
||||
|
||||
@Autowired
|
||||
private MonitoringContext monitoringContextImpl;
|
||||
|
||||
private static final Logger logger = Logger.getLogger(DashboardErrorDaoImpl.class);
|
||||
|
||||
private String getTimeOutList() throws Exception {
|
||||
|
||||
DataSourceType dt = DataSourceContextHolder.getDataSourceType();
|
||||
String timeOutCodes = null;
|
||||
|
||||
final HashMap<String, String> paramMap = new HashMap<String, String>();
|
||||
paramMap.put("schemaId", dt.getSchema());
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
List<HashMap<String, Object>> result = new SpecifiedDataSourceExecutor<List<HashMap<String, Object>>>(dt) {
|
||||
protected List<HashMap<String, Object>> doExecute() throws Exception {
|
||||
return template.queryForList("DashboardError.getTimeOutList", paramMap);
|
||||
}
|
||||
}.execute();
|
||||
try {
|
||||
if ( !result.isEmpty() || result.size() > 0 ) {
|
||||
for(HashMap<String, Object> tmp : result){
|
||||
timeOutCodes = "'" + tmp.get("Prpty2Val") + "'";
|
||||
timeOutCodes = timeOutCodes.replaceAll(",", "','");
|
||||
}
|
||||
|
||||
} else {
|
||||
timeOutCodes = "'RECEAIOSA777','RECEAIOHP003','RECEAIOSP004','RECEAIOTC913','RECEAIOSA010','RECEAIOEP010','RECEAIOHP010','RECEAIOSP010','RECEAIOTP010'";
|
||||
}
|
||||
return timeOutCodes;
|
||||
} catch (Exception e) {
|
||||
//e.printStackTrace();
|
||||
logger.error("getTimeOutList error", e);
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
private String getBizErrorList() throws Exception {
|
||||
|
||||
DataSourceType dt = DataSourceContextHolder.getDataSourceType();
|
||||
String bizErrorCodes = null;
|
||||
|
||||
final HashMap<String, String> paramMap = new HashMap<String, String>();
|
||||
paramMap.put("schemaId", dt.getSchema());
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
List<HashMap<String, Object>> result = new SpecifiedDataSourceExecutor<List<HashMap<String, Object>>>(dt) {
|
||||
protected List<HashMap<String, Object>> doExecute() throws Exception {
|
||||
return template.queryForList("DashboardError.getBizErrorList", paramMap);
|
||||
}
|
||||
}.execute();
|
||||
try {
|
||||
if ( !result.isEmpty() || result.size() > 0 ) {
|
||||
for(HashMap<String, Object> tmp : result){
|
||||
bizErrorCodes = "'" + tmp.get("Prpty2Val") + "'";
|
||||
bizErrorCodes = bizErrorCodes.replaceAll(",", "','");
|
||||
}
|
||||
} else {
|
||||
bizErrorCodes = "'RECEAICEU104','RECEAICKE301','RECEAIIRP040','RECEAIOEP020','RECEAIOEP030','RECEAIOHP020','RECEAIOHP022','RECEAIOHP030','RECEAIOMP002','RECEAIOMP006','RECEAIOSA020','RECEAIOSP020','RECEAIOSP030','RECEAIOTP002','RECEAIOTP006','RECEAICBE001','RECEAICBE010','RECEAICBX001','RECEAICME001','RECEAICMK001','RECEAIFBR002','RECEAIIRA001','RECEAIIRP050','RECEAIIRP060','RECEAIIRP062'";
|
||||
}
|
||||
return bizErrorCodes;
|
||||
} catch (Exception e) {
|
||||
//e.printStackTrace();
|
||||
logger.error("getBizErrorList error", e);
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
public Vector<String[]> getLogList(String owner, String logTime, String nodeIndex,
|
||||
String errorType, String commDiv) throws Exception {
|
||||
|
||||
String timeOutError = getTimeOutList();
|
||||
String bizError = getBizErrorList();
|
||||
|
||||
final HashMap<String, String> paramMap = new HashMap<String, String>();
|
||||
paramMap.put("schemaId", owner);
|
||||
paramMap.put("logTablename", CommonUtil.getLogErrTable(CommonUtil.getToday("")) );
|
||||
paramMap.put("logTablename2", CommonUtil.getLogTable(Calendar.getInstance(), true));
|
||||
|
||||
paramMap.put("rowno", String.valueOf(MAX_ROWS));
|
||||
paramMap.put("logDate", CommonUtil.getToday("yyyyMMdd"));
|
||||
paramMap.put("logTime", logTime.replaceAll(":", ""));
|
||||
paramMap.put("commDiv", commDiv);
|
||||
paramMap.put("nodeIndex", nodeIndex);
|
||||
if (errorType != null && errorType.trim().length() > 1) {
|
||||
paramMap.put("errorType", errorType);
|
||||
paramMap.put("timeOutList", timeOutError);
|
||||
paramMap.put("bizError", bizError);
|
||||
}
|
||||
|
||||
try {
|
||||
|
||||
final Vector<String[]> vt = new Vector<String[]>();
|
||||
template.queryWithRowHandler("DashboardError.getLogList", paramMap,
|
||||
new RowHandler(){
|
||||
public void handleRow(Object valueObject) {
|
||||
|
||||
HashMap<String, String> rowMap = (HashMap<String, String>)valueObject;
|
||||
|
||||
String errorTypeTxt = "업무에러";
|
||||
if("TIMEOUT".equals(errorType)){
|
||||
errorTypeTxt = "타임아웃";
|
||||
}else if("CONNECTION".equals(errorType)){
|
||||
errorTypeTxt = "통신에러";
|
||||
}
|
||||
|
||||
String[] row = new String[14];
|
||||
row[0] = rowMap.get("GUID");
|
||||
row[1] = rowMap.get("EAISvcName");
|
||||
row[2] = rowMap.get("BzwkDsticName");
|
||||
row[3] = rowMap.get("EAIErrCd");
|
||||
row[4] = chunkErrorMsg(rowMap.get("EAIErrCtnt"));
|
||||
row[5] = rowMap.get("EaiSevrInstncName");
|
||||
row[6] = rowMap.get("MsgDpstYMS");
|
||||
row[7] = errorTypeTxt;
|
||||
//row[7] = (timeOutError.indexOf(rowMap.get("EAIErrCd")) > 0) ? "타임아웃" : "에러";
|
||||
row[8] = rowMap.get("TrackAsisKey1Name");
|
||||
row[9] = rowMap.get("TrackAsisKey2Name");
|
||||
row[10] = rowMap.get("RsempName");
|
||||
row[11] = rowMap.get("RspblPsnCntpCtnt");
|
||||
row[12] = rowMap.get("GstatSysAdptrBzwkGroupName");
|
||||
row[13] = rowMap.get("PsvSysAdptrBzwkGroupName");
|
||||
|
||||
if (vt.size() < MAX_ROWS) {
|
||||
vt.add(row);
|
||||
}
|
||||
}});
|
||||
return vt;
|
||||
} catch (Exception e) {
|
||||
//e.printStackTrace();
|
||||
logger.error("getLogList error", e);
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
public Vector<String[]> getLogListBranchTest(String owner, String logTime,
|
||||
String nodeIndex, String errorType, String commDiv)
|
||||
throws Exception {
|
||||
String timeOutError = getTimeOutList();
|
||||
String bizError = getBizErrorList();
|
||||
|
||||
final HashMap<String, String> paramMap = new HashMap<String, String>();
|
||||
paramMap.put("schemaId", owner);
|
||||
paramMap.put("logTablename", CommonUtil.getLogErrTable(CommonUtil.getToday("")));
|
||||
paramMap.put("logTablename2", CommonUtil.getLogTable(Calendar.getInstance(), true));
|
||||
|
||||
paramMap.put("rowno", String.valueOf(MAX_ROWS));
|
||||
paramMap.put("logDate", CommonUtil.getToday("yyyyMMdd"));
|
||||
paramMap.put("logTime", logTime.replaceAll(":", ""));
|
||||
paramMap.put("commDiv", commDiv);
|
||||
paramMap.put("nodeIndex", nodeIndex);
|
||||
if (errorType != null && errorType.trim().length() > 1) {
|
||||
paramMap.put("errorType", errorType);
|
||||
paramMap.put("timeOutList", timeOutError);
|
||||
paramMap.put("bizError", bizError);
|
||||
}
|
||||
try {
|
||||
final Vector<String[]> vt = new Vector<String[]>();
|
||||
template.queryWithRowHandler("DashboardError.getLogListBranchTest", paramMap,
|
||||
new RowHandler(){
|
||||
|
||||
public void handleRow(Object valueObject) {
|
||||
|
||||
HashMap<String, String> rowMap = (HashMap<String, String>)valueObject;
|
||||
|
||||
String errorTypeTxt = "업무에러";
|
||||
if("TIMEOUT".equals(errorType)){
|
||||
errorTypeTxt = "타임아웃";
|
||||
}else if("CONNECTION".equals(errorType)){
|
||||
errorTypeTxt = "통신에러";
|
||||
}
|
||||
|
||||
String[] row = new String[14];
|
||||
row[0] = rowMap.get("GUID");
|
||||
row[1] = rowMap.get("EAISvcName");
|
||||
row[2] = rowMap.get("BzwkDsticName");
|
||||
row[3] = rowMap.get("EAIErrCd");
|
||||
row[4] = chunkErrorMsg(rowMap.get("EAIErrCtnt"));
|
||||
row[5] = rowMap.get("EaiSevrInstncName");
|
||||
row[6] = rowMap.get("MsgDpstYMS");
|
||||
row[7] = errorTypeTxt;
|
||||
//row[7] = (timeOutError.indexOf(rowMap.get("EAIErrCd")) > 0) ? "타임아웃" : "에러";
|
||||
row[8] = rowMap.get("TrackAsisKey1Name"); //추적보조키1명
|
||||
row[9] = rowMap.get("TrackAsisKey2Name"); //추적보조키2명
|
||||
row[10] = rowMap.get("RsempName"); //업무담당명
|
||||
row[11] = rowMap.get("RspblPsnCntpCtnt"); //담당자연락처내용
|
||||
row[12] = rowMap.get("GstatSysAdptrBzwkGroupName"); //기동시스템어댑터업무그룹명
|
||||
row[13] = rowMap.get("PsvSysAdptrBzwkGroupName"); //수동시스템어댑터업무그룹명
|
||||
if (vt.size() < MAX_ROWS) {
|
||||
vt.add(row);
|
||||
}
|
||||
}});
|
||||
return vt;
|
||||
} catch (Exception e) {
|
||||
//e.printStackTrace();
|
||||
logger.error("getLogListBranchTest", e);
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
private String chunkErrorMsg(String errMsg) {
|
||||
errMsg = errMsg.replace("[에러코드:", "");
|
||||
errMsg = errMsg.replace("][EAI 서비스코드:", "");
|
||||
errMsg = errMsg.substring(errMsg.indexOf("]")+1);
|
||||
// return CommonUtil.getByteSub(errMsg.getBytes(), 0, MAX_ERRORMSG_SIZE);
|
||||
return errMsg;
|
||||
}
|
||||
|
||||
public HashMap<String, Object> getDSGTelno(String owner, String adt) throws Exception {
|
||||
HashMap<String, String> SSparam = new HashMap<String, String>();
|
||||
SSparam.put("schemaId", owner);
|
||||
SSparam.put("AdptrBzwkGroupName", adt);
|
||||
return (HashMap<String, Object>)template.queryForObject("DashboardError.getOSIDTelno", SSparam);
|
||||
}
|
||||
|
||||
|
||||
public int getMobileMonitorLogListCount(String owner,String logTime, String nowTime)
|
||||
throws Exception {
|
||||
|
||||
final HashMap<String, String> paramMap = new HashMap<String, String>();
|
||||
paramMap.put("schemaId", owner);
|
||||
paramMap.put("logTablename", CommonUtil.getLogErrTable(CommonUtil.getToday("")) );
|
||||
paramMap.put("logTablename2", CommonUtil.getLogTable(Calendar.getInstance(), true));
|
||||
paramMap.put("logTime", logTime);
|
||||
paramMap.put("nowTime", nowTime);
|
||||
|
||||
return (Integer)template.queryForObject("DashboardError.getMobileMonitorLogListCount", paramMap);
|
||||
}
|
||||
|
||||
public Vector<String[]> getMobileMonitorLogList(String owner,String logDate,String errorType,String commDiv)
|
||||
throws Exception {
|
||||
|
||||
String timeOutError = getTimeOutList();
|
||||
String bizError = getBizErrorList();
|
||||
|
||||
final HashMap<String, String> paramMap = new HashMap<String, String>();
|
||||
paramMap.put("schemaId", owner);
|
||||
paramMap.put("logTablename", CommonUtil.getLogErrTable(CommonUtil.getToday("")) );
|
||||
paramMap.put("logTablename2", CommonUtil.getLogTable(Calendar.getInstance(), true));
|
||||
paramMap.put("rowno", String.valueOf(MAX_ROWS));
|
||||
paramMap.put("logDate", logDate.substring(0,8));
|
||||
paramMap.put("logDate2", logDate);
|
||||
paramMap.put("commDiv", commDiv);
|
||||
if (errorType != null && errorType.trim().length() > 1) {
|
||||
paramMap.put("errorType", errorType);
|
||||
paramMap.put("timeOutList", timeOutError);
|
||||
paramMap.put("bizError", bizError);
|
||||
}
|
||||
|
||||
try {
|
||||
final Vector<String[]> vt = new Vector<String[]>();
|
||||
template.queryWithRowHandler("DashboardError.getMobileMonitorLogList", paramMap,
|
||||
new RowHandler(){
|
||||
public void handleRow(Object valueObject) {
|
||||
|
||||
HashMap<String, String> rowMap = (HashMap<String, String>)valueObject;
|
||||
String[] row = new String[15];
|
||||
row[0] = rowMap.get("GUID");
|
||||
row[1] = rowMap.get("EAISVCNAME");
|
||||
row[2] = rowMap.get("BZWKDSTICNAME");
|
||||
row[3] = rowMap.get("EAIERRCD");
|
||||
row[4] = rowMap.get("EAIERRCTNT");
|
||||
row[5] = rowMap.get("LGINGSYSID");
|
||||
row[6] = rowMap.get("MSGDPSTYMS");
|
||||
row[7] = rowMap.get("LOGPRCSSSERNO");
|
||||
row[8] = rowMap.get("GSTATSYSADPTRBZWKGROUPNAME");
|
||||
row[9] = rowMap.get("PSVSYSADPTRBZWKGROUPNAME");
|
||||
row[10] = rowMap.get("DOM");
|
||||
row[11] = rowMap.get("EAIBZWKDSTCD");
|
||||
row[12] = rowMap.get("EAISVCDESC");
|
||||
row[13] = rowMap.get("EAIGROUPCODSTCD");
|
||||
|
||||
String errorTypeTxt = "업무에러";
|
||||
if("TIMEOUT".equals(errorType)){
|
||||
errorTypeTxt = "타임아웃";
|
||||
}else if("CONNECTION".equals(errorType)){
|
||||
errorTypeTxt = "통신에러";
|
||||
}
|
||||
|
||||
row[14] = errorTypeTxt;
|
||||
|
||||
if (vt.size() < MAX_ROWS) {
|
||||
vt.add(row);
|
||||
}
|
||||
}});
|
||||
return vt;
|
||||
} catch (Exception e) {
|
||||
//e.printStackTrace();
|
||||
logger.error("getMobileMonitorLogList", e);
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
public Vector<String[]> getMobileMonitorBatchLogList(String owner,String logDate,String errorType) throws Exception {
|
||||
|
||||
final HashMap<String, String> paramMap = new HashMap<String, String>();
|
||||
paramMap.put("schemaId", owner);
|
||||
paramMap.put("errorType", errorType);
|
||||
paramMap.put("logDate", logDate.substring(0,8));
|
||||
|
||||
try {
|
||||
final Vector<String[]> vt = new Vector<String[]>();
|
||||
template.queryWithRowHandler("DashboardError.getMobileMonitorBatchLogList", paramMap,
|
||||
new RowHandler(){
|
||||
public void handleRow(Object valueObject) {
|
||||
|
||||
HashMap<String, String> rowMap = (HashMap<String, String>)valueObject;
|
||||
|
||||
String[] row = new String[7];
|
||||
row[0] = rowMap.get("BJOBBZWKDSTCD");
|
||||
row[1] = rowMap.get("OSIDINSTIDSTCD");
|
||||
row[2] = rowMap.get("SNDRCVFILENAME");
|
||||
row[3] = rowMap.get("UAPPLCD");
|
||||
row[4] = rowMap.get("BJOBPTRNDSTCD");
|
||||
row[5] = rowMap.get("FILETRSMTSTARTHMS");
|
||||
row[6] = rowMap.get("EAIOBSTCLOCCURCAUSCTNT");
|
||||
if (vt.size() < MAX_ROWS) {
|
||||
vt.add(row);
|
||||
}
|
||||
}});
|
||||
return vt;
|
||||
} catch (Exception e) {
|
||||
//e.printStackTrace();
|
||||
logger.error("getMobileMonitorBatchLogList", e);
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
public Vector getDetailInfomation(String owner,String eaiGuid,String startConvCal,String endConvCal, String apCd)
|
||||
throws Exception {
|
||||
|
||||
final HashMap<String, String> paramMap = new HashMap<String, String>();
|
||||
paramMap.put("schemaId", owner);
|
||||
paramMap.put("logTablename", CommonUtil.getLogTable(Calendar.getInstance(), true));
|
||||
paramMap.put("startDt", startConvCal);
|
||||
paramMap.put("endDt", endConvCal);
|
||||
paramMap.put("eaiGuid", eaiGuid.substring(0, 33));
|
||||
paramMap.put("apCd", apCd);
|
||||
|
||||
try {
|
||||
final Vector vt = new Vector();
|
||||
template.queryWithRowHandler("DashboardError.getDetailInfomation", paramMap,
|
||||
new RowHandler(){
|
||||
public void handleRow(Object valueObject) {
|
||||
|
||||
HashMap<String, String> rowMap = (HashMap<String, String>)valueObject;
|
||||
|
||||
vt.add(rowMap.get("EAIBZWKDSTCD"));
|
||||
vt.add(rowMap.get("ERRORCTNT"));
|
||||
vt.add(rowMap.get("ADPTRBZWKGROUPDESC"));
|
||||
vt.add(rowMap.get("OSIDINSTIBZWKRSEMPNAME"));
|
||||
vt.add(rowMap.get("OSIDINSTITELNO"));
|
||||
|
||||
String appCode = rowMap.get("CODE");
|
||||
// 암호화 된 전문을 복호화 한다.
|
||||
String msgCtnt = rowMap.get("BZWKDATACTNT");
|
||||
|
||||
String decrypt = "";
|
||||
if(msgCtnt != null){
|
||||
try{
|
||||
String path = monitoringContextImpl.getStringProperty("SCP_PATH","/fsscp/pav/eai/agent0001/scpdb_agent_unix.ini");
|
||||
String key = monitoringContextImpl.getStringProperty("SCP_KEY","SEC");
|
||||
// decrypt = new ScpDbAgent().ScpDecB64( path, key, msgCtnt, "utf-8");
|
||||
decrypt = msgCtnt;
|
||||
}catch(Exception e){
|
||||
decrypt = msgCtnt;
|
||||
logger.info("ScpDbAgent decrypt error ", e);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// 전문에서 기관코드 분리
|
||||
if("EBE".equalsIgnoreCase(appCode)){
|
||||
vt.add(decrypt.substring(69,72));
|
||||
}else if("ELB".equalsIgnoreCase(appCode)){
|
||||
vt.add(decrypt.substring(80,83));
|
||||
}else{
|
||||
vt.add("NULL");
|
||||
}
|
||||
vt.add(decrypt);
|
||||
vt.add(rowMap.get("EAISVCNAME"));
|
||||
vt.add(rowMap.get("EAISVCDESC"));
|
||||
vt.add(rowMap.get("MSGDPSTYMS"));
|
||||
vt.add(rowMap.get("EAIERRCTNT"));
|
||||
vt.add(rowMap.get("EAISEVRINSTNCNAME"));
|
||||
}});
|
||||
return vt;
|
||||
} catch (Exception e) {
|
||||
//e.printStackTrace();
|
||||
logger.error("getDetailInfomation", e);
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,694 @@
|
||||
package com.eactive.eai.rms.onl.dashboard.repository;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
|
||||
import org.apache.commons.collections.map.MultiKeyMap;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.springframework.context.annotation.Scope;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.eactive.eai.rms.common.datasource.DataSourceType;
|
||||
import com.eactive.eai.rms.common.datasource.DataSourceTypeManager;
|
||||
import com.eactive.eai.rms.onl.tracking.vo.DbStaticsVo;
|
||||
import com.eactive.eai.rms.onl.tracking.vo.MemStaticsVo;
|
||||
import com.eactive.eai.rms.onl.vo.SmsVO;
|
||||
|
||||
|
||||
@Scope(value = "singleton")
|
||||
@Repository("dashboard2Repository")
|
||||
public class Dashboard2Repository implements Serializable {
|
||||
|
||||
/** The Constant serialVersionUID. */
|
||||
private static final long serialVersionUID = -8968729820736492173L;
|
||||
|
||||
/** The Constant logger. */
|
||||
private static final Logger logger = Logger.getLogger(Dashboard2Repository.class);
|
||||
|
||||
// 서비스 -> Map(EAI 서비스코드,서버구분코드)
|
||||
private HashMap<String,HashMap<String,String>> repoEAISevrDstcd;
|
||||
|
||||
// 대시보드 거래건수 ( 메모리 버전 )
|
||||
private MultiKeyMap repoMemTransaction;
|
||||
|
||||
// 서비스, 호스트 -> vo
|
||||
private MultiKeyMap repository;
|
||||
|
||||
// 서비스 -> 호스트네임 리스트
|
||||
private HashMap<String,List<String>> repoHostNames;
|
||||
|
||||
// 호스트명 -> 인스턴스네임 리스트
|
||||
private HashMap<String,List<String>> repoInstNames;
|
||||
|
||||
// DB 에 저장된 통계정보 최대값.
|
||||
private String maxProcTime;
|
||||
|
||||
|
||||
// 호스트 telnet 연결 성공 여부 ( ip -> "1/0" )
|
||||
private HashMap<String,String> repoHostAlive;
|
||||
|
||||
// SMS 메시지 리스트
|
||||
private List<SmsVO> repoSms;
|
||||
|
||||
// Peak Trade by TPS( service -> date,trade,tps )
|
||||
private HashMap<String,String> repoPeakTps;
|
||||
|
||||
// Peak Trade by Trade ( service -> date,trade,tps )
|
||||
private HashMap<String,String> repoPeakTrade;
|
||||
|
||||
|
||||
// 일괄전송 전송현황 건수 ( 정상송신,정상수신,에러송신,에러수신,대기송신,대기수신)
|
||||
private int[] procBatch = new int[6];
|
||||
private int[] procEaiBatch = new int[6];
|
||||
|
||||
//ITSM 대시보드 연동 거래처리 집계
|
||||
private HashMap<String,HashMap<String,String>> itsmDashTranInfo;
|
||||
|
||||
//ITSM PEAK DAY 정보
|
||||
private HashMap<String,HashMap<String,String>> itsmDashPeakdayInfo;
|
||||
|
||||
//ITSM 대시보드 연동 날짜별 거래건수
|
||||
private HashMap<String,List> itsmDashDayTranList;
|
||||
|
||||
//ITSM 대시보드 연동 날짜별 거래건수
|
||||
private HashMap<String,List> itsmDashHourTranList;
|
||||
|
||||
//ITSM 대시보드 연동 서비스별 업무에러 MAP
|
||||
private HashMap<String,HashMap<String,String>> itsmDashBizErrorMap;
|
||||
|
||||
//ITSM 대시보드 연동 서비스별 타임아웃에러 MAP
|
||||
private HashMap<String,HashMap<String,String>> itsmDashTimeoutErrorMap;
|
||||
|
||||
//ITSM 통신에러 MAP
|
||||
private HashMap<String,HashMap<String,String>> itsmDashConnectErrorMap;
|
||||
|
||||
//ITSM 대시비도연동 서버 인스턴스별 거래건수
|
||||
private HashMap<String,HashMap<String,String>> itsmDashServerInstTotalProcMap;
|
||||
|
||||
private String itsmDashTranInfoBatch;
|
||||
|
||||
private String itsmDashTranInfoBatch2;
|
||||
|
||||
private HashMap<String, HashMap<String, String>> itsmDashEaiBatchErrorList;
|
||||
|
||||
private HashMap<String, HashMap<String, String>> itsmDashFepBatchErrorList;
|
||||
|
||||
// 각 서비스별로 집계정보 저장
|
||||
// private Dashboard2ProcVo inTotalVo;
|
||||
// private Dashboard2ProcVo outTotalVo;
|
||||
// private Dashboard2ProcVo commTotalVo;
|
||||
// private Dashboard2ProcVo dmzTotalVo;
|
||||
// private Dashboard2ProcVo batchTotalVo;
|
||||
//
|
||||
// private String lastTime; // 최종으로 저장된 startTime(모든 서비스에 공통)
|
||||
|
||||
|
||||
/**
|
||||
* 저장소 를 초기화 한다.
|
||||
*/
|
||||
@PostConstruct
|
||||
public void createRepository() {
|
||||
repoEAISevrDstcd = new HashMap<String,HashMap<String,String>>();
|
||||
repoMemTransaction = new MultiKeyMap();
|
||||
repository = new MultiKeyMap();
|
||||
repoHostNames = new HashMap<String,List<String>>();
|
||||
repoInstNames = new HashMap<String,List<String>>();
|
||||
repoHostAlive = new HashMap<String,String>();
|
||||
repoSms = new ArrayList<SmsVO>();
|
||||
repoPeakTps = new HashMap<String,String>();
|
||||
repoPeakTrade = new HashMap<String,String>();
|
||||
|
||||
itsmDashTranInfo = new HashMap<String,HashMap<String,String>>();
|
||||
itsmDashPeakdayInfo = new HashMap<String,HashMap<String,String>>();
|
||||
itsmDashHourTranList = new HashMap<String,List>();
|
||||
itsmDashDayTranList = new HashMap<String,List>();
|
||||
itsmDashBizErrorMap = new HashMap<String,HashMap<String,String>>();
|
||||
itsmDashTimeoutErrorMap = new HashMap<String,HashMap<String,String>>();
|
||||
itsmDashConnectErrorMap = new HashMap<String,HashMap<String,String>>();
|
||||
itsmDashServerInstTotalProcMap = new HashMap<String,HashMap<String,String>>();
|
||||
|
||||
itsmDashEaiBatchErrorList = new HashMap<String,HashMap<String,String>>();
|
||||
itsmDashFepBatchErrorList = new HashMap<String,HashMap<String,String>>();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 저장소 데이터를 리셋 한다.
|
||||
*/
|
||||
public void initRepository() {
|
||||
repoEAISevrDstcd.clear();
|
||||
repoMemTransaction.clear();
|
||||
repository.clear();
|
||||
repoHostNames.clear();
|
||||
repoInstNames.clear();
|
||||
repoHostAlive.clear();
|
||||
repoSms.clear();
|
||||
repoPeakTps.clear();
|
||||
repoPeakTrade.clear();
|
||||
|
||||
for( int i = 0 ; i < 6 ; i++ ) {
|
||||
procBatch[i] = 0 ;
|
||||
procEaiBatch[i] = 0 ;
|
||||
}
|
||||
}
|
||||
|
||||
public void initMemTrRepository() {
|
||||
repoMemTransaction.clear();
|
||||
repoMemTransaction = new MultiKeyMap();
|
||||
}
|
||||
|
||||
public void checkMemTrRepository() {
|
||||
logger.info("check repoMemTransaction size=" + repoMemTransaction.size() );
|
||||
}
|
||||
|
||||
public void removeMemTrRepository(String host, String inst) {
|
||||
repoMemTransaction.remove(host, inst);
|
||||
}
|
||||
|
||||
/**
|
||||
* 주어진 서비스의 DB 에서 읽어온 EAI서비스코드,서버구분코드 맵을 리턴한다.
|
||||
* @param service
|
||||
* @return
|
||||
*/
|
||||
public HashMap<String,String> getRepoEAIServrDstcd(String service) {
|
||||
return repoEAISevrDstcd.get(service);
|
||||
}
|
||||
|
||||
/**
|
||||
* 주어진 서비스명으로 메모리에서 읽어온 맵을 리턴한다.
|
||||
* @param service
|
||||
* @return
|
||||
*/
|
||||
public HashMap<String,String> getItsmDashTranInfo(String service) {
|
||||
return itsmDashTranInfo.get(service);
|
||||
}
|
||||
|
||||
public HashMap<String,String> getItsmDashPeakdayInfo(String service) {
|
||||
return itsmDashPeakdayInfo.get(service);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 주어진 서비스명으로 메모리에서 읽어온 리스트을 리턴한다.
|
||||
* @param service
|
||||
* @return
|
||||
*/
|
||||
public List itsmDashHourTranList(String service) {
|
||||
return itsmDashHourTranList.get(service);
|
||||
}
|
||||
|
||||
public List itsmDashDayTranList(String service) {
|
||||
return itsmDashDayTranList.get(service);
|
||||
}
|
||||
|
||||
public HashMap<String, HashMap<String, String>> itsmDashBizErrorMap() {
|
||||
return itsmDashBizErrorMap;
|
||||
}
|
||||
|
||||
public HashMap<String, HashMap<String, String>> itsmDashTimeoutErrorMap() {
|
||||
return itsmDashTimeoutErrorMap;
|
||||
}
|
||||
|
||||
public HashMap<String, HashMap<String, String>> itsmDashConnectErrorMap() {
|
||||
return itsmDashConnectErrorMap;
|
||||
}
|
||||
|
||||
public HashMap<String,String> itsmDashServerInstTotalProcMap(String service) {
|
||||
return itsmDashServerInstTotalProcMap.get(service);
|
||||
}
|
||||
|
||||
public HashMap<String,HashMap<String,String>> itsmDashEaiBatchErrorList() {
|
||||
return itsmDashEaiBatchErrorList;
|
||||
}
|
||||
|
||||
public HashMap<String,HashMap<String,String>> itsmDashFepBatchErrorList() {
|
||||
return itsmDashFepBatchErrorList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 주어진 host 명이 포함된 DB 에서 읽어온 EAI서비스코드,서버구분코드 맵을 리턴한다.
|
||||
* @param host
|
||||
* @return
|
||||
*/
|
||||
// public HashMap<String,String> getRepoEAIServrDstcdByHost(String host) {
|
||||
// ServiceType service = getServiceTypeByHost(host);
|
||||
// if( service != null ) {
|
||||
// return getRepoEAIServrDstcd(service.getKey());
|
||||
// }
|
||||
//
|
||||
// return null ;
|
||||
// }
|
||||
//TODO JUN
|
||||
public HashMap<String,String> getRepoEAIServrDstcdByHost(String host) {
|
||||
DataSourceType dataSourceType = getServiceTypeByHost(host);
|
||||
if( dataSourceType != null ) {
|
||||
return getRepoEAIServrDstcd(dataSourceType.getName());
|
||||
}
|
||||
|
||||
return null ;
|
||||
}
|
||||
|
||||
/**
|
||||
* 주어진 host 명이 포함된 DB 의 서비스 타입을 찾아서 리턴한다.
|
||||
* @param host
|
||||
* @return
|
||||
*/
|
||||
// public ServiceType getServiceTypeByHost(String host) {
|
||||
// Iterator<String> it = repoHostNames.keySet().iterator();
|
||||
// while( it.hasNext() ) {
|
||||
// String key = it.next();
|
||||
// List<String> list = repoHostNames.get(key);
|
||||
// for( String h : list ) {
|
||||
// if( h.equals(host) ) {
|
||||
// return ServiceType.get(key);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// return null ;
|
||||
// }
|
||||
//TODO JUN
|
||||
public DataSourceType getServiceTypeByHost(String host) {
|
||||
Iterator<String> it = repoHostNames.keySet().iterator();
|
||||
while( it.hasNext() ) {
|
||||
String key = it.next();
|
||||
List<String> list = repoHostNames.get(key);
|
||||
for( String h : list ) {
|
||||
if( h.equals(host) ) {
|
||||
return DataSourceTypeManager.getDataSourceType(key);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return null ;
|
||||
}
|
||||
/**
|
||||
* Repository 에 주어진 서비스를 키로 하여 EAI서비스코드,서버구분코드 맵을 추가한다.
|
||||
* @param service
|
||||
* @param map
|
||||
*/
|
||||
public void setRepoEAISevrDstcd(String service, HashMap<String,String> map) {
|
||||
repoEAISevrDstcd.put(service, map);
|
||||
}
|
||||
|
||||
/**
|
||||
* Repository 에 주어진 서비스를 키로 하여 메모리 거래현황 맵을 추가한다.
|
||||
* @param service
|
||||
* @param map
|
||||
*/
|
||||
public void setItsmDashTranInfo(String service, HashMap<String,String> map) {
|
||||
itsmDashTranInfo.put(service, map);
|
||||
}
|
||||
|
||||
public void setItsmDashPeakdayInfo(String service, HashMap<String,String> map) {
|
||||
itsmDashPeakdayInfo.put(service, map);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Repository 에 주어진 서비스를 키로 하여 메모리 시간별거래건수 맵을 추가한다.
|
||||
* @param service
|
||||
* @param map
|
||||
*/
|
||||
public void setItsmDashHourTranList(String service, List list) {
|
||||
|
||||
itsmDashHourTranList.put(service, list);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Repository 에 주어진 서비스를 키로 하여 메모리 시간별거래건수 맵을 추가한다.
|
||||
* @param service
|
||||
* @param map
|
||||
*/
|
||||
public void setItsmDashDayTranList(String service, List list) {
|
||||
|
||||
itsmDashDayTranList.put(service, list);
|
||||
}
|
||||
|
||||
/**
|
||||
* Repository 에 주어진 서비스를 키로 하여 메모리 업무에러리스트 맵을 추가한다.
|
||||
* @param service
|
||||
* @param map
|
||||
*/
|
||||
public void setItsmDashBizErrorMap(HashMap<String,HashMap<String, String>> map) {
|
||||
|
||||
this.itsmDashBizErrorMap = map;
|
||||
}
|
||||
|
||||
/**
|
||||
* Repository 에 주어진 서비스를 키로 하여 메모리 타임아웃에러리스트 맵을 추가한다.
|
||||
* @param service
|
||||
* @param map
|
||||
*/
|
||||
public void setItsmDashTimeoutErrorMap(HashMap<String, HashMap<String, String>> map) {
|
||||
this.itsmDashTimeoutErrorMap = map;
|
||||
}
|
||||
|
||||
public void setItsmDashConnectErrorMap(HashMap<String, HashMap<String, String>> map) {
|
||||
this.itsmDashConnectErrorMap = map;
|
||||
}
|
||||
|
||||
|
||||
public void setItsmDashServerInstTotalProcMap(String service ,HashMap<String,String> map) {
|
||||
|
||||
this.itsmDashServerInstTotalProcMap.put(service, map);
|
||||
}
|
||||
|
||||
|
||||
public void setItsmDashTranInfoBatch( String batchCount ) {
|
||||
this.itsmDashTranInfoBatch = batchCount ;
|
||||
}
|
||||
|
||||
public String getItsmDashTranInfoBatch() {
|
||||
return this.itsmDashTranInfoBatch;
|
||||
}
|
||||
|
||||
public void setItsmDashTranInfoBatch2( String batchCount2 ) {
|
||||
this.itsmDashTranInfoBatch2 = batchCount2 ;
|
||||
}
|
||||
|
||||
public String getItsmDashTranInfoBatch2() {
|
||||
return this.itsmDashTranInfoBatch2;
|
||||
}
|
||||
|
||||
public void setItsmDashEaiBatchErrorList(HashMap<String,HashMap<String,String>> eaiBatchErrorList) {
|
||||
this.itsmDashEaiBatchErrorList = eaiBatchErrorList;
|
||||
}
|
||||
|
||||
public void setItsmDashFepBatchErrorList(HashMap<String,HashMap<String,String>> fepBatchErrorList) {
|
||||
this.itsmDashFepBatchErrorList = fepBatchErrorList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 메모리 건래건수 Repository 를 리턴한다.
|
||||
* @return
|
||||
*/
|
||||
public MultiKeyMap getRepoMemTr() {
|
||||
return repoMemTransaction;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 저장소 객체를 리턴한다.
|
||||
* @return
|
||||
*/
|
||||
public MultiKeyMap getRepository() {
|
||||
return repository;
|
||||
}
|
||||
|
||||
/**
|
||||
* 서비스 -> 호스트명 리스트를 저장한다.
|
||||
* @param service
|
||||
* @param list
|
||||
*/
|
||||
public void setHostNames(String service, List<String> list ) {
|
||||
repoHostNames.put(service,list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 호스트명 -> 인스턴스 리스트를 저장한다.
|
||||
* @param host
|
||||
* @param list
|
||||
*/
|
||||
public void setInstNames(String host, List<String> list ) {
|
||||
repoInstNames.put(host,list);
|
||||
}
|
||||
|
||||
/**
|
||||
* Memory 거래현황정보 추가
|
||||
* @param host
|
||||
* @param inst
|
||||
* @param vo
|
||||
*/
|
||||
//대시보드 메모리 set synchronized 추가테스트 20201019
|
||||
public synchronized void setMemTradeVo( String host, String inst, MemStaticsVo vo) {
|
||||
repoMemTransaction.put(host,inst,vo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 메모리 거래현황 Repository 에서 주어진 호스트명, 인스턴스명 에 대한 Vo 객체를 찾아서 리턴한다.
|
||||
* @param host
|
||||
* @param inst
|
||||
* @return
|
||||
*/
|
||||
//대시보드 메모리 get synchronized 추가테스트 20201019
|
||||
public synchronized MemStaticsVo getMemTradeVo(String host, String inst) {
|
||||
MemStaticsVo vo = (MemStaticsVo)repoMemTransaction.get(host,inst);
|
||||
if( vo == null ) {
|
||||
vo = new MemStaticsVo();
|
||||
vo.setHostName(host);
|
||||
vo.setInstName(inst);
|
||||
}
|
||||
|
||||
return vo;
|
||||
}
|
||||
|
||||
/**
|
||||
* 주어진 호스트명 에서 수신된 Vo 리스트를 찾아서 리턴한다.
|
||||
* @param host
|
||||
* @return
|
||||
*/
|
||||
public List<MemStaticsVo> getMemTradeVoByHost( String host ) {
|
||||
List<MemStaticsVo> list = new ArrayList<MemStaticsVo>();
|
||||
List<String> insts = getInstNames(host);
|
||||
|
||||
if( insts != null ) {
|
||||
for( String inst : insts ) {
|
||||
list.add( getMemTradeVo(host,inst) );
|
||||
}
|
||||
}
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
* 주어진 서비스에서 수신된 전체 Vo 리스트를 찾아서 리턴한다.
|
||||
* @param service
|
||||
* @return
|
||||
*/
|
||||
public List<MemStaticsVo> getMemTradeVoByService( String service ) {
|
||||
List<MemStaticsVo> list = new ArrayList<MemStaticsVo>();
|
||||
List<String> hosts = getHostNames(service);
|
||||
if( hosts != null ) {
|
||||
for( String host : hosts ) {
|
||||
list.addAll( getMemTradeVoByHost(host) );
|
||||
}
|
||||
}
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
public void setTradeVo(String service, String host, DbStaticsVo vo) {
|
||||
repository.put(service, host, vo);
|
||||
}
|
||||
|
||||
public DbStaticsVo getTradeVo(String service, String host) {
|
||||
|
||||
DbStaticsVo vo = (DbStaticsVo)repository.get(service, host);
|
||||
if( vo == null ) {
|
||||
vo = new DbStaticsVo();
|
||||
vo.init();
|
||||
}
|
||||
|
||||
return vo;
|
||||
}
|
||||
|
||||
public List<DbStaticsVo> getTradeVo(String service) {
|
||||
List<DbStaticsVo> list = new ArrayList<DbStaticsVo>();
|
||||
|
||||
List<String> hostNames = repoHostNames.get(service);
|
||||
if( hostNames != null ) {
|
||||
for( String host : hostNames ) {
|
||||
list.add( getTradeVo(service, host) );
|
||||
}
|
||||
}
|
||||
|
||||
if( list.size() == 0 ) {
|
||||
DbStaticsVo vo = new DbStaticsVo();
|
||||
vo.init();
|
||||
list.add(vo);
|
||||
}
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
public DbStaticsVo getTotalVo(String service) {
|
||||
List<DbStaticsVo> list = getTradeVo(service);
|
||||
|
||||
DbStaticsVo retVo = new DbStaticsVo();
|
||||
retVo.init();
|
||||
for( DbStaticsVo vo : list ) {
|
||||
retVo.add( vo );
|
||||
}
|
||||
|
||||
return retVo ;
|
||||
}
|
||||
|
||||
|
||||
public void setMaxProcTime( String fulltime ) {
|
||||
this.maxProcTime = fulltime ;
|
||||
}
|
||||
|
||||
public String getMaxProcTime() {
|
||||
return this.maxProcTime;
|
||||
}
|
||||
|
||||
|
||||
public boolean isInitHostRepository() {
|
||||
if( repoHostAlive.size() > 0 )
|
||||
return true ;
|
||||
else
|
||||
return false ;
|
||||
}
|
||||
|
||||
public void addHostKey( List<String> listAddr ) {
|
||||
|
||||
if( listAddr != null ) {
|
||||
for( String addr : listAddr ) {
|
||||
repoHostAlive.put(addr, "1");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isHostAlive( String ipaddr, String port ) {
|
||||
String alive = repoHostAlive.get(ipaddr + ":" + port);
|
||||
|
||||
// 디폴트는 성공으로 간주하고, 실패시에만 Fail 처리한다.
|
||||
if( "0".equals(alive) ) {
|
||||
return false ;
|
||||
} else {
|
||||
return true ;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isHostAlive( String ipaddr ) {
|
||||
boolean foundDead = false ;
|
||||
|
||||
// ip:port
|
||||
Iterator it = repoHostAlive.keySet().iterator();
|
||||
while( it.hasNext() ) {
|
||||
String key = (String)it.next();
|
||||
String tmp[] = key.split(":");
|
||||
if( tmp.length > 1 ) {
|
||||
if( ipaddr.equals( tmp[0] ) ) {
|
||||
String alive = repoHostAlive.get(key);
|
||||
if( "1".equals(alive) ) {
|
||||
return true ;
|
||||
} else {
|
||||
foundDead = true ;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if( foundDead ) {
|
||||
// 모든 inst 가 실패
|
||||
return false ;
|
||||
}
|
||||
|
||||
// 디폴트
|
||||
return true ;
|
||||
}
|
||||
|
||||
public void setHostAlive( String ipaddr, String port, boolean alive ) {
|
||||
String aliveVal = "1" ;
|
||||
if( alive == false ) {
|
||||
aliveVal = "0" ;
|
||||
}
|
||||
|
||||
repoHostAlive.put(ipaddr + ":" + port, aliveVal );
|
||||
}
|
||||
|
||||
/**
|
||||
* ip : port 형태의 주소값 리스트를 리턴한다.
|
||||
* @return
|
||||
*/
|
||||
public List<String> getHostIPList() {
|
||||
Iterator it = repoHostAlive.keySet().iterator();
|
||||
|
||||
List<String> list = new ArrayList<String>();
|
||||
while( it.hasNext() ) {
|
||||
String key = (String)it.next();
|
||||
list.add( key );
|
||||
}
|
||||
|
||||
return list ;
|
||||
}
|
||||
|
||||
public List<String> getHostNames( String service ) {
|
||||
return repoHostNames.get(service);
|
||||
}
|
||||
|
||||
public List<String> getInstNames( String host ) {
|
||||
return repoInstNames.get(host);
|
||||
}
|
||||
|
||||
public void addSms( SmsVO vo ) {
|
||||
repoSms.add( vo );
|
||||
|
||||
// 만일 100개가 넘으면 앞에서 부터 50개를 삭제한다.
|
||||
if( repoSms.size() >= 100 ) {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void setPeakTps( String service, String val ) {
|
||||
repoPeakTps.put(service, val);
|
||||
}
|
||||
|
||||
public String getPeakTps( String service ) {
|
||||
return repoPeakTps.get(service);
|
||||
}
|
||||
|
||||
public void setPeakTrade( String service, String val ) {
|
||||
repoPeakTrade.put(service, val);
|
||||
}
|
||||
|
||||
public String getPeakTrade( String service ) {
|
||||
return repoPeakTrade.get(service);
|
||||
}
|
||||
|
||||
public String getProcBatch( ) {
|
||||
StringBuffer sb = new StringBuffer();
|
||||
for( int i = 0 ; i < this.procBatch.length ; i++ ) {
|
||||
sb.append(this.procBatch[i]).append(",");
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public String getProcEaiBatch( ) {
|
||||
StringBuffer sb = new StringBuffer();
|
||||
for( int i = 0 ; i < this.procEaiBatch.length ; i++ ) {
|
||||
sb.append(this.procEaiBatch[i]).append(",");
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void setProcBatch( int p1, int p2, int p3, int p4, int p5, int p6 ) {
|
||||
this.procBatch[0] = p1 ;
|
||||
this.procBatch[1] = p2 ;
|
||||
this.procBatch[2] = p3 ;
|
||||
this.procBatch[3] = p4 ;
|
||||
this.procBatch[4] = p5 ;
|
||||
this.procBatch[5] = p6 ;
|
||||
}
|
||||
|
||||
public void setProcEaiBatch( int p1, int p2, int p3, int p4, int p5, int p6 ) {
|
||||
this.procEaiBatch[0] = p1 ;
|
||||
this.procEaiBatch[1] = p2 ;
|
||||
this.procEaiBatch[2] = p3 ;
|
||||
this.procEaiBatch[3] = p4 ;
|
||||
this.procEaiBatch[4] = p5 ;
|
||||
this.procEaiBatch[5] = p6 ;
|
||||
}
|
||||
|
||||
}
|
||||
+812
@@ -0,0 +1,812 @@
|
||||
package com.eactive.eai.rms.onl.dashboard.service;
|
||||
|
||||
import java.net.InetAddress;
|
||||
import java.net.UnknownHostException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
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.context.MonitoringContext;
|
||||
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;
|
||||
import com.eactive.eai.rms.onl.common.service.DashboardTargetService;
|
||||
import com.eactive.eai.rms.onl.common.service.EaiServerInfoService;
|
||||
import com.eactive.eai.rms.onl.dashboard.repository.Dashboard2Repository;
|
||||
import com.eactive.eai.rms.onl.tracking.vo.DbStaticsVo;
|
||||
import com.eactive.eai.rms.onl.tracking.vo.MemStaticsVo;
|
||||
|
||||
@Service("dashboard2RepositoryService")
|
||||
public class Dashboard2RepositoryService {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(Dashboard2RepositoryService.class);
|
||||
|
||||
/** The monitoring context. */
|
||||
@Autowired
|
||||
@Qualifier("monitoringContext")
|
||||
private transient MonitoringContext monitoringContext;
|
||||
|
||||
/** The eai server info service. */
|
||||
@Autowired
|
||||
@Qualifier("eaiServerInfoService")
|
||||
private EaiServerInfoService eaiServerInfoService;
|
||||
|
||||
/** The dashboard target service. */
|
||||
@Autowired
|
||||
@Qualifier("DashboardTargetService")
|
||||
private DashboardTargetService dashboadTargetService;
|
||||
|
||||
|
||||
@Autowired
|
||||
@Qualifier("dashboard2Repository")
|
||||
private Dashboard2Repository dashboardRepository;
|
||||
|
||||
// hostNames, instNames 초기화 여부
|
||||
private boolean isInitHostInstName = false;
|
||||
|
||||
// EAISevrDstcd 초기화 여부
|
||||
private boolean isInitEAISevrDstcd = false;
|
||||
|
||||
private boolean isInitTargetService = false;
|
||||
private String dashTargetService = "" ;
|
||||
|
||||
public void initTargetService() {
|
||||
if( isInitTargetService == false ) {
|
||||
dashTargetService = getTargetService();
|
||||
isInitTargetService = true ;
|
||||
}
|
||||
}
|
||||
|
||||
public String getDashTargetService() {
|
||||
initTargetService();
|
||||
return dashTargetService ;
|
||||
}
|
||||
|
||||
/**
|
||||
* repository 데이터를 초기화 한다.
|
||||
* ( 날짜가 변경선을 지난 경우 등에 해당한다. )
|
||||
*/
|
||||
public void initMemTrRepository() {
|
||||
dashboardRepository.initMemTrRepository();
|
||||
|
||||
initHostInstNames(true);
|
||||
initEaiSevrDstcd(true);
|
||||
}
|
||||
|
||||
public void checkMemTrRepository() {
|
||||
dashboardRepository.checkMemTrRepository();
|
||||
}
|
||||
|
||||
public void removeMemTrRepository( String host, String inst ) {
|
||||
dashboardRepository.removeMemTrRepository(host, inst);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 서비스별 호스트명 리스트를 맵에 추가한다.
|
||||
* @param service
|
||||
* @param list
|
||||
*/
|
||||
public void setHostNames(String service, List<String> list ) {
|
||||
dashboardRepository.setHostNames(service, list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 호스트별 인스턴스명 리스트를 맵에 추가한다.
|
||||
* @param host
|
||||
* @param list
|
||||
*/
|
||||
public void setInstNames(String host, List<String> list ) {
|
||||
dashboardRepository.setInstNames(host, list);
|
||||
}
|
||||
|
||||
/**
|
||||
* Repository 에 주어진 서비스를 키로 하여 메모리 거래현황 맵을 추가한다.
|
||||
* @param service
|
||||
* @param map
|
||||
*/
|
||||
public void setItsmDashTranInfo(String service, HashMap<String,String> map) {
|
||||
dashboardRepository.setItsmDashTranInfo(service, map);
|
||||
}
|
||||
|
||||
|
||||
public void setItsmDashPeakdayInfo(String service, HashMap<String,String> map) {
|
||||
dashboardRepository.setItsmDashPeakdayInfo(service, map);
|
||||
}
|
||||
|
||||
/**
|
||||
* 주어진 서비스명으로 메모리에서 읽어온 맵을 리턴한다.
|
||||
* @param service
|
||||
* @return
|
||||
*/
|
||||
public HashMap<String,String> getItsmDashTranInfo(String service) {
|
||||
return dashboardRepository.getItsmDashTranInfo(service);
|
||||
}
|
||||
|
||||
public HashMap<String,String> getItsmDashPeakdayInfo(String service) {
|
||||
return dashboardRepository.getItsmDashPeakdayInfo(service);
|
||||
}
|
||||
|
||||
/**
|
||||
* Repository 에 주어진 서비스를 키로 하여 메모리 거래현황 맵을 추가한다.
|
||||
* @param service
|
||||
* @param map
|
||||
*/
|
||||
public void setItsmDashHourTranList(String service, List list) {
|
||||
dashboardRepository.setItsmDashHourTranList(service, list);
|
||||
}
|
||||
|
||||
|
||||
public void setItsmDashDayTranList(String service, List list) {
|
||||
dashboardRepository.setItsmDashDayTranList(service, list);
|
||||
}
|
||||
|
||||
public void setItsmDashBizErrorMap(HashMap<String, HashMap<String, String>> map) {
|
||||
dashboardRepository.setItsmDashBizErrorMap(map);
|
||||
}
|
||||
|
||||
|
||||
public void setItsmDashTimeoutErrorMap(HashMap<String, HashMap<String, String>> map) {
|
||||
dashboardRepository.setItsmDashTimeoutErrorMap(map);
|
||||
}
|
||||
|
||||
public void setItsmDashConnectErrorMap(HashMap<String, HashMap<String, String>> map) {
|
||||
dashboardRepository.setItsmDashConnectErrorMap(map);
|
||||
}
|
||||
|
||||
public void setItsmDashServerInstTotalProcMap(String service,HashMap<String,String> map) {
|
||||
dashboardRepository.setItsmDashServerInstTotalProcMap(service,map);
|
||||
}
|
||||
|
||||
public void setItsmDashTranInfoBatch( String batchCount ) {
|
||||
dashboardRepository.setItsmDashTranInfoBatch(batchCount) ;
|
||||
}
|
||||
|
||||
public void setItsmDashTranInfoBatch2( String batchCount2 ) {
|
||||
dashboardRepository.setItsmDashTranInfoBatch2(batchCount2) ;
|
||||
}
|
||||
|
||||
public void setItsmDashEaiBatchErrorList(HashMap<String,HashMap<String,String>> eaiBatchErrorList) {
|
||||
dashboardRepository.setItsmDashEaiBatchErrorList(eaiBatchErrorList);
|
||||
}
|
||||
|
||||
public void setItsmDashFepBatchErrorList(HashMap<String,HashMap<String,String>> fepBatchErrorList) {
|
||||
dashboardRepository.setItsmDashFepBatchErrorList(fepBatchErrorList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 주어진 서비스명으로 메모리에서 읽어온 맵을 리턴한다.
|
||||
* @param service
|
||||
* @return
|
||||
*/
|
||||
public List getItsmDashHourTranList(String service) {
|
||||
return dashboardRepository.itsmDashHourTranList(service);
|
||||
}
|
||||
|
||||
public List getItsmDashDayTranList(String service) {
|
||||
return dashboardRepository.itsmDashDayTranList(service);
|
||||
}
|
||||
|
||||
public HashMap<String, HashMap<String, String>> getItsmDashBizErrorMap() {
|
||||
return dashboardRepository.itsmDashBizErrorMap();
|
||||
}
|
||||
|
||||
public HashMap<String, HashMap<String, String>> getItsmDashTimeoutErrorMap() {
|
||||
return dashboardRepository.itsmDashTimeoutErrorMap();
|
||||
}
|
||||
|
||||
public HashMap<String, HashMap<String, String>> getItsmDashConnectErrorMap() {
|
||||
return dashboardRepository.itsmDashConnectErrorMap();
|
||||
}
|
||||
|
||||
public HashMap<String, HashMap<String, String>> getAllDashErrorMap() {
|
||||
|
||||
HashMap<String, HashMap<String, String>> result = new HashMap<>();
|
||||
|
||||
result.putAll(dashboardRepository.itsmDashBizErrorMap());
|
||||
result.putAll(dashboardRepository.itsmDashTimeoutErrorMap());
|
||||
result.putAll(dashboardRepository.itsmDashConnectErrorMap());
|
||||
result.putAll(dashboardRepository.itsmDashEaiBatchErrorList());
|
||||
result.putAll(dashboardRepository.itsmDashFepBatchErrorList());
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public HashMap<String,String> getItsmDashServerInstTotalProcMap(String service) {
|
||||
return dashboardRepository.itsmDashServerInstTotalProcMap(service);
|
||||
}
|
||||
|
||||
public String getItsmDashTranInfoBatch() {
|
||||
return dashboardRepository.getItsmDashTranInfoBatch() ;
|
||||
}
|
||||
|
||||
public String getItsmDashTranInfoBatch2() {
|
||||
return dashboardRepository.getItsmDashTranInfoBatch2() ;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 대시보드타겟 서비스가 ALL 인경우 EAI 서버구분코드값을 정할때,
|
||||
* EAISevrDstcd 필드를 사용하지 않고 DB 로 구분한다.
|
||||
* @param dataSourceType
|
||||
* @param targetService
|
||||
* @param map
|
||||
*/
|
||||
private HashMap<String,String> reinitEaiSevrDstcd(DataSourceType dataSourceType, String targetService, HashMap<String,String> map ) {
|
||||
|
||||
HashMap<String,String> retMap = new HashMap<String,String>();
|
||||
|
||||
if( "ALL".equals(targetService) ) {
|
||||
String eaiSevrDstcd = "" ;
|
||||
|
||||
if( DataSourceTypeManager.MCI.equals(dataSourceType.getName()) ) {
|
||||
eaiSevrDstcd = DataSourceTypeManager.MCI; // MCI
|
||||
} else if( DataSourceTypeManager.MCU.equals(dataSourceType.getName()) ) {
|
||||
eaiSevrDstcd = DataSourceTypeManager.MCU ; // MCU
|
||||
} else if( DataSourceTypeManager.EAI.equals(dataSourceType.getName()) ) {
|
||||
eaiSevrDstcd = DataSourceTypeManager.EAI ; // EAI
|
||||
} else if( DataSourceTypeManager.FEP.equals(dataSourceType.getName()) ) {
|
||||
eaiSevrDstcd = DataSourceTypeManager.FEP ; // FEP
|
||||
} else if( DataSourceTypeManager.OPA.equals(dataSourceType.getName()) ) {
|
||||
eaiSevrDstcd = DataSourceTypeManager.OPA ; // OPA
|
||||
} else {
|
||||
return map;
|
||||
}
|
||||
|
||||
Iterator<String> it = map.keySet().iterator();
|
||||
while( it.hasNext() ) {
|
||||
String eaiSvcName = it.next();
|
||||
retMap.put(eaiSvcName, eaiSevrDstcd);
|
||||
}
|
||||
} else {
|
||||
return map ;
|
||||
}
|
||||
|
||||
return retMap ;
|
||||
}
|
||||
|
||||
/**
|
||||
* 각 서비스별 EAI서비스코드(EAISvcName) 와 서버구분코드(EAISevrDstcd) 값을 초기화 한다.
|
||||
* @param isForceOverwrite
|
||||
*/
|
||||
public void initEaiSevrDstcd( boolean isForceOverwrite ) {
|
||||
if( isForceOverwrite == false ) {
|
||||
if( isInitEAISevrDstcd == true ) {
|
||||
return ;
|
||||
}
|
||||
}
|
||||
|
||||
HashMap<String,String> map = null;
|
||||
|
||||
String targetService = getDashTargetService();
|
||||
if( targetService == null || "".equals(targetService) ) {
|
||||
targetService = "ALL" ;
|
||||
}
|
||||
|
||||
for (DataSourceType d : DataSourceTypeManager.getOnlineDataSourceTypes()){
|
||||
|
||||
if(DataSourceTypeManager.APIGW.equals(d.getName())) {
|
||||
try {
|
||||
DataSourceContextHolder.setDataSourceType(d);
|
||||
map = dashboadTargetService.selectEAISevrDstcd();
|
||||
map = reinitEaiSevrDstcd(d, targetService, map );
|
||||
dashboardRepository.setRepoEAISevrDstcd(d.getName(), map);
|
||||
} catch ( Exception e ) {
|
||||
//e.printStackTrace();
|
||||
logger.error("initEaiSevrDstcd error", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
isInitEAISevrDstcd = true ;
|
||||
}
|
||||
|
||||
/**
|
||||
* 해당 서비스의 EAISvcName,EAISevrDstcd 맵을 리턴한다.
|
||||
* @param dataSourceType
|
||||
* @return
|
||||
*/
|
||||
public HashMap<String,String> getEAISevrDstcdMap(DataSourceType dataSourceType) {
|
||||
return dashboardRepository.getRepoEAIServrDstcd(dataSourceType.getName());
|
||||
}
|
||||
|
||||
/**
|
||||
* 주어진 host 명이 포함된 DB 에서 읽어온 EAI서비스코드,서버구분코드 맵을 리턴한다.
|
||||
* @param host
|
||||
* @return
|
||||
*/
|
||||
public HashMap<String,String> getRepoEAIServrDstcdByHost(String host) {
|
||||
return dashboardRepository.getRepoEAIServrDstcdByHost(host);
|
||||
}
|
||||
|
||||
public DataSourceType getServiceTypeByHost(String host) {
|
||||
return dashboardRepository.getServiceTypeByHost(host);
|
||||
}
|
||||
|
||||
public boolean isValidHost( String host ) {
|
||||
// FIXME : CLOUD_ENV 환경에서는 check 하지 않도록 함
|
||||
// if( null == dashboardRepository.getServiceTypeByHost(host) ) {
|
||||
// return false;
|
||||
// }
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 호스트명, 인스턴스명 을 초기화 한다.
|
||||
* @param isForceOverwrite
|
||||
*/
|
||||
public void initHostInstNames( boolean isForceOverwrite ) {
|
||||
if( isForceOverwrite == false ) {
|
||||
if( isInitHostInstName == true ) {
|
||||
return ;
|
||||
}
|
||||
}
|
||||
|
||||
List<Map<String,String>> listTmp = null ;
|
||||
List<String> hostList = new ArrayList<String>();
|
||||
HashMap<String,List<String>> mapInst = new HashMap<String,List<String>>();
|
||||
|
||||
for (DataSourceType d :DataSourceTypeManager.getOnlineDataSourceTypes()){
|
||||
|
||||
if(DataSourceTypeManager.APIGW.equals(d.getName())) {
|
||||
|
||||
try {
|
||||
DataSourceContextHolder.setDataSourceType(d);
|
||||
listTmp = eaiServerInfoService.getEaiServerIpListDB();
|
||||
hostList.clear();
|
||||
|
||||
for( Map<String, String> map : listTmp ) {
|
||||
String host = map.get("HOSTNAME") ;
|
||||
String inst = map.get("EAISVRINSTNM");
|
||||
hostList.add(host);
|
||||
|
||||
List<String> l = mapInst.get(host);
|
||||
if( l == null ) {
|
||||
l = new ArrayList<String>();
|
||||
}
|
||||
l.add( inst );
|
||||
mapInst.put(host, l);
|
||||
}
|
||||
|
||||
List<String> hostSide = CommonUtil.getDistinctList(hostList, true);
|
||||
setHostNames(d.getName(), hostSide);
|
||||
if( hostSide != null ) {
|
||||
for( String host : hostSide ) {
|
||||
List<String> l = mapInst.get(host);
|
||||
if( l != null ) {
|
||||
l = CommonUtil.getDistinctList(l, true);
|
||||
setInstNames(host, l);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch(Exception e) {
|
||||
logger.warn("Fail to get DataSourceType = " + d.getJndiName(), e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
isInitHostInstName = true ;
|
||||
}
|
||||
|
||||
public void setMemTradeVo(String host, String inst, MemStaticsVo vo) {
|
||||
logger.info("host=" + host +", inst="+ inst +", MemStaticsVo="+vo);
|
||||
dashboardRepository.setMemTradeVo(host, inst, vo);
|
||||
}
|
||||
|
||||
public MemStaticsVo getMemTradeVo(String host, String inst) {
|
||||
return dashboardRepository.getMemTradeVo(host, inst);
|
||||
}
|
||||
|
||||
public MemStaticsVo getMemTradeVoByHost(String host,List<Map<String, String>> ipList) {
|
||||
HashMap<String, String> instMap = new HashMap<String, String>();
|
||||
if( ipList != null ) {
|
||||
for( Map<String,String> map : ipList ) {
|
||||
String inst = map.get("EAISVRINSTNM");
|
||||
instMap.put(inst, inst);
|
||||
}
|
||||
}
|
||||
|
||||
MemStaticsVo totalVo = new MemStaticsVo();
|
||||
totalVo.setHostName(host);
|
||||
|
||||
List<MemStaticsVo> list = dashboardRepository.getMemTradeVoByHost(host);
|
||||
if( list != null ) {
|
||||
for( MemStaticsVo vo : list ) {
|
||||
if( instMap.get(vo.getInstName()) != null ) {
|
||||
totalVo.add(vo);
|
||||
}
|
||||
|
||||
if( logger.isDebugEnabled() ) {
|
||||
logger.debug( "host=" + host + ", procIn=" + vo.getProcIn() + ", procOut=" + vo.getProcOut());
|
||||
}
|
||||
}
|
||||
} else {
|
||||
logger.warn("MEM_TRADE_REPOSITORY : list is null !(host=" + host + ")");
|
||||
|
||||
}
|
||||
|
||||
return totalVo;
|
||||
}
|
||||
|
||||
public MemStaticsVo getMemTradeVoByHost(String host) {
|
||||
MemStaticsVo totalVo = new MemStaticsVo();
|
||||
totalVo.setHostName(host);
|
||||
|
||||
List<MemStaticsVo> list = dashboardRepository.getMemTradeVoByHost(host);
|
||||
if( list != null ) {
|
||||
for( MemStaticsVo vo : list ) {
|
||||
totalVo.add(vo);
|
||||
if( logger.isDebugEnabled() ) {
|
||||
logger.debug( "host=" + host + ", procIn=" + vo.getProcIn() + ", procOut=" + vo.getProcOut());
|
||||
}
|
||||
}
|
||||
} else {
|
||||
logger.warn("MEM_TRADE_REPOSITORY : list is null !(host=" + host + ")");
|
||||
|
||||
}
|
||||
|
||||
return totalVo;
|
||||
}
|
||||
|
||||
public MemStaticsVo getMemTradeVoByHost(String host, String inst) {
|
||||
MemStaticsVo totalVo = new MemStaticsVo();
|
||||
totalVo.setHostName(host);
|
||||
totalVo.setInstName(inst);
|
||||
|
||||
List<MemStaticsVo> list = dashboardRepository.getMemTradeVoByHost(host);
|
||||
if( list != null ) {
|
||||
for( MemStaticsVo vo : list ) {
|
||||
if(vo.getInstName().equals(inst)) {
|
||||
totalVo.add(vo);
|
||||
}
|
||||
|
||||
if( logger.isDebugEnabled() ) {
|
||||
logger.debug( "host=" + host + ", procIn=" + vo.getProcIn() + ", procOut=" + vo.getProcOut());
|
||||
}
|
||||
}
|
||||
} else {
|
||||
logger.warn("MEM_TRADE_REPOSITORY : list is null !(host=" + host + ")");
|
||||
}
|
||||
|
||||
return totalVo;
|
||||
}
|
||||
|
||||
public MemStaticsVo getMemTradeVoByService(String service) {
|
||||
MemStaticsVo totalVo = new MemStaticsVo();
|
||||
|
||||
List<MemStaticsVo> list = dashboardRepository.getMemTradeVoByService(service);
|
||||
|
||||
List<String >instList = new ArrayList<String>();
|
||||
List<Map<String, String>>iplist = eaiServerInfoService.getEaiServerIpListDB();
|
||||
if( list != null ) {
|
||||
for( Map<String,String> map : iplist ) {
|
||||
String inst = map.get("EAISVRINSTNM");
|
||||
instList.add(inst);
|
||||
}
|
||||
}
|
||||
if( list != null ) {
|
||||
for( MemStaticsVo vo : list ) {
|
||||
for(String inst : instList) {
|
||||
if( vo.getInstName().equals(inst)) {
|
||||
totalVo.add(vo);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return totalVo;
|
||||
}
|
||||
|
||||
/**
|
||||
* 서비스별, 호스트별 거래건수 객체를 맵에 추가한다.
|
||||
* @param service
|
||||
* @param host
|
||||
* @param vo
|
||||
*/
|
||||
public void setTradeVo(String service, String host, DbStaticsVo vo) {
|
||||
dashboardRepository.setTradeVo(service, host, vo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 주어진 서비스,호스트 에 대한 거래건수 객체를 리턴한다.
|
||||
* @param service
|
||||
* @param host
|
||||
* @return
|
||||
*/
|
||||
public DbStaticsVo getTradeVo(String service, String host) {
|
||||
return dashboardRepository.getTradeVo(service, host);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 주어진 서비스에 에 대한 거래건수 리스트를 리턴한다.
|
||||
* @param service
|
||||
* @return
|
||||
*/
|
||||
public List<DbStaticsVo> getTradeVo(String service) {
|
||||
return dashboardRepository.getTradeVo(service);
|
||||
}
|
||||
|
||||
/**
|
||||
* 주어진 서비스에 대한 거래건수 의 합을 리턴한다.
|
||||
* @param service
|
||||
* @return
|
||||
*/
|
||||
public DbStaticsVo getTotalVo(String service) {
|
||||
return dashboardRepository.getTotalVo(service);
|
||||
}
|
||||
|
||||
public String getMaxProcTime() {
|
||||
return dashboardRepository.getMaxProcTime();
|
||||
}
|
||||
|
||||
public void setMaxProcTime( String fulltime ) {
|
||||
dashboardRepository.setMaxProcTime( fulltime );
|
||||
}
|
||||
|
||||
|
||||
public void initHostAlive() {
|
||||
if( dashboardRepository.isInitHostRepository() ) {
|
||||
return ;
|
||||
}
|
||||
//동적
|
||||
for(DataSourceType d : DataSourceTypeManager.getOnlineDataSourceTypes()){
|
||||
DataSourceContextHolder.setDataSourceType(d); // 스케쥴러에서만 initHostAlive 를 쓰므로 Datasource를 미리 할당해준다.
|
||||
|
||||
List<Map<String,String>> list = null ;
|
||||
list = eaiServerInfoService.getEaiServerIpListDB();
|
||||
ArrayList<String> listHost = new ArrayList<String>();
|
||||
for( Map<String,String> map : list ) {
|
||||
//String inst = map.get("EAISVRINSTNM");
|
||||
String ip = map.get("EAISVRIP");
|
||||
String port = map.get("EAISVRLSNPORT");
|
||||
//String host = map.get("HOSTNAME");
|
||||
|
||||
listHost.add( ip + ":" + port ); // 참고 : 중복된 ip 가 있을 수 있으나, 맵에 추가하기에 상관없음.
|
||||
}
|
||||
|
||||
dashboardRepository.addHostKey( listHost );
|
||||
|
||||
}
|
||||
//BATCH
|
||||
List<Map<String,String>> list = null ;
|
||||
DataSourceType d = DataSourceTypeManager.getDataSourceType(DataSourceTypeManager.BAT);
|
||||
if (d != null){
|
||||
list = eaiServerInfoService.getEaiServerIpListDB();
|
||||
}
|
||||
ArrayList<String> listHost = new ArrayList<String>();
|
||||
|
||||
if(list != null) {
|
||||
for( Map<String,String> map : list ) { //취약점소스 수정 2020.08.25
|
||||
//String inst = map.get("EAISVRINSTNM");
|
||||
String ip = map.get("EAISVRIP");
|
||||
String port = map.get("EAISVRLSNPORT");
|
||||
//String host = map.get("HOSTNAME");
|
||||
listHost.add( ip + ":" + port ); // 참고 : 중복된 ip 가 있을 수 있으나, 맵에 추가하기에 상관없음.
|
||||
}
|
||||
}
|
||||
|
||||
dashboardRepository.addHostKey( listHost );
|
||||
}
|
||||
|
||||
public List<String> getHostIPList() {
|
||||
return dashboardRepository.getHostIPList();
|
||||
}
|
||||
|
||||
public List<String> getHostNames(String service) {
|
||||
return dashboardRepository.getHostNames(service);
|
||||
}
|
||||
|
||||
public boolean isHostAlive(String ipaddress, String port) {
|
||||
return dashboardRepository.isHostAlive(ipaddress, port);
|
||||
}
|
||||
|
||||
public boolean isHostAlive(String ipaddress) {
|
||||
return dashboardRepository.isHostAlive(ipaddress);
|
||||
}
|
||||
|
||||
public String getHostAlive(String ipaddress, String port) {
|
||||
if( isHostAlive(ipaddress, port) ) {
|
||||
return "1" ;
|
||||
} else {
|
||||
return "0" ;
|
||||
}
|
||||
}
|
||||
|
||||
// 해당 IP 의 인스턴스중 한개만 살아 있어도 true
|
||||
public String getHostAlive( String ipaddress ) {
|
||||
if( isHostAlive(ipaddress) ) {
|
||||
return "1" ;
|
||||
} else {
|
||||
return "0" ;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void setHostAlive(String ipaddress, String port, boolean alive) {
|
||||
dashboardRepository.setHostAlive(ipaddress, port, alive);
|
||||
}
|
||||
|
||||
|
||||
public void setPeakTps(String service, String val) {
|
||||
dashboardRepository.setPeakTps(service, val);
|
||||
}
|
||||
|
||||
public void reloadPeakTpsTrade( ) {
|
||||
DataSourceType ds = DataSourceTypeManager.getDataSourceType(DataSourceTypeManager.MONITORING);
|
||||
DataSourceContextHolder.setDataSourceType(ds);
|
||||
// PEAK TPS
|
||||
monitoringContext.refresh(MonitoringContext.RMS_PEAK_TPS); // RMS_PEAK_TPS의 property값을 DB에 있는 값으로 리셋
|
||||
String prop = monitoringContext.getStringProperty(MonitoringContext.RMS_PEAK_TPS,"");
|
||||
if( prop == null || "".equals(prop)) {
|
||||
logger.error("RMS_PAEK_TPS value not found.");
|
||||
} else {
|
||||
String[] lines = prop.split(";");
|
||||
for( String line : lines ) {
|
||||
String [] data = line.split(",");
|
||||
if( data.length > 2 ) {
|
||||
dashboardRepository.setPeakTps(data[0], line);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// PEAK TRADE
|
||||
monitoringContext.refresh(MonitoringContext.RMS_PEAK_TRADE); // RMS_PEAK_TRADE의 property값을 DB에 있는 값으로 리셋
|
||||
prop = monitoringContext.getStringProperty(MonitoringContext.RMS_PEAK_TRADE,"");
|
||||
if( prop == null || "".equals(prop)) {
|
||||
logger.error("RMS_PEAK_TRADE value not found.");
|
||||
} else {
|
||||
String[] lines = prop.split(";");
|
||||
for( String line : lines ) {
|
||||
String [] data = line.split(",");
|
||||
if( data.length > 2 ) {
|
||||
dashboardRepository.setPeakTrade(data[0], line);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public String getPeakTps(String service) {
|
||||
String val = dashboardRepository.getPeakTps(service);
|
||||
|
||||
if( val == null || "".equals(val) ) {
|
||||
String m = monitoringContext.getStringProperty(MonitoringContext.RMS_PEAK_TPS,"");
|
||||
String[] lines = m.split(";");
|
||||
for( String line : lines ) {
|
||||
String [] data = line.split(",");
|
||||
if( data.length > 3 && service.equals(data[0]) ) {
|
||||
dashboardRepository.setPeakTps(service, line);
|
||||
return line ;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return val ;
|
||||
}
|
||||
|
||||
public String getPeakTpsAll() {
|
||||
StringBuffer sb = new StringBuffer();
|
||||
String val ="";
|
||||
for (DataSourceType d : DataSourceTypeManager.getOnlineDataSourceTypes()){
|
||||
val = dashboardRepository.getPeakTps(d.getName() );
|
||||
sb.append( CommonUtil.rightTrim(val, ",") ).append(";");
|
||||
}
|
||||
DataSourceType d = DataSourceTypeManager.getDataSourceType(DataSourceTypeManager.BAP);
|
||||
if(d != null) {
|
||||
val = dashboardRepository.getPeakTps(d.getName() );
|
||||
sb.append( CommonUtil.rightTrim(val, ",") ).append(";");
|
||||
}
|
||||
DataSourceType d2 = DataSourceTypeManager.getDataSourceType(DataSourceTypeManager.BAT);
|
||||
if(d2 != null) {
|
||||
val = dashboardRepository.getPeakTps(d2.getName());
|
||||
sb.append( CommonUtil.rightTrim(val, ",") ).append(";");
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void setPeakTrade(String service, String val) {
|
||||
dashboardRepository.setPeakTrade(service, val);
|
||||
}
|
||||
|
||||
public String getPeakTrade(String service) {
|
||||
String val = dashboardRepository.getPeakTrade(service);
|
||||
|
||||
if( val == null || "".equals(val) ) {
|
||||
String m = monitoringContext.getStringProperty(MonitoringContext.RMS_PEAK_TRADE,"");
|
||||
String[] lines = m.split(";");
|
||||
for( String line : lines ) {
|
||||
String [] data = line.split(",");
|
||||
if( data.length > 2 && service.equals(data[0]) ) {
|
||||
return line ;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return val ;
|
||||
}
|
||||
|
||||
public String getPeakTradeAll() {
|
||||
StringBuffer sb = new StringBuffer();
|
||||
String val = "";
|
||||
for (DataSourceType d : DataSourceTypeManager.getOnlineDataSourceTypes()){
|
||||
val = dashboardRepository.getPeakTrade(d.getName() );
|
||||
sb.append( CommonUtil.rightTrim(val, ",") ).append(";");
|
||||
}
|
||||
DataSourceType d = DataSourceTypeManager.getDataSourceType(DataSourceTypeManager.BAP);
|
||||
if(d != null) {
|
||||
val = dashboardRepository.getPeakTrade(d.getName() );
|
||||
sb.append( CommonUtil.rightTrim(val, ",") ).append(";");
|
||||
}
|
||||
DataSourceType d2 = DataSourceTypeManager.getDataSourceType(DataSourceTypeManager.BAT);
|
||||
if(d2 != null) {
|
||||
val = dashboardRepository.getPeakTrade(d2.getName());
|
||||
sb.append( CommonUtil.rightTrim(val, ",") ).append(";");
|
||||
}
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
|
||||
public String getProcBatch( ) {
|
||||
return dashboardRepository.getProcBatch();
|
||||
}
|
||||
public String getProcEaiBatch( ) {
|
||||
return dashboardRepository.getProcEaiBatch();
|
||||
}
|
||||
|
||||
public void setProcBatch( int[] p ) {
|
||||
if( p != null && p.length == 6 )
|
||||
dashboardRepository.setProcBatch( p[0], p[1], p[2], p[3], p[4], p[5] );
|
||||
}
|
||||
|
||||
public void setProcEaiBatch( int[] p ) {
|
||||
if( p != null && p.length == 6 )
|
||||
dashboardRepository.setProcEaiBatch( p[0], p[1], p[2], p[3], p[4], p[5] );
|
||||
}
|
||||
|
||||
|
||||
private String getTargetService() {
|
||||
String local = "";
|
||||
try {
|
||||
InetAddress addr = InetAddress.getLocalHost();
|
||||
local = addr.getHostAddress();
|
||||
} catch ( UnknownHostException e ) {
|
||||
//e.printStackTrace();
|
||||
logger.error("getTargetService error", e);
|
||||
}
|
||||
|
||||
// 타겟서비스에 해당하는 DB 의 거래현황 데이터를 읽어서 해당DB 의 RM11 테이블에 집계데이터를 추가한다.
|
||||
// ALL : 온라인용 ( 전체 서비스 )
|
||||
// OUTSIDE : 테스트용 ( ZAUA - 192.168.175.82 )
|
||||
// COMMON : 테스트용 ( ZAPA - 192.168.175.54 )
|
||||
// 현재 사용되고 있지 않은곳이 내부(ZADA) 이므로 일단 ALL 데이터는 ZADA 로 WRITE 한다.
|
||||
String targetSvc = "ALL" ;
|
||||
String target = monitoringContext.getStringProperty(MonitoringContext.RMS_TRADE_COUNT_TARGET, "");
|
||||
String arrTmp[] = target.split(",");
|
||||
if( arrTmp != null && arrTmp.length > 0 ) {
|
||||
for( int i = 0 ; i < arrTmp.length ; i++ ) {
|
||||
String arrTmp2[] = arrTmp[i].split("=");
|
||||
if( arrTmp2 != null && arrTmp2.length == 2 && local.equals(arrTmp2[0]) ) {
|
||||
targetSvc = arrTmp2[1];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return targetSvc ;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.eactive.eai.rms.onl.dashboard.service;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Vector;
|
||||
|
||||
public interface DashboardErrorService {
|
||||
|
||||
public Vector getLogList(String owner, String logTime, String nodeIndex,
|
||||
String errorType, String commDiv) throws Exception;
|
||||
|
||||
public Vector getLogListBranchTest(String owner, String logTime,
|
||||
String nodeIndex, String errorType, String commDiv) throws Exception;
|
||||
|
||||
public HashMap<String, Object> getDSGTelno(String owner, String adt) throws Exception;
|
||||
}
|
||||
+37
@@ -0,0 +1,37 @@
|
||||
package com.eactive.eai.rms.onl.dashboard.service;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Vector;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.eactive.eai.rms.onl.dashboard.dao.DashboardErrorDAO;
|
||||
|
||||
@Service("dashboardErrorService")
|
||||
public class DashboardErrorServiceImpl implements DashboardErrorService {
|
||||
|
||||
|
||||
/** The repository. */
|
||||
@Autowired
|
||||
@Qualifier("dashboardError")
|
||||
private DashboardErrorDAO dashboardErrorDao;
|
||||
|
||||
public Vector<String[]> getLogList(String owner, String logTime, String nodeIndex,
|
||||
String errorType, String commDiv) throws Exception {
|
||||
return dashboardErrorDao.getLogList(owner, logTime, nodeIndex, errorType, commDiv);
|
||||
}
|
||||
|
||||
public Vector<String[]> getLogListBranchTest(String owner, String logTime,
|
||||
String nodeIndex, String errorType, String commDiv)
|
||||
throws Exception {
|
||||
return dashboardErrorDao.getLogListBranchTest(owner, logTime, nodeIndex, errorType, commDiv);
|
||||
|
||||
}
|
||||
|
||||
public HashMap<String, Object> getDSGTelno(String owner, String adt) throws Exception {
|
||||
return dashboardErrorDao.getDSGTelno(owner, adt);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
package com.eactive.eai.rms.onl.dashboard.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.eactive.eai.rms.onl.vo.AdaptersVO;
|
||||
import com.eactive.eai.rms.onl.vo.EAIEngineStatusVo;
|
||||
import com.eactive.eai.rms.onl.vo.HostStatusVo;
|
||||
import com.eactive.eai.rms.onl.vo.RealTimeAdaptersVO;
|
||||
import com.eactive.eai.rms.onl.vo.SmsVO;
|
||||
import com.eactive.eai.rms.onl.vo.TransactionTrackingVo;
|
||||
|
||||
/**
|
||||
* The Interface DashboardService.
|
||||
* <ul>
|
||||
* <li>1. Function :</li>
|
||||
* <li>2. Summary :</li>
|
||||
* <li>3. Notification :</li>
|
||||
* </ul>
|
||||
*
|
||||
*/
|
||||
public interface DashboardService {
|
||||
|
||||
public List<AdaptersVO> findAdapterStatusList(List serverList);
|
||||
|
||||
public AdaptersVO findAdapterStatus(AdaptersVO adaptersVO);
|
||||
|
||||
public EAIEngineStatusVo findEngineStatus(EAIEngineStatusVo vo);
|
||||
|
||||
public List<SmsVO> findSmsList(List serverList, String service);
|
||||
|
||||
public SmsVO findSms(SmsVO vo);
|
||||
|
||||
public String getSmsBreaker();
|
||||
|
||||
public void setSmsBreaker( String b);
|
||||
|
||||
public HostStatusVo findHostStatus( List serverList );
|
||||
|
||||
public AdaptersVO findAdapterStatusTotalList( List serverList );
|
||||
|
||||
public RealTimeAdaptersVO findRTAdapterStatusTotalList( List serverList );
|
||||
|
||||
public List<EAIEngineStatusVo> findEngineStatus(List serverList , boolean isFullList );
|
||||
|
||||
public List<EAIEngineStatusVo> findEngineStatusforDashBoard(List serverList , boolean isFullList , String service );
|
||||
|
||||
public List<TransactionTrackingVo> findTransactionList(List serverList, String service);
|
||||
|
||||
List<TransactionTrackingVo> findTransactionListByHost(List serverList, String hostName, boolean isFull);
|
||||
|
||||
public List<RealTimeAdaptersVO> findRTAdapterStatusList(List serverList) ;
|
||||
}
|
||||
@@ -0,0 +1,774 @@
|
||||
package com.eactive.eai.rms.onl.dashboard.service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
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.datasource.DataSourceTypeManager;
|
||||
import com.eactive.eai.rms.onl.server.repository.Repository;
|
||||
import com.eactive.eai.rms.onl.server.repository.TransactionRepositoryService;
|
||||
import com.eactive.eai.rms.onl.vo.AdaptersVO;
|
||||
import com.eactive.eai.rms.onl.vo.EAIEngineStatusVo;
|
||||
import com.eactive.eai.rms.onl.vo.HostStatusVo;
|
||||
import com.eactive.eai.rms.onl.vo.RealTimeAdaptersVO;
|
||||
import com.eactive.eai.rms.onl.vo.SmsVO;
|
||||
import com.eactive.eai.rms.onl.vo.TransactionTrackingVo;
|
||||
|
||||
/**
|
||||
* The Class DashboardServiceImpl.
|
||||
* <ul>
|
||||
* <li>1. Function :</li>
|
||||
* <li>2. Summary :</li>
|
||||
* <li>3. Notification :</li>
|
||||
* </ul>
|
||||
*
|
||||
*/
|
||||
@Service("dashboardService")
|
||||
public class DashboardServiceImpl implements DashboardService {
|
||||
|
||||
/** The repository. */
|
||||
@Autowired
|
||||
@Qualifier("repository")
|
||||
private Repository repository;
|
||||
|
||||
/** The transaction repository service. */
|
||||
@Autowired
|
||||
@Qualifier("transactionRepositoryService")
|
||||
private TransactionRepositoryService transactionRepositoryService;
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* com.eactive.eai.rms.dashboard.service.DashboardService#findAdapterStatusList
|
||||
* (java.util.List)
|
||||
*/
|
||||
public List<AdaptersVO> findAdapterStatusList(List serverList) {
|
||||
List<AdaptersVO> list = new ArrayList<AdaptersVO>();
|
||||
for (int i = 0; i < serverList.size(); i++) {
|
||||
Map server = (Map) serverList.get(i);
|
||||
String instanceName = (String) server.get("EAISVRINSTNM");
|
||||
String hostName = (String) server.get("HOSTNAME");
|
||||
|
||||
AdaptersVO vo = (AdaptersVO) repository.getMonitorData(hostName,
|
||||
instanceName, AdaptersVO.class.getName());
|
||||
|
||||
if (vo == null) {
|
||||
vo = new AdaptersVO();
|
||||
vo.setHostName(hostName);
|
||||
vo.setInstanceName(instanceName);
|
||||
}
|
||||
|
||||
list.add(vo);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
public List<RealTimeAdaptersVO> findRTAdapterStatusList(List serverList) {
|
||||
List<RealTimeAdaptersVO> list = new ArrayList<RealTimeAdaptersVO>();
|
||||
for (int i = 0; i < serverList.size(); i++) {
|
||||
Map server = (Map) serverList.get(i);
|
||||
String hostName = (String) server.get("HOSTNAME");
|
||||
String instanceName = (String) server.get("EAISVRINSTNM");
|
||||
|
||||
RealTimeAdaptersVO vo = (RealTimeAdaptersVO) repository.getMonitorData(hostName,
|
||||
instanceName, RealTimeAdaptersVO.class.getName());
|
||||
|
||||
if (vo == null) {
|
||||
vo = new RealTimeAdaptersVO();
|
||||
vo.setHostName(hostName);
|
||||
vo.setInstanceName(instanceName);
|
||||
}
|
||||
|
||||
list.add(vo);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* com.eactive.eai.rms.dashboard.service.DashboardService#findAdapterStatus
|
||||
* (com.eactive.eai.rms.vo.AdaptersVO)
|
||||
*/
|
||||
public AdaptersVO findAdapterStatus(AdaptersVO adaptersVO) {
|
||||
AdaptersVO vo = (AdaptersVO) repository.getMonitorData(adaptersVO
|
||||
.getHostName(), adaptersVO.getInstanceName(), AdaptersVO.class
|
||||
.getName());
|
||||
if (vo != null) {
|
||||
vo.setService(adaptersVO.getService());
|
||||
}
|
||||
return vo;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* com.eactive.eai.rms.dashboard.service.DashboardService#findEngineStatus
|
||||
* (com.eactive.eai.rms.vo.EAIEngineStatusVo)
|
||||
*/
|
||||
public EAIEngineStatusVo findEngineStatus(EAIEngineStatusVo engineVO) {
|
||||
EAIEngineStatusVo vo = (EAIEngineStatusVo) repository.getMonitorData(
|
||||
engineVO.getHostName(), engineVO.getInstanceName(),
|
||||
EAIEngineStatusVo.class.getName());
|
||||
|
||||
if (vo != null) {
|
||||
vo.setService(engineVO.getService());
|
||||
return vo;
|
||||
} else {
|
||||
return engineVO;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* com.eactive.eai.rms.dashboard.service.DashboardService#findEngineStatus
|
||||
* (java.util.List)
|
||||
*/
|
||||
public List<EAIEngineStatusVo> findEngineStatus(List serverList, boolean isFullList) {
|
||||
|
||||
List<EAIEngineStatusVo> list = new ArrayList<EAIEngineStatusVo>();
|
||||
for (int i = 0; i < serverList.size(); i++) {
|
||||
Map server = (Map) serverList.get(i);
|
||||
String hostName = (String) server.get("HOSTNAME");
|
||||
String instanceName = (String) server.get("EAISVRINSTNM");
|
||||
|
||||
EAIEngineStatusVo vo = (EAIEngineStatusVo) repository
|
||||
.getMonitorData(hostName, instanceName,
|
||||
EAIEngineStatusVo.class.getName());
|
||||
if (vo != null) {
|
||||
list.add(vo);
|
||||
} else {
|
||||
// 2008.08.11 YUN_DEBUG
|
||||
// Dashboard Main 화면에서 서버 인스턴스 상태 표시하는데,
|
||||
// 서버 인스턴스가 내려갔을때도 정확하게 표시되게 하기 위해서
|
||||
// 빈 객체를 추가한다.
|
||||
if (isFullList == true) {
|
||||
vo = new EAIEngineStatusVo();
|
||||
vo.setInstanceName(instanceName);
|
||||
vo.setHostName(hostName);
|
||||
list.add(vo);
|
||||
}
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
public List<EAIEngineStatusVo> findEngineStatusforDashBoard(List serverList, boolean isFullList ,String service) {
|
||||
|
||||
List<EAIEngineStatusVo> list = new ArrayList<EAIEngineStatusVo>();
|
||||
for (int i = 0; i < serverList.size(); i++) {
|
||||
Map server = (Map) serverList.get(i);
|
||||
String hostName = (String) server.get("HOSTNAME");
|
||||
String instanceName = (String) server.get("EAISVRINSTNM");
|
||||
|
||||
if (DataSourceTypeManager.BAT.equals(service)){
|
||||
|
||||
hostName = hostName + "_svc";
|
||||
}
|
||||
|
||||
EAIEngineStatusVo vo = (EAIEngineStatusVo) repository
|
||||
.getMonitorData(hostName, instanceName,
|
||||
EAIEngineStatusVo.class.getName());
|
||||
if (vo != null) {
|
||||
list.add(vo);
|
||||
} else {
|
||||
// 2008.08.11 YUN_DEBUG
|
||||
// Dashboard Main 화면에서 서버 인스턴스 상태 표시하는데,
|
||||
// 서버 인스턴스가 내려갔을때도 정확하게 표시되게 하기 위해서
|
||||
// 빈 객체를 추가한다.
|
||||
if (isFullList == true) {
|
||||
vo = new EAIEngineStatusVo();
|
||||
vo.setInstanceName(instanceName);
|
||||
vo.setHostName(hostName);
|
||||
list.add(vo);
|
||||
}
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* com.eactive.eai.rms.dashboard.service.DashboardService#findSmsList(java
|
||||
* .util.List, java.lang.String)
|
||||
*/
|
||||
public List<SmsVO> findSmsList(List serverList, String service) {
|
||||
List<SmsVO> list = new ArrayList<SmsVO>();
|
||||
for (int i = 0; i < serverList.size(); i++) {
|
||||
Map server = (Map) serverList.get(i);
|
||||
String instanceName = (String) server.get("EAISVRINSTNM");
|
||||
String hostName = (String) server.get("HOSTNAME");
|
||||
SmsVO vo = (SmsVO) repository.getMonitorData(hostName,
|
||||
instanceName, SmsVO.class.getName());
|
||||
|
||||
if (vo != null) {
|
||||
vo.setService(service);
|
||||
list.add(vo);
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* com.eactive.eai.rms.dashboard.service.DashboardService#findSms(com.eactive
|
||||
* .eai.rms.vo.SmsVO)
|
||||
*/
|
||||
public SmsVO findSms(SmsVO original) {
|
||||
SmsVO smsVO = (SmsVO) repository.getMonitorData(original.getHostName(),
|
||||
original.getInstanceName(), original);
|
||||
if (smsVO != null) {
|
||||
return smsVO;
|
||||
} else {
|
||||
return original;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* set Sms break time
|
||||
* @param time
|
||||
*/
|
||||
public void setSmsBreaker( String time ) {
|
||||
repository.setSmsBreaker( time );
|
||||
}
|
||||
|
||||
/**
|
||||
* get Sms break time
|
||||
* @return
|
||||
*/
|
||||
public String getSmsBreaker( ) {
|
||||
return repository.getSmsBreaker();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* com.eactive.eai.rms.dashboard.service.DashboardService#findHostStatus(
|
||||
* com.eactive.eai.rms.vo.HostStatusVo)
|
||||
*/
|
||||
public HostStatusVo findHostStatus(List serverList) {
|
||||
|
||||
HostStatusVo ret = new HostStatusVo();
|
||||
|
||||
// host 내 인스턴스 중에서 메모리값이 높은 VO 정보 채택
|
||||
for (int i = 0; i < serverList.size(); i++) {
|
||||
Map server = (Map) serverList.get(i);
|
||||
HostStatusVo original = new HostStatusVo();
|
||||
original.setHostName((String) server.get("HOSTNAME"));
|
||||
original.setInstanceName((String) server.get("EAISVRINSTNM"));
|
||||
|
||||
HostStatusVo vo = (HostStatusVo) repository.getMonitorData(
|
||||
original.getHostName(), original.getInstanceName(), original);
|
||||
if (vo != null) {
|
||||
// 임시로 Cpu 비교.
|
||||
// HostStatusAgent에서 Memory 정보 구하는 Command 수정하면 memory비교로 복구.
|
||||
// if( ret.getMemory() < vo.getMemory() ) {
|
||||
if( ret.getCpu() < vo.getCpu() ) {
|
||||
ret.setCpu(vo.getCpu());
|
||||
ret.setMemory(vo.getMemory());
|
||||
ret.setDisk(vo.getDisk());
|
||||
}
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
public RealTimeAdaptersVO findRTAdapterStatusTotalList(List serverList) {
|
||||
|
||||
List<RealTimeAdaptersVO> list = findRTAdapterStatusList(serverList);
|
||||
RealTimeAdaptersVO ret = new RealTimeAdaptersVO();
|
||||
|
||||
int sna[] = { 0, 0, 0, 0 };
|
||||
int socket[] = { 0, 0, 0, 0 };
|
||||
int socket2[] = { 0, 0, 0, 0 };
|
||||
int tuxedo[] = { 0, 0, 0, 0 };
|
||||
int mq[] = { 0, 0, 0, 0 };
|
||||
int http[] = { 0, 0, 0, 0 };
|
||||
int ejb[] = { 0, 0, 0, 0 };
|
||||
|
||||
int total = 3;
|
||||
for (AdaptersVO vo : list) {
|
||||
// total 설정
|
||||
// instance1, instance2
|
||||
// Rule1. 두 인스턴스의 상태가 동일 할 경우 상태변경 없음
|
||||
// 에러 , 에러 == > 에러
|
||||
// 정상 , 정상 == > 정상
|
||||
// 부분정상 , 부분정상 == > 부분정상
|
||||
|
||||
// Rule2. 하나라도 정지인경우 나머지 상태를 따라감
|
||||
// 에러 , 정지 == > 에러
|
||||
// 정상 , 정지 == > 정상
|
||||
// 정지 , 정지 == > 정지
|
||||
|
||||
// Rule3. 정지를 제외한 상태가 서로 다를 경우 부분정상
|
||||
// 에러 , 정상 == > 부분정상
|
||||
// 에러 , 부분정상 == > 부분정상
|
||||
// 정상 , 부분정상 == > 부분정상
|
||||
if( total == 3 ) total = vo.getTotal(3); // Rule2
|
||||
else if( vo.getTotal(3) == 3 ) ; // Rule2
|
||||
else if( total == vo.getTotal(3) ) ; // Rule1
|
||||
else total = 1; // Rule3
|
||||
|
||||
if (vo.getSna(3) == 0) { // error
|
||||
sna[0]++;
|
||||
} else if (vo.getSna(3) == 1) { // normal
|
||||
sna[1]++;
|
||||
} else if (vo.getSna(3) == 2) { // success
|
||||
sna[2]++;
|
||||
} else if (vo.getSna(3) == 3) { // no service
|
||||
}
|
||||
|
||||
if (vo.getSocket(3) == 0) { // error
|
||||
socket[0]++;
|
||||
} else if (vo.getSocket(3) == 1) { // normal
|
||||
socket[1]++;
|
||||
} else if (vo.getSocket(3) == 2) { // success
|
||||
socket[2]++;
|
||||
} else if( vo.getSocket(3) == 3 ) { // no service
|
||||
|
||||
}
|
||||
if (vo.getSocket2(3) == 0) { // error
|
||||
socket2[0]++;
|
||||
} else if (vo.getSocket2(3) == 1) { // normal
|
||||
socket2[1]++;
|
||||
} else if (vo.getSocket2(3) == 2) { // success
|
||||
socket2[2]++;
|
||||
} else if (vo.getSocket2(3) == 3 ) { // no service
|
||||
|
||||
}
|
||||
|
||||
if (vo.getTuxedo(3) == 0) { // error
|
||||
tuxedo[0]++;
|
||||
} else if (vo.getTuxedo(3) == 1) { // normal
|
||||
tuxedo[1]++;
|
||||
} else if (vo.getTuxedo(3) == 2) { // success
|
||||
tuxedo[2]++;
|
||||
} else if (vo.getSocket2(3) == 3) { // no service
|
||||
|
||||
}
|
||||
|
||||
if (vo.getMq(3) == 0) { // error
|
||||
mq[0]++;
|
||||
} else if (vo.getMq(3) == 1) { // normal
|
||||
mq[1]++;
|
||||
} else if (vo.getMq(3) == 2) { // success
|
||||
mq[2]++;
|
||||
} else if( vo.getMq(3) == 3 ) { // no service
|
||||
|
||||
}
|
||||
|
||||
if (vo.getHttp(3) == 0) { // error
|
||||
http[0]++;
|
||||
} else if (vo.getHttp(3) == 1) { // normal
|
||||
http[1]++;
|
||||
} else if (vo.getHttp(3) == 2) { // success
|
||||
http[2]++;
|
||||
} else if (vo.getHttp(3) == 3) { // no service
|
||||
}
|
||||
|
||||
if (vo.getEjb(3) == 0) { // error
|
||||
ejb[0]++;
|
||||
} else if (vo.getEjb(3) == 1) { // normal
|
||||
ejb[1]++;
|
||||
} else if (vo.getEjb(3) == 2) { // success
|
||||
ejb[2]++;
|
||||
} else if (vo.getEjb(3) == 3) { // no service
|
||||
}
|
||||
}
|
||||
|
||||
if (sna[0] > 0) {
|
||||
ret.setSna(3, 0);
|
||||
} else if (sna[1] > 0) {
|
||||
ret.setSna(3, 1);
|
||||
} else if (sna[2] == 0) {
|
||||
ret.setSna(3, 3); // no service
|
||||
} else {
|
||||
ret.setSna(3, 2); // success
|
||||
}
|
||||
|
||||
if (socket[0] > 0) {
|
||||
ret.setSocket(3, 0);
|
||||
} else if (socket[1] > 0) {
|
||||
ret.setSocket(3, 1);
|
||||
} else if (socket[2] == 0) {
|
||||
ret.setSocket(3, 3); // no service
|
||||
} else {
|
||||
ret.setSocket(3, 2); // success
|
||||
}
|
||||
|
||||
if (socket2[0] > 0) {
|
||||
ret.setSocket2(3, 0);
|
||||
} else if (socket2[1] > 0) {
|
||||
ret.setSocket2(3, 1);
|
||||
} else if (socket2[2] == 0) {
|
||||
ret.setSocket2(3, 3); // no service
|
||||
} else {
|
||||
ret.setSocket2(3, 2); // success
|
||||
}
|
||||
|
||||
if (tuxedo[0] > 0) {
|
||||
ret.setTuxedo(3, 0);
|
||||
} else if (tuxedo[1] > 0) {
|
||||
ret.setTuxedo(3, 1);
|
||||
} else if (tuxedo[2] == 0) {
|
||||
ret.setTuxedo(3, 3); // no service
|
||||
} else {
|
||||
ret.setTuxedo(3, 2); // success
|
||||
}
|
||||
|
||||
if (mq[0] > 0) {
|
||||
ret.setMq(3, 0);
|
||||
} else if (mq[1] > 0) {
|
||||
ret.setMq(3, 1);
|
||||
} else if (mq[2] == 0) {
|
||||
ret.setMq(3, 3); // no service
|
||||
} else {
|
||||
ret.setMq(3, 2); // success
|
||||
}
|
||||
|
||||
if (http[0] > 0) {
|
||||
ret.setHttp(3, 0);
|
||||
} else if (http[1] > 0) {
|
||||
ret.setHttp(3, 1);
|
||||
} else if (http[2] == 0) {
|
||||
ret.setHttp(3, 3); // no service
|
||||
} else {
|
||||
ret.setHttp(3, 2); // success
|
||||
}
|
||||
|
||||
if (ejb[0] > 0) {
|
||||
ret.setEjb(3, 0);
|
||||
} else if (ejb[1] > 0) {
|
||||
ret.setEjb(3, 1);
|
||||
} else if (ejb[2] == 0) {
|
||||
ret.setEjb(3, 3); // no service
|
||||
} else {
|
||||
ret.setEjb(3, 2); // success
|
||||
}
|
||||
|
||||
// 2009.09.25 추가 지정 옵션
|
||||
// 없으면 3을 지정한다.
|
||||
// if( sna[0] == 0 && sna[1] == 0 && sna[2] == 0 ) {
|
||||
// ret.setSna(3, 3); // none
|
||||
// }
|
||||
//
|
||||
// if( socket[0] == 0 && socket[1] == 0 && socket[2] == 0 ) {
|
||||
// ret.setSocket(3, 3); // none
|
||||
// }
|
||||
//
|
||||
// if( socket2[0] == 0 && socket2[1] == 0 && socket2[2] == 0 ) {
|
||||
// ret.setSocket2(3, 3); // none
|
||||
// }
|
||||
//
|
||||
// if( tuxedo[0] == 0 && tuxedo[1] == 0 && tuxedo[2] == 0 ) {
|
||||
// ret.setTuxedo(3, 3); // none
|
||||
// }
|
||||
//
|
||||
// if( mq[0] == 0 && mq[1] == 0 && mq[2] == 0 ) {
|
||||
// ret.setMq(3, 3); // none
|
||||
// }
|
||||
//
|
||||
// if( http[0] == 0 && http[1] == 0 && http[2] == 0 ) {
|
||||
// ret.setHttp(3, 3); // none
|
||||
// }
|
||||
//
|
||||
// if( ejb[0] == 0 && ejb[1] == 0 && ejb[2] == 0 ) {
|
||||
// ret.setEjb(3, 3); // none
|
||||
// }
|
||||
|
||||
ret.setTotal(3, total);
|
||||
return ret;
|
||||
}
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @seecom.eactive.eai.rms.dashboard.service.DashboardService#
|
||||
* findAdapterStatusTotalList(java.util.List)
|
||||
*/
|
||||
public AdaptersVO findAdapterStatusTotalList(List serverList) {
|
||||
// 호스트별 인스턴스 리스트
|
||||
List<AdaptersVO> list = findAdapterStatusList(serverList);
|
||||
// 상태값만 저장하는 VO
|
||||
AdaptersVO ret = new AdaptersVO();
|
||||
// {에러, 부분정상, 정상, 정지}
|
||||
int sna[] = { 0, 0, 0, 0 };
|
||||
int socket[] = { 0, 0, 0, 0 };
|
||||
int socket2[] = { 0, 0, 0, 0 };
|
||||
int tuxedo[] = { 0, 0, 0, 0 };
|
||||
int mq[] = { 0, 0, 0, 0 };
|
||||
int http[] = { 0, 0, 0, 0 };
|
||||
int ejb[] = { 0, 0, 0, 0 };
|
||||
|
||||
int total = 3;
|
||||
for (AdaptersVO vo : list) {
|
||||
// total 설정
|
||||
// instance1, instance2
|
||||
// Rule1. 두 인스턴스의 상태가 동일 할 경우 상태변경 없음
|
||||
// 에러 , 에러 == > 에러
|
||||
// 정상 , 정상 == > 정상
|
||||
// 부분정상 , 부분정상 == > 부분정상
|
||||
|
||||
// Rule2. 하나라도 정지인경우 나머지 상태를 따라감
|
||||
// 에러 , 정지 == > 에러
|
||||
// 정상 , 정지 == > 정상
|
||||
// 정지 , 정지 == > 정지
|
||||
|
||||
// Rule3. 정지를 제외한 상태가 서로 다를 경우 부분정상
|
||||
// 에러 , 정상 == > 부분정상
|
||||
// 에러 , 부분정상 == > 부분정상
|
||||
// 정상 , 부분정상 == > 부분정상
|
||||
if( total == 3 ) total = vo.getTotal(3); // Rule2
|
||||
else if( vo.getTotal(3) == 3 ) ; // Rule2
|
||||
else if( total == vo.getTotal(3) ) ; // Rule1
|
||||
else total = 1; // Rule3
|
||||
|
||||
if (vo.getSna(3) == 0) { // error
|
||||
sna[0]++;
|
||||
} else if (vo.getSna(3) == 1) { // normal
|
||||
sna[1]++;
|
||||
} else if (vo.getSna(3) == 2) { // success
|
||||
sna[2]++;
|
||||
} else if (vo.getSna(3) == 3) { // no service
|
||||
}
|
||||
|
||||
if (vo.getSocket(3) == 0) { // error
|
||||
socket[0]++;
|
||||
} else if (vo.getSocket(3) == 1) { // normal
|
||||
socket[1]++;
|
||||
} else if (vo.getSocket(3) == 2) { // success
|
||||
socket[2]++;
|
||||
} else if( vo.getSocket(3) == 3 ) { // no service
|
||||
|
||||
}
|
||||
if (vo.getSocket2(3) == 0) { // error
|
||||
socket2[0]++;
|
||||
} else if (vo.getSocket2(3) == 1) { // normal
|
||||
socket2[1]++;
|
||||
} else if (vo.getSocket2(3) == 2) { // success
|
||||
socket2[2]++;
|
||||
} else if (vo.getSocket2(3) == 3 ) { // no service
|
||||
|
||||
}
|
||||
|
||||
if (vo.getTuxedo(3) == 0) { // error
|
||||
tuxedo[0]++;
|
||||
} else if (vo.getTuxedo(3) == 1) { // normal
|
||||
tuxedo[1]++;
|
||||
} else if (vo.getTuxedo(3) == 2) { // success
|
||||
tuxedo[2]++;
|
||||
} else if (vo.getSocket2(3) == 3) { // no service
|
||||
|
||||
}
|
||||
|
||||
if (vo.getMq(3) == 0) { // error
|
||||
mq[0]++;
|
||||
} else if (vo.getMq(3) == 1) { // normal
|
||||
mq[1]++;
|
||||
} else if (vo.getMq(3) == 2) { // success
|
||||
mq[2]++;
|
||||
} else if( vo.getMq(3) == 3 ) { // no service
|
||||
|
||||
}
|
||||
|
||||
if (vo.getHttp(3) == 0) { // error
|
||||
http[0]++;
|
||||
} else if (vo.getHttp(3) == 1) { // normal
|
||||
http[1]++;
|
||||
} else if (vo.getHttp(3) == 2) { // success
|
||||
http[2]++;
|
||||
} else if (vo.getHttp(3) == 3) { // no service
|
||||
}
|
||||
|
||||
if (vo.getEjb(3) == 0) { // error
|
||||
ejb[0]++;
|
||||
} else if (vo.getEjb(3) == 1) { // normal
|
||||
ejb[1]++;
|
||||
} else if (vo.getEjb(3) == 2) { // success
|
||||
ejb[2]++;
|
||||
} else if (vo.getEjb(3) == 3) { // no service
|
||||
}
|
||||
} // end for
|
||||
|
||||
// 에러가 하나라도 있으면 에러 > 부분정상이 하나라도 있으면 부분정상 > 정상이 하나라도 있으면 정상
|
||||
if (sna[0] > 0) {
|
||||
ret.setSna(3, 0);
|
||||
} else if (sna[1] > 0) {
|
||||
ret.setSna(3, 1);
|
||||
} else if (sna[2] == 0) {
|
||||
ret.setSna(3, 3); // no service
|
||||
} else {
|
||||
ret.setSna(3, 2); // success
|
||||
}
|
||||
|
||||
if (socket[0] > 0) {
|
||||
ret.setSocket(3, 0);
|
||||
} else if (socket[1] > 0) {
|
||||
ret.setSocket(3, 1);
|
||||
} else if (socket[2] == 0) {
|
||||
ret.setSocket(3, 3); // no service
|
||||
} else {
|
||||
ret.setSocket(3, 2); // success
|
||||
}
|
||||
|
||||
if (socket2[0] > 0) {
|
||||
ret.setSocket2(3, 0);
|
||||
} else if (socket2[1] > 0) {
|
||||
ret.setSocket2(3, 1);
|
||||
} else if (socket2[2] == 0) {
|
||||
ret.setSocket2(3, 3); // no service
|
||||
} else {
|
||||
ret.setSocket2(3, 2); // success
|
||||
}
|
||||
|
||||
if (tuxedo[0] > 0) {
|
||||
ret.setTuxedo(3, 0);
|
||||
} else if (tuxedo[1] > 0) {
|
||||
ret.setTuxedo(3, 1);
|
||||
} else if (tuxedo[2] == 0) {
|
||||
ret.setTuxedo(3, 3); // no service
|
||||
} else {
|
||||
ret.setTuxedo(3, 2); // success
|
||||
}
|
||||
|
||||
if (mq[0] > 0) {
|
||||
ret.setMq(3, 0);
|
||||
} else if (mq[1] > 0) {
|
||||
ret.setMq(3, 1);
|
||||
} else if (mq[2] == 0) {
|
||||
ret.setMq(3, 3); // no service
|
||||
} else {
|
||||
ret.setMq(3, 2); // success
|
||||
}
|
||||
|
||||
if (http[0] > 0) {
|
||||
ret.setHttp(3, 0);
|
||||
} else if (http[1] > 0) {
|
||||
ret.setHttp(3, 1);
|
||||
} else if (http[2] == 0) {
|
||||
ret.setHttp(3, 3); // no service
|
||||
} else {
|
||||
ret.setHttp(3, 2); // success
|
||||
}
|
||||
|
||||
if (ejb[0] > 0) {
|
||||
ret.setEjb(3, 0);
|
||||
} else if (ejb[1] > 0) {
|
||||
ret.setEjb(3, 1);
|
||||
} else if (ejb[2] == 0) {
|
||||
ret.setEjb(3, 3); // no service
|
||||
} else {
|
||||
ret.setEjb(3, 2); // success
|
||||
}
|
||||
|
||||
// 2009.09.25 추가 지정 옵션
|
||||
// 없으면 3을 지정한다.
|
||||
// if( sna[0] == 0 && sna[1] == 0 && sna[2] == 0 ) {
|
||||
// ret.setSna(3, 3); // none
|
||||
// }
|
||||
//
|
||||
// if( socket[0] == 0 && socket[1] == 0 && socket[2] == 0 ) {
|
||||
// ret.setSocket(3, 3); // none
|
||||
// }
|
||||
//
|
||||
// if( socket2[0] == 0 && socket2[1] == 0 && socket2[2] == 0 ) {
|
||||
// ret.setSocket2(3, 3); // none
|
||||
// }
|
||||
//
|
||||
// if( tuxedo[0] == 0 && tuxedo[1] == 0 && tuxedo[2] == 0 ) {
|
||||
// ret.setTuxedo(3, 3); // none
|
||||
// }
|
||||
//
|
||||
// if( mq[0] == 0 && mq[1] == 0 && mq[2] == 0 ) {
|
||||
// ret.setMq(3, 3); // none
|
||||
// }
|
||||
//
|
||||
// if( http[0] == 0 && http[1] == 0 && http[2] == 0 ) {
|
||||
// ret.setHttp(3, 3); // none
|
||||
// }
|
||||
//
|
||||
// if( ejb[0] == 0 && ejb[1] == 0 && ejb[2] == 0 ) {
|
||||
// ret.setEjb(3, 3); // none
|
||||
// }
|
||||
|
||||
|
||||
ret.setTotal(3, total);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* com.eactive.eai.rms.dashboard.service.DashboardService#findTransactionList
|
||||
* (java.util.List, java.lang.String)
|
||||
*/
|
||||
public List<TransactionTrackingVo> findTransactionList(List serverList,
|
||||
String service) {
|
||||
|
||||
TransactionTrackingVo origin = new TransactionTrackingVo();
|
||||
|
||||
List<TransactionTrackingVo> list = new ArrayList<TransactionTrackingVo>();
|
||||
for (int i = 0; i < serverList.size(); i++) {
|
||||
Map server = (Map) serverList.get(i);
|
||||
|
||||
origin.setHostName((String) server.get("HOSTNAME"));
|
||||
origin.setInstanceName((String) server.get("EAISVRINSTNM"));
|
||||
|
||||
TransactionTrackingVo vo = (TransactionTrackingVo) transactionRepositoryService
|
||||
.getTrackingVo(origin);
|
||||
|
||||
if (vo != null) {
|
||||
vo.setService(service);
|
||||
list.add(vo);
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
public List<TransactionTrackingVo> findTransactionListByHost(
|
||||
List serverList, String hostName, boolean isFull) {
|
||||
TransactionTrackingVo origin = new TransactionTrackingVo();
|
||||
|
||||
List<TransactionTrackingVo> list = new ArrayList<TransactionTrackingVo>();
|
||||
for (int i = 0; i < serverList.size(); i++) {
|
||||
Map server = (Map) serverList.get(i);
|
||||
origin.setHostName((String) server.get("HOSTNAME"));
|
||||
origin.setInstanceName((String) server.get("EAISVRINSTNM"));
|
||||
|
||||
if( ! hostName.equals(origin.getHostName())) {
|
||||
continue;
|
||||
}
|
||||
|
||||
TransactionTrackingVo vo = (TransactionTrackingVo) transactionRepositoryService
|
||||
.getTrackingVo(origin);
|
||||
|
||||
if( vo != null ) {
|
||||
list.add(vo);
|
||||
} else {
|
||||
if( isFull ) {
|
||||
TransactionTrackingVo tmpVo = new TransactionTrackingVo();
|
||||
tmpVo.setHostName(origin.getHostName());
|
||||
tmpVo.setInstanceName(origin.getInstanceName());
|
||||
tmpVo.setTotalProc(0);
|
||||
tmpVo.setTotalError(0);
|
||||
list.add(tmpVo);
|
||||
}
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,245 @@
|
||||
package com.eactive.eai.rms.onl.dashboard.service;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.GregorianCalendar;
|
||||
import java.util.HashMap;
|
||||
import java.util.Optional;
|
||||
import java.util.Vector;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.eactive.eai.common.util.SystemUtil;
|
||||
import com.eactive.eai.data.entity.onl.property.Prop;
|
||||
import com.eactive.eai.data.entity.onl.property.PropGroup;
|
||||
import com.eactive.eai.rms.common.base.OnlBaseService;
|
||||
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.data.entity.onl.property.PropertyGroupService;
|
||||
import com.eactive.eai.rms.onl.dashboard.dao.DashboardErrorDAO;
|
||||
import com.eactive.eai.rms.onl.manage.comm.unifbwk.UnifbwkManService;
|
||||
import com.eactive.eai.rms.onl.manage.comm.unifbwk.UnifbwkUI;
|
||||
|
||||
/**
|
||||
* The Interface DashboardService.
|
||||
* <ul>
|
||||
* <li>1. Function :</li>
|
||||
* <li>2. Summary :</li>
|
||||
* <li>3. Notification :</li>
|
||||
* </ul>
|
||||
*
|
||||
*/
|
||||
@Service("mobileMonitorService")
|
||||
public class MobileMonitorService extends OnlBaseService {
|
||||
|
||||
@Autowired
|
||||
@Qualifier("dashboardError")
|
||||
private DashboardErrorDAO dashboardErrorDao;
|
||||
|
||||
@Autowired
|
||||
private PropertyGroupService propertyGroupService;
|
||||
|
||||
@Autowired
|
||||
private UnifbwkManService unifbwkManService;
|
||||
|
||||
public int getLogListCount(String service, String logTime, String nowTime) throws Exception {
|
||||
|
||||
DataSourceType dt = DataSourceTypeManager.getDataSourceType(service);
|
||||
DataSourceContextHolder.setDataSourceType(dt);
|
||||
|
||||
// 취약점코드 수정 2019.08.22 SW
|
||||
String owner = "";
|
||||
if (dt != null) {
|
||||
owner = dt.getSchema();
|
||||
}
|
||||
|
||||
int resultCount = dashboardErrorDao.getMobileMonitorLogListCount(owner, logTime, nowTime);
|
||||
|
||||
return resultCount;
|
||||
}
|
||||
|
||||
public Vector getLogList(String service, String logTime, String errorType, String commDiv) throws Exception {
|
||||
|
||||
String logDate = getCurrentDate() + logTime.replaceAll(":", "");
|
||||
|
||||
Vector vt = null;
|
||||
|
||||
DataSourceType dt = DataSourceTypeManager.getDataSourceType(service);
|
||||
|
||||
if (dt != null) {
|
||||
DataSourceContextHolder.setDataSourceType(dt);
|
||||
|
||||
String owner = "";
|
||||
if (dt != null) {
|
||||
owner = dt.getSchema();
|
||||
}
|
||||
|
||||
vt = dashboardErrorDao.getMobileMonitorLogList(owner, logDate, errorType, commDiv);
|
||||
}
|
||||
|
||||
return vt;
|
||||
}
|
||||
|
||||
public Vector getBatchLogList(String service, String logTime, String errType) throws Exception {
|
||||
|
||||
String logDate = getCurrentDate() + logTime.replaceAll(":", "");
|
||||
|
||||
Vector vt = null;
|
||||
|
||||
DataSourceType dt = DataSourceTypeManager.getDataSourceType(service);
|
||||
|
||||
if (dt != null) {
|
||||
DataSourceContextHolder.setDataSourceType(dt);
|
||||
|
||||
String owner = "";
|
||||
if (dt != null) {
|
||||
owner = dt.getSchema();
|
||||
}
|
||||
|
||||
vt = dashboardErrorDao.getMobileMonitorBatchLogList(owner, logDate, errType);
|
||||
}
|
||||
|
||||
return vt;
|
||||
}
|
||||
|
||||
public Vector getDetailInfomation(String eaiGuid, String service, String apCd) throws Exception {
|
||||
|
||||
Vector vt = null;
|
||||
|
||||
int yy = Integer.valueOf(eaiGuid.substring(13, 17));
|
||||
int mm = Integer.valueOf(eaiGuid.substring(17, 19));
|
||||
int dd = Integer.valueOf(eaiGuid.substring(19, 21));
|
||||
int hh = Integer.valueOf(eaiGuid.substring(21, 23));
|
||||
int MM = Integer.valueOf(eaiGuid.substring(23, 25));
|
||||
|
||||
String startConvCal = "";
|
||||
String endConvCal = "";
|
||||
|
||||
Calendar orgCal = new GregorianCalendar();
|
||||
|
||||
orgCal.set(yy, mm - 1, dd, hh, MM, 00);
|
||||
orgCal.add(Calendar.MINUTE, -5);
|
||||
startConvCal = convertSdfTime(orgCal);
|
||||
orgCal.add(Calendar.MINUTE, 10);
|
||||
endConvCal = convertSdfTime(orgCal);
|
||||
|
||||
if ("".equals(service))
|
||||
service = "DSG";
|
||||
|
||||
DataSourceType dt = DataSourceTypeManager.getDataSourceType(service);
|
||||
DataSourceContextHolder.setDataSourceType(dt);
|
||||
|
||||
// 취약점코드 수정 2019.08.22 SW
|
||||
String owner = "";
|
||||
if (dt != null) {
|
||||
owner = dt.getSchema();
|
||||
}
|
||||
|
||||
// 대외디비에서 해당 GUID 검색
|
||||
vt = dashboardErrorDao.getDetailInfomation(owner, eaiGuid, startConvCal, endConvCal, apCd);
|
||||
|
||||
// 대외 거래인 경우는 대외거래로 처리, 대외 거래가 아닌 경우 공동망 거래 처리
|
||||
if ("GSG".equals(service)) {
|
||||
dt = DataSourceTypeManager.getDataSourceType(service);
|
||||
DataSourceContextHolder.setDataSourceType(dt);
|
||||
|
||||
if (dt != null) {
|
||||
owner = dt.getSchema();
|
||||
}
|
||||
|
||||
if (!vt.isEmpty() && !"null".equalsIgnoreCase(vt.get(5).toString())) {
|
||||
// 은행코드가 있는 경우 은행코드를 검색해준다.//운영은 INSIDE -> COMMON
|
||||
String bankCode = getBankCode(service, (String) vt.get(5));
|
||||
vt.add(bankCode); // 인덱스 6
|
||||
}
|
||||
|
||||
} else {
|
||||
// GUID가 대외에 있는 경우는 어뎁터의 이름과 전화번호를 넘겨준다.
|
||||
if (!vt.isEmpty() && !"null".equalsIgnoreCase(vt.get(5).toString())) {
|
||||
// 은행코드가 있는 경우 은행코드를 검색해준다.//개발은 INSIDE -> 운영은 COMMON
|
||||
String system = "";
|
||||
if (SystemUtil.isProdServer()) {
|
||||
system = "GSG";
|
||||
} else {
|
||||
system = "DSG";
|
||||
}
|
||||
String bankCode = getBankCode(system, (String) vt.get(5));
|
||||
vt.set(5, bankCode);
|
||||
}
|
||||
|
||||
String ServCd = (String) vt.get(7);
|
||||
|
||||
// 기동업무 정보 조회 //운영적용시 INSIDE -> OUTSIDE
|
||||
String apInfoIn[] = getWorkerInfo("DSG", ServCd.substring(ServCd.length() - 6, ServCd.length() - 3))
|
||||
.split(":");
|
||||
// 기동 담당자
|
||||
vt.add(apInfoIn[0]);
|
||||
// 기동업무 한글명
|
||||
vt.add(ServCd.substring(ServCd.length() - 6, ServCd.length() - 3) + " (" + apInfoIn[1] + ")");
|
||||
|
||||
// 수동업무 정보 조회//운영적용시 INSIDE -> OUTSIDE
|
||||
String apInfoOut[] = getWorkerInfo("DSG", ServCd.substring(0, 3)).split(":");
|
||||
// 수동 담당자
|
||||
vt.add(apInfoOut[0]);
|
||||
// 수동업무 한글명
|
||||
vt.add(ServCd.substring(0, 3) + " (" + apInfoOut[1] + ")");
|
||||
|
||||
}
|
||||
|
||||
return vt;
|
||||
}
|
||||
|
||||
// 업무코드 한글명 및 담당자 조회
|
||||
private String getWorkerInfo(String service, String apCode) throws Exception {
|
||||
|
||||
String result = "";
|
||||
DataSourceType dt = DataSourceTypeManager.getDataSourceType(service);
|
||||
DataSourceContextHolder.setDataSourceType(dt);
|
||||
// 취약점코드 수정 2019.08.22 SW
|
||||
String owner = "";
|
||||
if (dt != null) {
|
||||
owner = dt.getSchema();
|
||||
}
|
||||
HashMap paramMap = new HashMap();
|
||||
paramMap.put("schemaId", owner);
|
||||
paramMap.put("eaiBzwkDstcd", apCode);
|
||||
|
||||
UnifbwkUI userUI = unifbwkManService.selectDetail((String) paramMap.get("eaiBzwkDstcd"));
|
||||
|
||||
if (userUI != null) {
|
||||
result = userUI.getEaiBzwkDstcd() + ":" + userUI.getBzwkDsticName();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
private String getBankCode(String service, String bankCode) throws Exception {
|
||||
DataSourceType dt = DataSourceTypeManager.getDataSourceType(service);
|
||||
DataSourceContextHolder.setDataSourceType(dt);
|
||||
Optional<PropGroup> propGroup = propertyGroupService.findById("BANKCODE");
|
||||
if (!propGroup.isPresent()) {
|
||||
return "";
|
||||
}
|
||||
for (Prop prop : propGroup.get().getProps()) {
|
||||
if (prop.getId().getPrptyname().equals(bankCode)) {
|
||||
return prop.getPrpty2val();
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
private String convertSdfTime(Calendar cal) {
|
||||
Date d = cal.getTime();
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssSSS");
|
||||
return sdf.format(d).toString();
|
||||
}
|
||||
|
||||
private String getCurrentDate() {
|
||||
SimpleDateFormat SDF_YYYYMMDD = new SimpleDateFormat("yyyyMMdd");
|
||||
return (SDF_YYYYMMDD).format(new Date());
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
package com.eactive.eai.rms.onl.dashboard.vo;
|
||||
|
||||
import com.eactive.eai.rms.onl.common.vo.HostInfomationForm;
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* 1. 기능 :
|
||||
* 2. 처리 개요 :
|
||||
* -
|
||||
* 3. 주의사항 :
|
||||
* </pre>
|
||||
*/
|
||||
public class AdapterStatusForm
|
||||
extends HostInfomationForm {
|
||||
|
||||
private String cmd = "";
|
||||
|
||||
private String adapterType = "";
|
||||
|
||||
private String adapterGroupNm = "";
|
||||
|
||||
private String adapterNm = "";
|
||||
|
||||
private String adapterStartStop = "";
|
||||
|
||||
|
||||
public String getAdapterType() {
|
||||
return adapterType;
|
||||
}
|
||||
|
||||
public void setAdapterType(String adapterType) {
|
||||
this.adapterType = adapterType;
|
||||
}
|
||||
|
||||
public String getCmd() {
|
||||
return cmd;
|
||||
}
|
||||
|
||||
public void setCmd(String cmd) {
|
||||
this.cmd = cmd;
|
||||
}
|
||||
|
||||
public String getAdapterGroupNm() {
|
||||
return adapterGroupNm;
|
||||
}
|
||||
|
||||
public void setAdapterGroupNm(String adapterGroupNm) {
|
||||
this.adapterGroupNm = adapterGroupNm;
|
||||
}
|
||||
|
||||
public String getAdapterNm() {
|
||||
return adapterNm;
|
||||
}
|
||||
|
||||
public void setAdapterNm(String adapterNm) {
|
||||
this.adapterNm = adapterNm;
|
||||
}
|
||||
|
||||
public String getAdapterStartStop() {
|
||||
return adapterStartStop;
|
||||
}
|
||||
|
||||
public void setAdapterStartStop(String adapterStartStop) {
|
||||
this.adapterStartStop = adapterStartStop;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user