kr.co.hit.live.admin.monitor
Class ServiceCallViewWebAction

java.lang.Object
  extended by kr.co.hit.live.web.action.AbstractWebAction
      extended by kr.co.hit.live.admin.monitor.LogViewWebAction
          extended by kr.co.hit.live.admin.monitor.ServiceCallViewWebAction
All Implemented Interfaces:
WebAction

public class ServiceCallViewWebAction
extends LogViewWebAction

서버의 서비스가 호출된 목록을 보여주는 WebAction 구현 클래스이다.

Author:
김형도

Field Summary
protected  String cssUrl
          서비스 내용을 HTML로 출력할 때 사용할 CSS 파일 경로를 설정한다.
static String DEFAULT_LOGTIME_PATTERN
           
protected  String[] defaultColumns
          로그 라인을 파싱하여 처리할 때 사용할 컬럼 목록이다.
protected  boolean isIpRequired
          ip_addr 파라미터 필수여부를 설정한다.
static String ITEM_IPADDR
           
static String ITEM_NODE
           
static String ITEM_OPNAME
           
static String ITEM_RETCOUNT
           
static String ITEM_SUCCYN
           
static String ITEM_SVCMSEC
           
static String ITEM_SVCNAME
           
static String ITEM_SVCURL
           
static String ITEM_TIME
           
static String ITEM_TOTALMSEC
           
static String ITEM_TRID
           
static String ITEM_USERID
           
protected  String logtimePattern
          서비스 호출 시간의 패턴 문자열을 설정한다.
protected  String logUrl
          하나의 서비스 처리에 대한 상세 로그 내용을 보여주기 위한 서비스의 URL을 설정한다.
static String NODE_PARAM
           
protected  String[] searchColumns
          조회할 때 사용할 컬럼 목록이다.
protected  String svcInfoUrl
          서비스 명에 대한 상세 정보를 보여주기 위한 서비스의 URL을 설정한다.
protected  String svcKey
          smon.live, lmon.live, svc.live와 같은 서비스 URL을 출력되는 컬럼위치를 지정한다.
 
Fields inherited from class kr.co.hit.live.admin.monitor.LogViewWebAction
appenderName, CTX_PARAM, DATE_PARAM, loggerName, TRID_PARAM
 
Fields inherited from class kr.co.hit.live.web.action.AbstractWebAction
context, logger
 
Constructor Summary
ServiceCallViewWebAction()
           
 
Method Summary
 WebActionForward execute(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          WebActionDispatcher 서블릿이 호출하는 메소드이다.
protected  String[] getColumnNames()
          로그 라인을 파싱하여 처리할 때 사용할 컬럼 목록을 반환한다.
protected  String[] getSearchColumnNames()
          조회할 때 처리할 때 사용할 컬럼 목록을 반환한다.
protected  Map<String,Object> parseLogLine(String logLine, SimpleDateFormat sdf)
          log 파일의 각 라인을 파싱하여 Map 객체로 반환한다.
 void setCssUrl(String url)
           
 void setIpRequired(String isRequired)
           
 void setLogTimePattern(String pattern)
           
 void setLogUrl(String url)
           
 void setServiceInfoUrl(String url)
           
 void setSvcKey(String key)
           
protected  WebActionForward showFileNotFoundMessage(javax.servlet.http.HttpServletResponse response, String requestURI, ValueObject paramVO)
          RollinDate에 해당되는 로그파일이 없을 때 내용을 출력한다.
protected  WebActionForward showServiceCallList(javax.servlet.http.HttpServletResponse response, ValueObject listVO, String requestURI, ValueObject paramVO)
          목록을 출력하는 기능을 제공한다.
protected  void writeRow(ValueRow row, PrintWriter out)
           
 
Methods inherited from class kr.co.hit.live.admin.monitor.LogViewWebAction
getLogInputStreamReader, setAppender, setLogger
 
Methods inherited from class kr.co.hit.live.web.action.AbstractWebAction
createForward, getServletContext, getWebApplicationContext, setForward, setPrefix, setSuffix, setWebApplicationContext, showConfiguration
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NODE_PARAM

public static final String NODE_PARAM
See Also:
Constant Field Values

ITEM_TIME

public static final String ITEM_TIME
See Also:
Constant Field Values

ITEM_NODE

public static final String ITEM_NODE
See Also:
Constant Field Values

ITEM_TRID

public static final String ITEM_TRID
See Also:
Constant Field Values

ITEM_USERID

public static final String ITEM_USERID
See Also:
Constant Field Values

ITEM_IPADDR

public static final String ITEM_IPADDR
See Also:
Constant Field Values

ITEM_SVCURL

public static final String ITEM_SVCURL
See Also:
Constant Field Values

ITEM_TOTALMSEC

public static final String ITEM_TOTALMSEC
See Also:
Constant Field Values

ITEM_SVCNAME

public static final String ITEM_SVCNAME
See Also:
Constant Field Values

ITEM_OPNAME

public static final String ITEM_OPNAME
See Also:
Constant Field Values

ITEM_SVCMSEC

public static final String ITEM_SVCMSEC
See Also:
Constant Field Values

ITEM_SUCCYN

public static final String ITEM_SUCCYN
See Also:
Constant Field Values

ITEM_RETCOUNT

public static final String ITEM_RETCOUNT
See Also:
Constant Field Values

DEFAULT_LOGTIME_PATTERN

public static final String DEFAULT_LOGTIME_PATTERN
See Also:
Constant Field Values

defaultColumns

protected String[] defaultColumns
로그 라인을 파싱하여 처리할 때 사용할 컬럼 목록이다.


searchColumns

protected String[] searchColumns
조회할 때 사용할 컬럼 목록이다.


logUrl

protected String logUrl
하나의 서비스 처리에 대한 상세 로그 내용을 보여주기 위한 서비스의 URL을 설정한다.


logtimePattern

protected String logtimePattern
서비스 호출 시간의 패턴 문자열을 설정한다.


svcInfoUrl

protected String svcInfoUrl
서비스 명에 대한 상세 정보를 보여주기 위한 서비스의 URL을 설정한다.


cssUrl

protected String cssUrl
서비스 내용을 HTML로 출력할 때 사용할 CSS 파일 경로를 설정한다.


isIpRequired

protected boolean isIpRequired
ip_addr 파라미터 필수여부를 설정한다.


svcKey

protected String svcKey
smon.live, lmon.live, svc.live와 같은 서비스 URL을 출력되는 컬럼위치를 지정한다.

Constructor Detail

ServiceCallViewWebAction

public ServiceCallViewWebAction()
Method Detail

setLogUrl

public void setLogUrl(String url)

setLogTimePattern

public void setLogTimePattern(String pattern)

setServiceInfoUrl

public void setServiceInfoUrl(String url)

setCssUrl

public void setCssUrl(String url)

setIpRequired

public void setIpRequired(String isRequired)

setSvcKey

public void setSvcKey(String key)

execute

public WebActionForward execute(javax.servlet.http.HttpServletRequest request,
                                javax.servlet.http.HttpServletResponse response)
                         throws Exception
Description copied from interface: WebAction
WebActionDispatcher 서블릿이 호출하는 메소드이다. 이 인터페이스를 구현하는 클래스는 이 메소드에서 업무처리를 수행하고 forward할 View의 URL을 WebActionForward로 리턴한다. null을 리턴할 경우에는 forward하지 않는다.

Specified by:
execute in interface WebAction
Specified by:
execute in class AbstractWebAction
Returns:
Throws:
Exception

getColumnNames

protected String[] getColumnNames()
로그 라인을 파싱하여 처리할 때 사용할 컬럼 목록을 반환한다.

단순히 컬럼 명과 갯수만 달라지는 경우에는 사이트별 설정정보(xxx_config.xml)에서 컬럼 목록을 지정하여 처리할 수 있다. key명은 smon.format으로 고정한다. 사이트별 설정정보에 smon.format을 지정하지 않으면 기본 컬럼목록을 반환한다.

 작성예)
 <entry key="smon.format">time|node|tr_id|user_id|ip_addr|svc_url|total_msec|svc_name|op_name|svc_msec|succ_yn|ret_count</entry>
 
column 항목은 WebActionDispatcher의 logDiagnostics 메소드에서 출력하는 항목과 순서가 동일해야 한다.

Returns:

getSearchColumnNames

protected String[] getSearchColumnNames()
조회할 때 처리할 때 사용할 컬럼 목록을 반환한다.

단순히 컬럼 명과 갯수만 달라지는 경우에는 사이트별 설정정보(xxx_config.xml)에서 컬럼 목록을 지정하여 처리할 수 있다. key명은 smon.searchkeys으로 고정하며, smon.format에 정의된 항목 중 선택한다. 사이트별 설정정보에 smon.searchkeys을 지정하지 않으면 기본 컬럼목록을 반환한다.

 작성예)
 <entry key="smon.searchkeys">tr_id|user_id|ip_addr|svc_url|total_msec|svc_name|op_name|svc_msec|succ_yn</entry>
 

Returns:

parseLogLine

protected Map<String,Object> parseLogLine(String logLine,
                                          SimpleDateFormat sdf)
log 파일의 각 라인을 파싱하여 Map 객체로 반환한다. 라인의 구조가 달라지면 본 메소드를 override 하여 재 구현한다.

Parameters:
logLine -
sdf -
Returns:

showServiceCallList

protected WebActionForward showServiceCallList(javax.servlet.http.HttpServletResponse response,
                                               ValueObject listVO,
                                               String requestURI,
                                               ValueObject paramVO)
                                        throws IOException
목록을 출력하는 기능을 제공한다. 출력 모양을 변경하고자 한다면 아래 메소드를 상속받아 재정의한다.

Parameters:
response -
listVO -
requestURI -
paramVO -
Throws:
IOException

writeRow

protected void writeRow(ValueRow row,
                        PrintWriter out)

showFileNotFoundMessage

protected WebActionForward showFileNotFoundMessage(javax.servlet.http.HttpServletResponse response,
                                                   String requestURI,
                                                   ValueObject paramVO)
                                            throws IOException
RollinDate에 해당되는 로그파일이 없을 때 내용을 출력한다.

Parameters:
response -
listVO -
requestURI -
paramVO -
Throws:
IOException


Copyright © 2014. All Rights Reserved.