init
This commit is contained in:
@@ -0,0 +1,73 @@
|
||||
//package com.ext.eai.agent.fds;
|
||||
//
|
||||
//import com.eactive.eai.agent.command.Command;
|
||||
//import com.eactive.eai.agent.command.CommandException;
|
||||
//import com.eactive.eai.common.util.Logger;
|
||||
//import com.ext.eai.fds.FDSManager;
|
||||
//
|
||||
//public class ReloadFDSCommand extends Command
|
||||
//{
|
||||
// /**
|
||||
// *
|
||||
// */
|
||||
// private static final long serialVersionUID = 1L;
|
||||
//
|
||||
// /**
|
||||
// * 1. 기능 : ReloadFDSCommand 생성자
|
||||
// * 2. 처리 개요 :
|
||||
// * 3. 주의사항
|
||||
// *
|
||||
// * @param
|
||||
// * @return
|
||||
// * @exception
|
||||
// **/
|
||||
// public ReloadFDSCommand() {
|
||||
// super("ReloadFDSCommand");
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 1. 기능 : FDSManager의 데이터를 DB로부터 Reload
|
||||
// * 2. 처리 개요 : FDSManager의 reload메소드를 실행하여 DB로부터 Reload
|
||||
// * 3. 주의사항
|
||||
// *
|
||||
// * @param
|
||||
// * @return
|
||||
// * @exception CommandException
|
||||
// **/
|
||||
// public Object execute() throws CommandException
|
||||
// {
|
||||
// Logger logger = Logger.getLogger(Logger.LOGGER_DEFAULT);
|
||||
// if (logger.isInfo()) logger.info(this.name + " is executed");
|
||||
//
|
||||
// if( !(args instanceof String) ) {
|
||||
// String rspErrorCode = "RECEAIMCM001";
|
||||
// String msg = makeException(rspErrorCode, null);
|
||||
// if (logger.isError()) logger.error(msg);
|
||||
// throw new CommandException(msg);
|
||||
// }
|
||||
//
|
||||
// try{
|
||||
// FDSManager manager = FDSManager.getInstance();
|
||||
// String keyName = (String)args;
|
||||
// if(keyName != null ){
|
||||
// if( "ALL".equals(keyName)){
|
||||
// manager.reload();
|
||||
// if(logger.isWarn())
|
||||
// logger.warn(this.name + "] 모든 정보가 Reload 되었습니다.");
|
||||
// }else{
|
||||
// throw new Exception("not support args " + keyName );
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// if(logger.isWarn()) logger.warn(this.name + "] 모든 정보가 Reload 되었습니다.");
|
||||
// }catch (Exception e){
|
||||
// String rspErrorCode = "RECEAIMCM002";
|
||||
// String msg = makeException(rspErrorCode, e);
|
||||
// if (logger.isError()) logger.error(msg);
|
||||
//// e.printStackTrace();
|
||||
// throw new CommandException(msg);
|
||||
// }
|
||||
// return "success";
|
||||
// }
|
||||
//
|
||||
//}
|
||||
@@ -0,0 +1,85 @@
|
||||
package com.ext.eai.agent.stdmessage;
|
||||
|
||||
import com.eactive.eai.agent.command.Command;
|
||||
import com.eactive.eai.agent.command.CommandException;
|
||||
import com.eactive.eai.common.stdmessage.STDMessageManager;
|
||||
import com.eactive.eai.common.util.Logger;
|
||||
|
||||
public class ReloadSTDMessageCommand extends Command
|
||||
{
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 1. 기능 : ReloadSTDMessageCommand 생성자
|
||||
* 2. 처리 개요 :
|
||||
* 3. 주의사항
|
||||
*
|
||||
* @param
|
||||
* @return
|
||||
* @exception
|
||||
**/
|
||||
public ReloadSTDMessageCommand() {
|
||||
super("ReloadSTDMessageCommand");
|
||||
}
|
||||
|
||||
/**
|
||||
* 1. 기능 : STDMessageManager의 데이터를 DB로부터 Reload
|
||||
* 2. 처리 개요 : STDMessageManager의 reload메소드를 실행하여 DB로부터 Reload
|
||||
* 3. 주의사항
|
||||
*
|
||||
* @param
|
||||
* @return
|
||||
* @exception CommandException
|
||||
**/
|
||||
public Object execute() throws CommandException
|
||||
{
|
||||
Logger logger = Logger.getLogger(Logger.LOGGER_DEFAULT);
|
||||
if (logger.isInfo()) logger.info(this.name + " is executed");
|
||||
|
||||
if( !(args instanceof String) ) {
|
||||
String rspErrorCode = "RECEAIMCM001";
|
||||
String msg = makeException(rspErrorCode, null);
|
||||
if (logger.isError()) logger.error(msg);
|
||||
throw new CommandException(msg);
|
||||
}
|
||||
|
||||
try{
|
||||
STDMessageManager manager = STDMessageManager.getInstance();
|
||||
|
||||
String keyName = (String)args;
|
||||
|
||||
if(keyName != null ){
|
||||
if( "ALL".equals(keyName)){
|
||||
manager.reload();
|
||||
if(logger.isWarn())
|
||||
logger.warn(this.name + "] 모든 정보가 Reload 되었습니다.");
|
||||
}
|
||||
else {
|
||||
manager.reload(keyName);
|
||||
if(logger.isWarn())
|
||||
logger.warn(this.name + "] "+keyName+" 에 대한 정보가 Reload 되었습니다.");
|
||||
}
|
||||
}
|
||||
}catch (Exception e){
|
||||
String rspErrorCode = "RECEAIMCM002";
|
||||
String msg = makeException(rspErrorCode, e);
|
||||
if (logger.isError()) logger.error(msg);
|
||||
// e.printStackTrace();
|
||||
throw new CommandException(msg);
|
||||
}
|
||||
return "success";
|
||||
}
|
||||
|
||||
// public static void main(String args[]) throws Exception {
|
||||
// test();
|
||||
//}
|
||||
|
||||
// private static void test() throws Exception {
|
||||
// Command command = new ReloadSTDMessageCommand();
|
||||
// command.setArgs("ALL");
|
||||
// AgentUtil.broadcast(command);
|
||||
// }
|
||||
}
|
||||
@@ -0,0 +1,84 @@
|
||||
package com.ext.eai.agent.stdmessage;
|
||||
|
||||
import java.util.Vector;
|
||||
|
||||
import com.eactive.eai.agent.command.Command;
|
||||
import com.eactive.eai.agent.command.CommandException;
|
||||
import com.eactive.eai.common.stdmessage.STDMessageManager;
|
||||
import com.eactive.eai.common.util.Logger;
|
||||
|
||||
public class ReloadSTDMessageListCommand extends Command
|
||||
{
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 1. 기능 : ReloadSTDMessageCommand 생성자
|
||||
* 2. 처리 개요 :
|
||||
* 3. 주의사항
|
||||
*
|
||||
* @param
|
||||
* @return
|
||||
* @exception
|
||||
**/
|
||||
public ReloadSTDMessageListCommand() {
|
||||
super("ReloadSTDMessageListCommand");
|
||||
}
|
||||
|
||||
/**
|
||||
* 1. 기능 : STDMessageManager의 데이터를 DB로부터 Reload
|
||||
* 2. 처리 개요 : STDMessageManager의 reload메소드를 실행하여 DB로부터 Reload
|
||||
* 3. 주의사항
|
||||
*
|
||||
* @param
|
||||
* @return
|
||||
* @exception CommandException
|
||||
**/
|
||||
public Object execute() throws CommandException
|
||||
{
|
||||
Logger logger = Logger.getLogger(Logger.LOGGER_DEFAULT);
|
||||
if (logger.isInfo()) logger.info(this.name + " is executed");
|
||||
|
||||
if( !(args instanceof Vector) ) {
|
||||
String rspErrorCode = "RECEAIMCM001";
|
||||
String msg = makeException(rspErrorCode, null);
|
||||
if (logger.isError()) logger.error(msg);
|
||||
throw new CommandException(msg);
|
||||
}
|
||||
|
||||
try{
|
||||
STDMessageManager manager = STDMessageManager.getInstance();
|
||||
|
||||
Vector messageVt = (Vector)args;
|
||||
String key = "";
|
||||
for(int i=0; i<messageVt.size(); i++) {
|
||||
key = (String)messageVt.get(i);
|
||||
|
||||
if(key != null ){
|
||||
manager.reload(key);
|
||||
if(logger.isWarn())
|
||||
logger.warn(this.name + "] "+key+" 에 대한 정보가 Reload 되었습니다.");
|
||||
}
|
||||
}
|
||||
}catch (Exception e){
|
||||
String rspErrorCode = "RECEAIMCM002";
|
||||
String msg = makeException(rspErrorCode, e);
|
||||
if (logger.isError()) logger.error(msg, e);
|
||||
throw new CommandException(msg);
|
||||
}
|
||||
return "success";
|
||||
}
|
||||
|
||||
// public static void main(String args[]) throws Exception {
|
||||
// test();
|
||||
//}
|
||||
|
||||
// private static void test() throws Exception {
|
||||
// Command command = new ReloadSTDMessageListCommand();
|
||||
// command.setArgs("ALL");
|
||||
// AgentUtil.broadcast(command);
|
||||
//
|
||||
// }
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
package com.ext.eai.agent.stdmessage;
|
||||
|
||||
import com.eactive.eai.agent.command.Command;
|
||||
import com.eactive.eai.agent.command.CommandException;
|
||||
import com.eactive.eai.common.stdmessage.STDMessageManager;
|
||||
import com.eactive.eai.common.util.Logger;
|
||||
|
||||
/**
|
||||
* 1. 기능 : Running중인 EAI Server의 메모리에 로딩된 STDMessageManager의 정보 변경
|
||||
* 2. 처리 개요 : STDMessageManager에서 해당 STDMessage를 제거
|
||||
* 3. 주의사항
|
||||
*
|
||||
* @author
|
||||
* @version v 1.0.0
|
||||
* @see 관련 기능을 참조
|
||||
* @since
|
||||
*/
|
||||
public class RemoveSTDMessageCommand extends Command
|
||||
{
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 1. 기능 : RemoveSTDMessageCommand 생성자
|
||||
* 2. 처리 개요 :
|
||||
* 3. 주의사항
|
||||
*
|
||||
**/
|
||||
public RemoveSTDMessageCommand() {
|
||||
super("RemoveSTDMessageCommand");
|
||||
}
|
||||
|
||||
/**
|
||||
* 1. 기능 : STDMessageManager에서 해당 STDMessage를 제거
|
||||
* 2. 처리 개요 : STDMessageManager에서 해당 STDMessage를 제거
|
||||
* 3. 주의사항
|
||||
*
|
||||
* @exception CommandException Argument Type이 다르거나 Command 수행중 Excpetion이 발생할 경우
|
||||
**/
|
||||
public Object execute() throws CommandException
|
||||
{
|
||||
Logger logger = Logger.getLogger(Logger.LOGGER_DEFAULT);
|
||||
if (logger.isInfo()) logger.info(this.name + " is executed");
|
||||
|
||||
if( !(args instanceof String) ) {
|
||||
String rspErrorCode = "RECEAIMCM001";
|
||||
String msg = makeException(rspErrorCode, null);
|
||||
if (logger.isError()) logger.error(msg);
|
||||
throw new CommandException(msg);
|
||||
}
|
||||
|
||||
try{
|
||||
|
||||
String bwkSvcKey = null;
|
||||
STDMessageManager manager = STDMessageManager.getInstance();
|
||||
|
||||
bwkSvcKey = (String) args;
|
||||
if(bwkSvcKey != null){
|
||||
manager.removeSTDMessage(bwkSvcKey);
|
||||
}
|
||||
|
||||
}catch (Exception e){
|
||||
String rspErrorCode = "RECEAIMCM002";
|
||||
String msg = makeException(rspErrorCode, e);
|
||||
if (logger.isError()) logger.error(msg, e);
|
||||
throw new CommandException(msg);
|
||||
}
|
||||
return "success";
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package com.ext.eai.agent.submessage;
|
||||
|
||||
import com.eactive.eai.agent.command.Command;
|
||||
import com.eactive.eai.agent.command.CommandException;
|
||||
import com.eactive.eai.common.submessage.SubMessageManager;
|
||||
import com.eactive.eai.common.util.Logger;
|
||||
|
||||
public class ReloadSubMessageCommand extends Command {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public ReloadSubMessageCommand() {
|
||||
super("ReloadSubMessageCommand");
|
||||
}
|
||||
|
||||
public Object execute() throws CommandException {
|
||||
Logger logger = Logger.getLogger(Logger.LOGGER_DEFAULT);
|
||||
if (logger.isInfo())
|
||||
logger.info(this.name + " is executed");
|
||||
|
||||
if (!(args instanceof String)) {
|
||||
String rspErrorCode = "RECEAIMCM001";
|
||||
String msg = makeException(rspErrorCode, null);
|
||||
if (logger.isError())
|
||||
logger.error(msg);
|
||||
throw new CommandException(msg);
|
||||
}
|
||||
|
||||
try {
|
||||
SubMessageManager manager = SubMessageManager.getInstance();
|
||||
String keyName = (String) args;
|
||||
if (keyName != null) {
|
||||
if ("ALL".equals(keyName)) {
|
||||
manager.reload();
|
||||
if (logger.isWarn())
|
||||
logger.warn(this.name + "] 모든 정보가 Reload 되었습니다.");
|
||||
} else {
|
||||
manager.reload(keyName);
|
||||
if (logger.isWarn())
|
||||
logger.warn(this.name + "] " + keyName + " 에 대한 정보가 Reload 되었습니다.");
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
String rspErrorCode = "RECEAIMCM002";
|
||||
String msg = makeException(rspErrorCode, e);
|
||||
if (logger.isError())
|
||||
logger.error(msg);
|
||||
throw new CommandException(msg);
|
||||
}
|
||||
return "success";
|
||||
}
|
||||
|
||||
// public static void main(String args[]) throws Exception {
|
||||
// test();
|
||||
//}
|
||||
|
||||
// private static void test() throws Exception {
|
||||
// Command command = new ReloadSubMessageCommand();
|
||||
// command.setArgs("ALL");
|
||||
// AgentUtil.broadcast(command);
|
||||
// }
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
package com.ext.eai.agent.submessage;
|
||||
|
||||
import java.util.Vector;
|
||||
|
||||
import com.eactive.eai.agent.command.Command;
|
||||
import com.eactive.eai.agent.command.CommandException;
|
||||
import com.eactive.eai.common.submessage.SubMessageManager;
|
||||
import com.eactive.eai.common.util.Logger;
|
||||
|
||||
public class ReloadSubMessageListCommand extends Command {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public ReloadSubMessageListCommand() {
|
||||
super("ReloadSubMessageListCommand");
|
||||
}
|
||||
|
||||
public Object execute() throws CommandException {
|
||||
Logger logger = Logger.getLogger(Logger.LOGGER_DEFAULT);
|
||||
if (logger.isInfo())
|
||||
logger.info(this.name + " is executed");
|
||||
|
||||
if (!(args instanceof Vector)) {
|
||||
String rspErrorCode = "RECEAIMCM001";
|
||||
String msg = makeException(rspErrorCode, null);
|
||||
if (logger.isError())
|
||||
logger.error(msg);
|
||||
throw new CommandException(msg);
|
||||
}
|
||||
|
||||
try {
|
||||
SubMessageManager manager = SubMessageManager.getInstance();
|
||||
|
||||
Vector messageVt = (Vector) args;
|
||||
String key = "";
|
||||
for (int i = 0; i < messageVt.size(); i++) {
|
||||
key = (String) messageVt.get(i);
|
||||
|
||||
if (key != null) {
|
||||
manager.reload(key);
|
||||
if (logger.isWarn())
|
||||
logger.warn(this.name + "] " + key + " 에 대한 정보가 Reload 되었습니다.");
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
String rspErrorCode = "RECEAIMCM002";
|
||||
String msg = makeException(rspErrorCode, e);
|
||||
if (logger.isError())
|
||||
logger.error(msg, e);
|
||||
throw new CommandException(msg);
|
||||
}
|
||||
return "success";
|
||||
}
|
||||
|
||||
// public static void main(String args[]) throws Exception {
|
||||
// test();
|
||||
//}
|
||||
|
||||
// private static void test() throws Exception {
|
||||
// Command command = new ReloadSubMessageListCommand();
|
||||
// command.setArgs("ALL");
|
||||
// AgentUtil.broadcast(command);
|
||||
//
|
||||
// }
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
package com.ext.eai.agent.submessage;
|
||||
|
||||
import com.eactive.eai.agent.command.Command;
|
||||
import com.eactive.eai.agent.command.CommandException;
|
||||
import com.eactive.eai.common.submessage.SubMessageManager;
|
||||
import com.eactive.eai.common.util.Logger;
|
||||
|
||||
public class RemoveSubMessageCommand extends Command {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public RemoveSubMessageCommand() {
|
||||
super("RemoveSubMessageCommand");
|
||||
}
|
||||
|
||||
public Object execute() throws CommandException {
|
||||
Logger logger = Logger.getLogger(Logger.LOGGER_DEFAULT);
|
||||
if (logger.isInfo())
|
||||
logger.info(this.name + " is executed");
|
||||
|
||||
if (!(args instanceof String)) {
|
||||
String rspErrorCode = "RECEAIMCM001";
|
||||
String msg = makeException(rspErrorCode, null);
|
||||
if (logger.isError())
|
||||
logger.error(msg);
|
||||
throw new CommandException(msg);
|
||||
}
|
||||
|
||||
try {
|
||||
|
||||
String bwkSvcKey = null;
|
||||
SubMessageManager manager = SubMessageManager.getInstance();
|
||||
|
||||
bwkSvcKey = (String) args;
|
||||
if (bwkSvcKey != null) {
|
||||
manager.remove(bwkSvcKey);
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
String rspErrorCode = "RECEAIMCM002";
|
||||
String msg = makeException(rspErrorCode, e);
|
||||
if (logger.isError())
|
||||
logger.error(msg, e);
|
||||
throw new CommandException(msg);
|
||||
}
|
||||
return "success";
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package com.ext.eai.fds;//package com.ext.eai.fds;
|
||||
//
|
||||
//public interface FDSKeys {
|
||||
//
|
||||
// final String SERVICES_FILE = "adssvc.properties";
|
||||
// final String YES = "Y";
|
||||
// final String NO = "N";
|
||||
// final String SKIP_YN = "SKIP_YN";
|
||||
// final String CONNECT_TARGET = "CONNECT_TARGET";
|
||||
// interface JSON {
|
||||
// String HEADER = "Header";
|
||||
// String SYSTEM_HEADER = "systemHeader";
|
||||
// String BODY = "Body";
|
||||
// String TX_CODE = "DLNG_ID";
|
||||
// String TX_RESP_CODE = "RSPNS_RSLT_DVSN_CD";
|
||||
// String FDS_MSG_TYPE_CODE = "MSG_TYPE_CODE";
|
||||
// }
|
||||
//
|
||||
// interface TX_RESP_CODE {
|
||||
// String NORMAL = "N";
|
||||
// }
|
||||
//
|
||||
// interface FDS_MSG_TYPE_CODE {
|
||||
// String REQ = "T";
|
||||
// String RES = "R";
|
||||
// }
|
||||
//
|
||||
// interface CONNECT_TARGET_CD {
|
||||
// String HTTP = "http";
|
||||
// String COLLECT = "collect";
|
||||
// String DETECT = "detect";
|
||||
// }
|
||||
//}
|
||||
//
|
||||
@@ -0,0 +1,302 @@
|
||||
//package com.ext.eai.fds;
|
||||
//
|
||||
//import java.io.InputStream;
|
||||
//import java.io.UnsupportedEncodingException;
|
||||
//import java.util.Map;
|
||||
//import java.util.Properties;
|
||||
//
|
||||
//import org.json.simple.parser.JSONParser;
|
||||
//
|
||||
//import com.eactive.eai.common.exception.ExceptionUtil;
|
||||
//import com.eactive.eai.common.lifecycle.Lifecycle;
|
||||
//import com.eactive.eai.common.lifecycle.LifecycleException;
|
||||
//import com.eactive.eai.common.lifecycle.LifecycleListener;
|
||||
//import com.eactive.eai.common.lifecycle.LifecycleSupport;
|
||||
//import com.eactive.eai.common.message.EAIMessage;
|
||||
//import com.eactive.eai.common.message.ExtMessage;
|
||||
//import com.eactive.eai.common.server.EAIServerManager;
|
||||
//import com.eactive.eai.common.util.Logger;
|
||||
//import com.ext.eai.common.stdmessage.STDMessage;
|
||||
//import com.greenbeesoft.ids.connector.Connector;
|
||||
//import com.greenbeesoft.ids.connector.ConnectorManager;
|
||||
//
|
||||
///**
|
||||
//* 1. 기능 : FDS 전송을 위한 Rule 정보를 File로 부터 로딩해 메모리에 관리하는 Manager 클래스
|
||||
//* 2. 처리 개요 : File Rule 정보에 저장된 FDS Rule 정보를 메모리에 로딩 관리한다.
|
||||
//* * -
|
||||
//* 3. 주의사항
|
||||
//*
|
||||
//* @author :
|
||||
//* @version : v 1.0.0
|
||||
//* @see : 관련 기능을 참조
|
||||
//* @since :
|
||||
//* :
|
||||
//*/
|
||||
//public class FDSManager implements Lifecycle
|
||||
//{
|
||||
// public static String FDS_PROP_GROUP_NAME = "FDS";
|
||||
// public static String FDS_SEND_SKIP_YN = "FDS_SEND_SKIP_YN";
|
||||
// static Logger logger = Logger.getLogger(Logger.LOGGER_DEFAULT);
|
||||
// /**
|
||||
// * FDSManager Single Instance
|
||||
// */
|
||||
// private static FDSManager instance = new FDSManager();
|
||||
//
|
||||
// /**
|
||||
// * LifecyleSupport object
|
||||
// */
|
||||
// private LifecycleSupport lifecycle = new LifecycleSupport(this);
|
||||
//
|
||||
// /**
|
||||
// * Property 정보를 저장하는 collection
|
||||
// */
|
||||
// private Properties acceptedServiceList;
|
||||
//
|
||||
// private Connector fdsConnector;
|
||||
//
|
||||
// private String skipYn ;
|
||||
// private String connectTarget ;
|
||||
//
|
||||
// /**
|
||||
// * 기동 여부
|
||||
// */
|
||||
// private boolean started;
|
||||
//
|
||||
// /**
|
||||
// * 1. 기능 : Default Constructor
|
||||
// * 2. 처리 개요 :
|
||||
// * -
|
||||
// * 3. 주의사항
|
||||
// *
|
||||
// **/
|
||||
// private FDSManager() {
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 1. 기능 : FDSManager Singleton Object를 반환하는 getter method
|
||||
// * 2. 처리 개요 : FDSManager Singleton Object를 반환한다.
|
||||
// * -
|
||||
// * 3. 주의사항
|
||||
// *
|
||||
// * @param
|
||||
// * @return
|
||||
// * @exception
|
||||
// **/
|
||||
// public static FDSManager getInstance() {
|
||||
// return instance;
|
||||
// }
|
||||
//
|
||||
//
|
||||
// /**
|
||||
// * 1. 기능 : FDSManager의 초기화 여부를 반환하는 getter 메서드
|
||||
// * 2. 처리 개요 : FDSManager의 초기화 여부를 반환한다.
|
||||
// * 3. 주의사항
|
||||
// *
|
||||
// * @return 초기화 여부
|
||||
// **/
|
||||
// public boolean isStarted() {
|
||||
// return this.started;
|
||||
// }
|
||||
//
|
||||
//
|
||||
// // =================================================================================
|
||||
// // 이 부분은 Lifecycle용으로 제공되는 메소드이다.
|
||||
// /**
|
||||
// * 1. 기능 : Lifecycle의 start 메서드로 FDSManager를 초기화하는 메서드
|
||||
// * 2. 처리 개요 : PropertyDAO를 이용해 추출 Rule 정보 모두를 가져와 초기화한다.
|
||||
// * -
|
||||
// * 3. 주의사항
|
||||
// *
|
||||
// * @param
|
||||
// * @return
|
||||
// * @exception
|
||||
// **/
|
||||
// public void start() throws LifecycleException {
|
||||
// if (started)
|
||||
// throw new LifecycleException("RECEAICPM201");
|
||||
//
|
||||
// // Notify our interested LifecycleListeners
|
||||
// lifecycle.fireLifecycleEvent(STARTING_EVENT, this);
|
||||
//
|
||||
// try {
|
||||
// init();
|
||||
// } catch(Exception e) {
|
||||
// //throw new LifecycleException("RECEAICPM201");
|
||||
// throw new LifecycleException(ExceptionUtil.getErrorCode(e,"RECEAICPM201"));
|
||||
// }
|
||||
//
|
||||
// started = true;
|
||||
// logger.info("FDSManager] It is started.");
|
||||
// // Notify our interested LifecycleListeners
|
||||
// lifecycle.fireLifecycleEvent(STARTED_EVENT, this);
|
||||
// }
|
||||
// private void init() throws Exception {
|
||||
// Properties serviceList = new Properties();
|
||||
// //File Load
|
||||
// InputStream is = getClass().getClassLoader().getResourceAsStream(FDSKeys.SERVICES_FILE);
|
||||
// if ( is == null )
|
||||
// {
|
||||
//// throw new IllegalArgumentException("Not Found FDS Properties file in classpath. [" + SERVICES_FILE + "]");
|
||||
// logger.error("Not Found FDS Properties file in classpath. [" + FDSKeys.SERVICES_FILE + "]");
|
||||
// }
|
||||
//
|
||||
// try
|
||||
// {
|
||||
// serviceList.load(is);
|
||||
// acceptedServiceList = serviceList;
|
||||
// }
|
||||
// catch (Exception e)
|
||||
// {
|
||||
// logger.error("acceptedServiceList : " + acceptedServiceList.size());
|
||||
// }
|
||||
// finally
|
||||
// {
|
||||
// try {
|
||||
// if ( is != null ) is.close();
|
||||
// } catch (Exception e2) {
|
||||
// }
|
||||
// }
|
||||
// skipYn = ( acceptedServiceList.containsKey(FDSKeys.SKIP_YN)) ? acceptedServiceList.getProperty(FDSKeys.SKIP_YN) : FDSKeys.NO;
|
||||
// connectTarget= ( acceptedServiceList.containsKey(FDSKeys.CONNECT_TARGET)) ? acceptedServiceList.getProperty(FDSKeys.CONNECT_TARGET) : FDSKeys.CONNECT_TARGET_CD.HTTP;
|
||||
//
|
||||
// ConnectorManager connectorManager = ConnectorManager.getInstance();
|
||||
// try{
|
||||
// connectorManager.init(EAIServerManager.getInstance().getSystemEnvTypeConvert()+"_adsapi.properties");//D/T/P
|
||||
// }catch(Exception e){
|
||||
// logger.error("ConnectorManager init fail " ,e);
|
||||
// }
|
||||
//
|
||||
// fdsConnector = connectorManager.getConnector(connectTarget);
|
||||
//
|
||||
// }
|
||||
// public synchronized void reload() throws Exception {
|
||||
// if(logger.isWarn()) {
|
||||
// logger.warn("FDSManager] reload all Started ...");
|
||||
// }
|
||||
// init();
|
||||
// if(logger.isWarn()) {
|
||||
// logger.warn("FDSManager] reload all finished ...");
|
||||
// }
|
||||
// }
|
||||
//
|
||||
//
|
||||
// /**
|
||||
// * 1. 기능 : Lifecycle의 stop 메서드로 FDSManager를 종료하는 메서드
|
||||
// * 2. 처리 개요 : 멤버에 캐싱한 프라퍼티 Rule 정보를 clear한다.
|
||||
// * -
|
||||
// * 3. 주의사항
|
||||
// *
|
||||
// * @param
|
||||
// * @return
|
||||
// * @exception
|
||||
// **/
|
||||
// public void stop() throws LifecycleException {
|
||||
// // Validate and update our current component state
|
||||
// if (!started)
|
||||
// throw new LifecycleException("RECEAICPM203");
|
||||
//
|
||||
// // Notify our interested LifecycleListeners
|
||||
// lifecycle.fireLifecycleEvent(STOPING_EVENT, this);
|
||||
//
|
||||
//
|
||||
//
|
||||
// started = false;
|
||||
// logger.info("FDSManager] It is stopped.");
|
||||
// // Notify our interested LifecycleListeners
|
||||
// lifecycle.fireLifecycleEvent(STOPPED_EVENT, this);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 1. 기능 : LifecycleListener를 등록하는 메서드
|
||||
// * 2. 처리 개요 : LifecycleListener를 등록한다.
|
||||
// * 3. 주의사항
|
||||
// *
|
||||
// * @param listener LifecycleEvent를 수신한 LifecycleListener
|
||||
// **/
|
||||
// public void addLifecycleListener(LifecycleListener listener)
|
||||
// {
|
||||
// lifecycle.addLifecycleListener(listener);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 1. 기능 : 등록된 LifecycleListener 리스트를 반환하는 메서드
|
||||
// * 2. 처리 개요 : 등록된 LifecycleListener 리스트를 반환하다.
|
||||
// * 3. 주의사항
|
||||
// *
|
||||
// * @return 등록된 LifecycleListener 리스트
|
||||
// **/
|
||||
// public LifecycleListener[] findLifecycleListeners()
|
||||
// {
|
||||
// return lifecycle.findLifecycleListeners();
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 1. 기능 : 등록된 LifecycleListener를 삭제하는 메서드
|
||||
// * 2. 처리 개요 : 파라미터의 LifecycleListener를 삭제한다.
|
||||
// * 3. 주의사항
|
||||
// *
|
||||
// * @param listener 삭제할 LifecycleListener
|
||||
// **/
|
||||
// public void removeLifecycleListener(LifecycleListener listener)
|
||||
// {
|
||||
// lifecycle.removeLifecycleListener(listener);
|
||||
// }
|
||||
//
|
||||
// public void send(EAIMessage reqEaiMsg, EAIMessage retEaiMsg){
|
||||
// ExtMessage extMessage =retEaiMsg.getExtMsg();
|
||||
// String serviceId = extMessage.getServiceId();
|
||||
// String responseType = extMessage.getResponseType();
|
||||
// if ( FDSKeys.TX_RESP_CODE.NORMAL.equals(responseType) && acceptedServiceList.containsKey(serviceId)){
|
||||
// if(!FDSKeys.YES.equals(skipYn)) {
|
||||
// Map reqJson = null;
|
||||
// try {
|
||||
// reqJson = getJSONMap(reqEaiMsg,retEaiMsg, acceptedServiceList.getProperty(serviceId));
|
||||
// fdsConnector.send(reqJson);
|
||||
// logger.debug("fds collect send ~ OK !!" );
|
||||
// } catch (Exception e) {
|
||||
// logger.error("fds send parsing error", e);
|
||||
// }
|
||||
// }else {
|
||||
// logger.debug("fds collect skip ~ !!" );
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// private static Map getJSONMap(EAIMessage reqEaiMsg,EAIMessage retEaiMsg, String io) throws Exception{
|
||||
// if (io == null ){
|
||||
// throw new Exception("invalid property io ="+ io);
|
||||
// }
|
||||
//
|
||||
// ExtMessage reqExt =retEaiMsg.getExtMsg();
|
||||
// STDMessage reqStd =(STDMessage)reqExt.getStdMessage();
|
||||
//
|
||||
// Object bodyObj = null;
|
||||
// if (!"O".equals(io)){ //요청 body 셋팅
|
||||
// bodyObj = reqEaiMsg.getExtMsg().getBizData()[0];
|
||||
// }else{
|
||||
// bodyObj = reqExt.getBizData()[0];
|
||||
// }
|
||||
//
|
||||
// String body ="";
|
||||
// if (bodyObj instanceof String){
|
||||
// body =(String)bodyObj;
|
||||
// }else if (bodyObj instanceof byte[]){
|
||||
// try {
|
||||
// body = new String((byte[])bodyObj,"utf-8");
|
||||
// } catch (UnsupportedEncodingException e) {
|
||||
// logger.error("fds send data convert error ", e);
|
||||
// }
|
||||
// }
|
||||
// String sendData = reqStd.toJSONString(body);
|
||||
//
|
||||
//
|
||||
// Map reqJson = (Map)new JSONParser().parse(sendData);
|
||||
//
|
||||
// Map<String,Object> header = (Map)reqJson.get(FDSKeys.JSON.HEADER);
|
||||
// Map<String,Object> systemHeader = (Map)header.get(FDSKeys.JSON.SYSTEM_HEADER);
|
||||
// systemHeader.put(FDSKeys.JSON.FDS_MSG_TYPE_CODE, FDSKeys.FDS_MSG_TYPE_CODE.REQ );
|
||||
// if (logger.isDebug()){
|
||||
// logger.debug("fds send data = "+reqJson);
|
||||
// }
|
||||
// return reqJson;
|
||||
// }
|
||||
//}
|
||||
@@ -0,0 +1,72 @@
|
||||
package com.ext.eai.trace;
|
||||
|
||||
import com.eactive.eai.common.message.EAIMessage;
|
||||
import com.eactive.eai.common.property.PropManager;
|
||||
import com.eactive.eai.common.util.Logger;
|
||||
|
||||
@Deprecated
|
||||
public class TranManagerWrapper {
|
||||
protected static Logger logger = Logger.getLogger(Logger.LOGGER_DEFAULT);
|
||||
public static String start1(EAIMessage eaiMsg){
|
||||
String traceGeneratorYn = PropManager.getInstance().getProperty("TRACE", "trace.generator.yn", "Y");
|
||||
if (!"Y".equals(traceGeneratorYn)){
|
||||
return null;
|
||||
}
|
||||
String json = getJSONString(eaiMsg);
|
||||
logger.debug("TranManagerWrapper] start1 GUID["+eaiMsg.getMapper().getGuid(eaiMsg.getStandardMessage())
|
||||
+ "."+eaiMsg.getMapper().getGuidSeq(eaiMsg.getStandardMessage()) + "]" + json);
|
||||
return json;
|
||||
}
|
||||
public static String end1(EAIMessage eaiMsg){
|
||||
String traceGeneratorYn = PropManager.getInstance().getProperty("TRACE", "trace.generator.yn", "Y");
|
||||
if (!"Y".equals(traceGeneratorYn)){
|
||||
return null;
|
||||
}
|
||||
String json = getJSONString(eaiMsg);
|
||||
logger.debug("TranManagerWrapper] end1 GUID["+eaiMsg.getMapper().getGuid(eaiMsg.getStandardMessage())
|
||||
+ "."+eaiMsg.getMapper().getGuidSeq(eaiMsg.getStandardMessage()) + "]" + json);
|
||||
return json;
|
||||
}
|
||||
public static String start2(EAIMessage eaiMsg){
|
||||
String traceGeneratorYn = PropManager.getInstance().getProperty("TRACE", "trace.generator.yn", "Y");
|
||||
if (!"Y".equals(traceGeneratorYn)){
|
||||
return null;
|
||||
}
|
||||
String json = getJSONString(eaiMsg);
|
||||
logger.debug("TranManagerWrapper] start2 GUID["+eaiMsg.getMapper().getGuid(eaiMsg.getStandardMessage())
|
||||
+ "."+eaiMsg.getMapper().getGuidSeq(eaiMsg.getStandardMessage()) + "]" + json);
|
||||
return json;
|
||||
}
|
||||
public static String end2(EAIMessage eaiMsg){
|
||||
String traceGeneratorYn = PropManager.getInstance().getProperty("TRACE", "trace.generator.yn", "Y");
|
||||
if (!"Y".equals(traceGeneratorYn)){
|
||||
return null;
|
||||
}
|
||||
String json = getJSONString(eaiMsg);
|
||||
logger.debug("TranManagerWrapper] end2 GUID["+eaiMsg.getMapper().getGuid(eaiMsg.getStandardMessage())
|
||||
+ "."+eaiMsg.getMapper().getGuidSeq(eaiMsg.getStandardMessage()) + "]" + json);
|
||||
return json;
|
||||
}
|
||||
private static String getJSONString(EAIMessage eaiMsg){
|
||||
// ExtMessage ext = eaiMsg.getExtMsg();
|
||||
// STDMessage std = (STDMessage)ext.getStdMessage();
|
||||
// Object message = ext.getBizData()[0];
|
||||
// String msg ="";
|
||||
// if (message instanceof String){
|
||||
// msg =(String)message;
|
||||
// }else if (message instanceof byte[]){
|
||||
// try {
|
||||
// msg = new String((byte[])message,"utf-8");
|
||||
// } catch (UnsupportedEncodingException e) {
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
// }
|
||||
// return msg;
|
||||
try {
|
||||
return eaiMsg.getStandardMessage().getBizData();
|
||||
} catch (Exception e) {
|
||||
logger.error(e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user