<?xml version="1.0" encoding="euc-kr"?>
<%@ 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" %>
<Dataset>
	<Columns>
		<Column Name="EaiSevrInstncName"  Type="string" Size="255" />
		<Column Name="AdptrBzwkGroupName" Type="string" Size="255" />
		<Column Name="AdptrBzwkName"      Type="string" Size="255" />
		<Column Name="AdptrBzwkDesc"      Type="string" Size="255" />
		<Column Name="MaxConnection"      Type="string" Size="255" />
		<Column Name="CurrentConnection"  Type="string" Size="255" />
		<Column Name="SendCount"          Type="string" Size="255" />
		<Column Name="RecvCount"          Type="string" Size="255" />
		<Column Name="ErrorCount"         Type="string" Size="255" />
		<Column Name="Status"             Type="string" Size="255" />
		<Column Name="Param7"             Type="string" Size="255" />
		<Column Name="Param8"             Type="string" Size="255" />
	</Columns>
	<Rows>
<%!
	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 ) {
%>
		<Row>
			<Data><%=eaiSvrInstNm%></Data>
			<Data></Data>
			<Data></Data>
			<Data></Data>
			<Data></Data>
			<Data></Data>
			<Data></Data>
			<Data></Data>
			<Data></Data>
		</Row>
<%
	
	} else {
		int col = arrList[0].length ;
		int row = arrList.length ;
		for( int i = 0 ; i < row ; i++ ) {
			out.println("<Row>");
			out.println("<Data>" + eaiSvrInstNm + "</Data>");
			
			for( int j = 0 ; j < col ; j++ ) {
				out.println("<Data>" + arrList[i][j] + "</Data>");
			}
			out.println("</Row>");
		}
	}
%>
	</Rows>
</Dataset>