init
This commit is contained in:
@@ -0,0 +1,290 @@
|
||||
package com.eactive.eai.agent;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.ObjectInputStream;
|
||||
import java.io.ObjectOutputStream;
|
||||
import java.net.ConnectException;
|
||||
import java.net.HttpURLConnection;
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
import java.net.URLConnection;
|
||||
import java.util.HashMap;
|
||||
import java.util.Properties;
|
||||
import java.net.ProtocolException;
|
||||
import java.util.Arrays;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
import java.util.Vector;
|
||||
import javax.naming.Context;
|
||||
import javax.naming.InitialContext;
|
||||
|
||||
import com.eactive.eai.agent.command.Command;
|
||||
import com.eactive.eai.agent.command.CommandException;
|
||||
import com.eactive.eai.common.dao.DAOFactory;
|
||||
import com.eactive.eai.common.server.EAIServerDAO;
|
||||
import com.eactive.eai.common.server.EAIServerManager;
|
||||
import com.eactive.eai.common.server.EAIServerVO;
|
||||
import com.eactive.eai.common.util.ApplicationContextProvider;
|
||||
import com.eactive.eai.common.util.Logger;
|
||||
|
||||
/**
|
||||
* 1. 기능 : 등록된 EAI Server 에 Command를 broadcast
|
||||
* 2. 처리 개요 : 등록된 EAI Server 에 Command를 broadcast
|
||||
* 3. 주의사항
|
||||
*
|
||||
* @author
|
||||
* @version v 1.0.0
|
||||
* @see 관련 기능을 참조
|
||||
* @since
|
||||
*
|
||||
*/
|
||||
public class AgentUtil
|
||||
{
|
||||
static Logger logger = Logger.getLogger(Logger.LOGGER_DEFAULT);
|
||||
final static String SERVLET_URL = "/ESBWeb/WebAgent";
|
||||
|
||||
private static HashMap returnValue;
|
||||
|
||||
/**
|
||||
* 1. 기능 : AgentUtil 기본 생성자
|
||||
* 2. 처리 개요 :
|
||||
* 3. 주의사항
|
||||
*
|
||||
* @param
|
||||
* @return
|
||||
* @exception
|
||||
**/
|
||||
private AgentUtil(){
|
||||
returnValue = new HashMap();
|
||||
}
|
||||
|
||||
/**
|
||||
* 1. 기능 : 등록된 EAI Server 의 URL을 생성하여 반환
|
||||
* 2. 처리 개요 : EAIServerDAO를 통해 데이터베이스에 등록된 EAI Server의 URL을 생성하여 반환
|
||||
* 3. 주의사항
|
||||
*
|
||||
* @param
|
||||
* @return HashMap 등록된 EAI Server 의 URL.
|
||||
* @exception Exception
|
||||
**/
|
||||
private static HashMap getAllSvrUrl()throws Exception{
|
||||
|
||||
Map<String, EAIServerVO> servers = new HashMap<>();
|
||||
HashMap urlLists = new HashMap();
|
||||
|
||||
servers = EAIServerManager.getInstance().getAllServer(false);
|
||||
|
||||
Iterator it = servers.keySet().iterator();
|
||||
String svrName = "";
|
||||
while( it.hasNext()){
|
||||
svrName = (String)it.next();
|
||||
try{
|
||||
if(! ("ALL".equalsIgnoreCase(svrName))){
|
||||
StringBuffer urlBuf = new StringBuffer();
|
||||
EAIServerVO vo = (EAIServerVO)servers.get(svrName);
|
||||
if(vo != null){
|
||||
urlBuf.append(vo.toURL(EAIServerVO.HTTP_PROTOCOL));
|
||||
urlBuf.append(SERVLET_URL);
|
||||
logger.debug("AgentUtil] getAllSvrUrl - URL : "+urlBuf.toString());
|
||||
|
||||
urlLists.put(svrName, urlBuf.toString());
|
||||
}
|
||||
else {
|
||||
logger.error("AgentUtil] getAllSvrUrl - BroadCast할 서버 정보를 가져올 수 없습니다. ");
|
||||
}
|
||||
}
|
||||
|
||||
}catch (Exception e){
|
||||
logger.error("AgentUtil] getAllSvrUrl Error. - "+e.getMessage());
|
||||
}
|
||||
}
|
||||
return urlLists;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* temp code for test
|
||||
*/
|
||||
// private static HashMap getServerUrl() {
|
||||
//
|
||||
// HashMap urls = new HashMap();
|
||||
//
|
||||
// urls.put("cgServer", "http://172.17.51.127:8001/ESBWeb/WebAgent");
|
||||
// // urls.put("cgServer2", "http://172.17.51.127:7001/ESBWeb/WebAgent");
|
||||
// return urls;
|
||||
//
|
||||
// }
|
||||
|
||||
/**
|
||||
* 1. 기능 : 등록된 EAI Server에 Command를 broadcast
|
||||
* 2. 처리 개요 : 등록된 EAI Server의 URLConnection을 생성하여 Command broadcast하고
|
||||
* 전송된 결과값의 HashMap을 생성하여 반환
|
||||
* 3. 주의사항
|
||||
*
|
||||
* @param svrName broadcast할 EAI Server명
|
||||
* @param url broadcast할 EAI Server의 url
|
||||
* @param command broadcast할 Command
|
||||
* @return HashMap broadcast후 전송된 결과값.
|
||||
* 전송된 데이터가 success가 아니면 Exception이 전송된 것임.
|
||||
* @exception Exception
|
||||
**/
|
||||
public static HashMap broadcast(String svrName, String url, Command command)throws Exception{
|
||||
URLConnection urlCon;
|
||||
String response = "";
|
||||
|
||||
if(returnValue == null){
|
||||
returnValue = new HashMap();
|
||||
}
|
||||
|
||||
if(url !=null){
|
||||
urlCon = getURLConnection(url);
|
||||
try{
|
||||
response = sendCommand(urlCon, command);
|
||||
returnValue.put(svrName, response);
|
||||
}catch (Exception e){
|
||||
logger.error("AgentUtil] broadcast Excpetion", e);
|
||||
returnValue.put(svrName, e.getMessage());
|
||||
}
|
||||
|
||||
}else{
|
||||
logger.error("AgentUtil] broadcast Error. - url is null");
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* 1. 기능 : 등록된 EAI Server에 Command를 broadcast
|
||||
* 2. 처리 개요 : 등록된 EAI Server의 URLConnection을 생성하여 Command broadcast하고
|
||||
* 전송된 결과값의 HashMap을 생성하여 반환
|
||||
* 3. 주의사항
|
||||
*
|
||||
* @param command broadcast할 Command
|
||||
* @return HashMap broadcast후 전송된 결과값.
|
||||
* 전송된 데이터가 success가 아니면 Exception이 전송된 것임.
|
||||
* @exception Exception
|
||||
**/
|
||||
public static HashMap broadcast(Command command)throws Exception{
|
||||
URLConnection urlCon;
|
||||
HashMap servers = getAllSvrUrl();
|
||||
// HashMap servers = getServerUrl();
|
||||
|
||||
if(returnValue == null){
|
||||
returnValue = new HashMap();
|
||||
}
|
||||
|
||||
if(servers != null){
|
||||
Iterator it = servers.keySet().iterator();
|
||||
String svrName = "";
|
||||
String url = "";
|
||||
String response = "";
|
||||
|
||||
while( it.hasNext()){
|
||||
svrName = (String)it.next();
|
||||
url = (String) servers.get(svrName);
|
||||
|
||||
urlCon = getURLConnection(url);
|
||||
try{
|
||||
response = sendCommand(urlCon, command);
|
||||
returnValue.put(svrName, response);
|
||||
}catch (Exception e){
|
||||
logger.error("AgentUtil] broadcast Excpetion - "+url+ e.getMessage());
|
||||
returnValue.put(svrName, e.getMessage());
|
||||
}
|
||||
}
|
||||
}else{
|
||||
logger.error("AgentUtil] broadcast Error. - url is null");
|
||||
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 1. 기능 : 해당 URLConnection으로 command 전송 처리 결과를 반환
|
||||
* 2. 처리 개요 : 해당 URLConnection으로 command 전송하고 처리 결과를 반환
|
||||
* 3. 주의사항
|
||||
*
|
||||
* @param urlCon 연결할 URLConnection
|
||||
* @param command 전송할 Command
|
||||
* @return String 처리된 결과
|
||||
* @exception Exception
|
||||
**/
|
||||
public static String sendCommand(URLConnection urlCon, Command command)throws Exception{
|
||||
ObjectOutputStream oos = null;
|
||||
ObjectInputStream ois = null;
|
||||
String response = "";
|
||||
|
||||
try {
|
||||
oos = new ObjectOutputStream(urlCon.getOutputStream());
|
||||
oos.writeObject(command);
|
||||
oos.flush();
|
||||
logger.debug("AgentUtil] SendCommand - "+urlCon.getURL().toString());
|
||||
|
||||
ois = new ObjectInputStream(urlCon.getInputStream());
|
||||
response = (String)ois.readObject();
|
||||
|
||||
} catch (ConnectException e) {
|
||||
logger.error("AgentUtil] sendCommand ConnectException. - "+urlCon.getURL()+ " can't Connect"+e.getMessage());
|
||||
throw e;
|
||||
} catch (IOException e2) {
|
||||
logger.error("AgentUtil] sendCommand IOException. - "+urlCon.getURL()+ " can't IO" +e2.getMessage());
|
||||
throw e2;
|
||||
} catch (Exception e) {
|
||||
logger.error("AgentUtil] sendCommand Exception. - "+urlCon.getURL()+e.getMessage());
|
||||
throw e;
|
||||
} finally {
|
||||
if (oos != null) try { oos.close(); } catch (Exception e) { oos = null; }
|
||||
if (ois != null) try { ois.close(); } catch (Exception e) { ois = null; }
|
||||
}
|
||||
return response;
|
||||
}
|
||||
|
||||
/**
|
||||
* 1. 기능 : 지정된 url의 URLConnection 생성
|
||||
* 2. 처리 개요 : 지정된 url의 URLConnection 생성
|
||||
* 3. 주의사항
|
||||
*
|
||||
* @param url URLConnection을 생성을 위한 url
|
||||
* @return URLConnection 생성된 URLConnection
|
||||
* @exception
|
||||
**/
|
||||
public static URLConnection getURLConnection(String url) {
|
||||
URL u = null;
|
||||
try {
|
||||
u = new URL(url);
|
||||
} catch (MalformedURLException e) {
|
||||
logger.error("AgentUtil] getURLConnection ", e);
|
||||
}
|
||||
|
||||
HttpURLConnection conn = null;
|
||||
|
||||
try {
|
||||
conn = (HttpURLConnection) u.openConnection();
|
||||
} catch (Exception e) {
|
||||
logger.error("openConnection error", e);
|
||||
}
|
||||
|
||||
if(conn != null){
|
||||
conn.setDoInput(true);
|
||||
conn.setDoOutput(true);
|
||||
conn.setUseCaches(false);
|
||||
}
|
||||
else{
|
||||
logger.error("AgentUtil] getURLConnection Error. - " + url +" 의 HttpURLConnection 을 생성할 수 없습니다.");
|
||||
}
|
||||
|
||||
try {
|
||||
if(conn != null){
|
||||
conn.setRequestMethod("POST");
|
||||
}
|
||||
} catch (ProtocolException pe) {
|
||||
logger.error("AgentUtil] getURLConnection ", pe);
|
||||
}
|
||||
if(conn != null){
|
||||
conn.setRequestProperty("Content-type", "application/octet-stream");
|
||||
}
|
||||
return conn;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,187 @@
|
||||
package com.eactive.eai.agent.adapter;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.Vector;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import com.eactive.eai.adapter.AdapterGroupVO;
|
||||
import com.eactive.eai.adapter.AdapterManager;
|
||||
import com.eactive.eai.adapter.AdapterVO;
|
||||
import com.eactive.eai.adapter.Keys;
|
||||
import com.eactive.eai.adapter.http.dynamic.HttpDynamicInAdapterManager;
|
||||
import com.eactive.eai.adapter.http.healthcheck.HttpTargetMonitorManager;
|
||||
import com.eactive.eai.agent.command.Command;
|
||||
import com.eactive.eai.agent.command.CommandException;
|
||||
import com.eactive.eai.common.server.EAIServerManager;
|
||||
import com.eactive.eai.common.util.Logger;
|
||||
|
||||
public class ReloadAdapterGroupCommand extends Command {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private static Object obj = new Object();
|
||||
|
||||
public ReloadAdapterGroupCommand() {
|
||||
super("ReloadAdapterGroupCommand");
|
||||
}
|
||||
|
||||
/**
|
||||
* 1. 기능 : AdapterManager에 AdapterGroupVO를 제거
|
||||
* 2. 처리 개요 : AdapterGroupVO의 EAISvrInstNm이 DEFAULT_SERVER(ALL) 이거나 LocalServer인 경우
|
||||
* AdapterManager에 등록된 해당 AdapterGroupVO를 제거
|
||||
* 3. 주의사항 : 테스트용임
|
||||
*
|
||||
* @exception CommandException Argument Type이 다르거나 Command 수행중 Exception이 발생할 경우
|
||||
**/
|
||||
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);
|
||||
}
|
||||
|
||||
AdapterManager manager = AdapterManager.getInstance();
|
||||
|
||||
String adapterGroupName = (String) args;
|
||||
// Stop & Remove Adapter Group
|
||||
synchronized (obj) {
|
||||
try {
|
||||
AdapterGroupVO gvo = manager.getAdapterGroupVO(adapterGroupName);
|
||||
|
||||
if (gvo != null) {
|
||||
try {
|
||||
gvo.stop();
|
||||
if (logger.isInfo())
|
||||
logger.info("AdapterGroupVO[" + adapterGroupName + "] stop()");
|
||||
} catch (Exception e) {
|
||||
if (logger.isInfo())
|
||||
logger.info("AdapterGroupVO[" + adapterGroupName + "] not started status- skip stop()");
|
||||
// if Error continue...
|
||||
}
|
||||
|
||||
manager.removeAdapterGroupVO(adapterGroupName);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
String rspErrorCode = "RECEAIMCM002";
|
||||
String msg = makeException(rspErrorCode, e);
|
||||
if (logger.isError())
|
||||
logger.error(msg, e);
|
||||
throw new CommandException(msg);
|
||||
}
|
||||
|
||||
// Load from DB and Start
|
||||
AdapterGroupVO reloadGroupVO = null;
|
||||
try {
|
||||
reloadGroupVO = manager.loadAdapterGroup(adapterGroupName);
|
||||
} catch (Exception e) {
|
||||
String rspErrorCode = "RECEAIMCM002";
|
||||
String msg = makeException(rspErrorCode, e);
|
||||
if (logger.isError())
|
||||
logger.error(msg, e);
|
||||
throw new CommandException(msg);
|
||||
}
|
||||
|
||||
Vector<String> vt = new Vector<>();
|
||||
|
||||
String localServerName = EAIServerManager.getInstance().getLocalServerName();
|
||||
for (Iterator<AdapterVO> it = reloadGroupVO.getAdapters(); it.hasNext();) {
|
||||
AdapterVO avo = it.next();
|
||||
if (!com.eactive.eai.common.server.Keys.DEFAULT_SERVER.equals(avo.getEaiSevrInstncName())
|
||||
&& !localServerName.equals(avo.getEaiSevrInstncName())) {
|
||||
vt.add(avo.getName());
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < vt.size(); i++) {
|
||||
reloadGroupVO.removeAdapterVO(vt.get(i));
|
||||
}
|
||||
|
||||
if (reloadGroupVO != null) {
|
||||
try {
|
||||
if (logger.isWarn())
|
||||
logger.warn("ReloadAdapterGroupCommand] execute. - UsedFlag = " + reloadGroupVO.isUsedFlag());
|
||||
if (reloadGroupVO.isUsedFlag()) {
|
||||
// WCA 어댑터에서 start시 어댑터를 조회하므로 순서를 변경한다.
|
||||
manager.addAdapterGroupVO(reloadGroupVO);
|
||||
reloadGroupVO.start();
|
||||
} else {
|
||||
if (logger.isDebug())
|
||||
logger.debug("AddAdapterGroupCommand] execute. - UsedFlag = " + reloadGroupVO.isUsedFlag());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
String rspErrorCode = "RECEAIMCM002";
|
||||
String msg = makeException(rspErrorCode, e);
|
||||
if (logger.isError())
|
||||
logger.error(msg, e);
|
||||
throw new CommandException(msg);
|
||||
|
||||
}
|
||||
} else {
|
||||
if (logger.isWarn()) {
|
||||
logger.warn("ReloadAdapterGroupCommand] execute. - vo is null");
|
||||
}
|
||||
}
|
||||
|
||||
// HTTP, REST inbound Adapter PathMap reload
|
||||
try {
|
||||
reloadHttpPathMap(reloadGroupVO);
|
||||
} catch (Exception e) {
|
||||
String rspErrorCode = "RECEAIMCM002";
|
||||
String msg = makeException(rspErrorCode, e);
|
||||
if (logger.isError())
|
||||
logger.error(msg, e);
|
||||
throw new CommandException(msg);
|
||||
}
|
||||
|
||||
// HTTP, REST outbound adapter HealthCheck
|
||||
try {
|
||||
reloadHttpHealthChecker(reloadGroupVO);
|
||||
} catch (Exception e) {
|
||||
String rspErrorCode = "RECEAIMCM002";
|
||||
String msg = makeException(rspErrorCode, e);
|
||||
if (logger.isError())
|
||||
logger.error(msg, e);
|
||||
throw new CommandException(msg);
|
||||
}
|
||||
}
|
||||
|
||||
return "success";
|
||||
}
|
||||
|
||||
private void reloadHttpPathMap(AdapterGroupVO reloadGroupVO) throws Exception {
|
||||
if (reloadGroupVO != null
|
||||
&& (StringUtils.equals(reloadGroupVO.getType(), Keys.TYPE_HTTP)
|
||||
|| StringUtils.equals(reloadGroupVO.getType(), Keys.TYPE_REST))
|
||||
&& StringUtils.equals(reloadGroupVO.getGubun(), "I")) {
|
||||
HttpDynamicInAdapterManager manager = HttpDynamicInAdapterManager.getInstance();
|
||||
manager.reloadAdapterUrl(reloadGroupVO);
|
||||
}
|
||||
}
|
||||
|
||||
private void reloadHttpHealthChecker(AdapterGroupVO reloadGroupVO) {
|
||||
Logger logger = Logger.getLogger(Logger.LOGGER_DEFAULT);
|
||||
HttpTargetMonitorManager manager = HttpTargetMonitorManager.getInstance();
|
||||
if(manager == null || !manager.isStarted()) {
|
||||
logger.info("HttpTargetMonitorManager not used or not started!");
|
||||
return;
|
||||
}
|
||||
|
||||
if (reloadGroupVO != null
|
||||
&& (StringUtils.equals(reloadGroupVO.getType(), Keys.TYPE_HTTP)
|
||||
|| StringUtils.equals(reloadGroupVO.getType(), Keys.TYPE_REST))
|
||||
&& StringUtils.equals(reloadGroupVO.getGubun(), Keys.ADAPTER_OUT)) {
|
||||
manager.addAdapterGroup(reloadGroupVO);
|
||||
}
|
||||
else {
|
||||
if(logger.isInfo()) {
|
||||
String adapterGroupName = (reloadGroupVO == null ? "" : reloadGroupVO.getName());
|
||||
logger.info("Not suitable for HttpTargetMonitorManager - " + adapterGroupName );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
package com.eactive.eai.agent.adapter;
|
||||
|
||||
import com.eactive.eai.adapter.AdapterPropManager;
|
||||
import com.eactive.eai.agent.command.Command;
|
||||
import com.eactive.eai.agent.command.CommandException;
|
||||
import com.eactive.eai.common.util.Logger;
|
||||
|
||||
public class ReloadAdapterPropGroupCommand extends Command {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public ReloadAdapterPropGroupCommand() {
|
||||
super("ReloadAdapterPropGroupCommand");
|
||||
}
|
||||
|
||||
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 {
|
||||
AdapterPropManager manager = AdapterPropManager.getInstance();
|
||||
|
||||
String keyName = (String) args;
|
||||
|
||||
if (keyName != null) {
|
||||
if ("ALL".equals(keyName)) {
|
||||
manager.reload();
|
||||
if (logger.isWarn())
|
||||
logger.warn(this.name + "] all rule Reload.");
|
||||
} else {
|
||||
manager.reload(keyName);
|
||||
if (logger.isWarn())
|
||||
logger.warn(this.name + "] " + keyName + " is 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 ReloadAdapterPropGroupCommand();
|
||||
// command.setArgs("ALL");
|
||||
// AgentUtil.broadcast(command);
|
||||
// }
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
package com.eactive.eai.agent.adapter;
|
||||
|
||||
import com.eactive.eai.adapter.AdapterGroupVO;
|
||||
import com.eactive.eai.adapter.AdapterManager;
|
||||
import com.eactive.eai.adapter.http.dynamic.HttpDynamicInAdapterManager;
|
||||
import com.eactive.eai.adapter.http.healthcheck.HttpTargetMonitorManager;
|
||||
import com.eactive.eai.agent.command.Command;
|
||||
import com.eactive.eai.agent.command.CommandException;
|
||||
import com.eactive.eai.common.util.Logger;
|
||||
|
||||
public class RemoveAdapterGroupCommand extends Command {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public RemoveAdapterGroupCommand() {
|
||||
super("RemoveAdapterGroupCommand");
|
||||
}
|
||||
|
||||
/**
|
||||
* 1. 기능 : AdapterManager에 AdapterGroupVO를 제거
|
||||
* 2. 처리 개요 : AdapterGroupVO의 EAISvrInstNm이 DEFAULT_SERVER(ALL) 이거나 LocalServer인 경우
|
||||
* AdapterManager에 등록된 해당 AdapterGroupVO를 제거
|
||||
* 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);
|
||||
}
|
||||
|
||||
AdapterManager manager = AdapterManager.getInstance();
|
||||
String adapterGroupName = null;
|
||||
try {
|
||||
adapterGroupName = (String) args;
|
||||
AdapterGroupVO gvo = manager.getAdapterGroupVO(adapterGroupName);
|
||||
if (gvo != null) {
|
||||
gvo.stop();
|
||||
manager.removeAdapterGroupVO(adapterGroupName);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
String rspErrorCode = "RECEAIMCM002";
|
||||
String msg = makeException(rspErrorCode, e);
|
||||
if (logger.isError())
|
||||
logger.error(msg, e);
|
||||
throw new CommandException(msg);
|
||||
}
|
||||
|
||||
// HTTP, REST inbound Adapter PathMap remove
|
||||
try {
|
||||
HttpDynamicInAdapterManager dynamicManager = HttpDynamicInAdapterManager.getInstance();
|
||||
dynamicManager.removeAdptUriMapByAdapterGroupName(adapterGroupName);
|
||||
} catch (Exception e) {
|
||||
String rspErrorCode = "RECEAIMCM002";
|
||||
String msg = makeException(rspErrorCode, e);
|
||||
if (logger.isError())
|
||||
logger.error(msg, e);
|
||||
}
|
||||
|
||||
try {
|
||||
HttpTargetMonitorManager monitorManager = HttpTargetMonitorManager.getInstance();
|
||||
monitorManager.removeHttpHeacthCheckerWithGroupName(adapterGroupName);
|
||||
} catch (Exception e) {
|
||||
String rspErrorCode = "RECEAIMCM002";
|
||||
String msg = makeException(rspErrorCode, e);
|
||||
if (logger.isError())
|
||||
logger.error(msg, e);
|
||||
}
|
||||
|
||||
return "success";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
package com.eactive.eai.agent.adapter;
|
||||
|
||||
import com.eactive.eai.adapter.AdapterPropManager;
|
||||
import com.eactive.eai.adapter.wca.util.RuntimeUtil;
|
||||
import com.eactive.eai.agent.command.Command;
|
||||
import com.eactive.eai.agent.command.CommandException;
|
||||
import com.eactive.eai.common.util.Logger;
|
||||
|
||||
public class RemoveAdapterPropGroupCommand extends Command {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public RemoveAdapterPropGroupCommand() {
|
||||
super("RemoveAdapterPropGroupCommand");
|
||||
}
|
||||
|
||||
public Object execute() throws CommandException {
|
||||
Logger logger = Logger.getLogger(Logger.LOGGER_DEFAULT);
|
||||
String SNA_PROP_GROUP_NAME = "SNAAdapter{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 {
|
||||
AdapterPropManager manager = AdapterPropManager.getInstance();
|
||||
String key = null;
|
||||
|
||||
if (args != null) {
|
||||
key = (String) args;
|
||||
manager.removeAdapterPropGroupVO(key);
|
||||
|
||||
/**
|
||||
* SNA Adapter notifyAllSoftlink
|
||||
*/
|
||||
if (SNA_PROP_GROUP_NAME.equals(key)) {
|
||||
RuntimeUtil snaUtil = RuntimeUtil.getInstance();
|
||||
snaUtil.notifyAllSoftlink();
|
||||
}
|
||||
}
|
||||
} 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(String args[]);
|
||||
//}
|
||||
|
||||
//private static void test(String args[]) throws Exception {
|
||||
// String selectedName = null;
|
||||
//
|
||||
// if(args.length ==1)
|
||||
// selectedName = args[0];
|
||||
//
|
||||
// if(selectedName == null || selectedName.length() ==0){
|
||||
// selectedName = "ALL_TEST";
|
||||
// }
|
||||
//
|
||||
// if(selectedName != null){
|
||||
//// System.out.println("RemoveAdapterPropGroupCommand ] vo is not null.... remove start");
|
||||
//
|
||||
// Command command = new RemoveAdapterPropGroupCommand();
|
||||
// command.setArgs(selectedName);
|
||||
// AgentUtil.broadcast(command);
|
||||
// }
|
||||
//
|
||||
// }
|
||||
}
|
||||
+40
@@ -0,0 +1,40 @@
|
||||
package com.eactive.eai.agent.authoutbound;
|
||||
|
||||
import com.eactive.eai.agent.command.Command;
|
||||
import com.eactive.eai.agent.command.CommandException;
|
||||
import com.eactive.eai.common.authoutbound.AccessTokenManagerByDB;
|
||||
import com.eactive.eai.common.util.Logger;
|
||||
|
||||
public class ReloadOutboundOAuthCredentialCommand extends Command {
|
||||
private static final long serialVersionUID = 1L;
|
||||
private static Logger logger = Logger.getLogger(Logger.LOGGER_DEFAULT);
|
||||
|
||||
@Override
|
||||
public Object execute() throws CommandException {
|
||||
|
||||
if (logger.isInfo()) {
|
||||
logger.info(this.name + " is executed");
|
||||
}
|
||||
|
||||
if (!(args instanceof String)) {
|
||||
throwCommandException("RECEAIMCM001", null);
|
||||
}
|
||||
|
||||
try {
|
||||
String adapterGroupName = (String) args;
|
||||
AccessTokenManagerByDB.getInstance().refresh(adapterGroupName);
|
||||
} catch (Exception e) {
|
||||
throwCommandException("RECEAIMCM002", e);
|
||||
}
|
||||
return "success";
|
||||
}
|
||||
|
||||
private void throwCommandException(String errorCode, Exception exception) throws CommandException {
|
||||
Logger logger = Logger.getLogger(Logger.LOGGER_DEFAULT);
|
||||
String msg = makeException(errorCode, exception);
|
||||
if (logger.isError()) {
|
||||
logger.error(msg, exception);
|
||||
}
|
||||
throw new CommandException(msg);
|
||||
}
|
||||
}
|
||||
+39
@@ -0,0 +1,39 @@
|
||||
package com.eactive.eai.agent.authoutbound;
|
||||
|
||||
import com.eactive.eai.agent.command.Command;
|
||||
import com.eactive.eai.agent.command.CommandException;
|
||||
import com.eactive.eai.common.authoutbound.AccessTokenManagerByDB;
|
||||
import com.eactive.eai.common.util.Logger;
|
||||
|
||||
public class RemoveOutboundOAuthCredentialCommand extends Command {
|
||||
private static final long serialVersionUID = 1L;
|
||||
private static Logger logger = Logger.getLogger(Logger.LOGGER_DEFAULT);
|
||||
|
||||
@Override
|
||||
public Object execute() throws CommandException {
|
||||
if (logger.isInfo()) {
|
||||
logger.info(this.name + " is executed");
|
||||
}
|
||||
|
||||
if (!(args instanceof String)) {
|
||||
throwCommandException("RECEAIMCM001", null);
|
||||
}
|
||||
|
||||
try {
|
||||
String adapterGroupName = (String) args;
|
||||
AccessTokenManagerByDB.getInstance().removeAccessTokenVO(adapterGroupName);
|
||||
} catch (Exception e) {
|
||||
throwCommandException("RECEAIMCM002", e);
|
||||
}
|
||||
return "success";
|
||||
}
|
||||
|
||||
private void throwCommandException(String errorCode, Exception exception) throws CommandException {
|
||||
Logger logger = Logger.getLogger(Logger.LOGGER_DEFAULT);
|
||||
String msg = makeException(errorCode, exception);
|
||||
if (logger.isError()) {
|
||||
logger.error(msg, exception);
|
||||
}
|
||||
throw new CommandException(msg);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
package com.eactive.eai.agent.authserver;
|
||||
|
||||
import com.eactive.eai.agent.command.Command;
|
||||
import com.eactive.eai.agent.command.CommandException;
|
||||
import com.eactive.eai.authserver.service.OAuth2Manager;
|
||||
import com.eactive.eai.common.util.Logger;
|
||||
import java.util.Arrays;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
public class ReloadApiScopeCommand extends Command {
|
||||
public static final String COMMAND_TYPE_API = "API";
|
||||
public static final String COMMAND_TYPE_SCOPE = "SCOPE";
|
||||
public static final String COMMAND_TYPE_API_SCOPE = "API-SCOPE";
|
||||
|
||||
public ReloadApiScopeCommand() {
|
||||
super("ReloadApiScopeCommand");
|
||||
}
|
||||
|
||||
/**
|
||||
* args[0]: type(API, SCOPE, API-SCOPE)<br>
|
||||
* args[1]: apiId<br>
|
||||
* args[2]: scopeId
|
||||
*/
|
||||
@Override
|
||||
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 {
|
||||
OAuth2Manager manager = OAuth2Manager.getInstance();
|
||||
|
||||
String[] keyName = (String[]) args;
|
||||
|
||||
if (keyName != null) {
|
||||
manager.reloadApiScopeRelation(keyName);
|
||||
if (logger.isWarn()) {
|
||||
logger.warn(this.name + "] " + Arrays.toString(keyName) + " 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";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package com.eactive.eai.agent.authserver;
|
||||
|
||||
import com.eactive.eai.agent.command.Command;
|
||||
import com.eactive.eai.agent.command.CommandException;
|
||||
import com.eactive.eai.authserver.service.OAuth2Manager;
|
||||
import com.eactive.eai.common.util.Logger;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
public class ReloadClientCommand extends Command {
|
||||
|
||||
public ReloadClientCommand() {
|
||||
super("ReloadClientCommand");
|
||||
}
|
||||
|
||||
@Override
|
||||
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 {
|
||||
OAuth2Manager manager = OAuth2Manager.getInstance();
|
||||
|
||||
String keyName = (String) args;
|
||||
|
||||
if (keyName != null) {
|
||||
manager.reloadClient(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);
|
||||
throw new CommandException(msg);
|
||||
}
|
||||
return "success";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
package com.eactive.eai.agent.b2badaptermapping;
|
||||
|
||||
import com.eactive.eai.agent.command.Command;
|
||||
import com.eactive.eai.agent.command.CommandException;
|
||||
import com.eactive.eai.common.b2badaptermapping.B2BAdapterMapManager;
|
||||
import com.eactive.eai.common.util.Logger;
|
||||
|
||||
public class ReloadB2BAdapterMapCommand extends Command {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public ReloadB2BAdapterMapCommand() {
|
||||
super("ReloadB2BAdapterMapCommand");
|
||||
}
|
||||
|
||||
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 {
|
||||
B2BAdapterMapManager manager = B2BAdapterMapManager.getInstance();
|
||||
String keyName = (String) args;
|
||||
|
||||
if ("ALL".equals(keyName)) {
|
||||
manager.reload();
|
||||
logger.warn(this.name + ": all rule Reload.");
|
||||
} else {
|
||||
manager.reload(keyName);
|
||||
logger.warn(this.name + ": " + keyName + " 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";
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package com.eactive.eai.agent.b2badaptermapping;
|
||||
|
||||
import com.eactive.eai.agent.command.Command;
|
||||
import com.eactive.eai.agent.command.CommandException;
|
||||
import com.eactive.eai.common.b2badaptermapping.B2BAdapterMapManager;
|
||||
import com.eactive.eai.common.util.Logger;
|
||||
|
||||
public class RemoveB2BAdapterMapCommand extends Command {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public RemoveB2BAdapterMapCommand() {
|
||||
super("RemoveB2BAdapterMapCommand");
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
B2BAdapterMapManager manager = B2BAdapterMapManager.getInstance();
|
||||
try {
|
||||
String keyName = (String) args;
|
||||
manager.remove(keyName);
|
||||
} 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,52 @@
|
||||
package com.eactive.eai.agent.b2bextractor;
|
||||
|
||||
import com.eactive.eai.agent.command.Command;
|
||||
import com.eactive.eai.agent.command.CommandException;
|
||||
import com.eactive.eai.common.b2bextractor.B2BExtractManager;
|
||||
import com.eactive.eai.common.util.Logger;
|
||||
|
||||
public class ReloadB2BExtractCommand extends Command {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public ReloadB2BExtractCommand() {
|
||||
super("ReloadB2BExtractCommand");
|
||||
}
|
||||
|
||||
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 {
|
||||
B2BExtractManager manager = B2BExtractManager.getInstance();
|
||||
String keyName = (String) args;
|
||||
|
||||
if ("ALL".equals(keyName)) {
|
||||
manager.reload();
|
||||
if (logger.isWarn())
|
||||
logger.warn(this.name + "] all rule 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);
|
||||
throw new CommandException(msg);
|
||||
}
|
||||
return "success";
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
package com.eactive.eai.agent.b2bextractor;
|
||||
|
||||
import java.util.Vector;
|
||||
|
||||
import com.eactive.eai.agent.command.Command;
|
||||
import com.eactive.eai.agent.command.CommandException;
|
||||
import com.eactive.eai.common.b2bextractor.B2BExtractManager;
|
||||
import com.eactive.eai.common.util.Logger;
|
||||
|
||||
/**
|
||||
* 라우팅필드 추출 서비스리스트 메모리 동기화 Command - 오픈뱅킹 EAIServiceLoader_312에서 사용
|
||||
*
|
||||
* @author openbanking
|
||||
* @since 2019.08
|
||||
*/
|
||||
public class ReloadB2BExtractListCommand extends Command {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
private static final Logger logger = Logger.getLogger(Logger.LOGGER_DEFAULT);
|
||||
|
||||
public ReloadB2BExtractListCommand() {
|
||||
super("ReloadB2BExtractListCommand");
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object execute() throws CommandException {
|
||||
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);
|
||||
}
|
||||
|
||||
B2BExtractManager manager = B2BExtractManager.getInstance();
|
||||
try {
|
||||
Vector keyNameVt = (Vector) args;
|
||||
String keyName = "";
|
||||
for (int i = 0; i < keyNameVt.size(); i++) {
|
||||
keyName = (String) keyNameVt.get(i);
|
||||
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);
|
||||
throw new CommandException(msg);
|
||||
}
|
||||
|
||||
return "success";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
package com.eactive.eai.agent.b2bextractor;
|
||||
|
||||
import com.eactive.eai.agent.command.Command;
|
||||
import com.eactive.eai.agent.command.CommandException;
|
||||
import com.eactive.eai.common.b2bextractor.B2BExtractManager;
|
||||
import com.eactive.eai.common.util.Logger;
|
||||
|
||||
public class RemoveB2BExtractCommand extends Command {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public RemoveB2BExtractCommand() {
|
||||
super("RemoveB2BExtractCommand");
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
String key = null;
|
||||
B2BExtractManager manager = B2BExtractManager.getInstance();
|
||||
try {
|
||||
key = (String) args;
|
||||
manager.removeB2BExtract(key);
|
||||
|
||||
} 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,57 @@
|
||||
package com.eactive.eai.agent.b2bservice;
|
||||
|
||||
import com.eactive.eai.agent.command.Command;
|
||||
import com.eactive.eai.agent.command.CommandException;
|
||||
import com.eactive.eai.common.b2bservice.B2BServiceManager;
|
||||
import com.eactive.eai.common.util.Logger;
|
||||
|
||||
public class ReloadB2BServiceCommand extends Command {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
private static final Logger logger = Logger.getLogger(Logger.LOGGER_DEFAULT);
|
||||
|
||||
public ReloadB2BServiceCommand() {
|
||||
super("ReloadB2BServiceCommand");
|
||||
}
|
||||
|
||||
public Object execute() throws CommandException {
|
||||
|
||||
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 {
|
||||
B2BServiceManager manager = B2BServiceManager.getInstance();
|
||||
String keyName = (String) args;
|
||||
|
||||
if (keyName != null) {
|
||||
if ("ALL".equals(keyName)) {
|
||||
manager.reload();
|
||||
if (logger.isWarn())
|
||||
logger.warn(this.name + "] all rule 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);
|
||||
throw new CommandException(msg);
|
||||
}
|
||||
return "success";
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
package com.eactive.eai.agent.b2bservice;
|
||||
|
||||
import java.util.Vector;
|
||||
|
||||
import com.eactive.eai.agent.command.Command;
|
||||
import com.eactive.eai.agent.command.CommandException;
|
||||
import com.eactive.eai.common.b2bservice.B2BServiceManager;
|
||||
import com.eactive.eai.common.util.Logger;
|
||||
|
||||
public class ReloadB2BServiceListCommand extends Command {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public ReloadB2BServiceListCommand() {
|
||||
super("ReloadB2BServiceListCommand");
|
||||
}
|
||||
|
||||
@Override
|
||||
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);
|
||||
}
|
||||
|
||||
B2BServiceManager manager = B2BServiceManager.getInstance();
|
||||
try {
|
||||
Vector keyNameVt = (Vector) args;
|
||||
String keyName = "";
|
||||
for (int i = 0; i < keyNameVt.size(); i++) {
|
||||
keyName = (String) keyNameVt.get(i);
|
||||
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);
|
||||
throw new CommandException(msg);
|
||||
}
|
||||
|
||||
return "success";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
package com.eactive.eai.agent.b2bservice;
|
||||
|
||||
import com.eactive.eai.agent.command.Command;
|
||||
import com.eactive.eai.agent.command.CommandException;
|
||||
import com.eactive.eai.common.b2bservice.B2BServiceManager;
|
||||
import com.eactive.eai.common.util.Logger;
|
||||
|
||||
public class RemoveB2BServiceCommand extends Command {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public RemoveB2BServiceCommand() {
|
||||
super("RemoveB2BServiceCommand");
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
String key = null;
|
||||
B2BServiceManager manager = B2BServiceManager.getInstance();
|
||||
|
||||
try {
|
||||
key = (String) args;
|
||||
if (key != null) {
|
||||
manager.removeB2BServiceVO(key);
|
||||
}
|
||||
} 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,63 @@
|
||||
package com.eactive.eai.agent.bizkey;
|
||||
|
||||
import com.eactive.eai.agent.command.Command;
|
||||
import com.eactive.eai.agent.command.CommandException;
|
||||
import com.eactive.eai.common.bizkey.BizKeyManager;
|
||||
import com.eactive.eai.common.util.Logger;
|
||||
|
||||
public class ReloadBizKeyCommand extends Command {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public ReloadBizKeyCommand() {
|
||||
super("ReloadBizKeyCommand");
|
||||
}
|
||||
|
||||
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 {
|
||||
BizKeyManager manager = BizKeyManager.getInstance();
|
||||
|
||||
String keyName = (String) args;
|
||||
|
||||
if (keyName != null) {
|
||||
if ("ALL".equals(keyName)) {
|
||||
manager.reload();
|
||||
if (logger.isWarn())
|
||||
logger.warn(this.name + "] all rule Reload.");
|
||||
} else {
|
||||
String[] keys = keyName.split(",");
|
||||
manager.reload(keys[0], keys[1]);
|
||||
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);
|
||||
throw new CommandException(msg);
|
||||
}
|
||||
return "success";
|
||||
|
||||
}
|
||||
|
||||
// public static void main(String[] args)throws Exception{
|
||||
// Command command = new ReloadBizKeyCommand();
|
||||
// command.setArgs("ALL");
|
||||
// AgentUtil.broadcast(command);
|
||||
//
|
||||
// }
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
package com.eactive.eai.agent.bizkey;
|
||||
|
||||
import java.util.Vector;
|
||||
|
||||
import com.eactive.eai.agent.command.Command;
|
||||
import com.eactive.eai.agent.command.CommandException;
|
||||
import com.eactive.eai.common.bizkey.BizKeyManager;
|
||||
import com.eactive.eai.common.util.Logger;
|
||||
|
||||
/**
|
||||
* 업무필드 추출 서비스리스트 메모리 동기화 Command
|
||||
* - 오픈뱅킹 EAIServiceLoader_312에서 사용
|
||||
*
|
||||
* @author openbanking
|
||||
* @since 2019.08
|
||||
*/
|
||||
public class ReloadBizKeyListCommand extends Command {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public ReloadBizKeyListCommand() {
|
||||
super("ReloadBizKeyListCommand");
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
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);
|
||||
}
|
||||
|
||||
BizKeyManager manager = BizKeyManager.getInstance();
|
||||
try {
|
||||
Vector keyNameVt = (Vector)args;
|
||||
String keyName ="";
|
||||
for(int i=0; i<keyNameVt.size(); i++) {
|
||||
keyName = (String)keyNameVt.get(i);
|
||||
// BizKeyManager를 변경하지 않고 exrClsNm = {TR, AK} 정의 호출
|
||||
manager.reload(keyName, "TR");
|
||||
manager.reload(keyName, "AK");
|
||||
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);
|
||||
throw new CommandException(msg);
|
||||
}
|
||||
|
||||
return "success";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
package com.eactive.eai.agent.bizkey;
|
||||
|
||||
import com.eactive.eai.agent.command.Command;
|
||||
import com.eactive.eai.agent.command.CommandException;
|
||||
import com.eactive.eai.common.bizkey.BizKeyManager;
|
||||
import com.eactive.eai.common.util.Logger;
|
||||
|
||||
public class RemoveBizKeyCommand extends Command {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public RemoveBizKeyCommand() {
|
||||
super("RemoveBizKeyCommand");
|
||||
}
|
||||
|
||||
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 {
|
||||
BizKeyManager manager = BizKeyManager.getInstance();
|
||||
String keyName = (String) args;
|
||||
if (keyName != null) {
|
||||
String[] keys = keyName.split(",");
|
||||
manager.removeBizKey(keys[0] + keys[1]);
|
||||
}
|
||||
|
||||
} 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,56 @@
|
||||
package com.eactive.eai.agent.businessday;
|
||||
|
||||
import com.eactive.eai.agent.command.Command;
|
||||
import com.eactive.eai.agent.command.CommandException;
|
||||
import com.eactive.eai.common.util.Logger;
|
||||
import com.kbstar.eai.common.businessday.BusinessDayManager;
|
||||
import com.kbstar.eai.common.businessday.BusinessDayVO;
|
||||
|
||||
public class AddBusinessDayCommand extends Command {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public AddBusinessDayCommand(String name) {
|
||||
super(name);
|
||||
}
|
||||
|
||||
public AddBusinessDayCommand() {
|
||||
super("AddBusinessDayCommand");
|
||||
}
|
||||
|
||||
public Object execute() throws CommandException {
|
||||
|
||||
Logger logger = Logger.getLogger(Logger.LOGGER_DEFAULT);
|
||||
if (logger.isInfo())
|
||||
logger.info(this.name + " is executed");
|
||||
|
||||
if (!(args instanceof BusinessDayVO)) {
|
||||
String rspErrorCode = "RECEAIMIM001";
|
||||
String msg = makeException(rspErrorCode, null);
|
||||
if (logger.isError())
|
||||
logger.error(msg);
|
||||
throw new CommandException(msg);
|
||||
}
|
||||
|
||||
BusinessDayVO vo = (BusinessDayVO) args;
|
||||
|
||||
try {
|
||||
BusinessDayManager manager = BusinessDayManager.getInstance();
|
||||
manager.setMessage(vo);
|
||||
} catch (Exception e) {
|
||||
String rspErrorCode = "RECEAIMIM002";
|
||||
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
|
||||
// {
|
||||
// BusinessDayVO vo = new BusinessDayVO(args[0]);
|
||||
// Command command = new AddBusinessDayCommand("AddBusinessDayCommand");
|
||||
// command.setArgs(vo);
|
||||
// AgentUtil.broadcast(command);
|
||||
// }
|
||||
}
|
||||
@@ -0,0 +1,334 @@
|
||||
//package com.eactive.eai.agent.businessday;
|
||||
//
|
||||
//import java.util.HashMap;
|
||||
//import java.util.Iterator;
|
||||
//import java.util.Properties;
|
||||
//
|
||||
//import com.eactive.eai.adapter.AdapterGroupVO;
|
||||
//import com.eactive.eai.adapter.AdapterManager;
|
||||
//import com.eactive.eai.adapter.AdapterPropManager;
|
||||
//import com.eactive.eai.adapter.AdapterVO;
|
||||
//import com.eactive.eai.adapter.ElinkAdapter;
|
||||
//import com.eactive.eai.adapter.ElinkAdapterFactory;
|
||||
//import com.eactive.eai.agent.AgentUtil;
|
||||
//import com.eactive.eai.agent.command.Command;
|
||||
//import com.eactive.eai.agent.command.CommandException;
|
||||
//import com.eactive.eai.common.dao.DAOFactory;
|
||||
//import com.eactive.eai.common.util.DatetimeUtil;
|
||||
//import com.eactive.eai.common.util.Logger;
|
||||
//import com.eactive.eai.common.util.UUIDGenerator;
|
||||
//import com.ext.eai.common.stdmessage.STDMessage;
|
||||
//import com.ext.eai.common.stdmessage.STDMessageManager;
|
||||
//import com.ext.eai.common.stdmessage.parser.STDMessageParser;
|
||||
//import com.ext.eai.common.stdmessage.parser.STDMessageParserFactory;
|
||||
//import com.kbstar.eai.common.businessday.BusinessDayDAO;
|
||||
//import com.kbstar.eai.common.businessday.EventSystemInfoVO;
|
||||
//
|
||||
///**
|
||||
//* 1. 기능 : 일자전환 통지 이벤트 Command
|
||||
//* 2. 처리 개요 : EAI의 영업일자를 변경
|
||||
//* 3. 주의사항
|
||||
//*
|
||||
//* @author
|
||||
//* @version v 1.0.0
|
||||
//* @see 관련 기능을 참조
|
||||
//* @since
|
||||
//*
|
||||
//*/
|
||||
//public class CDEventCommand extends Command
|
||||
//{
|
||||
// /**
|
||||
// *
|
||||
// */
|
||||
// private static final long serialVersionUID = 1L;
|
||||
// /**
|
||||
// * 1. 기능 : UpdateBusinessDayCommand 생성자
|
||||
// * 2. 처리 개요 :
|
||||
// * 3. 주의사항
|
||||
// *
|
||||
// **/
|
||||
// public CDEventCommand(String name) {
|
||||
// super(name);
|
||||
// }
|
||||
//
|
||||
// public CDEventCommand() {
|
||||
// super("CDEventCommand");
|
||||
// }
|
||||
// /**
|
||||
// * 1. 기능 : 일자전환 통지 이벤트 Command
|
||||
// * 2. 처리 개요 : EAI의 영업일자 변경이벤트를 전송
|
||||
// * 3. 주의사항
|
||||
// *
|
||||
// * @exception CommandException Argument Type이 다르거나 Command 수행중 Excpetion이 발생할 경우
|
||||
// **/
|
||||
// public Object execute() throws CommandException
|
||||
// {
|
||||
// Logger logger = Logger.getLogger(Logger.LOGGER_DEFAULT);
|
||||
// if (logger.isWarn()) logger.warn(this.name + " is executed");
|
||||
//
|
||||
// if( !(args instanceof String) ) {
|
||||
// String rspErrorCode = "RECEAIMIM001";
|
||||
// String msg = makeException(rspErrorCode, null);
|
||||
// if (logger.isError()) logger.error(msg);
|
||||
// throw new CommandException(msg);
|
||||
// }
|
||||
//
|
||||
// String orgMessage = (String) args;
|
||||
// String reqMessage = "";
|
||||
// String resMessage = null;
|
||||
// try{
|
||||
// String eventSystem = "";
|
||||
// // 테이블에서 이벤트 정보를 조회하여
|
||||
// // 이벤트 전문을 발생하고 결과를 이벤트로그에 저장한다.
|
||||
//
|
||||
// // 1. Event Query
|
||||
// DAOFactory factory = DAOFactory.newInstance();
|
||||
// BusinessDayDAO dao = null;
|
||||
// dao = (BusinessDayDAO)factory.create(BusinessDayDAO.class);
|
||||
// HashMap eventInfo = dao.getEventSystemInfo();
|
||||
// // 2. Event Send Loop
|
||||
// Iterator it = eventInfo.keySet().iterator();
|
||||
// EventSystemInfoVO vo = null;
|
||||
//
|
||||
// String sendDateTime = "";
|
||||
// String recvDateTime = "";
|
||||
//
|
||||
// byte[] resBytes = null;
|
||||
//
|
||||
// String eventStatus = "C";
|
||||
//
|
||||
// if(orgMessage.startsWith("prepare")) {
|
||||
// eventStatus = "P";
|
||||
// }
|
||||
//
|
||||
// String result = "0";
|
||||
//
|
||||
// for(int i=0;it.hasNext();i++) {
|
||||
// eventSystem = (String)it.next();
|
||||
// vo = (EventSystemInfoVO)eventInfo.get(eventSystem);
|
||||
//
|
||||
// if( eventStatus.equals("P") && "1".equals(vo.getEAIEvntPrcssDstcd()) ) {
|
||||
// continue;
|
||||
// }
|
||||
//
|
||||
// if (logger.isWarn()) logger.warn(this.name + "] 이벤트 송신 - "+ eventSystem);
|
||||
// sendDateTime = DatetimeUtil.getCurrentDateTime(); // getCurrentTimeMillis
|
||||
// //--------------------------------------------------------------------
|
||||
// // Send Event Message to Target System
|
||||
// AdapterGroupVO adptGrpVO = null;
|
||||
//
|
||||
// try {
|
||||
// AdapterManager adapterManager = AdapterManager.getInstance();
|
||||
// adptGrpVO = adapterManager.getAdapterGroupVO(vo.getAdptrBzwkGroupName());
|
||||
// AdapterVO adptVO = adptGrpVO.nextAdapterVO();
|
||||
// //PropManager manager = PropManager.getInstance();
|
||||
// AdapterPropManager manager = AdapterPropManager.getInstance();
|
||||
//
|
||||
// if(adptVO == null) throw new Exception("Adapter not found - " + vo.getAdptrBzwkGroupName());
|
||||
//
|
||||
// Properties adapterProp = manager.getProperties(adptVO.getPropGroupName());
|
||||
//
|
||||
// if(adapterProp == null) throw new Exception("AdapterProperty not found - " + adptVO.getPropGroupName());
|
||||
// String adptrMsgPtrnCd = adptGrpVO.getAdptrMsgPtrnCd();
|
||||
// String adptrMsgType = adptGrpVO.getMessageType();
|
||||
//
|
||||
// if (logger.isWarn()) {
|
||||
// logger.warn(this.name + "] 이벤트 송신 Adapter ["+ vo.getAdptrBzwkGroupName()+"] adptrMsgPtrnCd["+adptrMsgPtrnCd+"] TYPE["+adptGrpVO.getType()+"]");
|
||||
// }
|
||||
//
|
||||
// if("K".equals(adptrMsgPtrnCd) && "XML".equals(adptrMsgType)) {
|
||||
// STDMessageManager kbheaderManager = STDMessageManager.getInstance();
|
||||
// STDMessage kbmsg = kbheaderManager.getSTDMessage(vo.getEvntRecvSysName());
|
||||
// if(kbmsg == null) {
|
||||
// logger.error(this.name + "] KB표준메시지미등록 - 키 : 이벤트수신시스템명 ["+ vo.getEvntRecvSysName()+"] ");
|
||||
//
|
||||
// recvDateTime = DatetimeUtil.getCurrentDateTime(); // getCurrentTimeMillis
|
||||
// dao.addEventLog(vo.getEvntRecvSysName(), eventStatus, sendDateTime, recvDateTime, "0");
|
||||
//
|
||||
// continue;
|
||||
// }
|
||||
// kbmsg = setKBMessageDefaultValue(kbmsg);
|
||||
// reqMessage = "<InData Req=\""+orgMessage.substring(0,7)+"\" Date=\""+orgMessage.substring(7,15)+"\"/>";
|
||||
// reqMessage = kbmsg.toXMLString(reqMessage);
|
||||
// }
|
||||
// else {
|
||||
// reqMessage = orgMessage;
|
||||
// }
|
||||
//
|
||||
// if (logger.isWarn()) {
|
||||
// logger.warn(this.name + "] Event Message ["+reqMessage+"]");
|
||||
// }
|
||||
//
|
||||
// ElinkAdapter adapter = null;
|
||||
// adapter = ElinkAdapterFactory.newInstance().getElinkAdapter(adptGrpVO.getType());
|
||||
// resBytes = (byte[])adapter.callService(vo.getAdptrBzwkGroupName(), adapterProp, reqMessage.getBytes());
|
||||
// if (logger.isWarn()) {
|
||||
// if(resBytes != null) {
|
||||
// resMessage = new String(resBytes);
|
||||
// logger.warn(this.name + "] 응답메시지 ["+resMessage+"]");
|
||||
//
|
||||
// if("K".equals(adptrMsgPtrnCd) && "XML".equals(adptrMsgType)) {
|
||||
// //KBMessage resKbmsg = KBMessageUtil.convert(resMessage);
|
||||
// STDMessageParser parser = STDMessageParserFactory.createPaserFactory(adptrMsgType);
|
||||
// if(parser == null) throw new Exception("KBMessageParser not found - " + adptrMsgType);
|
||||
// STDMessage resKbmsg = parser.convert(resMessage);
|
||||
//
|
||||
// String errCd = resKbmsg.getKBCommon().getErrcd();
|
||||
//
|
||||
// if(errCd == null || errCd.trim().length() == 0) {
|
||||
// result = "1";
|
||||
// }
|
||||
// else {
|
||||
// result = "0";
|
||||
// }
|
||||
// logger.warn(this.name + "] " + vo.getEvntRecvSysName() + " 응답메시지 KB표준 에러코드 ["+errCd+"]");
|
||||
// }
|
||||
// else {
|
||||
// if(resMessage.startsWith("succeeded")) {
|
||||
// result = "1";
|
||||
// }
|
||||
// else {
|
||||
// result = "0";
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// else {
|
||||
// logger.warn(this.name + "] 응답메시지 NULL");
|
||||
// result = "0";
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// } catch(Exception e) {
|
||||
// if (logger.isError()) {
|
||||
// logger.warn(this.name + "] 이벤트 송신어댑터("+vo.getAdptrBzwkGroupName()+")가 정상이 아닙니다. ", e);
|
||||
// }
|
||||
// result = "0";
|
||||
// }
|
||||
// //--------------------------------------------------------------------
|
||||
//
|
||||
// // 3. Event Result Logging
|
||||
// recvDateTime = DatetimeUtil.getCurrentDateTime(); // getCurrentTimeMillis
|
||||
// dao.addEventLog(vo.getEvntRecvSysName(), eventStatus, sendDateTime, recvDateTime, result);
|
||||
// }
|
||||
// if (logger.isWarn()) logger.warn(this.name + " Finished");
|
||||
//
|
||||
// } catch (Exception e){
|
||||
// String rspErrorCode = "RECEAIMIM002";
|
||||
// String msg = makeException(rspErrorCode, e);
|
||||
// if (logger.isError()) logger.error(msg, e);
|
||||
// throw new CommandException(msg);
|
||||
// }
|
||||
// return "success";
|
||||
// }
|
||||
//
|
||||
// private STDMessage setKBMessageDefaultValue(STDMessage kbmessage) {
|
||||
//
|
||||
// String currDate = DatetimeUtil.getCurrentDate();
|
||||
//
|
||||
// kbmessage.getKBHeader().setTranBaseYmd(currDate);
|
||||
//
|
||||
// String guid = UUIDGenerator.getGUID(kbmessage.getKBCommon().getGroupCoCd());
|
||||
// kbmessage.getKBHeader().setGuIdNo(guid);
|
||||
// // 전문형식 - DEFAULT(1)
|
||||
// kbmessage.getKBHeader().setTelgmFmatDstcd("1");
|
||||
//
|
||||
// // 거래유형구분 - DEFAULT(1)
|
||||
// kbmessage.getKBCommon().setTranPtrnDstcd("1");
|
||||
// // 리바운드 거래여부 - DEFAULT(0)
|
||||
// kbmessage.getKBCommon().setRbndTranYn("0");
|
||||
//
|
||||
// // 은행코드 - 004
|
||||
// kbmessage.getKBCommon().setBnkCd("004");
|
||||
// // 거래부점코드 - 1706
|
||||
// kbmessage.getKBCommon().setTranBrncd ("1706");
|
||||
//
|
||||
// // 중계채널구분코드 - 02 (EAI)
|
||||
// kbmessage.getKBCommon().setRelayChnlDstcd("02");
|
||||
//
|
||||
// // 채널구분코드
|
||||
// String chnlDstcd = kbmessage.getKBCommon().getChnlDstcd();
|
||||
// if(chnlDstcd == null || chnlDstcd.trim().length() == 0) {
|
||||
// kbmessage.getKBCommon().setChnlDstcd ("06");
|
||||
// }
|
||||
//
|
||||
// // 채널세부업무구분코드
|
||||
// String chnlDBzwkDstcd = kbmessage.getKBCommon().getChnlDBzwkDstcd();
|
||||
// if(chnlDBzwkDstcd == null || chnlDBzwkDstcd.trim().length() == 0) {
|
||||
// kbmessage.getKBCommon().setChnlDBzwkDstcd ("00");
|
||||
// }
|
||||
//
|
||||
// // 매체구분코드
|
||||
// String mdiaDstcd = kbmessage.getKBCommon().getMdiaDstcd();
|
||||
// if(mdiaDstcd == null || mdiaDstcd.trim().length() == 0) {
|
||||
// kbmessage.getKBCommon().setMdiaDstcd ("00");
|
||||
// }
|
||||
// //---------------------------------------
|
||||
//
|
||||
// // 언어구분코드 - KOR : 2008.07.16
|
||||
// kbmessage.getKBCommon().setLangDstcd ("KOR");
|
||||
// // 단말번호 - 000
|
||||
// kbmessage.getKBCommon().setTrmno ("000");
|
||||
// // 사용자직원번호 - 0000000
|
||||
// kbmessage.getKBCommon().setUserEmpid ("0000000");
|
||||
//
|
||||
// //---------------------------------------------------
|
||||
// // KB메시지 입력메시지정보 Default
|
||||
// //---------------------------------------------------
|
||||
// // 입력메시지유형구분코드 - DEFAULT(11)
|
||||
// kbmessage.getKBCommon().setInptMsgPtrnDstcd("11");
|
||||
//
|
||||
// // 2009.01.05 한진호대리 요청사항
|
||||
// kbmessage.getKBCommon().setInptMsgSerno("000"); // (3 ) 입력메시지일련번호
|
||||
//
|
||||
// // 입력메시지 작성일시 (20)- 전문작성일시
|
||||
// kbmessage.getKBCommon().setInptMsgWritYms(DatetimeUtil.getCurrentTime()+"000");
|
||||
//
|
||||
// //---------------------------------------------------
|
||||
// // KB메시지 승인정보 Default
|
||||
// // 2008.05.21 강길수차장 요청
|
||||
// //---------------------------------------------------
|
||||
// // 승인완료구분코드 - 0
|
||||
// kbmessage.getKBCommon().setAthorFnshDstcd ("0");
|
||||
// // 책임자승인구분코드 - 0
|
||||
// kbmessage.getKBCommon().setSpvsrAthorDstcd ("0");
|
||||
// //---------------------------------------------------
|
||||
//
|
||||
// //---------------------------------------------------
|
||||
// // KB메시지 전행업무공통부 Default
|
||||
// // 2008.07.10 강길수차장 요청
|
||||
// //---------------------------------------------------
|
||||
// // (8 ) 기산년월일
|
||||
// kbmessage.getKBCommon().setIdtrek("00000000");
|
||||
// //(3 ) SOD영업점유형
|
||||
// kbmessage.getKBCommon().setSodBbrnPtrnDstcd("000") ;
|
||||
// //(2 ) SOD사용자유형
|
||||
// kbmessage.getKBCommon().setSodUserPtrnDstcd("00");
|
||||
// //(1 ) 입출가능여부
|
||||
// kbmessage.getKBCommon().setInotAbilYn("0");
|
||||
//
|
||||
// // (1 ) 무자원대체가능사용자여부 : 2008.07.16
|
||||
// kbmessage.getKBCommon().setNoRtaUserYn("0");
|
||||
//
|
||||
// // (1 ) 거래중단요청여부 : 2008.07.16
|
||||
// kbmessage.getKBCommon().setTranDscnDmndYn("0");
|
||||
//
|
||||
// // (1) 취소유형코드 : 2008.07.16
|
||||
// kbmessage.getKBCommon().setCnclPtrnDstcd("0");
|
||||
//
|
||||
// // (1 ) 개별데이터편집여부 : 2008.07.16
|
||||
// kbmessage.getKBCommon().setIdiviDataEdtYn("1");
|
||||
// return kbmessage;
|
||||
//
|
||||
// }
|
||||
//
|
||||
//// public static void main(String args[]) throws Exception {
|
||||
//// test();
|
||||
////}
|
||||
//
|
||||
//// private static void test() throws Exception {
|
||||
//// String date = "prepare20090708";
|
||||
//// Command command = new CDEventCommand("ChangeDateCommand");
|
||||
//// command.setArgs(date);
|
||||
//// AgentUtil.broadcast(command);
|
||||
//// }
|
||||
//}
|
||||
@@ -0,0 +1,72 @@
|
||||
//package com.eactive.eai.agent.businessday;
|
||||
//
|
||||
//import com.eactive.eai.agent.AgentUtil;
|
||||
//import com.eactive.eai.agent.command.Command;
|
||||
//import com.eactive.eai.agent.command.CommandException;
|
||||
//import com.eactive.eai.common.property.PropManager;
|
||||
//import com.eactive.eai.common.util.Logger;
|
||||
//import com.kbstar.eai.common.businessday.BusinessDayManager;
|
||||
//import com.kbstar.eai.common.businessday.BusinessDayVO;
|
||||
//
|
||||
///**
|
||||
//* 1. 기능 : 일자전환 통지 Command
|
||||
//* 2. 처리 개요 : EAI의 영업이랒를 변경
|
||||
//* 3. 주의사항
|
||||
//*
|
||||
//* @author
|
||||
//* @version v 1.0.0
|
||||
//* @see 관련 기능을 참조
|
||||
//* @since
|
||||
//*
|
||||
//*/
|
||||
//public class CDFinishCommand extends Command
|
||||
//{
|
||||
// /**
|
||||
// *
|
||||
// */
|
||||
// private static final long serialVersionUID = 1L;
|
||||
//
|
||||
// /**
|
||||
// * 1. 기능 : CDPrepareCommand 생성자
|
||||
// * 2. 처리 개요 :
|
||||
// * 3. 주의사항
|
||||
// *
|
||||
// **/
|
||||
// public CDFinishCommand(String name) {
|
||||
// super(name);
|
||||
// }
|
||||
//
|
||||
// public CDFinishCommand() {
|
||||
// super("CDFinishCommand");
|
||||
// }
|
||||
// /**
|
||||
// * 1. 기능 : 일자전환 통지 Command
|
||||
// * 2. 처리 개요 : EAI의 일자전환상태를 Prepare로 변경
|
||||
// * 3. 주의사항
|
||||
// *
|
||||
// * @exception CommandException Argument Type이 다르거나 Command 수행중 Excpetion이 발생할 경우
|
||||
// **/
|
||||
// public Object execute() throws CommandException
|
||||
// {
|
||||
// Logger logger = Logger.getLogger(Logger.LOGGER_DEFAULT);
|
||||
// if (logger.isWarn()) logger.warn(this.name + " is executed");
|
||||
//
|
||||
// try{
|
||||
// PropManager pMan = PropManager.getInstance();
|
||||
// pMan.setProperty("BUSINESS_DAY_CHANGE", "CHANGE_STATUS", "F");
|
||||
// if (logger.isWarn()) logger.warn(this.name + "] 일자전환 : 일자변환상태[Finish]가 종료로 변경되었습니다.");
|
||||
// }catch (Exception e){
|
||||
// String rspErrorCode = "RECEAIMIM002";
|
||||
// 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
|
||||
//// {
|
||||
//// Command command = new CDFinishCommand("CDPrepareCommand");
|
||||
//// AgentUtil.broadcast(command);
|
||||
//// }
|
||||
//}
|
||||
@@ -0,0 +1,75 @@
|
||||
//package com.eactive.eai.agent.businessday;
|
||||
//
|
||||
//import com.eactive.eai.agent.AgentUtil;
|
||||
//import com.eactive.eai.agent.command.Command;
|
||||
//import com.eactive.eai.agent.command.CommandException;
|
||||
//import com.eactive.eai.common.property.PropManager;
|
||||
//import com.eactive.eai.common.util.Logger;
|
||||
//import com.kbstar.eai.common.businessday.BusinessDayManager;
|
||||
//import com.kbstar.eai.common.businessday.BusinessDayVO;
|
||||
//
|
||||
///**
|
||||
//* 1. 기능 : 일자전환 통지 Command
|
||||
//* 2. 처리 개요 : EAI의 영업이랒를 변경
|
||||
//* 3. 주의사항
|
||||
//*
|
||||
//* @author
|
||||
//* @version v 1.0.0
|
||||
//* @see 관련 기능을 참조
|
||||
//* @since
|
||||
//*
|
||||
//*/
|
||||
//public class CDPrepareCommand extends Command
|
||||
//{
|
||||
// /**
|
||||
// *
|
||||
// */
|
||||
// private static final long serialVersionUID = 1L;
|
||||
//
|
||||
// /**
|
||||
// * 1. 기능 : CDPrepareCommand 생성자
|
||||
// * 2. 처리 개요 :
|
||||
// * 3. 주의사항
|
||||
// *
|
||||
// **/
|
||||
// public CDPrepareCommand(String name) {
|
||||
// super(name);
|
||||
// }
|
||||
//
|
||||
// public CDPrepareCommand() {
|
||||
// super("CDPrepareCommand");
|
||||
// }
|
||||
// /**
|
||||
// * 1. 기능 : 일자전환 통지 Command
|
||||
// * 2. 처리 개요 : EAI의 일자전환상태를 Prepare로 변경
|
||||
// * 3. 주의사항
|
||||
// *
|
||||
// * @exception CommandException Argument Type이 다르거나 Command 수행중 Excpetion이 발생할 경우
|
||||
// **/
|
||||
// public Object execute() throws CommandException
|
||||
// {
|
||||
// Logger logger = Logger.getLogger(Logger.LOGGER_DEFAULT);
|
||||
// if (logger.isWarn()) logger.warn(this.name + " is executed");
|
||||
//
|
||||
// try{
|
||||
// PropManager pMan = PropManager.getInstance();
|
||||
// pMan.setProperty("BUSINESS_DAY_CHANGE", "CHANGE_STATUS", "P");
|
||||
// if (logger.isWarn()) logger.warn(this.name + "] 일자전환 : 일자변환상태[Prepare]가 준비로 변경되었습니다.");
|
||||
// }catch (Exception e){
|
||||
// String rspErrorCode = "RECEAIMIM002";
|
||||
// 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 CDPrepareCommand("CDPrepareCommand");
|
||||
//// AgentUtil.broadcast(command);
|
||||
//// }
|
||||
//}
|
||||
@@ -0,0 +1,76 @@
|
||||
//package com.eactive.eai.agent.businessday;
|
||||
//
|
||||
//import com.eactive.eai.agent.AgentUtil;
|
||||
//import com.eactive.eai.agent.command.Command;
|
||||
//import com.eactive.eai.agent.command.CommandException;
|
||||
//import com.eactive.eai.common.property.PropManager;
|
||||
//import com.eactive.eai.common.util.Logger;
|
||||
//import com.kbstar.eai.common.businessday.BusinessDayManager;
|
||||
//import com.kbstar.eai.common.businessday.BusinessDayVO;
|
||||
//
|
||||
///**
|
||||
//* 1. 기능 : 일자전환 통지 Command
|
||||
//* 2. 처리 개요 : EAI의 영업이랒를 변경
|
||||
//* 3. 주의사항
|
||||
//*
|
||||
//* @author
|
||||
//* @version v 1.0.0
|
||||
//* @see 관련 기능을 참조
|
||||
//* @since
|
||||
//*
|
||||
//*/
|
||||
//public class CDStandbyCommand extends Command
|
||||
//{
|
||||
// /**
|
||||
// *
|
||||
// */
|
||||
// private static final long serialVersionUID = 1L;
|
||||
//
|
||||
// /**
|
||||
// * 1. 기능 : CDPrepareCommand 생성자
|
||||
// * 2. 처리 개요 :
|
||||
// * 3. 주의사항
|
||||
// *
|
||||
// **/
|
||||
// public CDStandbyCommand(String name) {
|
||||
// super(name);
|
||||
// }
|
||||
//
|
||||
// public CDStandbyCommand() {
|
||||
// super("CDStandbyCommand");
|
||||
// }
|
||||
// /**
|
||||
// * 1. 기능 : 일자전환 통지 Command
|
||||
// * 2. 처리 개요 : EAI의 일자전환상태를 Prepare로 변경
|
||||
// * 3. 주의사항
|
||||
// *
|
||||
// * @exception CommandException Argument Type이 다르거나 Command 수행중 Excpetion이 발생할 경우
|
||||
// **/
|
||||
// public Object execute() throws CommandException
|
||||
// {
|
||||
// Logger logger = Logger.getLogger(Logger.LOGGER_DEFAULT);
|
||||
// if (logger.isWarn()) logger.warn(this.name + " is executed");
|
||||
//
|
||||
// try{
|
||||
// PropManager pMan = PropManager.getInstance();
|
||||
// pMan.setProperty("BUSINESS_DAY_CHANGE", "CHANGE_STATUS", "S");
|
||||
// if (logger.isWarn()) logger.warn(this.name + "] 일자전환 : 일자변환상태[standby]가 사전변경으로 변경되었습니다.");
|
||||
// }catch (Exception e){
|
||||
// String rspErrorCode = "RECEAIMIM002";
|
||||
// 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(String args[]);
|
||||
////}
|
||||
//
|
||||
////private static void test(String args[]) throws Exception {
|
||||
//// Command command = new CDStandbyCommand("CDPrepareCommand");
|
||||
//// AgentUtil.broadcast(command);
|
||||
//// }
|
||||
//}
|
||||
@@ -0,0 +1,86 @@
|
||||
//package com.eactive.eai.agent.businessday;
|
||||
//
|
||||
//import com.eactive.eai.agent.AgentUtil;
|
||||
//import com.eactive.eai.agent.command.Command;
|
||||
//import com.eactive.eai.agent.command.CommandException;
|
||||
//import com.eactive.eai.common.property.PropManager;
|
||||
//import com.eactive.eai.common.util.Logger;
|
||||
//import com.kbstar.eai.common.businessday.BusinessDayManager;
|
||||
//import com.kbstar.eai.common.businessday.BusinessDayVO;
|
||||
//
|
||||
///**
|
||||
//* 1. 기능 : 일자전환 통지 Command
|
||||
//* 2. 처리 개요 : EAI의 영업일자를 변경
|
||||
//* 3. 주의사항
|
||||
//*
|
||||
//* @author
|
||||
//* @version v 1.0.0
|
||||
//* @see 관련 기능을 참조
|
||||
//* @since
|
||||
//*
|
||||
//*/
|
||||
//public class ChangeDateCommand extends Command
|
||||
//{
|
||||
// /**
|
||||
// *
|
||||
// */
|
||||
// private static final long serialVersionUID = 1L;
|
||||
//
|
||||
// /**
|
||||
// * 1. 기능 : UpdateBusinessDayCommand 생성자
|
||||
// * 2. 처리 개요 :
|
||||
// * 3. 주의사항
|
||||
// *
|
||||
// **/
|
||||
// public ChangeDateCommand(String name) {
|
||||
// super(name);
|
||||
// }
|
||||
//
|
||||
// public ChangeDateCommand() {
|
||||
// super("ChangeDateCommand");
|
||||
// }
|
||||
// /**
|
||||
// * 1. 기능 : 일자전환 통지 Command
|
||||
// * 2. 처리 개요 : EAI의 영업일자를 변경
|
||||
// * 3. 주의사항
|
||||
// *
|
||||
// * @exception CommandException Argument Type이 다르거나 Command 수행중 Excpetion이 발생할 경우
|
||||
// **/
|
||||
// public Object execute() throws CommandException
|
||||
// {
|
||||
// Logger logger = Logger.getLogger(Logger.LOGGER_DEFAULT);
|
||||
// if (logger.isWarn()) logger.warn(this.name + " is executed");
|
||||
//
|
||||
// if( !(args instanceof String) ) {
|
||||
// String rspErrorCode = "RECEAIMIM001";
|
||||
// String msg = makeException(rspErrorCode, null);
|
||||
// if (logger.isError()) logger.error(msg);
|
||||
// throw new CommandException(msg);
|
||||
// }
|
||||
//
|
||||
// String bzDate = (String) args;
|
||||
// try{
|
||||
// PropManager pMan = PropManager.getInstance();
|
||||
// pMan.setProperty("BUSINESS_DAY_CHANGE", "BUSINESS_DAY", bzDate);
|
||||
// pMan.setProperty("BUSINESS_DAY_CHANGE", "CHANGE_STATUS", "C");
|
||||
// if (logger.isWarn()) logger.warn(this.name + "] 일자전환 : 영업일자["+bzDate+"] 일자변환상태[Commit]가 시작으로 변경되었습니다.");
|
||||
// }catch (Exception e){
|
||||
// String rspErrorCode = "RECEAIMIM002";
|
||||
// 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 {
|
||||
//// String date = "20090708";
|
||||
//// Command command = new ChangeDateCommand("ChangeDateCommand");
|
||||
//// command.setArgs(date);
|
||||
//// AgentUtil.broadcast(command);
|
||||
//// }
|
||||
//}
|
||||
@@ -0,0 +1,64 @@
|
||||
//package com.eactive.eai.agent.businessday;
|
||||
//
|
||||
//import com.eactive.eai.agent.AgentUtil;
|
||||
//import com.eactive.eai.agent.command.Command;
|
||||
//import com.eactive.eai.agent.command.CommandException;
|
||||
//import com.eactive.eai.common.util.Logger;
|
||||
//import com.kbstar.eai.common.businessday.BusinessDayManager;
|
||||
//
|
||||
//public class ReloadBusinessDayCommand extends Command
|
||||
//{
|
||||
// /**
|
||||
// *
|
||||
// */
|
||||
// private static final long serialVersionUID = 1L;
|
||||
//
|
||||
// /**
|
||||
// * 1. 기능 : ReloadBusinessDayCommand 생성자
|
||||
// * 2. 처리 개요 :
|
||||
// * 3. 주의사항
|
||||
// *
|
||||
// * @param
|
||||
// * @return
|
||||
// * @exception
|
||||
// **/
|
||||
// public ReloadBusinessDayCommand() {
|
||||
// super("ReloadBusinessDayCommand");
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 1. 기능 : BusinessDayManager의 데이터를 DB로부터 Reload
|
||||
// * 2. 처리 개요 : BusinessDayManager의 reload메소드를 실행하여 DB로부터 Reload
|
||||
// * 3. 주의사항
|
||||
// *
|
||||
// * @param
|
||||
// * @return
|
||||
// * @exception CommandException
|
||||
// **/
|
||||
// public Object execute() throws CommandException
|
||||
// {
|
||||
// Logger logger = Logger.getLogger(Logger.LOGGER_DEFAULT);
|
||||
// if (logger.isWarn()) logger.warn(this.name + " is executed");
|
||||
//
|
||||
// try{
|
||||
// BusinessDayManager manager = BusinessDayManager.getInstance();
|
||||
//
|
||||
// manager.reload();
|
||||
// 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);
|
||||
// throw new CommandException(msg);
|
||||
// }
|
||||
// return "success";
|
||||
// }
|
||||
//
|
||||
//// public static void main(String[] args)throws Exception{
|
||||
//// Command command = new ReloadBusinessDayCommand();
|
||||
//// command.setArgs("ALL");
|
||||
//// AgentUtil.broadcast(command);
|
||||
////
|
||||
//// }
|
||||
//}
|
||||
@@ -0,0 +1,85 @@
|
||||
//package com.eactive.eai.agent.businessday;
|
||||
//
|
||||
//import com.eactive.eai.agent.AgentUtil;
|
||||
//import com.eactive.eai.agent.command.Command;
|
||||
//import com.eactive.eai.agent.command.CommandException;
|
||||
//import com.eactive.eai.common.util.Logger;
|
||||
//import com.kbstar.eai.common.businessday.BusinessDayManager;
|
||||
//import com.kbstar.eai.common.businessday.BusinessDayVO;
|
||||
//
|
||||
///**
|
||||
//* 1. 기능 : Running중인 EAI Server의 메모리에 로딩된 BusinessDayManager의 정보 변경
|
||||
//* 2. 처리 개요 : BusinessDayManager에 BusinessDayVO제거
|
||||
//* 3. 주의사항
|
||||
//*
|
||||
//* @author
|
||||
//* @version v 1.0.0
|
||||
//* @see 관련 기능을 참조
|
||||
//* @since
|
||||
//*
|
||||
//*/
|
||||
//public class RemoveBusinessDayCommand extends Command
|
||||
//{
|
||||
// /**
|
||||
// *
|
||||
// */
|
||||
// private static final long serialVersionUID = 1L;
|
||||
//
|
||||
// /**
|
||||
// * 1. 기능 : RemoveBusinessDayCommand 생성자
|
||||
// * 2. 처리 개요 :
|
||||
// * 3. 주의사항
|
||||
// *
|
||||
// **/
|
||||
// public RemoveBusinessDayCommand(String name) {
|
||||
// super(name);
|
||||
// }
|
||||
//
|
||||
// public RemoveBusinessDayCommand() {
|
||||
// super("RemoveBusinessDayCommand");
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 1. 기능 : BusinessDayManager에 BusinessDayVO제거
|
||||
// * 2. 처리 개요 : BusinessDayManager에 BusinessDayVO제거
|
||||
// * 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 BusinessDayVO) ) {
|
||||
// String rspErrorCode = "RECEAIMIM001";
|
||||
// String msg = makeException(rspErrorCode, null);
|
||||
// if (logger.isError()) logger.error(msg);
|
||||
// throw new CommandException(msg);
|
||||
// }
|
||||
//
|
||||
// BusinessDayVO vo = (BusinessDayVO) args;
|
||||
// try{
|
||||
// BusinessDayManager manager = BusinessDayManager.getInstance();
|
||||
// manager.removeMessage(vo.getEAISvcName());
|
||||
// }catch (Exception e){
|
||||
// String rspErrorCode = "RECEAIMIM002";
|
||||
// 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(String args[]);
|
||||
////}
|
||||
//
|
||||
////private static void test(String args[]) throws Exception {
|
||||
//// BusinessDayVO vo = new BusinessDayVO(args[0]);
|
||||
//// Command command = new RemoveBusinessDayCommand("RemoveBusinessDayCommand");
|
||||
//// command.setArgs(vo);
|
||||
//// AgentUtil.broadcast(command);
|
||||
//// }
|
||||
//}
|
||||
@@ -0,0 +1,80 @@
|
||||
//package com.eactive.eai.agent.businessday;
|
||||
//
|
||||
//import com.eactive.eai.agent.AgentUtil;
|
||||
//import com.eactive.eai.agent.command.Command;
|
||||
//import com.eactive.eai.agent.command.CommandException;
|
||||
//import com.eactive.eai.common.util.Logger;
|
||||
//import com.kbstar.eai.common.businessday.BusinessDayManager;
|
||||
//import com.kbstar.eai.common.businessday.BusinessDayVO;
|
||||
//
|
||||
///**
|
||||
//* 1. 기능 : Running중인 EAI Server의 메모리에 로딩된 BusinessDayManager의 정보 변경
|
||||
//* 2. 처리 개요 : BusinessDayManager에 BusinessDayVO 데이터 변경
|
||||
//* 3. 주의사항
|
||||
//*
|
||||
//* @author
|
||||
//* @version v 1.0.0
|
||||
//* @see 관련 기능을 참조
|
||||
//* @since
|
||||
//*
|
||||
//*/
|
||||
//public class UpdateBusinessDayCommand extends Command
|
||||
//{
|
||||
// /**
|
||||
// *
|
||||
// */
|
||||
// private static final long serialVersionUID = 1L;
|
||||
//
|
||||
// /**
|
||||
// * 1. 기능 : UpdateBusinessDayCommand 생성자
|
||||
// * 2. 처리 개요 :
|
||||
// * 3. 주의사항
|
||||
// *
|
||||
// **/
|
||||
// public UpdateBusinessDayCommand(String name) {
|
||||
// super(name);
|
||||
// }
|
||||
//
|
||||
// public UpdateBusinessDayCommand() {
|
||||
// super("UpdateBusinessDayCommand");
|
||||
// }
|
||||
// /**
|
||||
// * 1. 기능 : BusinessDayManager에 BusinessDayVO 데이터 변경
|
||||
// * 2. 처리 개요 : BusinessDayManager에 BusinessDayVO 데이터 변경
|
||||
// * 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 BusinessDayVO) ) {
|
||||
// String rspErrorCode = "RECEAIMIM001";
|
||||
// String msg = makeException(rspErrorCode, null);
|
||||
// if (logger.isError()) logger.error(msg);
|
||||
// throw new CommandException(msg);
|
||||
// }
|
||||
//
|
||||
// BusinessDayVO vo = (BusinessDayVO) args;
|
||||
// try{
|
||||
// BusinessDayManager manager = BusinessDayManager.getInstance();
|
||||
// manager.setMessage(vo);
|
||||
// }catch (Exception e){
|
||||
// String rspErrorCode = "RECEAIMIM002";
|
||||
// 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
|
||||
//// {
|
||||
//// BusinessDayVO vo = new BusinessDayVO(args[0]);
|
||||
//// Command command = new UpdateBusinessDayCommand("UpdateBusinessDayCommand");
|
||||
//// command.setArgs(vo);
|
||||
//// AgentUtil.broadcast(command);
|
||||
//// }
|
||||
//}
|
||||
@@ -0,0 +1,55 @@
|
||||
package com.eactive.eai.agent.c2rservice;
|
||||
|
||||
import com.eactive.eai.agent.command.Command;
|
||||
import com.eactive.eai.agent.command.CommandException;
|
||||
import com.eactive.eai.common.c2rservice.C2RServiceManager;
|
||||
import com.eactive.eai.common.util.Logger;
|
||||
|
||||
public class ReloadC2RServiceCommand extends Command {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public ReloadC2RServiceCommand() {
|
||||
super("ReloadC2RServiceCommand");
|
||||
}
|
||||
|
||||
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 {
|
||||
C2RServiceManager manager = C2RServiceManager.getInstance();
|
||||
String keyName = (String) args;
|
||||
|
||||
if (keyName != null) {
|
||||
if ("ALL".equals(keyName)) {
|
||||
manager.reload();
|
||||
if (logger.isWarn())
|
||||
logger.warn(this.name + "] all rule 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);
|
||||
throw new CommandException(msg);
|
||||
}
|
||||
return "success";
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
package com.eactive.eai.agent.c2rservice;
|
||||
|
||||
import java.util.Vector;
|
||||
|
||||
import com.eactive.eai.agent.command.Command;
|
||||
import com.eactive.eai.agent.command.CommandException;
|
||||
import com.eactive.eai.common.c2rservice.C2RServiceManager;
|
||||
import com.eactive.eai.common.util.Logger;
|
||||
|
||||
public class ReloadC2RServiceListCommand extends Command {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public ReloadC2RServiceListCommand() {
|
||||
super("ReloadC2RServiceListCommand");
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
C2RServiceManager manager = C2RServiceManager.getInstance();
|
||||
try {
|
||||
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";
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
package com.eactive.eai.agent.c2rservice;
|
||||
|
||||
import com.eactive.eai.agent.command.Command;
|
||||
import com.eactive.eai.agent.command.CommandException;
|
||||
import com.eactive.eai.common.c2rservice.C2RServiceManager;
|
||||
import com.eactive.eai.common.util.Logger;
|
||||
|
||||
public class RemoveC2RServiceCommand extends Command {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public RemoveC2RServiceCommand() {
|
||||
super("RemoveC2RServiceCommand");
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
String key = null;
|
||||
C2RServiceManager manager = C2RServiceManager.getInstance();
|
||||
|
||||
try {
|
||||
key = (String) args;
|
||||
if (key != null) {
|
||||
manager.removeC2RServiceVO(key);
|
||||
}
|
||||
} 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,22 @@
|
||||
package com.eactive.eai.agent.circuitBreaker;
|
||||
|
||||
import com.eactive.eai.agent.command.Command;
|
||||
import com.eactive.eai.agent.command.CommandException;
|
||||
import com.eactive.eai.common.circuitBreaker.CircuitBreakerManager;
|
||||
import com.eactive.eai.common.util.Logger;
|
||||
|
||||
public class ReloadCircuitBreakerCommand extends Command {
|
||||
|
||||
Logger logger = Logger.getLogger(Logger.LOGGER_DEFAULT);
|
||||
|
||||
@Override
|
||||
public Object execute() throws CommandException {
|
||||
CircuitBreakerManager circuitBreakerManager = CircuitBreakerManager.getInstance();
|
||||
try {
|
||||
circuitBreakerManager.reload();
|
||||
}catch (Exception e) {
|
||||
throw new CommandException(e.getMessage());
|
||||
}
|
||||
return "success";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,84 @@
|
||||
package com.eactive.eai.agent.command;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.HashMap;
|
||||
|
||||
/**
|
||||
* 1. 기능 : Agent에 의해 실행될 Command 를 정의하기 위한 base class
|
||||
* 2. 처리 개요 : Agent에 의해 실행될 Command 를 정의하기 위한 base class
|
||||
* 3. 주의사항
|
||||
*
|
||||
* @author
|
||||
* @version v 1.0.0
|
||||
* @see 관련 기능을 참조
|
||||
* @since
|
||||
*
|
||||
*/
|
||||
public abstract class Command implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
/** Command object name */
|
||||
protected String name;
|
||||
/** Command Arguments */
|
||||
protected Object args;
|
||||
|
||||
private static HashMap<String,String> errorCode ;
|
||||
|
||||
static {
|
||||
errorCode = new HashMap<>();
|
||||
errorCode.put("RECEAIMCM001", "Command name[{1}] invalid parameter type - {2}");
|
||||
errorCode.put("RECEAIMCM002", "Command name[{1}] execute method error - {2}");
|
||||
}
|
||||
|
||||
public Command() {
|
||||
this.name = this.getClass().getName();
|
||||
}
|
||||
|
||||
public Command(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public void setArgs(Object args) {
|
||||
this.args = args;
|
||||
}
|
||||
|
||||
|
||||
public abstract Object execute() throws CommandException;
|
||||
|
||||
protected String makeException(String rspErrorCode, Throwable cause){
|
||||
String[] msgArgs = new String[2];
|
||||
msgArgs[0] = name;
|
||||
if(cause == null){
|
||||
msgArgs[1] = args.toString();
|
||||
}
|
||||
else{
|
||||
msgArgs[1] = cause.getMessage();
|
||||
}
|
||||
String msg = makeMessage(errorCode.get(rspErrorCode),msgArgs) ;
|
||||
|
||||
return msg;
|
||||
}
|
||||
|
||||
private static String makeMessage(String msg, String[] args) {
|
||||
String keyword = null, head = null, tail = null;
|
||||
int idx = -1;
|
||||
for(int i=0;i<args.length;i++) {
|
||||
keyword = "{"+(i+1)+"}";
|
||||
idx = msg.indexOf(keyword);
|
||||
if(idx == -1) {
|
||||
continue;
|
||||
}
|
||||
head = msg.substring(0,idx);
|
||||
tail = msg.substring(idx+keyword.length());
|
||||
msg = head+args[i]+tail;
|
||||
}
|
||||
return msg;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
|
||||
package com.eactive.eai.agent.command;
|
||||
|
||||
/**
|
||||
* 1. 기능 : Command Logic을 실행하다 발생될 User Define 오류를 처리하기 위한 Exception class<br>
|
||||
* 2. 처리 개요 : Command Logic을 실행하다 발생될 User Define 오류를 처리하기 위한 Exception class<br>
|
||||
* 3. 주의사항
|
||||
*
|
||||
* @author
|
||||
* @version v 1.0.0
|
||||
* @see 관련 기능을 참조
|
||||
* @since
|
||||
*
|
||||
*/
|
||||
public class CommandException extends Exception {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public CommandException() {
|
||||
super("CommandException is occured.");
|
||||
}
|
||||
|
||||
/**
|
||||
* 1. 기능 : Exception message를 초기화하는 Constructor
|
||||
* 2. 처리 개요 : Exception message를 초기화하는 Constructor
|
||||
* -
|
||||
* 3. 주의사항
|
||||
*
|
||||
* @param msg Exception message
|
||||
**/
|
||||
public CommandException(String msg) {
|
||||
super(msg);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
package com.eactive.eai.agent.command;
|
||||
|
||||
import java.lang.reflect.Constructor;
|
||||
|
||||
import com.eactive.eai.common.util.Logger;
|
||||
|
||||
/**
|
||||
* 1. 기능 : 공통 command
|
||||
* 2. 처리 개요 :
|
||||
* 3. 주의사항
|
||||
*
|
||||
* @author
|
||||
* @version v 1.0.0
|
||||
* @see 관련 기능을 참조
|
||||
* @since
|
||||
*
|
||||
*/
|
||||
public class CommonCommand extends Command {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
||||
public CommonCommand(String name,Object args) {
|
||||
this.name = name;
|
||||
this.args = args;
|
||||
}
|
||||
|
||||
public CommonCommand(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public Object execute() throws CommandException
|
||||
{
|
||||
if (name.indexOf(".") >=0 ){
|
||||
try {
|
||||
if(this.name != null) this.name = this.name.trim();
|
||||
@SuppressWarnings("rawtypes")
|
||||
Class cl = Class.forName(this.name);
|
||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||
Constructor constructor = cl.getConstructor();
|
||||
Object obj = constructor.newInstance();
|
||||
Command c = (Command)obj;
|
||||
c.setArgs(args);
|
||||
return c.execute();
|
||||
|
||||
} catch (Exception e) {
|
||||
Logger logger = Logger.getLogger(Logger.LOGGER_DEFAULT);
|
||||
logger.error("CommonCommand Exception "+e.getMessage(),e);
|
||||
throw new CommandException(e.getMessage());
|
||||
}
|
||||
}else{
|
||||
String rspErrorCode = "RECEAIMCM001";
|
||||
String msg = makeException(rspErrorCode, null);
|
||||
throw new CommandException(msg);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
package com.eactive.eai.agent.eaimessage;
|
||||
|
||||
import com.eactive.eai.agent.command.Command;
|
||||
import com.eactive.eai.agent.command.CommandException;
|
||||
import com.eactive.eai.common.message.EAIMessageManager;
|
||||
import com.eactive.eai.common.util.Logger;
|
||||
|
||||
public class ReloadEAIMessageCommand extends Command {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public ReloadEAIMessageCommand() {
|
||||
super("ReloadEAIMessageCommand");
|
||||
}
|
||||
|
||||
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)) {
|
||||
throwCommandException("RECEAIMCM001", null);
|
||||
}
|
||||
|
||||
try {
|
||||
EAIMessageManager manager = EAIMessageManager.getInstance();
|
||||
String keyName = (String) args;
|
||||
|
||||
if (keyName != null) {
|
||||
if ("ALL".equals(keyName)) {
|
||||
manager.reload();
|
||||
if (logger.isWarn()) {
|
||||
logger.warn(this.name + "] all rule Reload.");
|
||||
}
|
||||
} else {
|
||||
if (keyName.contains(",")) {
|
||||
reloadKeys(manager, keyName);
|
||||
} else {
|
||||
manager.reload(keyName.trim());
|
||||
if (logger.isWarn()) {
|
||||
logger.warn(this.name + "] " + keyName + " Reload.");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
throwCommandException("RECEAIMCM002", e);
|
||||
}
|
||||
return "success";
|
||||
}
|
||||
|
||||
private void reloadKeys(EAIMessageManager manager, String keyName) throws Exception {
|
||||
Logger logger = Logger.getLogger(Logger.LOGGER_DEFAULT);
|
||||
if (logger.isWarn()) {
|
||||
logger.warn(this.name + "] Array [" + keyName + "] Reload.");
|
||||
}
|
||||
|
||||
String[] keys = keyName.split(",");
|
||||
for (String key : keys) {
|
||||
if (key != null) {
|
||||
manager.reload(key.trim());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void throwCommandException(String errorCode, Exception exception) throws CommandException {
|
||||
Logger logger = Logger.getLogger(Logger.LOGGER_DEFAULT);
|
||||
String msg = makeException(errorCode, exception);
|
||||
if (logger.isError()) {
|
||||
logger.error(msg, exception);
|
||||
}
|
||||
throw new CommandException(msg);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
package com.eactive.eai.agent.eaimessage;
|
||||
|
||||
import java.util.Vector;
|
||||
|
||||
import com.eactive.eai.agent.command.Command;
|
||||
import com.eactive.eai.agent.command.CommandException;
|
||||
import com.eactive.eai.common.message.EAIMessageManager;
|
||||
import com.eactive.eai.common.util.Logger;
|
||||
|
||||
public class ReloadEAIMessageListCommand extends Command {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public ReloadEAIMessageListCommand() {
|
||||
super("ReloadEAIMessageListCommand");
|
||||
}
|
||||
|
||||
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 {
|
||||
EAIMessageManager manager = EAIMessageManager.getInstance();
|
||||
|
||||
Vector keyNameVt = (Vector) args;
|
||||
String keyName = "";
|
||||
for (int i = 0; i < keyNameVt.size(); i++) {
|
||||
keyName = (String) keyNameVt.get(i);
|
||||
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);
|
||||
throw new CommandException(msg);
|
||||
}
|
||||
return "success";
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
package com.eactive.eai.agent.eaimessage;
|
||||
|
||||
import com.eactive.eai.agent.command.Command;
|
||||
import com.eactive.eai.agent.command.CommandException;
|
||||
import com.eactive.eai.common.message.EAIMessageManager;
|
||||
import com.eactive.eai.common.util.Logger;
|
||||
|
||||
public class RemoveEAIMessageCommand extends Command{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public RemoveEAIMessageCommand() {
|
||||
super("RemoveEAIMessageCommand");
|
||||
}
|
||||
|
||||
/**
|
||||
* 1. 기능 : EAIMessageManager의 EAIMessage 제거
|
||||
* 2. 처리 개요 : EAIMessage EAISvrInstNm이 DEFAULT_SERVER(ALL) 이거나 LocalServer인 경우
|
||||
* EAIMessageManager의 EAIMessage 제거
|
||||
* 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{
|
||||
EAIMessageManager manager = EAIMessageManager.getInstance();
|
||||
String key = (String)args;
|
||||
if (key != null){
|
||||
manager.removeEAIMessage(key);
|
||||
}
|
||||
|
||||
}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,64 @@
|
||||
package com.eactive.eai.agent.eaimessage;
|
||||
|
||||
import java.util.Vector;
|
||||
|
||||
import com.eactive.eai.agent.command.Command;
|
||||
import com.eactive.eai.agent.command.CommandException;
|
||||
import com.eactive.eai.common.message.EAIMessageManager;
|
||||
import com.eactive.eai.common.util.Logger;
|
||||
|
||||
public class RemoveEAIMessageListCommand extends Command {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public RemoveEAIMessageListCommand() {
|
||||
super("RemoveEAIMessageListCommand");
|
||||
}
|
||||
|
||||
/**
|
||||
* 1. 기능 : EAIMessageManager의 EAIMessage 제거
|
||||
* 2. 처리 개요 : EAIMessage EAISvrInstNm이 DEFAULT_SERVER(ALL) 이거나 LocalServer인 경우
|
||||
* EAIMessageManager의 EAIMessage 제거
|
||||
* 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 Vector)) {
|
||||
String rspErrorCode = "RECEAIMCM001";
|
||||
String msg = makeException(rspErrorCode, null);
|
||||
if (logger.isError())
|
||||
logger.error(msg);
|
||||
throw new CommandException(msg);
|
||||
}
|
||||
|
||||
try {
|
||||
EAIMessageManager manager = EAIMessageManager.getInstance();
|
||||
|
||||
Vector keyNameVt = (Vector) args;
|
||||
String keyName = "";
|
||||
for (int i = 0; i < keyNameVt.size(); i++) {
|
||||
keyName = (String) keyNameVt.get(i);
|
||||
if (keyName != null) {
|
||||
manager.removeEAIMessage(keyName);
|
||||
if (logger.isWarn())
|
||||
logger.warn(this.name + "] " + keyName + " Remove.");
|
||||
}
|
||||
}
|
||||
|
||||
} 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,48 @@
|
||||
package com.eactive.eai.agent.eaiserver;
|
||||
|
||||
import com.eactive.eai.agent.command.Command;
|
||||
import com.eactive.eai.agent.command.CommandException;
|
||||
import com.eactive.eai.common.server.EAIServerManager;
|
||||
import com.eactive.eai.common.util.Logger;
|
||||
|
||||
public class ReloadEAIServerCommand extends Command {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public ReloadEAIServerCommand() {
|
||||
super("ReloadEAIServerCommand");
|
||||
}
|
||||
|
||||
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 {
|
||||
EAIServerManager manager = EAIServerManager.getInstance();
|
||||
String name = null;
|
||||
|
||||
name = (String) args;
|
||||
if (name != null) {
|
||||
manager.reloadEAIServer(name);
|
||||
}
|
||||
|
||||
} 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,46 @@
|
||||
package com.eactive.eai.agent.eaiserver;
|
||||
|
||||
import com.eactive.eai.agent.command.Command;
|
||||
import com.eactive.eai.agent.command.CommandException;
|
||||
import com.eactive.eai.common.server.EAIServerManager;
|
||||
import com.eactive.eai.common.util.Logger;
|
||||
|
||||
public class RemoveEAIServerCommand extends Command {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public RemoveEAIServerCommand() {
|
||||
super("RemoveEAIServerCommand");
|
||||
}
|
||||
|
||||
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 {
|
||||
EAIServerManager manager = EAIServerManager.getInstance();
|
||||
String name = (String) args;
|
||||
if (name != null) {
|
||||
manager.removeEAIServer(name);
|
||||
}
|
||||
|
||||
} 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,102 @@
|
||||
package com.eactive.eai.agent.encryption;
|
||||
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
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.property.PropManager;
|
||||
import com.eactive.eai.common.server.Keys;
|
||||
import com.eactive.eai.common.util.ApplicationContextProvider;
|
||||
import com.eactive.eai.common.util.Logger;
|
||||
|
||||
@Component
|
||||
public class EncryptionManager implements Lifecycle {
|
||||
static Logger logger = Logger.getLogger(Logger.LOGGER_DEFAULT);
|
||||
private static final String GROUP_NAME = "ENCRYPTION";
|
||||
|
||||
private String encryptYN = "";
|
||||
private boolean started;
|
||||
private LifecycleSupport lifecycle = new LifecycleSupport(this);
|
||||
|
||||
private EncryptionManager() {
|
||||
|
||||
}
|
||||
|
||||
public static EncryptionManager getInstance() {
|
||||
return ApplicationContextProvider.getContext().getBean(EncryptionManager.class);
|
||||
}
|
||||
|
||||
public void start() throws LifecycleException {
|
||||
if (started)
|
||||
throw new LifecycleException("RECEAICMM201");
|
||||
|
||||
lifecycle.fireLifecycleEvent(STARTING_EVENT, this);
|
||||
|
||||
try {
|
||||
init();
|
||||
} catch (Exception e) {
|
||||
throw new LifecycleException(ExceptionUtil.getErrorCode(e, "RECEAICMM202"));
|
||||
}
|
||||
|
||||
started = true;
|
||||
lifecycle.fireLifecycleEvent(STARTED_EVENT, this);
|
||||
}
|
||||
|
||||
private void init() throws Exception {
|
||||
encryptYN = "";
|
||||
encryptYN = PropManager.getInstance().getProperty(GROUP_NAME, System.getProperty(Keys.SERVER_KEY));
|
||||
if (encryptYN == null) {
|
||||
encryptYN = "N";
|
||||
} else {
|
||||
if (encryptYN.trim().length() == 0) {
|
||||
encryptYN = "N";
|
||||
}
|
||||
}
|
||||
|
||||
logger.warn("EncryptionManager] init :: encryption YN [ " + encryptYN + " ]");
|
||||
}
|
||||
|
||||
public synchronized void reload() throws Exception {
|
||||
if (logger.isWarn()) {
|
||||
logger.warn("EncryptionManager] reload all Started ...");
|
||||
}
|
||||
init();
|
||||
if (logger.isWarn()) {
|
||||
logger.warn("EncryptionManager] reload all finished ...");
|
||||
}
|
||||
}
|
||||
|
||||
public void stop() throws LifecycleException {
|
||||
if (!started)
|
||||
throw new LifecycleException("RECEAICMM203");
|
||||
|
||||
lifecycle.fireLifecycleEvent(STOPING_EVENT, this);
|
||||
|
||||
encryptYN = null;
|
||||
started = false;
|
||||
lifecycle.fireLifecycleEvent(STOPPED_EVENT, this);
|
||||
}
|
||||
|
||||
public void addLifecycleListener(LifecycleListener listener) {
|
||||
lifecycle.addLifecycleListener(listener);
|
||||
}
|
||||
|
||||
public LifecycleListener[] findLifecycleListeners() {
|
||||
return lifecycle.findLifecycleListeners();
|
||||
}
|
||||
|
||||
public void removeLifecycleListener(LifecycleListener listener) {
|
||||
lifecycle.removeLifecycleListener(listener);
|
||||
}
|
||||
|
||||
public boolean isStarted() {
|
||||
return this.started;
|
||||
}
|
||||
|
||||
public String getEncryptYN() {
|
||||
return encryptYN;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
package com.eactive.eai.agent.encryption;
|
||||
|
||||
import com.eactive.eai.agent.command.Command;
|
||||
import com.eactive.eai.agent.command.CommandException;
|
||||
import com.eactive.eai.common.util.Logger;
|
||||
|
||||
public class ReloadEncryptionYNCommand extends Command {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public ReloadEncryptionYNCommand() {
|
||||
super("ReloadEncryptionYNCommand");
|
||||
}
|
||||
|
||||
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 = "EAIINIT001";
|
||||
String msg = makeException(rspErrorCode, null);
|
||||
if (logger.isError())
|
||||
logger.error(msg);
|
||||
throw new CommandException(msg);
|
||||
}
|
||||
|
||||
try {
|
||||
EncryptionManager manager = EncryptionManager.getInstance();
|
||||
|
||||
String keyName = (String) args;
|
||||
|
||||
if (keyName != null) {
|
||||
if ("ENC".equals(keyName)) {
|
||||
manager.reload();
|
||||
if (logger.isWarn())
|
||||
logger.warn(this.name + "] 암호화 여부가 Reload 되었습니다.");
|
||||
} else {
|
||||
// String rspErrorCode = "EAIINIT002";
|
||||
String msg = "EAIINIT002 암호화 여부 동기화중 keyName [" + keyName + "] 오류가 발생하였습니다. ";
|
||||
if (logger.isError())
|
||||
logger.error(msg);
|
||||
throw new CommandException(msg);
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
String rspErrorCode = "EAIINIT003";
|
||||
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 ReloadEncryptionYNCommand();
|
||||
// command.setArgs("ENC");
|
||||
// AgentUtil.broadcast(command);
|
||||
//
|
||||
// }
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
package com.eactive.eai.agent.errorcode;
|
||||
|
||||
import com.eactive.eai.agent.command.Command;
|
||||
import com.eactive.eai.agent.command.CommandException;
|
||||
import com.eactive.eai.common.errorcode.ErrorCodeManager;
|
||||
import com.eactive.eai.common.util.Logger;
|
||||
|
||||
public class ReloadErrorCodeCommand extends Command {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public ReloadErrorCodeCommand(String name) {
|
||||
super(name);
|
||||
}
|
||||
|
||||
public Object execute() throws CommandException {
|
||||
|
||||
Logger logger = Logger.getLogger(Logger.LOGGER_DEFAULT);
|
||||
if (logger.isInfo())
|
||||
logger.info(this.name + " is executed");
|
||||
|
||||
if (!(args instanceof java.lang.String)) {
|
||||
String rspErrorCode = "RECEAIMCM001";
|
||||
String msg = makeException(rspErrorCode, null);
|
||||
if (logger.isError())
|
||||
logger.error(msg);
|
||||
throw new CommandException(msg);
|
||||
}
|
||||
|
||||
try {
|
||||
ErrorCodeManager manager = ErrorCodeManager.getInstance();
|
||||
|
||||
String keyName = (String) args;
|
||||
|
||||
if (keyName != null) {
|
||||
if ("ALL".equals(keyName)) {
|
||||
manager.reload();
|
||||
if (logger.isWarn())
|
||||
logger.warn(this.name + "] all rule 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);
|
||||
throw new CommandException(msg);
|
||||
}
|
||||
return "success";
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
package com.eactive.eai.agent.errorcode;
|
||||
|
||||
import com.eactive.eai.agent.command.Command;
|
||||
import com.eactive.eai.agent.command.CommandException;
|
||||
import com.eactive.eai.common.errorcode.ErrorCodeManager;
|
||||
import com.eactive.eai.common.util.Logger;
|
||||
|
||||
public class RemoveErrorCodeommand extends Command {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public RemoveErrorCodeommand(String name) {
|
||||
super(name);
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
String msgKey = (String) args;
|
||||
try {
|
||||
ErrorCodeManager manager = ErrorCodeManager.getInstance();
|
||||
manager.removeMessage(msgKey);
|
||||
} 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,50 @@
|
||||
package com.eactive.eai.agent.fcqueuereceiver;
|
||||
|
||||
import com.eactive.eai.agent.command.Command;
|
||||
import com.eactive.eai.agent.command.CommandException;
|
||||
import com.eactive.eai.common.util.Logger;
|
||||
import com.eactive.eai.flowcontrol.jms.FCQueueReceiverManager;
|
||||
|
||||
public class ReloadFCReceiverCommand extends Command {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public ReloadFCReceiverCommand() {
|
||||
super("ReloadFCReceiverCommand");
|
||||
}
|
||||
|
||||
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 {
|
||||
FCQueueReceiverManager manager = FCQueueReceiverManager.getInstance();
|
||||
|
||||
String queRcverName = (String) args;
|
||||
if (logger.isInfo()) {
|
||||
logger.info(this.name + " Reload[" + queRcverName + "]");
|
||||
}
|
||||
|
||||
if (queRcverName != null) {
|
||||
manager.loadFCQueueReceiver(queRcverName);
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
if (logger.isError())
|
||||
logger.error(e.getMessage(), e);
|
||||
throw new CommandException(e.getMessage());
|
||||
}
|
||||
return "success";
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
package com.eactive.eai.agent.fcqueuereceiver;
|
||||
|
||||
import com.eactive.eai.agent.command.Command;
|
||||
import com.eactive.eai.agent.command.CommandException;
|
||||
import com.eactive.eai.common.util.Logger;
|
||||
import com.eactive.eai.flowcontrol.jms.FCQueueReceiverManager;
|
||||
|
||||
public class RemoveFCReceiverCommand extends Command {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public RemoveFCReceiverCommand() {
|
||||
super("RemoveFCReceiverCommand");
|
||||
}
|
||||
|
||||
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 queRcverName = (String) args;
|
||||
FCQueueReceiverManager manager = FCQueueReceiverManager.getInstance();
|
||||
|
||||
if (logger.isInfo()) {
|
||||
logger.info(this.name + " Remove[" + queRcverName + "]");
|
||||
}
|
||||
if (queRcverName != null) {
|
||||
manager.removeFCQueueReceiver(queRcverName);
|
||||
} else {
|
||||
throw new CommandException("ReceiverName Error - " + queRcverName);
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
if (logger.isError())
|
||||
logger.error(e.getMessage(), e);
|
||||
throw new CommandException(e.getMessage());
|
||||
}
|
||||
return "success";
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
package com.eactive.eai.agent.firstaccount;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import com.eactive.eai.agent.command.Command;
|
||||
import com.eactive.eai.agent.command.CommandException;
|
||||
import com.eactive.eai.common.util.Logger;
|
||||
|
||||
public class RemoteFirstAccountCommand extends Command {
|
||||
static Logger logger = Logger.getLogger(Logger.LOGGER_DEFAULT);
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public RemoteFirstAccountCommand() {
|
||||
super("RemoteFirstAccountCommand");
|
||||
}
|
||||
|
||||
public Object execute() throws CommandException {
|
||||
try {
|
||||
logger.warn("Execute 실행중... ");
|
||||
HashMap argMap = (HashMap) args;
|
||||
String accNum = (String) argMap.get("accNum");
|
||||
logger.warn("정상적으로 호출되었습니다. accNum=[" + accNum + "]");
|
||||
ShareMemory sm = ShareMemory.getInstance();
|
||||
sm.setAccoutName(accNum);
|
||||
|
||||
} catch (Exception e) {
|
||||
String msg = makeException("Error Fist Account", e);
|
||||
logger.error(msg, e);
|
||||
throw new CommandException(msg);
|
||||
}
|
||||
return "success";
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.eactive.eai.agent.firstaccount;
|
||||
|
||||
public class ShareMemory {
|
||||
private static ShareMemory SINGLETON_INSTANCE = new ShareMemory();
|
||||
private String AccoutName = "0000";
|
||||
|
||||
public static ShareMemory getInstance() {
|
||||
if (SINGLETON_INSTANCE == null) {
|
||||
SINGLETON_INSTANCE = new ShareMemory();
|
||||
}
|
||||
return SINGLETON_INSTANCE;
|
||||
}
|
||||
|
||||
public String getAccoutName() {
|
||||
return this.AccoutName;
|
||||
}
|
||||
|
||||
public void setAccoutName(String accoutName) {
|
||||
this.AccoutName = accoutName;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package com.eactive.eai.agent.httpouttlsinfo;
|
||||
|
||||
import com.eactive.eai.agent.command.Command;
|
||||
import com.eactive.eai.agent.command.CommandException;
|
||||
import com.eactive.eai.common.util.Logger;
|
||||
import com.eactive.eai.httpouttlsinfo.HttpOutTlsInfoManager;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
public class ReloadHttpOutTlsInfoCommand extends Command {
|
||||
|
||||
public ReloadHttpOutTlsInfoCommand() {
|
||||
super("ReloadClientCommand");
|
||||
}
|
||||
|
||||
@Override
|
||||
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 {
|
||||
HttpOutTlsInfoManager manager = HttpOutTlsInfoManager.getInstance();
|
||||
|
||||
String keyName = (String) args;
|
||||
|
||||
if (keyName != null) {
|
||||
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);
|
||||
throw new CommandException(msg);
|
||||
}
|
||||
return "success";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
package com.eactive.eai.agent.httpouttlsinfo;
|
||||
|
||||
import com.eactive.eai.agent.command.Command;
|
||||
import com.eactive.eai.agent.command.CommandException;
|
||||
import com.eactive.eai.common.util.Logger;
|
||||
import com.eactive.eai.httpouttlsinfo.HttpOutTlsInfoManager;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
public class RemoveHttpOutTlsInfoCommand extends Command {
|
||||
|
||||
public RemoveHttpOutTlsInfoCommand() {
|
||||
super("ReloadClientCommand");
|
||||
}
|
||||
|
||||
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 {
|
||||
HttpOutTlsInfoManager manager = HttpOutTlsInfoManager.getInstance();
|
||||
|
||||
String keyName = (String) args;
|
||||
|
||||
if (keyName != null && keyName.trim().length() > 0) {
|
||||
manager.removeHttpOutTlsInfo(keyName);
|
||||
if (logger.isWarn())
|
||||
logger.warn("ReloadLayoutCommand ] " + keyName + " 에 대한 Layout 정보가 메모리에서 삭제되었습니다.");
|
||||
} else {
|
||||
if (logger.isWarn())
|
||||
logger.warn("ReloadLayoutCommand ] Layout 명을 확인하세요 [" + keyName + "]");
|
||||
}
|
||||
} 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,55 @@
|
||||
package com.eactive.eai.agent.inflow;
|
||||
|
||||
import com.eactive.eai.agent.command.Command;
|
||||
import com.eactive.eai.agent.command.CommandException;
|
||||
import com.eactive.eai.common.inflow.InflowControlManager;
|
||||
import com.eactive.eai.common.util.Logger;
|
||||
|
||||
public class ReloadInflowAdapterControlCommand extends Command {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public ReloadInflowAdapterControlCommand() {
|
||||
super("ReloadInflowAdapterControlCommand");
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
String keyName = (String) args;
|
||||
try {
|
||||
InflowControlManager manager = InflowControlManager.getInstance();
|
||||
|
||||
if (keyName != null) {
|
||||
if ("ALL".equals(keyName)) {
|
||||
manager.reloadAdapter();
|
||||
if (logger.isWarn())
|
||||
logger.warn(this.name + "] all rule Reload.");
|
||||
} else {
|
||||
manager.reloadAdapter(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);
|
||||
throw new CommandException(msg);
|
||||
}
|
||||
return "success";
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
package com.eactive.eai.agent.inflow;
|
||||
|
||||
import com.eactive.eai.agent.command.Command;
|
||||
import com.eactive.eai.agent.command.CommandException;
|
||||
import com.eactive.eai.common.inflow.InflowControlManager;
|
||||
import com.eactive.eai.common.util.Logger;
|
||||
|
||||
public class ReloadInflowInterfaceControlCommand extends Command {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public ReloadInflowInterfaceControlCommand() {
|
||||
super("ReloadInflowInterfaceControlCommand");
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
String keyName = (String) args;
|
||||
try {
|
||||
InflowControlManager manager = InflowControlManager.getInstance();
|
||||
|
||||
if (keyName != null) {
|
||||
if ("ALL".equals(keyName)) {
|
||||
manager.reloadInterface();
|
||||
if (logger.isWarn())
|
||||
logger.warn(this.name + "] all rule Reload.");
|
||||
} else {
|
||||
manager.reloadInterface(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);
|
||||
throw new CommandException(msg);
|
||||
}
|
||||
return "success";
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
package com.eactive.eai.agent.inflow;
|
||||
|
||||
import com.eactive.eai.agent.command.Command;
|
||||
import com.eactive.eai.agent.command.CommandException;
|
||||
import com.eactive.eai.common.inflow.InflowControlManager;
|
||||
import com.eactive.eai.common.util.Logger;
|
||||
|
||||
public class RemoveInflowAdapterControlCommand extends Command {
|
||||
|
||||
public RemoveInflowAdapterControlCommand() {
|
||||
super("RemoveInflowAdapterControlCommand");
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
String key = (String) args;
|
||||
try {
|
||||
InflowControlManager manager = InflowControlManager.getInstance();
|
||||
manager.removeAdapter(key);
|
||||
} 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,40 @@
|
||||
package com.eactive.eai.agent.inflow;
|
||||
|
||||
import com.eactive.eai.agent.command.Command;
|
||||
import com.eactive.eai.agent.command.CommandException;
|
||||
import com.eactive.eai.common.inflow.InflowControlManager;
|
||||
import com.eactive.eai.common.util.Logger;
|
||||
|
||||
public class RemoveInflowInterfaceControlCommand extends Command {
|
||||
public RemoveInflowInterfaceControlCommand() {
|
||||
super("RemoveInflowInterfaceControlCommand");
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
String key = (String) args;
|
||||
try {
|
||||
InflowControlManager manager = InflowControlManager.getInstance();
|
||||
manager.removeInterface(key);
|
||||
} 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,54 @@
|
||||
package com.eactive.eai.agent.jms;
|
||||
|
||||
import com.eactive.eai.agent.command.Command;
|
||||
import com.eactive.eai.agent.command.CommandException;
|
||||
import com.eactive.eai.common.server.EAIServerManager;
|
||||
import com.eactive.eai.common.util.Logger;
|
||||
import com.eactive.eai.flowcontrol.jms.QueueMonitorManager;
|
||||
import com.eactive.eai.flowcontrol.jms.QueueMonitorVO;
|
||||
|
||||
public class AddQueueMonitorCommand extends Command {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public AddQueueMonitorCommand(String name) {
|
||||
super(name);
|
||||
}
|
||||
|
||||
public AddQueueMonitorCommand() {
|
||||
super("AddQueueMonitorCommand");
|
||||
}
|
||||
|
||||
public Object execute() throws CommandException {
|
||||
|
||||
Logger logger = Logger.getLogger(Logger.LOGGER_DEFAULT);
|
||||
if (logger.isInfo())
|
||||
logger.info(this.name + " is executed");
|
||||
|
||||
if (!(args instanceof QueueMonitorVO)) {
|
||||
String rspErrorCode = "RECEAIMCM001";
|
||||
String msg = makeException(rspErrorCode, null);
|
||||
if (logger.isError())
|
||||
logger.error(msg);
|
||||
throw new CommandException(msg);
|
||||
}
|
||||
|
||||
QueueMonitorVO vo = (QueueMonitorVO) args;
|
||||
|
||||
try {
|
||||
String localServerName = EAIServerManager.getInstance().getLocalServerName();
|
||||
// 추가시에는 인스턴스 정보를 확인한다.
|
||||
if (localServerName != null && localServerName.equals(vo.getSevrInstncName())) {
|
||||
QueueMonitorManager manager = QueueMonitorManager.getInstance();
|
||||
manager.setQueueMonitor(vo);
|
||||
}
|
||||
} 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,129 @@
|
||||
package com.eactive.eai.agent.jms;
|
||||
|
||||
import java.time.ZonedDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.HashMap;
|
||||
|
||||
import javax.jms.Message;
|
||||
import javax.jms.ObjectMessage;
|
||||
import javax.jms.QueueConnection;
|
||||
import javax.jms.QueueConnectionFactory;
|
||||
import javax.jms.QueueReceiver;
|
||||
import javax.jms.QueueSession;
|
||||
import javax.jms.Session;
|
||||
import javax.naming.InitialContext;
|
||||
|
||||
import com.eactive.eai.agent.command.Command;
|
||||
import com.eactive.eai.agent.command.CommandException;
|
||||
import com.eactive.eai.common.exception.ExceptionUtil;
|
||||
import com.eactive.eai.common.logger.EAILogSender;
|
||||
import com.eactive.eai.common.message.EAIMessage;
|
||||
import com.eactive.eai.common.util.Logger;
|
||||
|
||||
public class RemoveMessageCommand extends Command {
|
||||
private static final long serialVersionUID = 1L;
|
||||
public final static String JMS_FACTORY = "com.eactive.eai.common.FlowRouterConnectionFactory";
|
||||
|
||||
public RemoveMessageCommand() {
|
||||
super("RemoveMessageCommand");
|
||||
}
|
||||
|
||||
public Object execute() throws CommandException {
|
||||
Logger logger = Logger.getLogger(Logger.LOGGER_DEFAULT);
|
||||
if (logger.isInfo())
|
||||
logger.info(this.name + " is executed");
|
||||
|
||||
if (!(args instanceof HashMap)) {
|
||||
throw new CommandException("Invalid Args - " + args);
|
||||
}
|
||||
|
||||
try {
|
||||
HashMap map = (HashMap) args;
|
||||
String queueName = (String) map.get("queueName");
|
||||
String eaiSvcCd = (String) map.get("eaiSvcCd"); // EAISVCCD
|
||||
String selector = "";
|
||||
|
||||
if (eaiSvcCd != null && eaiSvcCd.length() > 0) {
|
||||
selector = "EAISVCCD='" + eaiSvcCd + "'";
|
||||
}
|
||||
|
||||
purgeQueue(queueName, selector, true);
|
||||
|
||||
} catch (Exception e) {
|
||||
if (logger.isError())
|
||||
logger.error("execute", e);
|
||||
throw new CommandException(e.getMessage());
|
||||
}
|
||||
return "success";
|
||||
}
|
||||
|
||||
public static int purgeQueue(String queueName, String mSelector, boolean isLogging) throws Exception {
|
||||
Logger logger = Logger.getLogger(Logger.LOGGER_DEFAULT);
|
||||
int count = 0;
|
||||
InitialContext ctx = new InitialContext();
|
||||
|
||||
long sTime = System.currentTimeMillis();
|
||||
long cTime = 0;
|
||||
int purgeCount = 0;
|
||||
|
||||
try {
|
||||
DateTimeFormatter DATE_FORMAT = DateTimeFormatter.ofPattern("yy/MM/dd kk:mm:ss");
|
||||
|
||||
QueueConnectionFactory qconFactory = (QueueConnectionFactory) ctx.lookup(JMS_FACTORY);
|
||||
try (QueueConnection qcon = qconFactory.createQueueConnection();
|
||||
QueueSession qsession = qcon.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
|
||||
QueueReceiver qreceiver = createQueueReceiver(qsession, queueName, ctx, mSelector)) {
|
||||
qcon.start();
|
||||
|
||||
logger.warn("RemoveMessageCommand] " + queueName + " - Queued JMS Messages: "
|
||||
+ DATE_FORMAT.format(ZonedDateTime.now()));
|
||||
cTime = System.currentTimeMillis() - sTime;
|
||||
sTime = System.currentTimeMillis();
|
||||
|
||||
Message m = null;
|
||||
while ((m = qreceiver.receiveNoWait()) != null) {
|
||||
purgeCount++;
|
||||
|
||||
if (isLogging && m instanceof ObjectMessage) {
|
||||
processObjectMessage((ObjectMessage) m);
|
||||
count++;
|
||||
}
|
||||
}
|
||||
|
||||
if (logger.isWarn()) {
|
||||
logger.warn("RemoveMessageCommand] Purge " + purgeCount + " messages completed : connect time("
|
||||
+ cTime + ") ms, purge time (" + (System.currentTimeMillis() - sTime) + ") ms");
|
||||
}
|
||||
|
||||
return count;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
private static QueueReceiver createQueueReceiver(QueueSession qsession, String queueName, InitialContext ctx,
|
||||
String mSelector) throws Exception {
|
||||
javax.jms.Queue queue = (javax.jms.Queue) ctx.lookup(queueName);
|
||||
return (mSelector != null && mSelector.length() > 0) ? qsession.createReceiver(queue, mSelector)
|
||||
: qsession.createReceiver(queue);
|
||||
}
|
||||
|
||||
private static void processObjectMessage(ObjectMessage objMessage) {
|
||||
try {
|
||||
EAIMessage eaiMsg = (EAIMessage) objMessage.getObject();
|
||||
String rspErrorCode = "RECEAIFQR100"; // 운영자에 의해 큐에서 삭제됨
|
||||
String rspErrorMsg = ExceptionUtil.make(rspErrorCode, "");
|
||||
// eaiMsg.setRspErrCd(rspErrorCode);
|
||||
// eaiMsg.setRspErrMsg(rspErrorMsg);
|
||||
eaiMsg.setRspErr(rspErrorCode,rspErrorMsg);
|
||||
eaiMsg.setLogPssSno(eaiMsg.getLogPssSno() + 100);
|
||||
EAILogSender.send(eaiMsg, null);
|
||||
} catch (Exception e) {
|
||||
Logger logger = Logger.getLogger(Logger.LOGGER_DEFAULT);
|
||||
if (logger.isError()) {
|
||||
logger.error("RemoveMessageCommand] DB Log 실패 - " + e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package com.eactive.eai.agent.jms;
|
||||
|
||||
import com.eactive.eai.agent.command.Command;
|
||||
import com.eactive.eai.agent.command.CommandException;
|
||||
import com.eactive.eai.common.util.Logger;
|
||||
import com.eactive.eai.flowcontrol.jms.QueueMonitorManager;
|
||||
import com.eactive.eai.flowcontrol.jms.QueueMonitorVO;
|
||||
|
||||
public class RemoveQueueMonitorCommand extends Command {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public RemoveQueueMonitorCommand(String name) {
|
||||
super(name);
|
||||
}
|
||||
|
||||
public RemoveQueueMonitorCommand() {
|
||||
super("RemoveQueueMonitorCommand");
|
||||
}
|
||||
|
||||
public Object execute() throws CommandException {
|
||||
Logger logger = Logger.getLogger(Logger.LOGGER_DEFAULT);
|
||||
if (logger.isInfo())
|
||||
logger.info(this.name + " is executed");
|
||||
|
||||
if (!(args instanceof QueueMonitorVO)) {
|
||||
String rspErrorCode = "RECEAIMCM001";
|
||||
String msg = makeException(rspErrorCode, null);
|
||||
if (logger.isError())
|
||||
logger.error(msg);
|
||||
throw new CommandException(msg);
|
||||
}
|
||||
|
||||
QueueMonitorVO vo = (QueueMonitorVO) args;
|
||||
try {
|
||||
// 삭제시에는 인스턴스 정보가 변경될 수 있으므로 인스턴스정보를 확인하지 않음
|
||||
QueueMonitorManager manager = QueueMonitorManager.getInstance();
|
||||
manager.removeQueueMonitor(vo.getQueueName());
|
||||
} 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,54 @@
|
||||
package com.eactive.eai.agent.jms;
|
||||
|
||||
import com.eactive.eai.agent.command.Command;
|
||||
import com.eactive.eai.agent.command.CommandException;
|
||||
import com.eactive.eai.common.server.EAIServerManager;
|
||||
import com.eactive.eai.common.util.Logger;
|
||||
import com.eactive.eai.flowcontrol.jms.QueueMonitorManager;
|
||||
import com.eactive.eai.flowcontrol.jms.QueueMonitorVO;
|
||||
|
||||
public class UpdateQueueMonitorCommand extends Command {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public UpdateQueueMonitorCommand(String name) {
|
||||
super(name);
|
||||
}
|
||||
|
||||
public UpdateQueueMonitorCommand() {
|
||||
super("UpdateQueueMonitorCommand");
|
||||
}
|
||||
|
||||
public Object execute() throws CommandException {
|
||||
Logger logger = Logger.getLogger(Logger.LOGGER_DEFAULT);
|
||||
if (logger.isInfo())
|
||||
logger.info(this.name + " is executed");
|
||||
|
||||
if (!(args instanceof QueueMonitorVO)) {
|
||||
String rspErrorCode = "RECEAIMCM001";
|
||||
String msg = makeException(rspErrorCode, null);
|
||||
if (logger.isError())
|
||||
logger.error(msg);
|
||||
throw new CommandException(msg);
|
||||
}
|
||||
|
||||
QueueMonitorVO vo = (QueueMonitorVO) args;
|
||||
try {
|
||||
// 수정 시에는 인스턴스 정보가 변경될 수 있으므로 삭제 후 인스턴스정보를 확인하고 등록한다.
|
||||
String localServerName = EAIServerManager.getInstance().getLocalServerName();
|
||||
|
||||
QueueMonitorManager manager = QueueMonitorManager.getInstance();
|
||||
manager.removeQueueMonitor(vo.getQueueName());
|
||||
if (localServerName != null && localServerName.equals(vo.getSevrInstncName())) {
|
||||
manager.setQueueMonitor(vo);
|
||||
}
|
||||
} 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.eactive.eai.agent.lifecycle;
|
||||
|
||||
import com.eactive.eai.agent.AgentUtil;
|
||||
import com.eactive.eai.agent.command.Command;
|
||||
import com.eactive.eai.agent.command.CommandException;
|
||||
import com.eactive.eai.common.lifecycle.LifecycleManager;
|
||||
import com.eactive.eai.common.lifecycle.LifecycleVO;
|
||||
import com.eactive.eai.common.util.ApplicationContextProvider;
|
||||
import com.eactive.eai.common.util.Logger;
|
||||
|
||||
public class RemoveLifecycleCommand extends Command {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public RemoveLifecycleCommand(String name) {
|
||||
super(name);
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
String keyName = (String) args;
|
||||
|
||||
try {
|
||||
LifecycleManager manager = ApplicationContextProvider.getContext().getBean(LifecycleManager.class);
|
||||
if (manager != null || keyName != null) {
|
||||
manager.removeLifecycle(keyName);
|
||||
} else {
|
||||
throw new Exception("keyName is null");
|
||||
}
|
||||
} 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(String args[]);
|
||||
//}
|
||||
|
||||
//private static void test(String args[]) throws Exception {
|
||||
// LifecycleVO vo = new LifecycleVO(args[0], -1);
|
||||
// Command command = new RemoveLifecycleCommand("RemoveLifecycleCommand");
|
||||
// command.setArgs(vo);
|
||||
// AgentUtil.broadcast(command);
|
||||
// }
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
package com.eactive.eai.agent.messagekey;
|
||||
|
||||
import com.eactive.eai.agent.command.Command;
|
||||
import com.eactive.eai.agent.command.CommandException;
|
||||
import com.eactive.eai.common.messagekey.MessageKeyManager;
|
||||
import com.eactive.eai.common.util.Logger;
|
||||
|
||||
public class ReloadMessageKeyCommand extends Command {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public ReloadMessageKeyCommand() {
|
||||
super("ReloadMessageKeyCommand");
|
||||
}
|
||||
|
||||
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 {
|
||||
MessageKeyManager manager = MessageKeyManager.getInstance();
|
||||
String keyName = (String) args;
|
||||
|
||||
if (keyName != null) {
|
||||
if ("ALL".equals(keyName)) {
|
||||
manager.reload();
|
||||
if (logger.isWarn())
|
||||
logger.warn(this.name + "] all rule Reload.");
|
||||
} else {
|
||||
String[] keys = keyName.split(",");
|
||||
manager.reload(keys[0], keys[1]);
|
||||
if (logger.isWarn())
|
||||
logger.warn(this.name + "] " + keyName + " Reload.");
|
||||
|
||||
}
|
||||
} else {
|
||||
manager.reload();
|
||||
if (logger.isWarn())
|
||||
logger.warn(this.name + "] all rule 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 ReloadMessageKeyCommand();
|
||||
// command.setArgs("ALL");
|
||||
// AgentUtil.broadcast(command);
|
||||
// }
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package com.eactive.eai.agent.messagekey;
|
||||
|
||||
import java.util.Vector;
|
||||
|
||||
import com.eactive.eai.agent.command.Command;
|
||||
import com.eactive.eai.agent.command.CommandException;
|
||||
import com.eactive.eai.common.messagekey.MessageKeyManager;
|
||||
import com.eactive.eai.common.util.Logger;
|
||||
|
||||
public class ReloadMessageKeyListCommand extends Command {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public ReloadMessageKeyListCommand() {
|
||||
super("ReloadMessageKeyListCommand");
|
||||
}
|
||||
|
||||
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 {
|
||||
MessageKeyManager manager = MessageKeyManager.getInstance();
|
||||
Vector keyNameVt = (Vector) args;
|
||||
String keyName = "";
|
||||
for (int i = 0; i < keyNameVt.size(); i++) {
|
||||
keyName = (String) keyNameVt.get(i);
|
||||
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);
|
||||
throw new CommandException(msg);
|
||||
}
|
||||
return "success";
|
||||
|
||||
}
|
||||
|
||||
// public static void main(String args[]) throws Exception {
|
||||
// test();
|
||||
//}
|
||||
|
||||
// private static void test() throws Exception {
|
||||
// Command command = new ReloadMessageKeyListCommand();
|
||||
// command.setArgs("ALL");
|
||||
// AgentUtil.broadcast(command);
|
||||
// }
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
package com.eactive.eai.agent.messagekey;
|
||||
|
||||
import com.eactive.eai.agent.command.Command;
|
||||
import com.eactive.eai.agent.command.CommandException;
|
||||
import com.eactive.eai.common.messagekey.MessageKeyManager;
|
||||
import com.eactive.eai.common.util.Logger;
|
||||
|
||||
public class RemoveMessageKeyCommand extends Command {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public RemoveMessageKeyCommand() {
|
||||
super("RemoveMessageKeyCommand");
|
||||
}
|
||||
|
||||
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 keyName = null;
|
||||
MessageKeyManager manager = MessageKeyManager.getInstance();
|
||||
|
||||
keyName = (String) args;
|
||||
if (keyName != null) {
|
||||
String[] keys = keyName.split(",");
|
||||
String keyCode = keys[0] + keys[1];
|
||||
manager.removeMessageKey(keyCode);
|
||||
}
|
||||
} 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{
|
||||
// String selectedName = null;
|
||||
// String updateData = null;
|
||||
//
|
||||
// if(args.length ==1)
|
||||
// selectedName = args[0];
|
||||
//
|
||||
// if(selectedName == null || selectedName.length() ==0){
|
||||
// selectedName = "HttpAdapter_STD_IN_TEST";
|
||||
// }
|
||||
//
|
||||
// MessageKeyManager manager = MessageKeyManager.getInstance();
|
||||
// MessageKeyVO vo = new MessageKeyVO(selectedName);
|
||||
//
|
||||
// if(vo != null){
|
||||
// System.out.println("RemoveMessageKeyCommand ] vo is not null.... remove start");
|
||||
//
|
||||
// Command command = new RemoveMessageKeyCommand();
|
||||
// command.setArgs(vo);
|
||||
// AgentUtil.broadcast(command);
|
||||
// }
|
||||
// else{
|
||||
// System.out.println("RemoveMessageKeyCommand ] main() vo is null");
|
||||
// }
|
||||
// }
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
package com.eactive.eai.agent.property;
|
||||
|
||||
import com.eactive.eai.agent.command.Command;
|
||||
import com.eactive.eai.agent.command.CommandException;
|
||||
import com.eactive.eai.common.property.PropManager;
|
||||
import com.eactive.eai.common.util.Logger;
|
||||
|
||||
public class ReloadPropertyCommand extends Command {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public ReloadPropertyCommand() {
|
||||
super("ReloadPropertyCommand");
|
||||
}
|
||||
|
||||
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 {
|
||||
PropManager manager = PropManager.getInstance();
|
||||
|
||||
String keyName = (String) args;
|
||||
|
||||
if (keyName != null) {
|
||||
if ("ALL".equals(keyName)) {
|
||||
manager.reload();
|
||||
if (logger.isWarn())
|
||||
logger.warn(this.name + "] all rule 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);
|
||||
throw new CommandException(msg);
|
||||
}
|
||||
return "success";
|
||||
|
||||
}
|
||||
|
||||
// public static void main(String[] args)throws Exception{
|
||||
// Command command = new ReloadPropertyCommand();
|
||||
// command.setArgs("ALL");
|
||||
// AgentUtil.broadcast(command);
|
||||
//
|
||||
// }
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package com.eactive.eai.agent.property;
|
||||
|
||||
import com.eactive.eai.adapter.wca.util.RuntimeUtil;
|
||||
import com.eactive.eai.agent.command.Command;
|
||||
import com.eactive.eai.agent.command.CommandException;
|
||||
import com.eactive.eai.common.property.PropManager;
|
||||
import com.eactive.eai.common.util.Logger;
|
||||
|
||||
public class RemovePropertyCommand extends Command {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public RemovePropertyCommand() {
|
||||
super("RemovePropertyCommand");
|
||||
}
|
||||
|
||||
public Object execute() throws CommandException {
|
||||
Logger logger = Logger.getLogger(Logger.LOGGER_DEFAULT);
|
||||
String SNA_PROP_GROUP_NAME = "SNAAdapter{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 {
|
||||
PropManager manager = PropManager.getInstance();
|
||||
String propertyName = null;
|
||||
|
||||
if (args != null) {
|
||||
propertyName = (String) args;
|
||||
manager.removePropGroupVO(propertyName);
|
||||
|
||||
// System.out.println("RemovePropertyCommand grpName ] "+propertyName);
|
||||
|
||||
/**
|
||||
* SNA Adapter notifyAllSoftlink
|
||||
*/
|
||||
if (SNA_PROP_GROUP_NAME.equals(propertyName)) {
|
||||
RuntimeUtil snaUtil = RuntimeUtil.getInstance();
|
||||
snaUtil.notifyAllSoftlink();
|
||||
}
|
||||
}
|
||||
} 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,53 @@
|
||||
package com.eactive.eai.agent.restrict;
|
||||
|
||||
import com.eactive.eai.agent.command.Command;
|
||||
import com.eactive.eai.agent.command.CommandException;
|
||||
import com.eactive.eai.common.restrict.RestrictInfoManager;
|
||||
import com.eactive.eai.common.util.Logger;
|
||||
|
||||
/**
|
||||
* 거래통제 Reload 커맨트
|
||||
*
|
||||
* @Author : S010795
|
||||
* @Date : 2019. 5. 15.
|
||||
* @Version :
|
||||
*/
|
||||
public class ReloadRestrictInfoCommand extends Command {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public ReloadRestrictInfoCommand() {
|
||||
super("ReloadRestrictInfoCommand");
|
||||
}
|
||||
|
||||
public Object execute() throws CommandException {
|
||||
Logger logger = Logger.getLogger(Logger.LOGGER_DEFAULT);
|
||||
if (logger.isWarn())
|
||||
logger.warn(this.name + " is executed");
|
||||
|
||||
try {
|
||||
RestrictInfoManager manager = RestrictInfoManager.getInstance();
|
||||
manager.reload();
|
||||
if (logger.isWarn())
|
||||
logger.warn(this.name + "] all rule 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 ReloadRestrictInfoCommand();
|
||||
// command.setArgs("ALL");
|
||||
// AgentUtil.broadcast(command);
|
||||
//
|
||||
// }
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
package com.eactive.eai.agent.routing;
|
||||
|
||||
import com.eactive.eai.agent.command.Command;
|
||||
import com.eactive.eai.agent.command.CommandException;
|
||||
import com.eactive.eai.common.routing.RoutingManager;
|
||||
import com.eactive.eai.common.util.Logger;
|
||||
|
||||
public class ReloadRoutingCommand extends Command {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public ReloadRoutingCommand() {
|
||||
super("ReloadRoutingCommand");
|
||||
}
|
||||
|
||||
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 {
|
||||
RoutingManager manager = RoutingManager.getInstance();
|
||||
String keyName = null;
|
||||
|
||||
keyName = (String) args;
|
||||
if (keyName != null) {
|
||||
if ("ALL".equals(keyName)) {
|
||||
manager.reload();
|
||||
if (logger.isWarn())
|
||||
logger.warn(this.name + "] all rule 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);
|
||||
throw new CommandException(msg);
|
||||
}
|
||||
return "success";
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
package com.eactive.eai.agent.routing;
|
||||
|
||||
import com.eactive.eai.agent.command.Command;
|
||||
import com.eactive.eai.agent.command.CommandException;
|
||||
import com.eactive.eai.common.routing.RoutingManager;
|
||||
import com.eactive.eai.common.util.Logger;
|
||||
|
||||
public class RemoveRoutingCommand extends Command {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public RemoveRoutingCommand() {
|
||||
super("RemoveRoutingCommand");
|
||||
}
|
||||
|
||||
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 {
|
||||
RoutingManager manager = RoutingManager.getInstance();
|
||||
String key = null;
|
||||
|
||||
key = (String) args;
|
||||
if (key != null) {
|
||||
manager.removeRoutingVO(key);
|
||||
}
|
||||
} 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(String args[]);
|
||||
//}
|
||||
|
||||
//private static void test(String args[]) throws Exception {
|
||||
// String selectedName = null;
|
||||
//// String updateData = null;
|
||||
//
|
||||
// if(args.length ==1)
|
||||
// selectedName = args[0];
|
||||
//
|
||||
// if(selectedName == null || selectedName.length() ==0){
|
||||
// selectedName = "ALL_TEST";
|
||||
// }
|
||||
//
|
||||
// RoutingManager manager = RoutingManager.getInstance();
|
||||
// RoutingVO vo = new RoutingVO();
|
||||
// vo.setName(selectedName);
|
||||
//
|
||||
// if(vo != null){
|
||||
// System.out.println("RemoveRoutingCommand ] vo is not null.... remove start");
|
||||
//
|
||||
// Command command = new RemoveRoutingCommand();
|
||||
// command.setArgs(vo);
|
||||
// AgentUtil.broadcast(command);
|
||||
// }
|
||||
// else{
|
||||
// System.out.println("RemoveRoutingCommand ] main() vo is null");
|
||||
// }
|
||||
// }
|
||||
}
|
||||
@@ -0,0 +1,113 @@
|
||||
package com.eactive.eai.agent.testcall;
|
||||
|
||||
import java.util.Properties;
|
||||
|
||||
import com.eactive.eai.agent.command.Command;
|
||||
import com.eactive.eai.agent.command.CommandException;
|
||||
import com.eactive.eai.common.property.PropManager;
|
||||
import com.eactive.eai.common.testcall.TestCallManager;
|
||||
import com.eactive.eai.common.util.Logger;
|
||||
|
||||
/**
|
||||
* 1. 기능 : TestCallManager를 시작 또는 종료 2. 처리 개요 : TestCallManager를 시작 또는 종료 3.
|
||||
* 주의사항
|
||||
*
|
||||
* @author
|
||||
* @version v 1.0.0
|
||||
* @see 관련 기능을 참조
|
||||
* @since
|
||||
*
|
||||
*/
|
||||
public class TestCallCommand extends Command {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public TestCallCommand() {
|
||||
super("TestCallCommand");
|
||||
}
|
||||
|
||||
/**
|
||||
* 1. 기능 : TestCallManager를 시작 또는 종료 2. 처리 개요 : arg로 전달된 Property의 값이 START이면
|
||||
* TestCallManager를 시작하고 STOP이면 TestCallManager 종료 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 Properties)) {
|
||||
String rspErrorCode = "RECEAIMCM001";
|
||||
String msg = makeException(rspErrorCode, null);
|
||||
if (logger.isError())
|
||||
logger.error(msg);
|
||||
throw new CommandException(msg);
|
||||
}
|
||||
|
||||
Properties prop = new Properties();
|
||||
try {
|
||||
TestCallManager manager = TestCallManager.getInstance();
|
||||
PropManager pmanager = PropManager.getInstance();
|
||||
|
||||
prop = (Properties) args;
|
||||
|
||||
String run = "";
|
||||
String tmpperiod = "";
|
||||
|
||||
run = prop.getProperty("RUN");
|
||||
tmpperiod = prop.getProperty("PERIOD");
|
||||
|
||||
if (tmpperiod != null && tmpperiod.length() > 0) {
|
||||
long period = Long.parseLong(tmpperiod);
|
||||
pmanager.setProperty(manager.PROP_GROUP, manager.PROP_PERIOD, "" + period);
|
||||
}
|
||||
if (run != null && run.length() > 0) {
|
||||
if ("START".equals(run)) {
|
||||
// System.out.println("start..");
|
||||
manager.start();
|
||||
} else if ("STOP".equals(run)) {
|
||||
// System.out.println("stop..");
|
||||
manager.stop();
|
||||
}
|
||||
}
|
||||
|
||||
} 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(String args[]);
|
||||
//}
|
||||
|
||||
//private static void test(String args[]) throws Exception {
|
||||
//
|
||||
// String run = "";
|
||||
// if(args.length >0 )
|
||||
// run = args[0];
|
||||
// else
|
||||
// run = "START";
|
||||
//
|
||||
// Properties prop = new Properties();
|
||||
// try{
|
||||
//
|
||||
// prop.setProperty("RUN", run);
|
||||
//
|
||||
// Command command = new TestCallCommand();
|
||||
// command.setArgs(prop);
|
||||
// AgentUtil.broadcast(command);
|
||||
// }catch(Exception e){
|
||||
// System.out.println("error");
|
||||
//// e.printStackTrace();
|
||||
// }
|
||||
// }
|
||||
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
package com.eactive.eai.agent.transformer;
|
||||
|
||||
import com.eactive.eai.agent.command.Command;
|
||||
import com.eactive.eai.agent.command.CommandException;
|
||||
import com.eactive.eai.common.util.Logger;
|
||||
import com.eactive.eai.transformer.layout.LayoutManager;
|
||||
|
||||
public class ReloadLayoutCommand extends Command {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public ReloadLayoutCommand() {
|
||||
super("ReloadLayoutCommand");
|
||||
}
|
||||
|
||||
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 {
|
||||
LayoutManager manager = LayoutManager.getManager();
|
||||
|
||||
String layoutName = (String) args;
|
||||
|
||||
if (layoutName != null) {
|
||||
if ("ALL".equals(layoutName)) {
|
||||
manager.reload();
|
||||
manager.permanentReload();
|
||||
if (logger.isWarn())
|
||||
logger.warn("ReloadLayoutCommand ] all Layout info Reload.");
|
||||
} else {
|
||||
manager.reload(layoutName);
|
||||
manager.permanentReload(layoutName);
|
||||
if (logger.isWarn())
|
||||
logger.warn("ReloadLayoutCommand ] " + layoutName + " Layout info 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{
|
||||
//
|
||||
// LayoutManager manager = LayoutManager.getManager();
|
||||
//
|
||||
// Command command = new ReloadLayoutCommand();
|
||||
// command.setArgs("");
|
||||
// AgentUtil.broadcast(command);
|
||||
//
|
||||
// }
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
package com.eactive.eai.agent.transformer;
|
||||
|
||||
import java.util.Vector;
|
||||
|
||||
import com.eactive.eai.agent.command.Command;
|
||||
import com.eactive.eai.agent.command.CommandException;
|
||||
import com.eactive.eai.common.util.Logger;
|
||||
import com.eactive.eai.transformer.layout.LayoutManager;
|
||||
|
||||
public class ReloadLayoutListCommand extends Command {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public ReloadLayoutListCommand() {
|
||||
super("ReloadLayoutListCommand");
|
||||
}
|
||||
|
||||
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 {
|
||||
LayoutManager manager = LayoutManager.getManager();
|
||||
|
||||
Vector layoutNameVt = (Vector) args;
|
||||
String layoutName = "";
|
||||
for (int i = 0; i < layoutNameVt.size(); i++) {
|
||||
layoutName = (String) layoutNameVt.get(i);
|
||||
|
||||
if (layoutName != null) {
|
||||
manager.reload(layoutName);
|
||||
manager.permanentReload(layoutName);
|
||||
if (logger.isWarn())
|
||||
logger.warn("ReloadLayoutListCommand ] " + layoutName + " Layout info 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 {
|
||||
// LayoutManager manager = LayoutManager.getManager();
|
||||
// Vector vt = new Vector();
|
||||
// Command command = new ReloadLayoutListCommand();
|
||||
// command.setArgs(vt);
|
||||
// AgentUtil.broadcast(command);
|
||||
//
|
||||
// }
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
package com.eactive.eai.agent.transformer;
|
||||
|
||||
import com.eactive.eai.agent.command.Command;
|
||||
import com.eactive.eai.agent.command.CommandException;
|
||||
import com.eactive.eai.common.util.Logger;
|
||||
import com.eactive.eai.transformer.layout.LayoutTypeManager;
|
||||
|
||||
public class ReloadLayoutTypeCommand extends Command {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public ReloadLayoutTypeCommand() {
|
||||
super("ReloadLayoutTypeCommand");
|
||||
}
|
||||
|
||||
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 {
|
||||
LayoutTypeManager manager = LayoutTypeManager.getInstance();
|
||||
|
||||
String layoutTypeName = (String) args;
|
||||
if (layoutTypeName != null) {
|
||||
if ("ALL".equals(layoutTypeName)) {
|
||||
manager.reload();
|
||||
if (logger.isWarn())
|
||||
logger.warn("ReloadLayoutTypeCommand ] all LayoutType info Reload.");
|
||||
} else {
|
||||
manager.reload(layoutTypeName);
|
||||
if (logger.isWarn())
|
||||
logger.warn("ReloadLayoutTypeCommand ] " + layoutTypeName + " LayoutType info 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 {
|
||||
// LayoutTypeManager manager = LayoutTypeManager.getInstance();
|
||||
//
|
||||
// Command command = new ReloadLayoutTypeCommand();
|
||||
// command.setArgs("");
|
||||
// AgentUtil.broadcast(command);
|
||||
// }
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
package com.eactive.eai.agent.transformer;
|
||||
|
||||
import com.eactive.eai.agent.AgentUtil;
|
||||
import com.eactive.eai.agent.command.Command;
|
||||
import com.eactive.eai.agent.command.CommandException;
|
||||
import com.eactive.eai.common.util.Logger;
|
||||
import com.eactive.eai.transformer.layout.LayoutManager;
|
||||
|
||||
public class ReloadPermanentLayoutCommand extends Command {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public ReloadPermanentLayoutCommand() {
|
||||
super("ReloadPermanentLayoutCommand");
|
||||
}
|
||||
|
||||
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 = "EAIINIT001";
|
||||
String msg = makeException(rspErrorCode, null);
|
||||
if (logger.isError())
|
||||
logger.error(msg);
|
||||
throw new CommandException(msg);
|
||||
}
|
||||
|
||||
try {
|
||||
LayoutManager manager = LayoutManager.getManager();
|
||||
|
||||
String keyName = (String) args;
|
||||
|
||||
if (keyName != null) {
|
||||
if ("ALL".equals(keyName)) {
|
||||
manager.permanentReload();
|
||||
if (logger.isWarn()) {
|
||||
logger.warn(this.name + "] Permanent Cache가 Reload 되었습니다.");
|
||||
}
|
||||
} else {
|
||||
throw new Exception("잘못된 파라미터입니다. : " + keyName);
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
String rspErrorCode = "EAIINIT003";
|
||||
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();
|
||||
// }
|
||||
|
||||
public static void test() throws Exception {
|
||||
Command command = new ReloadPermanentLayoutCommand();
|
||||
command.setArgs("ALL");
|
||||
AgentUtil.broadcast(command);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
package com.eactive.eai.agent.transformer;
|
||||
|
||||
import com.eactive.eai.agent.command.Command;
|
||||
import com.eactive.eai.agent.command.CommandException;
|
||||
import com.eactive.eai.common.util.Logger;
|
||||
import com.eactive.eai.transformer.transform.TransformManager;
|
||||
|
||||
public class ReloadTransformCommand extends Command {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public ReloadTransformCommand() {
|
||||
super("ReloadTransformCommand");
|
||||
}
|
||||
|
||||
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 {
|
||||
TransformManager manager = TransformManager.getManager();
|
||||
|
||||
String transformName = (String) args;
|
||||
if (transformName != null) {
|
||||
if ("ALL".equals(transformName)) {
|
||||
manager.reload();
|
||||
if (logger.isWarn())
|
||||
logger.warn("ReloadTransformCommand ] all Transform info Reload.");
|
||||
} else {
|
||||
manager.reload(transformName);
|
||||
if (logger.isWarn())
|
||||
logger.warn("ReloadTransformCommand ] " + transformName + " Transform info 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{
|
||||
//
|
||||
// TransformManager manager = TransformManager.getManager();
|
||||
//
|
||||
// Command command = new ReloadTransformCommand();
|
||||
// command.setArgs("");
|
||||
// AgentUtil.broadcast(command);
|
||||
//
|
||||
// }
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
package com.eactive.eai.agent.transformer;
|
||||
|
||||
import com.eactive.eai.agent.command.Command;
|
||||
import com.eactive.eai.agent.command.CommandException;
|
||||
import com.eactive.eai.common.util.Logger;
|
||||
import com.eactive.eai.transformer.function.FunctionManager;
|
||||
|
||||
public class ReloadTransformFuncCommand extends Command {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public ReloadTransformFuncCommand() {
|
||||
super("ReloadTransformFuncCommand");
|
||||
}
|
||||
|
||||
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 {
|
||||
FunctionManager manager = FunctionManager.getInstance();
|
||||
|
||||
String functionName = (String) args;
|
||||
if (functionName != null) {
|
||||
if ("ALL".equals(functionName)) {
|
||||
manager.reload();
|
||||
if (logger.isWarn())
|
||||
logger.warn("ReloadTransformFuncCommand ] all TransformFunction info Reload.");
|
||||
} else {
|
||||
manager.reload(functionName);
|
||||
if (logger.isWarn())
|
||||
logger.warn("ReloadTransformFuncCommand ] " + functionName + " TransformFunction info 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 {
|
||||
//
|
||||
// FunctionManager manager = FunctionManager.getInstance();
|
||||
//
|
||||
// Command command = new ReloadTransformFuncCommand();
|
||||
// command.setArgs("");
|
||||
// AgentUtil.broadcast(command);
|
||||
//
|
||||
// }
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
package com.eactive.eai.agent.transformer;
|
||||
|
||||
import java.util.Vector;
|
||||
|
||||
import com.eactive.eai.agent.command.Command;
|
||||
import com.eactive.eai.agent.command.CommandException;
|
||||
import com.eactive.eai.common.util.Logger;
|
||||
import com.eactive.eai.transformer.transform.TransformManager;
|
||||
|
||||
public class ReloadTransformListCommand extends Command {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public ReloadTransformListCommand() {
|
||||
super("ReloadTransformListCommand");
|
||||
}
|
||||
|
||||
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 {
|
||||
TransformManager manager = TransformManager.getManager();
|
||||
|
||||
String transformName = "";
|
||||
Vector transformVt = (Vector) args;
|
||||
|
||||
// String layoutName = "";
|
||||
for (int i = 0; i < transformVt.size(); i++) {
|
||||
transformName = (String) transformVt.get(i);
|
||||
if (transformName != null) {
|
||||
manager.reload(transformName);
|
||||
if (logger.isWarn())
|
||||
logger.warn("ReloadTransformListCommand ] " + transformName + " all Transform info 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{
|
||||
//
|
||||
// TransformManager manager = TransformManager.getManager();
|
||||
//
|
||||
// Command command = new ReloadTransformListCommand();
|
||||
// command.setArgs("");
|
||||
// AgentUtil.broadcast(command);
|
||||
//
|
||||
// }
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package com.eactive.eai.agent.transformer;
|
||||
|
||||
import com.eactive.eai.agent.command.Command;
|
||||
import com.eactive.eai.agent.command.CommandException;
|
||||
import com.eactive.eai.common.util.Logger;
|
||||
import com.eactive.eai.transformer.layout.LayoutManager;
|
||||
|
||||
public class RemoveLayoutCommand extends Command {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public RemoveLayoutCommand() {
|
||||
super("RemoveLayoutCommand");
|
||||
}
|
||||
|
||||
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 {
|
||||
LayoutManager manager = LayoutManager.getManager();
|
||||
|
||||
String layoutName = (String) args;
|
||||
|
||||
if (layoutName != null && layoutName.trim().length() > 0) {
|
||||
manager.remove(layoutName);
|
||||
if (logger.isWarn())
|
||||
logger.warn("ReloadLayoutCommand ] " + layoutName + " 에 대한 Layout 정보가 메모리에서 삭제되었습니다.");
|
||||
} else {
|
||||
if (logger.isWarn())
|
||||
logger.warn("ReloadLayoutCommand ] Layout 명을 확인하세요 [" + layoutName + "]");
|
||||
}
|
||||
} 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{
|
||||
//
|
||||
// LayoutManager manager = LayoutManager.getManager();
|
||||
//
|
||||
// Command command = new RemoveLayoutCommand();
|
||||
// command.setArgs("");
|
||||
// AgentUtil.broadcast(command);
|
||||
//
|
||||
// }
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
package com.eactive.eai.agent.transformer;
|
||||
|
||||
import com.eactive.eai.agent.command.Command;
|
||||
import com.eactive.eai.agent.command.CommandException;
|
||||
import com.eactive.eai.common.util.Logger;
|
||||
import com.eactive.eai.transformer.layout.LayoutTypeManager;
|
||||
|
||||
public class RemoveLayoutTypeCommand extends Command {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public RemoveLayoutTypeCommand() {
|
||||
super("RemoveLayoutTypeCommand");
|
||||
}
|
||||
|
||||
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 {
|
||||
LayoutTypeManager manager = LayoutTypeManager.getInstance();
|
||||
|
||||
String layoutTypeName = (String) args;
|
||||
if (layoutTypeName != null) {
|
||||
manager.remove(layoutTypeName);
|
||||
}
|
||||
} 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{
|
||||
// LayoutTypeManager manager = LayoutTypeManager.getInstance();
|
||||
//
|
||||
// Command command = new RemoveLayoutTypeCommand();
|
||||
// command.setArgs("");
|
||||
// AgentUtil.broadcast(command);
|
||||
// }
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
package com.eactive.eai.agent.transformer;
|
||||
|
||||
import com.eactive.eai.agent.command.Command;
|
||||
import com.eactive.eai.agent.command.CommandException;
|
||||
import com.eactive.eai.common.util.Logger;
|
||||
import com.eactive.eai.transformer.transform.TransformManager;
|
||||
|
||||
public class RemoveTransformCommand extends Command {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public RemoveTransformCommand() {
|
||||
super("RemoveTransformCommand");
|
||||
}
|
||||
|
||||
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 {
|
||||
TransformManager manager = TransformManager.getManager();
|
||||
|
||||
String transformName = (String) args;
|
||||
if (transformName != null && transformName.trim().length() > 0) {
|
||||
manager.remove(transformName);
|
||||
if (logger.isWarn())
|
||||
logger.warn("RemoveTransformCommand ] " + transformName + " 에 대한 Transform 정보가 삭제되었습니다.");
|
||||
} else {
|
||||
if (logger.isWarn())
|
||||
logger.warn("ReloadLayoutCommand ] Transform 명을 확인하세요 [" + transformName + "]");
|
||||
}
|
||||
} 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 {
|
||||
//
|
||||
// TransformManager manager = TransformManager.getManager();
|
||||
//
|
||||
// Command command = new RemoveTransformCommand();
|
||||
// command.setArgs("");
|
||||
// AgentUtil.broadcast(command);
|
||||
//
|
||||
// }
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
package com.eactive.eai.agent.transformer;
|
||||
|
||||
import com.eactive.eai.agent.command.Command;
|
||||
import com.eactive.eai.agent.command.CommandException;
|
||||
import com.eactive.eai.common.util.Logger;
|
||||
import com.eactive.eai.transformer.function.FunctionManager;
|
||||
|
||||
public class RemoveTransformFuncCommand extends Command {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public RemoveTransformFuncCommand() {
|
||||
super("RemoveTransformFuncCommand");
|
||||
}
|
||||
|
||||
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 {
|
||||
FunctionManager manager = FunctionManager.getInstance();
|
||||
|
||||
String functionName = (String) args;
|
||||
if (functionName != null) {
|
||||
manager.remove(functionName);
|
||||
}
|
||||
} 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 {
|
||||
//
|
||||
// FunctionManager manager = FunctionManager.getInstance();
|
||||
//
|
||||
// Command command = new RemoveTransformFuncCommand();
|
||||
// command.setArgs("");
|
||||
// AgentUtil.broadcast(command);
|
||||
//
|
||||
// }
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
package com.eactive.eai.agent.useDate;
|
||||
|
||||
import com.eactive.eai.agent.command.Command;
|
||||
import com.eactive.eai.agent.command.CommandException;
|
||||
import com.eactive.eai.common.usedate.UseDateControlManager;
|
||||
import com.eactive.eai.common.util.Logger;
|
||||
|
||||
public class ReloadUseDateControlCommand extends Command {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public ReloadUseDateControlCommand() {
|
||||
super("ReloadUseDateControlCommand");
|
||||
}
|
||||
|
||||
/**
|
||||
* 1. 기능 : UseDateControlManager에 interface용 bucket을 리로드
|
||||
* 2. 처리 개요 :
|
||||
* 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);
|
||||
}
|
||||
|
||||
String keyName = (String) args;
|
||||
try {
|
||||
UseDateControlManager manager = UseDateControlManager.getInstance();
|
||||
|
||||
if (keyName != null) {
|
||||
if ("ALL".equals(keyName)) {
|
||||
manager.reload();
|
||||
if (logger.isWarn())
|
||||
logger.warn(this.name + "] all rule 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);
|
||||
throw new CommandException(msg);
|
||||
}
|
||||
return "success";
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package com.eactive.eai.agent.useDate;
|
||||
|
||||
import com.eactive.eai.agent.command.Command;
|
||||
import com.eactive.eai.agent.command.CommandException;
|
||||
import com.eactive.eai.common.usedate.UseDateControlManager;
|
||||
import com.eactive.eai.common.util.Logger;
|
||||
|
||||
public class RemoveUseDateControlCommand extends Command {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public RemoveUseDateControlCommand() {
|
||||
super("RemoveUseDateControlCommand");
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
String key = (String) args;
|
||||
try {
|
||||
UseDateControlManager manager = UseDateControlManager.getInstance();
|
||||
manager.remove(key);
|
||||
} 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,122 @@
|
||||
package com.eactive.eai.agent.web;
|
||||
|
||||
import java.io.ObjectInputStream;
|
||||
import java.io.ObjectOutputStream;
|
||||
import java.net.URLConnection;
|
||||
|
||||
import javax.servlet.http.HttpServlet;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.eactive.eai.agent.AgentUtil;
|
||||
import com.eactive.eai.agent.command.Command;
|
||||
import com.eactive.eai.agent.command.CommandException;
|
||||
import com.eactive.eai.common.exception.ExceptionUtil;
|
||||
import com.eactive.eai.common.server.Keys;
|
||||
import com.eactive.eai.common.util.Logger;
|
||||
|
||||
/**
|
||||
* 1. 기능 : AdapterGroupVO ADD
|
||||
* 2. 처리 개요 : AdapterGroupVO를 manager에 add
|
||||
* 3. 주의사항
|
||||
*
|
||||
* @author
|
||||
* @version v 1.0.0
|
||||
* @see 관련 기능을 참조
|
||||
* @since
|
||||
*
|
||||
*/
|
||||
public class WebAgent extends HttpServlet {
|
||||
static final String PARAMETER_MESSAGE = "_message_";
|
||||
public static final String FIELD_INST_NAME = "INST_NAME";
|
||||
public static final String FIELD_INTERNAL_URL = "INTERNAL_URL";
|
||||
public static final String FIELD_IS_CLOUD_PROXY = "IS_CLOUD_PROXY";
|
||||
public static final String INST_NAME = System.getProperty(Keys.SERVER_KEY);
|
||||
static Logger logger = Logger.getLogger(Logger.LOGGER_DEFAULT);
|
||||
|
||||
protected void execute(Command command) throws CommandException {
|
||||
try {
|
||||
command.execute();
|
||||
|
||||
} catch (CommandException ce) {
|
||||
// System.out.println("WebAgent Servlet] execute() occur CommandException :" + ce.toString());
|
||||
// ce.printStackTrace();
|
||||
throw ce;
|
||||
} catch (Exception e) {
|
||||
String errorMsg = ExceptionUtil.make(e, "RECEAIMCM010");
|
||||
if (logger.isError())
|
||||
logger.error(errorMsg, e);
|
||||
throw new CommandException(errorMsg);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 1. 기능 : 요청으로 전달된 Command 실행
|
||||
* 2. 처리 개요 : 요청으로 전달된 Command 실행하고 실행된 결과를 ObjectOutStream을 통해 전송
|
||||
* 3. 주의사항
|
||||
*
|
||||
* @param request HttpServletRequest
|
||||
* @param response HttpServletResponse
|
||||
* @return
|
||||
* @exception
|
||||
**/
|
||||
@Override
|
||||
public void service(HttpServletRequest request, HttpServletResponse response) {
|
||||
|
||||
ObjectInputStream is = null;
|
||||
ObjectOutputStream os = null;
|
||||
try {
|
||||
is = new ObjectInputStream(request.getInputStream());
|
||||
os = new ObjectOutputStream(response.getOutputStream());
|
||||
|
||||
Command command = (Command) is.readObject();
|
||||
|
||||
// 20220718 컨테이너 외부 EMS에서 커맨드 호출 시 다른컨테이너의 커맨드인 경우 전달 처리
|
||||
if ("true".equals(request.getHeader(FIELD_IS_CLOUD_PROXY))
|
||||
&& !INST_NAME.equals(request.getHeader(FIELD_INST_NAME))) {
|
||||
logger.info("Execute Command Proxy: " + command.getName() + ", TARGET_INST_NAME:"
|
||||
+ request.getHeader(FIELD_INST_NAME) + ", TARGET_URL:" + request.getHeader(FIELD_INTERNAL_URL));
|
||||
String iUrl = request.getHeader(FIELD_INTERNAL_URL);
|
||||
URLConnection urlCon = AgentUtil.getURLConnection(iUrl);
|
||||
urlCon.setConnectTimeout(3000);
|
||||
urlCon.setReadTimeout(2000);
|
||||
|
||||
AgentUtil.sendCommand(urlCon, command);
|
||||
|
||||
String result = "success";
|
||||
os.writeObject(result);
|
||||
} else {
|
||||
logger.info("Execute Command Local: " + command.getName());
|
||||
execute(command);
|
||||
|
||||
String result = "success";
|
||||
os.writeObject(result);
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
logger.error("WebAgent sync error " + e.getMessage(), e);
|
||||
response.setStatus(500);
|
||||
|
||||
try {
|
||||
os.writeObject(e.getMessage());
|
||||
} catch (Exception ex) {
|
||||
logger.warn("writeObject error", e);
|
||||
}
|
||||
|
||||
} finally {
|
||||
if (is != null) {
|
||||
try {
|
||||
is.close();
|
||||
} catch (Exception e) {
|
||||
}
|
||||
}
|
||||
if (os != null) {
|
||||
try {
|
||||
os.close();
|
||||
} catch (Exception e) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user