From 6ae1dd230dbd27d423190031264f1bf0645aab1d Mon Sep 17 00:00:00 2001 From: eactive Date: Fri, 21 Nov 2025 11:44:37 +0900 Subject: [PATCH] =?UTF-8?q?HTTP,=20SOCKET=20=EC=A1=B0=ED=9A=8C=EB=A5=BC=20?= =?UTF-8?q?=EC=9C=84=ED=95=9C=20JSP=20=EC=B6=94=EA=B0=80.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../agent/host/adapter_socket2_agent1.jsp | 114 ++++++++++++++++++ .../agent/host/adapter_socket2_agent2.jsp | 81 +++++++++++++ .../agent/host/adapter_socket2_startstop.jsp | 54 +++++++++ 3 files changed, 249 insertions(+) create mode 100644 WebContent/agent/host/adapter_socket2_agent1.jsp create mode 100644 WebContent/agent/host/adapter_socket2_agent2.jsp create mode 100644 WebContent/agent/host/adapter_socket2_startstop.jsp diff --git a/WebContent/agent/host/adapter_socket2_agent1.jsp b/WebContent/agent/host/adapter_socket2_agent1.jsp new file mode 100644 index 0000000..6eac161 --- /dev/null +++ b/WebContent/agent/host/adapter_socket2_agent1.jsp @@ -0,0 +1,114 @@ + +<%@ page contentType="text/xml; charset=utf-8"%> +<%@ page import="com.eactive.eai.adapter.socket2.config.MonitoringUtil"%> +<%@ page import="java.util.*,com.eactive.eai.common.util.Logger" %> + + + + + + + + + + + + + + + + + + +<%! + static Logger logger = Logger.getLogger(Logger.LOGGER_DEFAULT); +%> + +<% + // + // Socket2 status info + + + String eaiSvrInstNm = request.getParameter("eaiSvrInstNm"); + String adapterGroupName = request.getParameter("adapterGroupName"); + + if (eaiSvrInstNm == null) + eaiSvrInstNm = ""; + + if (adapterGroupName == null) + adapterGroupName = ""; + + String stateColor = ""; + String stateText = ""; + + String startColor = ""; + String startText = ""; + String startStop = ""; + + + String[][] arrList = null ; + try { + if(adapterGroupName.length() > 0) { + arrList = MonitoringUtil.adapterStatus(adapterGroupName); + } + else { + arrList = MonitoringUtil.adapterList1(); + } + } catch ( Exception e ) { + if (logger.isError()){ + logger.error(e.toString()); + } + } + + // ¸®ÅÏµÈ arrList °¡ null ÀÌ ¾Æ´Ï¸é¼­ ¹è¿­±æÀ̰¡ 0 ÀÎ °æ¿ì Exception ¹ß»ý + // ÇÏÁö ¾Êµµ·Ï Çϱâ À§ÇÔ. (2008-06-30) + if( arrList == null || arrList.length == 0 ) { +%> + + <%=eaiSvrInstNm%> + + + + + + + + + + + + + +<% + + } else { + int col = arrList[0].length ; + int row = arrList.length ; + + for( int i = 0 ; i < row ; i++ ) { + out.println(""); + out.println("" + eaiSvrInstNm + ""); + for( int j = 0 ; j < col ; j++ ) { + if(j == 2) { + out.println(""); + } else { + out.println("" + arrList[i][j] + ""); + } + } + + // ¹ö±×¼öÁ¤ + if(arrList[i] != null && arrList[i].length > 4 ) { + if( "STARTED".equals(arrList[i][7]) || "STARTING".equals(arrList[i][7])) { + startStop = "03" ; // stop + } else { + startStop = "01" ; // start + } + } + + out.println(""+ startStop +""); + out.println(""); + } + } +%> + + diff --git a/WebContent/agent/host/adapter_socket2_agent2.jsp b/WebContent/agent/host/adapter_socket2_agent2.jsp new file mode 100644 index 0000000..6daf110 --- /dev/null +++ b/WebContent/agent/host/adapter_socket2_agent2.jsp @@ -0,0 +1,81 @@ + +<%@ page contentType="text/xml; charset=utf-8"%> +<%@ page import="com.eactive.eai.adapter.socket2.config.MonitoringUtil"%> +<%@ page import="java.util.*,com.eactive.eai.common.util.Logger" %> + + + + + + + + + + + + + + + + +<%! + static Logger logger = Logger.getLogger(Logger.LOGGER_DEFAULT); +%> +<% + // + // Socket2 connection info + + String eaiSvrInstNm = request.getParameter("eaiSvrInstNm"); + + if (eaiSvrInstNm == null) + eaiSvrInstNm = ""; + + String stateColor = ""; + String stateText = ""; + + String startColor = ""; + String startText = ""; + String startStop = ""; + + String[][] arrList = null ; + try { + arrList = MonitoringUtil.adapterList2(); + } catch ( Exception e ) { + if (logger.isError()){ + logger.error(e.toString()); + } + } + + // ¸®ÅÏµÈ arrList °¡ null ÀÌ ¾Æ´Ï¸é¼­ ¹è¿­±æÀ̰¡ 0 ÀÎ °æ¿ì Exception ¹ß»ý + // ÇÏÁö ¾Êµµ·Ï Çϱâ À§ÇÔ. (2008-06-30) + if( arrList == null || arrList.length == 0 ) { +%> + + <%=eaiSvrInstNm%> + + + + + + + + + +<% + + } else { + int col = arrList[0].length ; + int row = arrList.length ; + for( int i = 0 ; i < row ; i++ ) { + out.println(""); + out.println("" + eaiSvrInstNm + ""); + + for( int j = 0 ; j < col ; j++ ) { + out.println("" + arrList[i][j] + ""); + } + out.println(""); + } + } +%> + + \ No newline at end of file diff --git a/WebContent/agent/host/adapter_socket2_startstop.jsp b/WebContent/agent/host/adapter_socket2_startstop.jsp new file mode 100644 index 0000000..6d7b74e --- /dev/null +++ b/WebContent/agent/host/adapter_socket2_startstop.jsp @@ -0,0 +1,54 @@ +<%@ page contentType="text/html; charset=utf-8" pageEncoding="utf-8"%> +<%@ page import="com.eactive.eai.adapter.socket2.config.MonitoringUtil"%> +<%@ page import="com.eactive.eai.common.util.CharsetDecoderUtil" %> +<%@ page import="java.util.*,com.eactive.eai.common.util.Logger" %> +<%! + static Logger logger = Logger.getLogger(Logger.LOGGER_DEFAULT); +%> +<% + // + // Socket2 adapter start/stop command + + String adapterGroupName = request.getParameter("adapterGroupName"); + String adapterName = request.getParameter("adapterName"); + String cmd = request.getParameter("cmd"); + + if( adapterGroupName == null ) { + adapterGroupName = "" ; + } + + if( adapterName == null ) { + adapterName = "" ; + } + + if( cmd == null ) { + cmd = "" ; + } + + + String retMsg = null ; + try { + if( cmd.equals("start") ) { + MonitoringUtil.adapterStart(adapterGroupName, adapterName); + retMsg = "true" ; + } else if( cmd.equals("stop") ) { + MonitoringUtil.adapterStop(adapterGroupName, adapterName); + retMsg = "true" ; + } else { + retMsg = "Unknown command error :" + cmd ; + } + } catch ( Exception e ) { + if (logger.isError()){ + logger.error("MonitoringUtil.adapterStart|adapterStop(" + adapterGroupName + ", " + adapterName + ")" ); + } + //e.printStackTrace(new java.io.PrintWriter(out)); + retMsg = "false" ; + } + + if( retMsg == null ) + retMsg = "" ; + + + + out.println( CharsetDecoderUtil.toKor(retMsg) ); +%>